@@ -87,7 +87,10 class ProjectsController < ApplicationController | |||
|
87 | 87 | respond_to do |format| |
|
88 | 88 | format.html { |
|
89 | 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 | 95 | format.api { render :action => 'show', :status => :created, :location => url_for(:controller => 'projects', :action => 'show', :id => @project.id) } |
|
93 | 96 | end |
@@ -2,6 +2,7 | |||
|
2 | 2 | |
|
3 | 3 | <% labelled_tabular_form_for :project, @project, :url => { :action => "create" } do |f| %> |
|
4 | 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 | 7 | <%= javascript_tag "Form.Element.focus('project_name');" %> |
|
7 | 8 | <% end %> |
@@ -186,6 +186,13 class ProjectsControllerTest < ActionController::TestCase | |||
|
186 | 186 | assert_kind_of Project, project |
|
187 | 187 | assert_equal Project.find(1), project.parent |
|
188 | 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 | 196 | end |
|
190 | 197 | |
|
191 | 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