issue-status-badge-in-email.patch

Go MAEDA, 2020-08-10 09:27

Download (1.84 KB)

View differences:

app/views/layouts/mailer.html.erb
47 47
  border: 1px solid #bbb;
48 48
  padding: 4px;
49 49
}
50
.badge {
51
  position:relative;
52
  font-weight:bold;
53
  font-size: 10px;
54
  bottom: 2px;
55
  padding: 1px 3px;
56
  margin-right: 2px;
57
  margin-left: 2px;
58
  border-radius: 2px;
59
  text-transform: uppercase;
60
  text-decoration: none;
61
}
62
.badge-status-open {
63
  color: #205D86;
64
  border: 1px solid #205D86;
65
}
66
.badge-status-closed {
67
  color: #1D781D;
68
  border: 1px solid #1D781D;
69
}
50 70
</style>
51 71
</head>
52 72
<body>
app/views/mailer/_issue.html.erb
1
<h1><%= link_to("#{issue.tracker.name} ##{issue.id}: #{issue.subject}", issue_url) %></h1>
1
<h1>
2
  <%= link_to("#{issue.tracker.name} ##{issue.id}: #{issue.subject}", issue_url) %>
3
  <%= issue_status_type_badge(issue.status) %>
4
</h1>
2 5

  
3 6
<%= render_email_issue_attributes(issue, user, true) %>
4 7

  
test/unit/mailer_test.rb
480 480
    end
481 481
  end
482 482

  
483
  def test_issue_add_should_include_issue_status_type_badge
484
    issue = Issue.find(1)
485
    Mailer.deliver_issue_add(issue)
486

  
487
    mail = last_email
488
    assert_select_email do
489
      assert_select 'span.badge.badge-status-open', text: 'open'
490
    end
491
  end
492

  
483 493
  def test_issue_edit_subject_should_include_status_changes_if_setting_is_enabled
484 494
    with_settings :show_status_changes_in_mail_subject => 1 do
485 495
      issue = Issue.find(2)