]> git.openstreetmap.org Git - rails.git/commitdiff
Add contents to issue reporters page
authorAnton Khorev <tony29@yandex.ru>
Fri, 7 Mar 2025 14:58:05 +0000 (17:58 +0300)
committerAnton Khorev <tony29@yandex.ru>
Fri, 7 Mar 2025 14:58:05 +0000 (17:58 +0300)
app/controllers/issues/reporters_controller.rb
app/views/issues/reporters/index.html.erb
config/locales/en.yml

index 0bc0695fc52762abacf183fe5457bdd8155522fc..78d9e2cc89d66d684585d685a8767e5fa27d7fde 100644 (file)
@@ -10,6 +10,14 @@ module Issues
 
     def index
       @issue = Issue.visible_to(current_user).find(params[:issue_id])
+
+      user_ids = @issue.reports.order(:created_at => :desc).pluck(:user_id).uniq
+      @unique_reporters = {
+        @issue.id => {
+          :count => user_ids.size,
+          :users => User.in_order_of(:id, user_ids)
+        }
+      }
     rescue ActiveRecord::RecordNotFound
       redirect_to :controller => "/errors", :action => "not_found"
     end
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..88b33946e74c2d0c224568bcd0d142dff72d003f 100644 (file)
@@ -0,0 +1,5 @@
+<% content_for :heading do %>
+  <h1><%= t ".title", :issue_id => @issue.id %></h1>
+<% end %>
+
+<%= render :partial => "reporters", :locals => { :issue => @issue } %>
index fd9a7e60d164ca84a905f01410d1e7080f380fc6..4120c96e53be8c582a5a0b870c959934f97e343e 100644 (file)
@@ -1581,6 +1581,8 @@ en:
         diary_comment: "%{entry_title}, comment #%{comment_id}"
         note: "Note #%{note_id}"
     reporters:
+      index:
+        title: "Issue #%{issue_id} Reporters"
       reporters:
         more_reporters: "and %{count} more"
   issue_comments: