summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2018-08-09 11:49:53 +0000
committerGo MAEDA <maeda@farend.jp>2018-08-09 11:49:53 +0000
commitd510c4e50e32d48c83416b932d81ca36fac198ad (patch)
tree44d59cbd96814402c487dc06c512b5aa7e20a1db
parentef79ec82942a31db3049c9d6e42c99805bdcaa13 (diff)
downloadredmine-d510c4e50e32d48c83416b932d81ca36fac198ad.tar.gz
redmine-d510c4e50e32d48c83416b932d81ca36fac198ad.zip
Mark default version in versions tab from project settings (#27799).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@17467 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/views/projects/settings/_versions.html.erb2
-rw-r--r--test/functional/projects_controller_test.rb21
2 files changed, 23 insertions, 0 deletions
diff --git a/app/views/projects/settings/_versions.html.erb b/app/views/projects/settings/_versions.html.erb
index f402fff7e..4651b405d 100644
--- a/app/views/projects/settings/_versions.html.erb
+++ b/app/views/projects/settings/_versions.html.erb
@@ -16,6 +16,7 @@
<table class="list versions">
<thead><tr>
<th><%= l(:label_version) %></th>
+ <th><%= l(:field_default_version) %></th>
<th><%= l(:field_effective_date) %></th>
<th><%= l(:field_description) %></th>
<th><%= l(:field_status) %></th>
@@ -27,6 +28,7 @@
<% @versions.sort.each do |version| %>
<tr class="version <%=h version.status %> <%= 'shared' if version.project != @project %>">
<td class="name <%= 'icon icon-shared' if version.project != @project %>"><%= link_to_version version %></td>
+ <td class="tick"><%= checked_image(version.id == @project.default_version_id) %></td>
<td class="date"><%= format_date(version.effective_date) %></td>
<td class="description"><%= version.description %></td>
<td class="status"><%= l("version_status_#{version.status}") %></td>
diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb
index 68265ad05..df1da4a28 100644
--- a/test/functional/projects_controller_test.rb
+++ b/test/functional/projects_controller_test.rb
@@ -641,6 +641,27 @@ class ProjectsControllerTest < Redmine::ControllerTest
assert_select 'a#tab-versions[href=?]', '/projects/ecookbook/settings/versions?version_name=.1&version_status='
end
+ def test_settings_should_show_default_version_in_versions_tab
+ project = Project.find(1)
+ project.default_version_id = 3
+ project.save!
+
+ @request.session[:user_id] = 2
+
+ get :settings, :params => {
+ :id => 'ecookbook',
+ :tab => 'versions',
+ }
+ assert_response :success
+
+ assert_select 'table.versions tbody' do
+ # asserts that only one version is marked as default
+ assert_select 'td.tick span.icon-checked', 1
+ # asserts which version is marked as default
+ assert_select 'tr:first-child td.tick span.icon-checked', 1
+ end
+ end
+
def test_settings_should_show_locked_members
user = User.generate!
member = User.add_to_project(user, Project.find(1))