Project

General

Profile

Feature #31104 » 31104-show-number-of-open-issues.patch

Yuichi HARADA, 2019-04-09 04:24

View differences:

app/models/mailer.rb
553 553
    @issues_url = url_for(:controller => 'issues', :action => 'index',
554 554
                                :set_filter => 1, :assigned_to_id => 'me',
555 555
                                :sort => 'due_date:asc')
556
    @open_issues_count = Issue.visible.open.assigned_to(user).count
556 557
    mail :to => user,
557 558
      :subject => l(:mail_subject_reminder, :count => issues.size, :days => days)
558 559
  end
......
770 771
    @references_objects << object
771 772
  end
772 773
end
773

  
app/views/mailer/reminder.html.erb
6 6
<% end -%>
7 7
</ul>
8 8

  
9
<p><%= link_to l(:label_issue_view_all), @issues_url %></p>
9
<p><%= link_to l(:label_issue_view_all), @issues_url %> (<%= l(:label_x_open_issues_abbr, :count => @open_issues_count) %>)</p>
app/views/mailer/reminder.text.erb
4 4
* <%= "#{issue.project} - #{issue.tracker} ##{issue.id}: #{issue.subject}" %>
5 5
<% end -%>
6 6

  
7
<%= l(:label_issue_view_all)%> (<%= l(:label_x_open_issues_abbr, :count => @open_issues_count) %>)
7 8
<%= @issues_url %>
test/unit/mailer_test.rb
621 621
    mail = last_email
622 622
    assert mail.bcc.include?('dlopper@somenet.foo')
623 623
    assert_mail_body_match 'Bug #3: Error 281 when updating a recipe', mail
624
    assert_mail_body_match 'View all issues (2 open)', mail
624 625
    assert_select_email do
625 626
      assert_select 'a[href=?]',
626 627
                    'http://localhost:3000/issues?assigned_to_id=me&set_filter=1&sort=due_date%3Aasc',
627 628
                    :text => 'View all issues'
629
      assert_select '/p:nth-last-of-type(1)', :text => 'View all issues (2 open)'
628 630
    end
629 631
    assert_equal '1 issue(s) due in the next 42 days', mail.subject
630 632
  end
(2-2/3)