menu_item :roadmap, :only => :roadmap
menu_item :settings, :only => :settings
- before_filter :find_project, :except => [ :index, :list, :add, :create, :copy ]
- before_filter :authorize, :except => [ :index, :list, :add, :create, :copy, :archive, :unarchive, :destroy]
- before_filter :authorize_global, :only => [:add, :create]
+ before_filter :find_project, :except => [ :index, :list, :new, :create, :copy ]
+ before_filter :authorize, :except => [ :index, :list, :new, :create, :copy, :archive, :unarchive, :destroy]
+ before_filter :authorize_global, :only => [:new, :create]
before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy ]
accept_key_auth :index
end
end
- # Add a new project
- def add
+ def new
@issue_custom_fields = IssueCustomField.find(:all, :order => "#{CustomField.table_name}.position")
@trackers = Tracker.all
@project = Project.new(params[:project])
end
else
respond_to do |format|
- format.html { render :action => 'add' }
+ format.html { render :action => 'new' }
format.xml { render :xml => @project.errors, :status => :unprocessable_entity }
end
end
<div class="contextual">
-<%= link_to l(:label_project_new), {:controller => 'projects', :action => 'add'}, :class => 'icon icon-add' %>
+<%= link_to l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add' %>
</div>
<h2><%=l(:label_project_plural)%></h2>
+++ /dev/null
-<h2><%=l(:label_project_new)%></h2>
-
-<% labelled_tabular_form_for :project, @project, :url => { :action => "create" } do |f| %>
-<%= render :partial => 'form', :locals => { :f => f } %>
-
-<fieldset class="box"><legend><%= l(:label_module_plural) %></legend>
-<% Redmine::AccessControl.available_project_modules.each do |m| %>
- <label class="floating">
- <%= check_box_tag 'enabled_modules[]', m, @project.module_enabled?(m) %>
- <%= l_or_humanize(m, :prefix => "project_module_") %>
- </label>
-<% end %>
-</fieldset>
-
-<%= submit_tag l(:button_save) %>
-<%= javascript_tag "Form.Element.focus('project_name');" %>
-<% end %>
<% end %>
<div class="contextual">
- <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'add'}, :class => 'icon icon-add') + ' |' if User.current.allowed_to?(:add_project, nil, :global => true) %>
+ <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add') + ' |' if User.current.allowed_to?(:add_project, nil, :global => true) %>
<%= link_to(l(:label_issue_view_all), { :controller => 'issues' }) + ' |' if User.current.allowed_to?(:view_issues, nil, :global => true) %>
<%= link_to(l(:label_overall_spent_time), { :controller => 'time_entries' }) + ' |' if User.current.allowed_to?(:view_time_entries, nil, :global => true) %>
<%= link_to l(:label_overall_activity), { :controller => 'activities', :action => 'index' }%>
--- /dev/null
+<h2><%=l(:label_project_new)%></h2>
+
+<% labelled_tabular_form_for :project, @project, :url => { :action => "create" } do |f| %>
+<%= render :partial => 'form', :locals => { :f => f } %>
+
+<fieldset class="box"><legend><%= l(:label_module_plural) %></legend>
+<% Redmine::AccessControl.available_project_modules.each do |m| %>
+ <label class="floating">
+ <%= check_box_tag 'enabled_modules[]', m, @project.module_enabled?(m) %>
+ <%= l_or_humanize(m, :prefix => "project_module_") %>
+ </label>
+<% end %>
+</fieldset>
+
+<%= submit_tag l(:button_save) %>
+<%= javascript_tag "Form.Element.focus('project_name');" %>
+<% end %>
projects.with_options :conditions => {:method => :get} do |project_views|
project_views.connect 'projects', :action => 'index'
project_views.connect 'projects.:format', :action => 'index'
- project_views.connect 'projects/new', :action => 'add'
+ project_views.connect 'projects/new', :action => 'new'
project_views.connect 'projects/:id', :action => 'show'
project_views.connect 'projects/:id.:format', :action => 'show'
project_views.connect 'projects/:id/:action', :action => /destroy|settings/
Redmine::AccessControl.map do |map|
map.permission :view_project, {:projects => [:show], :activities => [:index]}, :public => true
map.permission :search_project, {:search => :index}, :public => true
- map.permission :add_project, {:projects => [:add, :create]}, :require => :loggedin
+ map.permission :add_project, {:projects => [:new, :create]}, :require => :loggedin
map.permission :edit_project, {:projects => [:settings, :edit]}, :require => :member
map.permission :select_project_modules, {:projects => :modules}, :require => :member
map.permission :manage_members, {:projects => :settings, :members => [:new, :edit, :destroy, :autocomplete_for_member]}, :require => :member
map.permission :manage_versions, {:projects => :settings, :versions => [:new, :edit, :close_completed, :destroy]}, :require => :member
- map.permission :add_subprojects, {:projects => [:add, :create]}, :require => :member
+ map.permission :add_subprojects, {:projects => [:new, :create]}, :require => :member
map.project_module :issue_tracking do |map|
# Issue categories
end
end
- context "#add" do
+ context "#new" do
context "by admin user" do
setup do
@request.session[:user_id] = 1
end
should "accept get" do
- get :add
+ get :new
assert_response :success
- assert_template 'add'
+ assert_template 'new'
end
end
end
should "accept get" do
- get :add
+ get :new
assert_response :success
- assert_template 'add'
+ assert_template 'new'
assert_no_tag :select, :attributes => {:name => 'project[parent_id]'}
end
end
end
should "accept get" do
- get :add, :parent_id => 'ecookbook'
+ get :new, :parent_id => 'ecookbook'
assert_response :success
- assert_template 'add'
+ assert_template 'new'
# parent project selected
assert_tag :select, :attributes => {:name => 'project[parent_id]'},
:child => {:tag => 'option', :attributes => {:value => '1', :selected => 'selected'}}
should_route :get, "/projects", :controller => 'projects', :action => 'index'
should_route :get, "/projects.atom", :controller => 'projects', :action => 'index', :format => 'atom'
should_route :get, "/projects.xml", :controller => 'projects', :action => 'index', :format => 'xml'
- should_route :get, "/projects/new", :controller => 'projects', :action => 'add'
+ should_route :get, "/projects/new", :controller => 'projects', :action => 'new'
should_route :get, "/projects/test", :controller => 'projects', :action => 'show', :id => 'test'
should_route :get, "/projects/1.xml", :controller => 'projects', :action => 'show', :id => '1', :format => 'xml'
should_route :get, "/projects/4223/settings", :controller => 'projects', :action => 'settings', :id => '4223'