@@ -87,7 +87,10 class ProjectsController < ApplicationController | |||||
87 | respond_to do |format| |
|
87 | respond_to do |format| | |
88 | format.html { |
|
88 | format.html { | |
89 | flash[:notice] = l(:notice_successful_create) |
|
89 | flash[:notice] = l(:notice_successful_create) | |
90 | redirect_to :controller => 'projects', :action => 'settings', :id => @project |
|
90 | redirect_to(params[:continue] ? | |
|
91 | {:controller => 'projects', :action => 'new', :project => {:parent_id => @project.parent_id}.reject {|k,v| v.nil?}} : | |||
|
92 | {:controller => 'projects', :action => 'settings', :id => @project} | |||
|
93 | ) | |||
91 | } |
|
94 | } | |
92 | format.api { render :action => 'show', :status => :created, :location => url_for(:controller => 'projects', :action => 'show', :id => @project.id) } |
|
95 | format.api { render :action => 'show', :status => :created, :location => url_for(:controller => 'projects', :action => 'show', :id => @project.id) } | |
93 | end |
|
96 | end |
@@ -2,6 +2,7 | |||||
2 |
|
2 | |||
3 | <% labelled_tabular_form_for :project, @project, :url => { :action => "create" } do |f| %> |
|
3 | <% labelled_tabular_form_for :project, @project, :url => { :action => "create" } do |f| %> | |
4 | <%= render :partial => 'form', :locals => { :f => f } %> |
|
4 | <%= render :partial => 'form', :locals => { :f => f } %> | |
5 |
<%= submit_tag l(:button_ |
|
5 | <%= submit_tag l(:button_create) %> | |
|
6 | <%= submit_tag l(:button_create_and_continue), :name => 'continue' %> | |||
6 | <%= javascript_tag "Form.Element.focus('project_name');" %> |
|
7 | <%= javascript_tag "Form.Element.focus('project_name');" %> | |
7 | <% end %> |
|
8 | <% end %> |
@@ -186,6 +186,13 class ProjectsControllerTest < ActionController::TestCase | |||||
186 | assert_kind_of Project, project |
|
186 | assert_kind_of Project, project | |
187 | assert_equal Project.find(1), project.parent |
|
187 | assert_equal Project.find(1), project.parent | |
188 | end |
|
188 | end | |
|
189 | ||||
|
190 | should "continue" do | |||
|
191 | assert_difference 'Project.count' do | |||
|
192 | post :create, :project => {:name => "blog", :identifier => "blog"}, :continue => 'Create and continue' | |||
|
193 | end | |||
|
194 | assert_redirected_to '/projects/new?' | |||
|
195 | end | |||
189 | end |
|
196 | end | |
190 |
|
197 | |||
191 | context "by non-admin user with add_project permission" do |
|
198 | context "by non-admin user with add_project permission" do |
General Comments 0
You need to be logged in to leave comments.
Login now