Project

General

Profile

Feature #33254 » 0001-Show-open-closed-badge-on-issue-page.patch

Marius BĂLTEANU, 2020-04-18 17:22

View differences:

app/helpers/issue_statuses_helper.rb
18 18
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19 19

  
20 20
module IssueStatusesHelper
21
  def issue_status_type_badge(status)
22
    if status.is_closed?
23
      content_tag('span', l(:label_closed_issues), class: 'badge badge-status-closed')
24
    else
25
      content_tag('span', l(:label_open_issues), class: 'badge badge-status-open')
26
    end
27
  end
21 28
end
app/helpers/issues_helper.rb
20 20
module IssuesHelper
21 21
  include ApplicationHelper
22 22
  include Redmine::Export::PDF::IssuesPdfHelper
23
  include IssueStatusesHelper
23 24

  
24 25
  def issue_list(issues, &block)
25 26
    ancestors = []
app/views/issues/show.html.erb
1 1
<%= render :partial => 'action_menu' %>
2 2

  
3
<h2><%= issue_heading(@issue) %></h2>
3
<h2 class="inline-flex"><%= issue_heading(@issue) %></h2>
4
<%= issue_status_type_badge(@issue.status) %>
4 5

  
5 6
<div class="<%= @issue.css_classes %> details">
6 7
  <% if @prev_issue_id || @next_issue_id %>
app/views/versions/index.html.erb
22 22
      </div>
23 23
    <% end %>
24 24
    <header>
25
      <h3 class="icon icon-package version"><%= link_to_version version, :name => version_anchor(version) %></h3>
25
      <h3 class="icon icon-package version inline-flex"><%= link_to_version version, :name => version_anchor(version) %></h3>
26 26
      <span class="badge badge-status-<%= version.status %>"><%= l("version_status_#{version.status}") %></span>
27 27
    </header>
28 28
    <%= render :partial => 'versions/overview', :locals => {:version => version} %>
app/views/versions/show.html.erb
7 7
</div>
8 8

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

  
13 13
<%= render :partial => 'versions/overview', :locals => {:version => @version} %>
public/stylesheets/application.css
132 132

  
133 133
.mobile-show {display: none;}
134 134
.hidden {display: none;}
135
.inline-flex {display: inline-flex;}
135 136

  
136 137
/***** Links *****/
137 138
a, a:link, a:visited{ color: #169; text-decoration: none; }
......
532 533
div.issue .attributes .attribute .label {width: 170px; margin-left:-180px; font-weight:bold; float:left;  overflow:hidden; text-overflow: ellipsis;}
533 534
div.issue .attribute .value {overflow:auto; text-overflow: ellipsis;}
534 535
div.issue.overdue .due-date .value { color: #c22; }
536
body.controller-issues h2.inline-flex {padding-right: 0}
535 537

  
536 538
#issue_tree table.issues, #relations table.issues { border: 0; }
537 539
#issue_tree td.checkbox, #relations td.checkbox {display:none;}
......
614 616
div#roadmap .wiki h1:first-child { display: none; }
615 617
div#roadmap .wiki h1 { font-size: 120%; }
616 618
div#roadmap .wiki h2 { font-size: 110%; }
617
div#roadmap h2, div#roadmap h3 { display: inline; padding-right: 0;}
619
div#roadmap h2, div#roadmap h3 {padding-right: 0;}
618 620
body.controller-versions.action-show div#roadmap .related-issues {width:70%;}
619 621

  
620 622
div#version-summary { float:right; width:28%; margin-left: 16px; margin-bottom: 16px; background-color: #fff; }
test/functional/issues_controller_test.rb
2995 2995
    end
2996 2996
  end
2997 2997

  
2998
  def test_show_should_display_open_badge_for_open_issue
2999
    get :show, params: {id: 1}
3000

  
3001
    assert_response :success
3002
    assert_select 'span.badge.badge-status-open', text: 'open'
3003
  end
3004

  
3005
  def test_show_should_display_closed_badge_for_closed_issue
3006
    get :show, params: {id: 8}
3007

  
3008
    assert_response :success
3009
    assert_select 'span.badge.badge-status-closed', text: 'closed'
3010
  end
3011

  
2998 3012
  def test_get_new
2999 3013
    @request.session[:user_id] = 2
3000 3014
    get(
(6-6/6)