From b76ed623d7d525975079e7c06aff73458feba29d Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Fri, 7 Mar 2025 17:06:53 +0300 Subject: [PATCH] Create issue reporters template --- app/views/issues/_page.html.erb | 7 +------ app/views/issues/reporters/_reporters.html.erb | 6 ++++++ config/locales/en.yml | 4 +++- 3 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 app/views/issues/reporters/_reporters.html.erb diff --git a/app/views/issues/_page.html.erb b/app/views/issues/_page.html.erb index 9681704a1..225517c9d 100644 --- a/app/views/issues/_page.html.erb +++ b/app/views/issues/_page.html.erb @@ -25,12 +25,7 @@ <%= link_to reportable_title(issue.reportable), reportable_url(issue.reportable) %> <%= link_to issue.reported_user.display_name, issue.reported_user if issue.reported_user %> - <% @unique_reporters[issue.id][:users].each do |reporter| %> - <%= link_to reporter.display_name, reporter, :class => "d-block text-truncate", :title => reporter.display_name %> - <% end %> - <% if @unique_reporters[issue.id][:count] > 3 %> -

<%= t ".more_reporters", :count => @unique_reporters[issue.id][:count] - 3 %>

- <% end %> + <%= render :partial => "issues/reporters/reporters", :locals => { :issue => issue } %> <% if issue.user_updated %> diff --git a/app/views/issues/reporters/_reporters.html.erb b/app/views/issues/reporters/_reporters.html.erb new file mode 100644 index 000000000..bf29e55c0 --- /dev/null +++ b/app/views/issues/reporters/_reporters.html.erb @@ -0,0 +1,6 @@ + <% @unique_reporters[issue.id][:users].each do |reporter| %> + <%= link_to reporter.display_name, reporter, :class => "d-block text-truncate", :title => reporter.display_name %> + <% end %> + <% if @unique_reporters[issue.id][:count] > 3 %> +

<%= t ".more_reporters", :count => @unique_reporters[issue.id][:count] - 3 %>

+ <% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 093827ebd..fd9a7e60d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1538,7 +1538,6 @@ en: reports_count: one: "%{count} Report" other: "%{count} Reports" - more_reporters: "and %{count} more" reported_item: Reported Item states: ignored: Ignored @@ -1581,6 +1580,9 @@ en: reportable_title: diary_comment: "%{entry_title}, comment #%{comment_id}" note: "Note #%{note_id}" + reporters: + reporters: + more_reporters: "and %{count} more" issue_comments: create: comment_created: Your comment was successfully created -- 2.39.5