Project

General

Profile

Patch #29391 » 0002-Show-version-status-as-badge-in-rodmap-index-and-roa.patch

Marius BĂLTEANU, 2018-12-16 17:05

View differences:

app/views/versions/index.html.erb
18 18
    <% end %>
19 19
    <header>
20 20
      <h3 class="icon icon-package version"><%= link_to_version version, :name => version_anchor(version) %></h3>
21
      <span class="badge badge-status-<%= version.status %>"><%= l("version_status_#{version.status}") %></span>
21 22
    </header>
22 23
    <%= render :partial => 'versions/overview', :locals => {:version => version} %>
23 24
    <%= render(:partial => "wiki/content",
app/views/versions/show.html.erb
5 5
<%= call_hook(:view_versions_show_contextual, { :version => @version, :project => @project }) %>
6 6
</div>
7 7

  
8
<h2><%= @version.name %></h2>
9

  
10 8
<div id="roadmap" class="<%= @version.css_classes %>">
9
  <h2><%= @version.name %></h2>
10
  <span class="badge badge-status-<%= @version.status %>"><%= l("version_status_#{@version.status}") %></span>
11

  
11 12
<%= render :partial => 'versions/overview', :locals => {:version => @version} %>
12 13
<%= render(:partial => "wiki/content", :locals => {:content => @version.wiki_page.content}) if @version.wiki_page %>
13 14

  
public/stylesheets/application.css
550 550
div#roadmap .wiki h1:first-child { display: none; }
551 551
div#roadmap .wiki h1 { font-size: 120%; }
552 552
div#roadmap .wiki h2 { font-size: 110%; }
553
div#roadmap h2, div#roadmap h3 { display: inline; padding-right: 0;}
553 554
body.controller-versions.action-show div#roadmap .related-issues {width:70%;}
554 555

  
555 556
div#version-summary { float:right; width:28%; margin-left: 16px; margin-bottom: 16px; background-color: #fff; }
......
1252 1253
  bottom: 2px;
1253 1254
  padding: 0px 2px 0px 2px;
1254 1255
  margin-right: 2px;
1256
  margin-left: 2px;
1255 1257
  border-radius: 2px;
1256 1258
  text-transform: uppercase;
1257 1259
  text-decoration: none;
......
1264 1266
  color: #fff;
1265 1267
  background:#9DB9D5;
1266 1268
}
1269
.badge-status-open {
1270
  color: #fff;
1271
  background: #559cec;
1272
}
1273
.badge-status-locked {
1274
  background: #EEEEEE;
1275
}
1276
.badge-status-closed {
1277
  color: #fff;
1278
  background: #51ce39;
1279
}
1267 1280
/***** Icons *****/
1268 1281
.icon {
1269 1282
  background-position: 0% 50%;
test/functional/versions_controller_test.rb
34 34
    assert_response :success
35 35

  
36 36
    # Version with no date set appears
37
    assert_select 'h3', :text => Version.find(3).name
37
    assert_select 'h3', :text => "#{Version.find(3).name}"
38
    assert_select 'span[class=?]', 'badge badge-status-open', :text => 'open'
39

  
38 40
    # Completed version doesn't appear
39 41
    assert_select 'h3', :text => Version.find(1).name, :count => 0
40 42

  
......
99 101
    assert_response :success
100 102

  
101 103
    assert_select 'h2', :text => /1.0/
104
    assert_select 'span[class=?]', 'badge badge-status-locked', :text => 'locked'
102 105
  end
103 106

  
104 107
  def test_show_issue_calculations_should_take_into_account_only_visible_issues
(4-4/6)