Merge pull request #4146 from HDinger/fix/21794-missing-flash-messages

[21794] Missing flash messages
pull/4150/head
Oliver Günther 9 years ago
commit 4a1e9b547d
  1. 1
      app/controllers/boards_controller.rb
  2. 1
      app/controllers/groups_controller.rb
  3. 1
      app/controllers/news_controller.rb
  4. 5
      app/controllers/projects_controller.rb
  5. 1
      app/controllers/roles_controller.rb
  6. 14
      app/controllers/wiki_controller.rb
  7. 2
      config/locales/en.yml

@ -135,6 +135,7 @@ class BoardsController < ApplicationController
def destroy
@board.destroy
flash[:notice] = l(:notice_successful_delete)
redirect_to_settings_in_projects
end

@ -111,6 +111,7 @@ class GroupsController < ApplicationController
@group.destroy
respond_to do |format|
flash[:notice] = l(:notice_successful_delete)
format.html do redirect_to(groups_url) end
format.xml do head :ok end
end

@ -95,6 +95,7 @@ class NewsController < ApplicationController
def destroy
@news.destroy
flash[:notice] = l(:notice_successful_delete)
redirect_to action: 'index', project_id: @project
end

@ -227,7 +227,10 @@ class ProjectsController < ApplicationController
OpenProject::Notifications.send('project_deletion_imminent', project: @project_to_destroy)
@project_to_destroy.destroy
respond_to do |format|
format.html do redirect_to controller: '/admin', action: 'projects' end
format.html do
flash[:notice] = l(:notice_successful_delete)
redirect_to controller: '/admin', action: 'projects'
end
end
hide_project_in_layout

@ -89,6 +89,7 @@ class RolesController < ApplicationController
def destroy
@role = Role.find(params[:id])
@role.destroy
flash[:notice] = l(:notice_successful_delete)
redirect_to action: 'index'
notify_changed_roles(:removed, @role)
rescue

@ -182,7 +182,11 @@ class WikiController < ApplicationController
# Creates a new page or updates an existing one
def update
@page = @wiki.find_or_new_page(wiki_page_title)
return render_403 unless editable?
unless editable?
flash[:error] = l(:error_unable_update_wiki)
return render_403
end
@page.content = WikiContent.new(page: @page) if @page.new_record?
@content = @page.content_for_version(params[:version])
@ -205,6 +209,7 @@ class WikiController < ApplicationController
attachments = Attachment.attach_files(@page, params[:attachments])
render_attachment_warning_if_needed(@page)
call_hook(:controller_wiki_edit_after_save, params: params, page: @page)
flash[:notice] = l(:notice_successful_update)
redirect_to_show
else
render action: 'edit'
@ -278,7 +283,10 @@ class WikiController < ApplicationController
# Removes a wiki page and its history
# Children can be either set as root pages, removed or reassigned to another parent page
def destroy
return render_403 unless editable?
unless editable?
flash[:error] = l(:error_unable_delete_wiki)
return render_403
end
@descendants_count = @page.descendants.size
if @descendants_count > 0
@ -303,8 +311,10 @@ class WikiController < ApplicationController
@page.destroy
if page = @wiki.find_page(@wiki.start_page) || @wiki.pages.first
flash[:notice] = l(:notice_successful_delete)
redirect_to action: 'index', project_id: @project, id: page
else
flash[:notice] = l(:notice_successful_delete)
redirect_to project_path(@project)
end
end

@ -764,6 +764,8 @@ en:
error_unable_delete_status: "The work package status cannot be deleted since it is used by at least one work package."
error_unable_delete_default_status: "Unable to delete the default work package status. Please select another default work package status before deleting the current one."
error_unable_to_connect: "Unable to connect (%{value})"
error_unable_delete_wiki: "Unable to delete the wiki page."
error_unable_update_wiki: "Unable to update the wiki page."
error_workflow_copy_source: "Please select a source type or role"
error_workflow_copy_target: "Please select target type(s) and role(s)"
error_menu_item_not_created: Menu item could not be added

Loading…
Cancel
Save