OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/app/views/digest_mailer/work_packages.text.erb

40 lines
1.8 KiB

<% @aggregated_notifications.first(DigestMailer::MAX_SHOWN_WORK_PACKAGES).each do | work_package, notifications_by_work_package| %>
<%= "=" * (('# ' + work_package.id.to_s + work_package.subject).length + 4) %>
= #<%= work_package.id %> <%= work_package.subject %> =
<%= "=" * (('# ' + work_package.id.to_s + work_package.subject).length + 4) %>
<% notifications_by_work_package.each do | notification | %>
<%= "-" * 20 %>
<% unique_reasons = unique_reasons_of_notifications(notifications_by_work_package) %>
<%= digest_notification_timestamp_text(
notification,
html: false,
extended_text: true) %> (<% unique_reasons.each_with_index do |reason, index| %><%= I18n.t(:"mail.digests.work_packages.reason.#{reason || :unknown}", default: '-') %><%= ', ' unless unique_reasons.size-1 == index %><% end %>)
<% journal = notification.journal %>
<% if journal.notes.present? %>
<%= I18n.t(:label_comment_added) %>:
<%= journal.notes %>
<% end %>
<% journal.details.each do |detail| %>
* <%= journal.render_detail(detail, only_path: false, no_html: true) %>
<% end %>
<%= "-" * 20 %>
<% end %>
<% end %>
<%= "-" * 100 %>
<% if @aggregated_notifications.length > DigestMailer::MAX_SHOWN_WORK_PACKAGES %>
<% number_of_overflowing_work_packages = @aggregated_notifications.length - DigestMailer::MAX_SHOWN_WORK_PACKAGES %>
<% if number_of_overflowing_work_packages === 1 %>
<%= I18n.t(:'mail.digests.work_packages.more_to_see_singular') %> <%= I18n.t(:'mail.digests.work_packages.login_to_see_all') %>
<% else %>
<%= I18n.t(:'mail.digests.work_packages.more_to_see_plural', number: number_of_overflowing_work_packages) %> <%= I18n.t(:'mail.digests.work_packages.login_to_see_all') %>
<% end %>
<% end %>