# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module IssueStatusesHelper
+ def issue_status_type_badge(status)
+ if status.is_closed?
+ content_tag('span', l(:label_closed_issues), class: 'badge badge-status-closed')
+ else
+ content_tag('span', l(:label_open_issues), class: 'badge badge-status-open')
+ end
+ end
end
module IssuesHelper
include ApplicationHelper
include Redmine::Export::PDF::IssuesPdfHelper
+ include IssueStatusesHelper
def issue_list(issues, &block)
ancestors = []
<%= render :partial => 'action_menu' %>
-<h2><%= issue_heading(@issue) %></h2>
+<h2 class="inline-flex"><%= issue_heading(@issue) %></h2>
+<%= issue_status_type_badge(@issue.status) %>
<div class="<%= @issue.css_classes %> details">
<% if @prev_issue_id || @next_issue_id %>
</div>
<% end %>
<header>
- <h3 class="icon icon-package version"><%= link_to_version version, :name => version_anchor(version) %></h3>
+ <h3 class="icon icon-package version inline-flex"><%= link_to_version version, :name => version_anchor(version) %></h3>
<span class="badge badge-status-<%= version.status %>"><%= l("version_status_#{version.status}") %></span>
</header>
<%= render :partial => 'versions/overview', :locals => {:version => version} %>
</div>
<div id="roadmap" class="<%= @version.css_classes %>">
- <h2><%= @version.name %></h2>
+ <h2 class="inline-flex"><%= @version.name %></h2>
<span class="badge badge-status-<%= @version.status %>"><%= l("version_status_#{@version.status}") %></span>
<%= render :partial => 'versions/overview', :locals => {:version => @version} %>
.mobile-show {display: none;}
.hidden {display: none;}
+.inline-flex {display: inline-flex;}
/***** Links *****/
a, a:link, a:visited{ color: #169; text-decoration: none; }
div.issue .attributes .attribute .label {width: 170px; margin-left:-180px; font-weight:bold; float:left; overflow:hidden; text-overflow: ellipsis;}
div.issue .attribute .value {overflow:auto; text-overflow: ellipsis;}
div.issue.overdue .due-date .value { color: #c22; }
+body.controller-issues h2.inline-flex {padding-right: 0}
#issue_tree table.issues, #relations table.issues { border: 0; }
#issue_tree td.checkbox, #relations td.checkbox {display:none;}
div#roadmap .wiki h1:first-child { display: none; }
div#roadmap .wiki h1 { font-size: 120%; }
div#roadmap .wiki h2 { font-size: 110%; }
-div#roadmap h2, div#roadmap h3 { display: inline; padding-right: 0;}
+div#roadmap h2, div#roadmap h3 {padding-right: 0;}
body.controller-versions.action-show div#roadmap .related-issues {width:70%;}
div#version-summary { float:right; width:28%; margin-left: 16px; margin-bottom: 16px; background-color: #fff; }
end
end
+ def test_show_should_display_open_badge_for_open_issue
+ get :show, params: {id: 1}
+
+ assert_response :success
+ assert_select 'span.badge.badge-status-open', text: 'open'
+ end
+
+ def test_show_should_display_closed_badge_for_closed_issue
+ get :show, params: {id: 8}
+
+ assert_response :success
+ assert_select 'span.badge.badge-status-closed', text: 'closed'
+ end
+
def test_get_new
@request.session[:user_id] = 2
get(