Project

General

Profile

Feature #33832 » 33832-v2.patch

Go MAEDA, 2020-11-08 07:29

View differences:

app/helpers/issues_helper.rb
84 84
    end
85 85
    s << '<div>'
86 86
    subject = h(issue.subject)
87
    if issue.is_private?
88
      subject = subject + ' ' + content_tag('span', l(:field_is_private), :class => 'badge badge-private private')
89
    end
90 87
    s << content_tag('h3', subject)
91 88
    s << '</div>' * (ancestors.size + 1)
92 89
    s.html_safe
app/views/issues/show.html.erb
2 2

  
3 3
<h2 class="inline-flex"><%= issue_heading(@issue) %></h2>
4 4
<%= issue_status_type_badge(@issue.status) %>
5
<% if @issue.is_private? %>
6
  <span class="badge badge-private private"><%= l(:field_is_private) %></span>
7
<% end %>
5 8

  
6 9
<div class="<%= @issue.css_classes %> details">
7 10
  <% if @prev_issue_id || @next_issue_id %>
public/stylesheets/application.css
1451 1451
.badge-private {
1452 1452
  background: #d22;
1453 1453
  color: #fff;
1454
  border: 1px solid #d22;
1454 1455
}
1455 1456
.badge-count {
1456 1457
  color: #fff;
test/functional/issues_controller_test.rb
3020 3020
    assert_select 'span.badge.badge-status-closed', text: 'closed'
3021 3021
  end
3022 3022

  
3023
  def test_show_should_display_private_badge_for_private_issue
3024
    @request.session[:user_id] = 1
3025
    get :show, params: {id: 14}
3026

  
3027
    assert_response :success
3028
    assert_select 'span.badge.badge-private', text: 'Private'
3029
  end
3030

  
3023 3031
  def test_get_new
3024 3032
    @request.session[:user_id] = 2
3025 3033
    get(
(4-4/4)