diff --git a/app/views/versions/index.html.erb b/app/views/versions/index.html.erb index 61fbe05ab..7e924e124 100644 --- a/app/views/versions/index.html.erb +++ b/app/views/versions/index.html.erb @@ -16,11 +16,12 @@
<% @versions.each do |version| %>
- <% if User.current.allowed_to?(:manage_versions, version.project) %> -
+
+ <%= link_to_new_issue(version, version.project) %> + <% if User.current.allowed_to?(:manage_versions, version.project) %> <%= link_to l(:button_edit), edit_version_path(version), :title => l(:button_edit), :class => 'icon-only icon-edit' %> -
- <% end %> + <% end %> +

<%= link_to_version version, :name => version_anchor(version) %>

<%= l("version_status_#{version.status}") %> diff --git a/test/functional/versions_controller_test.rb b/test/functional/versions_controller_test.rb index 7b2249dfe..a0f67ae44 100644 --- a/test/functional/versions_controller_test.rb +++ b/test/functional/versions_controller_test.rb @@ -114,6 +114,25 @@ class VersionsControllerTest < Redmine::ControllerTest end end + def test_index_should_show_contextual + @request.session[:user_id] = 1 + get :index, :params => {:project_id => 1, :completed => 1} + assert_response :success + + assert_select 'article.version-open .contextual' do + assert_select 'a.icon.icon-add', :text => 'New issue' + assert_select 'a.icon-only.icon-edit' + end + assert_select 'article.version-locked .contextual' do + assert_select 'a.icon.icon-add', :text => 'New issue', :count => 0 + assert_select 'a.icon-only.icon-edit' + end + assert_select 'article.version-closed .contextual' do + assert_select 'a.icon.icon-add', :text => 'New issue', :count => 0 + assert_select 'a.icon-only.icon-edit' + end + end + def test_show with_settings :gravatar_enabled => '0' do get :show, :params => {:id => 2}