Skip to content

Commit

Permalink
Added Reporting time in Global Moderation / Users (#10213)
Browse files Browse the repository at this point in the history
* added-reported-time-to-user-moderations

* deleted-extra-line

* locale-changes

* fields reorder/contentmoderations - localizations revert

* fixed tests
  • Loading branch information
JoonasAapro authored and entantoencuanto committed Jan 26, 2023
1 parent f36bc8d commit 30fc452
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<th><%= t(".name") %></th>
<th><%= t(".nickname") %></th>
<th><%= t(".reason") %></th>
<th><%= sort_link(query, :created_at, t("models.moderation.fields.created_at", scope: "decidim.moderations")) %></th>
<th><%= sort_link(query, :report_count, t(".reports"), default_order: :desc) %></th>
<th class="actions"><%= t(".actions.title") %></th>
</tr>
Expand All @@ -40,6 +41,9 @@
<% reports = moderation.reports.map { |report| render "report", report: report } %>
<%= safe_join(reports, ",") %>
</td>
<td>
<%= l moderation.created_at, format: :decidim_short %>
</td>
<td>
<%= moderation.report_count %>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
<% if !respond_to?(:current_participatory_space) %>
<th><%= t("models.moderation.fields.participatory_space", scope: "decidim.moderations") %></th>
<% end %>
<th><%= sort_link(query, :report_count, t("models.moderation.fields.report_count", scope: "decidim.moderations")) %></th>
<th><%= t("models.moderation.fields.reported_content_url", scope: "decidim.moderations") %></th>
<th><%= t("models.moderation.fields.reports", scope: "decidim.moderations") %></th>
<th><%= sort_link(query, :created_at, t("models.moderation.fields.created_at", scope: "decidim.moderations")) %></th>
<th><%= sort_link(query, :report_count, t("models.moderation.fields.report_count", scope: "decidim.moderations")) %></th>
<% if params[:hidden] %>
<th><%= t("models.moderation.fields.hidden_at", scope: "decidim.moderations") %></th>
<% end %>
Expand All @@ -44,9 +44,6 @@
<%= participatory_space_title_for(moderation.reportable) %>
</td>
<% end %>
<td>
<%= moderation.report_count %>
</td>
<td>
<% if (reportable_url = moderation.reportable.reported_content_url) %>
<%=
Expand All @@ -63,6 +60,9 @@
<td>
<%= l(moderation.created_at, format: :long) %>
</td>
<td>
<%= moderation.report_count %>
</td>
<% if params[:hidden] %>
<td>
<%= l(moderation.hidden_at, format: :long) if moderation.hidden_at.present? %>
Expand Down
6 changes: 3 additions & 3 deletions decidim-admin/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1102,15 +1102,15 @@ en:
models:
moderation:
fields:
created_at: Creation date
created_at: Reported at
deleted_resource: Deleted resource
hidden_at: Hidden at
participatory_space: Participatory space
report_count: Count
report_count: Reports count
reportable_id: ID
reportable_type: Type
reported_content_url: Reported content URL
reports: Reports
reports: Reason
visit_url: Visit URL
report:
fields:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
moderations_ordered_by_report_count_asc = moderations.sort_by(&:report_count)

within "table" do
click_link "Count"
click_link "Reports count"

all("tbody tr").each_with_index do |row, index|
reportable_id = moderations_ordered_by_report_count_asc[index].reportable.id
Expand Down

0 comments on commit 30fc452

Please sign in to comment.