diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-04-17 07:40:39 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-04-17 07:40:39 +0000 |
commit | 42b5c332b2c24c8dcc2581e0cd130ef930959d99 (patch) | |
tree | 3ddade3fa50427138419d48c57b20d93ac960048 /app/controllers | |
parent | 64afa24a7f72526a2cbf6761e51b6cd326aa0c36 (diff) | |
download | redmine-42b5c332b2c24c8dcc2581e0cd130ef930959d99.tar.gz redmine-42b5c332b2c24c8dcc2581e0cd130ef930959d99.zip |
Lists can be reordered with drag and drop (#12909).
git-svn-id: http://svn.redmine.org/redmine/trunk@15336 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/custom_fields_controller.rb | 14 | ||||
-rw-r--r-- | app/controllers/enumerations_controller.rb | 14 | ||||
-rw-r--r-- | app/controllers/issue_statuses_controller.rb | 14 | ||||
-rw-r--r-- | app/controllers/roles_controller.rb | 14 | ||||
-rw-r--r-- | app/controllers/trackers_controller.rb | 20 |
5 files changed, 59 insertions, 17 deletions
diff --git a/app/controllers/custom_fields_controller.rb b/app/controllers/custom_fields_controller.rb index 3c2cf7cfa..ab0d5019f 100644 --- a/app/controllers/custom_fields_controller.rb +++ b/app/controllers/custom_fields_controller.rb @@ -54,11 +54,19 @@ class CustomFieldsController < ApplicationController def update if @custom_field.update_attributes(params[:custom_field]) - flash[:notice] = l(:notice_successful_update) call_hook(:controller_custom_fields_edit_after_save, :params => params, :custom_field => @custom_field) - redirect_back_or_default edit_custom_field_path(@custom_field) + respond_to do |format| + format.html { + flash[:notice] = l(:notice_successful_update) + redirect_back_or_default edit_custom_field_path(@custom_field) + } + format.js { render :nothing => true } + end else - render :action => 'edit' + respond_to do |format| + format.html { render :action => 'edit' } + format.js { render :nothing => true, :status => 422 } + end end end diff --git a/app/controllers/enumerations_controller.rb b/app/controllers/enumerations_controller.rb index 05ca5152a..feb360398 100644 --- a/app/controllers/enumerations_controller.rb +++ b/app/controllers/enumerations_controller.rb @@ -57,10 +57,18 @@ class EnumerationsController < ApplicationController def update if @enumeration.update_attributes(params[:enumeration]) - flash[:notice] = l(:notice_successful_update) - redirect_to enumerations_path + respond_to do |format| + format.html { + flash[:notice] = l(:notice_successful_update) + redirect_to enumerations_path + } + format.js { render :nothing => true } + end else - render :action => 'edit' + respond_to do |format| + format.html { render :action => 'edit' } + format.js { render :nothing => true, :status => 422 } + end end end diff --git a/app/controllers/issue_statuses_controller.rb b/app/controllers/issue_statuses_controller.rb index 6d574fe87..e49878f1d 100644 --- a/app/controllers/issue_statuses_controller.rb +++ b/app/controllers/issue_statuses_controller.rb @@ -51,10 +51,18 @@ class IssueStatusesController < ApplicationController def update @issue_status = IssueStatus.find(params[:id]) if @issue_status.update_attributes(params[:issue_status]) - flash[:notice] = l(:notice_successful_update) - redirect_to issue_statuses_path(:page => params[:page]) + respond_to do |format| + format.html { + flash[:notice] = l(:notice_successful_update) + redirect_to issue_statuses_path(:page => params[:page]) + } + format.js { render :nothing => true } + end else - render :action => 'edit' + respond_to do |format| + format.html { render :action => 'edit' } + format.js { render :nothing => true, :status => 422 } + end end end diff --git a/app/controllers/roles_controller.rb b/app/controllers/roles_controller.rb index 2732a89a1..2de185b5b 100644 --- a/app/controllers/roles_controller.rb +++ b/app/controllers/roles_controller.rb @@ -72,10 +72,18 @@ class RolesController < ApplicationController def update if @role.update_attributes(params[:role]) - flash[:notice] = l(:notice_successful_update) - redirect_to roles_path(:page => params[:page]) + respond_to do |format| + format.html { + flash[:notice] = l(:notice_successful_update) + redirect_to roles_path(:page => params[:page]) + } + format.js { render :nothing => true } + end else - render :action => 'edit' + respond_to do |format| + format.html { render :action => 'edit' } + format.js { render :nothing => true, :status => 422 } + end end end diff --git a/app/controllers/trackers_controller.rb b/app/controllers/trackers_controller.rb index 91784d16e..2b93753d0 100644 --- a/app/controllers/trackers_controller.rb +++ b/app/controllers/trackers_controller.rb @@ -59,12 +59,22 @@ class TrackersController < ApplicationController def update @tracker = Tracker.find(params[:id]) if @tracker.update_attributes(params[:tracker]) - flash[:notice] = l(:notice_successful_update) - redirect_to trackers_path(:page => params[:page]) - return + respond_to do |format| + format.html { + flash[:notice] = l(:notice_successful_update) + redirect_to trackers_path(:page => params[:page]) + } + format.js { render :nothing => true } + end + else + respond_to do |format| + format.html { + edit + render :action => 'edit' + } + format.js { render :nothing => true, :status => 422 } + end end - edit - render :action => 'edit' end def destroy |