diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-02-11 13:05:41 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-02-11 13:05:41 +0000 |
commit | 60b9e59d1580583ce1ab934349f4393f3ed13c63 (patch) | |
tree | 5aa4b3c56b9d0276d3c5b379658f877a739e24d0 /app/controllers | |
parent | 2ec55c5337f9eaf35a30257a416d87f99f7bae27 (diff) | |
download | redmine-60b9e59d1580583ce1ab934349f4393f3ed13c63.tar.gz redmine-60b9e59d1580583ce1ab934349f4393f3ed13c63.zip |
Displays the full form when creating a version from the issue form so that required custom fields can be filled (#7398).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8845 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/versions_controller.rb | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/app/controllers/versions_controller.rb b/app/controllers/versions_controller.rb index 54cd9d7c2..f04388c78 100644 --- a/app/controllers/versions_controller.rb +++ b/app/controllers/versions_controller.rb @@ -75,6 +75,17 @@ class VersionsController < ApplicationController def new @version = @project.versions.build(params[:version]) + + respond_to do |format| + format.html + format.js do + render :update do |page| + page.replace_html 'ajax-modal', :partial => 'versions/new_modal' + page << "showModal('ajax-modal', '600px');" + page << "Form.Element.focus('version_name');" + end + end + end end def create @@ -93,9 +104,11 @@ class VersionsController < ApplicationController redirect_back_or_default :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project end format.js do - # IE doesn't support the replace_html rjs method for select box options - render(:update) {|page| page.replace "issue_fixed_version_id", - content_tag('select', '<option></option>' + version_options_for_select(@project.shared_versions.open, @version), :id => 'issue_fixed_version_id', :name => 'issue[fixed_version_id]') + render(:update) {|page| + page << 'hideModal();' + # IE doesn't support the replace_html rjs method for select box options + page.replace "issue_fixed_version_id", + content_tag('select', '<option></option>' + version_options_for_select(@project.shared_versions.open, @version), :id => 'issue_fixed_version_id', :name => 'issue[fixed_version_id]') } end format.api do @@ -106,7 +119,10 @@ class VersionsController < ApplicationController respond_to do |format| format.html { render :action => 'new' } format.js do - render(:update) {|page| page.alert(@version.errors.full_messages.join('\n')) } + render :update do |page| + page.replace_html 'ajax-modal', :partial => 'versions/new_modal' + page << "Form.Element.focus('version_name');" + end end format.api { render_validation_errors(@version) } end |