##// END OF EJS Templates
Adds a "New issue" link on the global issue list (#6204)....
Jean-Philippe Lang -
r14963:b56f77322ac2
parent child
Show More
@@ -29,6 +29,14 module RoutesHelper
29 29 end
30 30 end
31 31
32 def _new_project_issue_path(project, *args)
33 if project
34 new_project_issue_path(project, *args)
35 else
36 new_issue_path(*args)
37 end
38 end
39
32 40 def _project_calendar_path(project, *args)
33 41 project ? project_calendar_path(project, *args) : issues_calendar_path(*args)
34 42 end
@@ -1,6 +1,6
1 1 <div class="contextual">
2 <% if @project && User.current.allowed_to?(:add_issues, @project) && @project.trackers.any? %>
3 <%= link_to l(:label_issue_new), new_project_issue_path(@project), :class => 'icon icon-add new-issue' %>
2 <% if User.current.allowed_to?(:add_issues, @project, :global => true) && (@project.nil? || @project.trackers.any?) %>
3 <%= link_to l(:label_issue_new), _new_project_issue_path(@project), :class => 'icon icon-add new-issue' %>
4 4 <% end %>
5 5 </div>
6 6
@@ -1081,6 +1081,12 class IssuesControllerTest < ActionController::TestCase
1081 1081 assert_select 'a.new-issue', 0
1082 1082 end
1083 1083
1084 def test_index_without_project_should_include_new_issue_link
1085 @request.session[:user_id] = 2
1086 get :index
1087 assert_select 'a.new-issue[href="/issues/new"]', :text => 'New issue'
1088 end
1089
1084 1090 def test_show_by_anonymous
1085 1091 get :show, :id => 1
1086 1092 assert_response :success
General Comments 0
You need to be logged in to leave comments. Login now