Add admin UI to Restore/Confirm moderation of notifications
Add the admin UI needed to restore the hidden proposal notifications when hidden by moderator. The admin can restore them or confirm the moderation made by moderator, just like proposals.
This commit is contained in:
@@ -142,6 +142,10 @@
|
||||
<%= link_to t("admin.menu.hidden_comments"), admin_comments_path %>
|
||||
</li>
|
||||
|
||||
<li <%= "class=is-active" if controller_name == "proposal_notifications" %>>
|
||||
<%= link_to t("admin.menu.hidden_proposal_notifications"), admin_proposal_notifications_path %>
|
||||
</li>
|
||||
|
||||
<li <%= "class=is-active" if controller_name == "hidden_users" %>>
|
||||
<%= link_to t("admin.menu.hidden_users"), admin_hidden_users_path %>
|
||||
</li>
|
||||
|
||||
49
app/views/admin/proposal_notifications/index.html.erb
Normal file
49
app/views/admin/proposal_notifications/index.html.erb
Normal file
@@ -0,0 +1,49 @@
|
||||
<h2><%= t("admin.proposal_notifications.index.title") %></h2>
|
||||
<p><%= t("admin.shared.moderated_content") %></p>
|
||||
|
||||
<%= render 'shared/filter_subnav', i18n_namespace: "admin.proposal_notifications.index" %>
|
||||
|
||||
<% if @proposal_notifications.any? %>
|
||||
<h3 class="margin"><%= page_entries_info @proposal_notifications %></h3>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<th scope="col"><%= t("admin.shared.title") %></th>
|
||||
<th scope="col" class="small-6"><%= t("admin.shared.description") %></th>
|
||||
<th scope="col" class="small-4"><%= t("admin.shared.actions") %></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @proposal_notifications.each do |proposal_notification| %>
|
||||
<tr id="<%= dom_id(proposal_notification) %>">
|
||||
<td class="align-top">
|
||||
<strong><%= proposal_notification.title %></strong>
|
||||
</td>
|
||||
<td>
|
||||
<div class="moderation-description">
|
||||
<%= proposal_notification.body %>
|
||||
</div>
|
||||
</td>
|
||||
<td class="align-top">
|
||||
<%= link_to t("admin.actions.restore"),
|
||||
restore_admin_proposal_notification_path(proposal_notification, request.query_parameters),
|
||||
method: :put,
|
||||
data: { confirm: t("admin.actions.confirm") },
|
||||
class: "button hollow warning" %>
|
||||
<% unless proposal_notification.confirmed_hide? %>
|
||||
<%= link_to t("admin.actions.confirm_hide"),
|
||||
confirm_hide_admin_proposal_notification_path(proposal_notification, request.query_parameters),
|
||||
method: :put,
|
||||
class: "button" %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= paginate @proposal_notifications %>
|
||||
<% else %>
|
||||
<div class="callout primary margin">
|
||||
<%= t("admin.proposal_notifications.index.no_hidden_proposals") %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -940,6 +940,15 @@ en:
|
||||
without_confirmed_hide: Pending
|
||||
title: Hidden proposals
|
||||
no_hidden_proposals: There is no hidden proposals.
|
||||
proposal_notifications:
|
||||
index:
|
||||
filter: Filter
|
||||
filters:
|
||||
all: All
|
||||
with_confirmed_hide: Confirmed
|
||||
without_confirmed_hide: Pending
|
||||
title: Hidden notifications
|
||||
no_hidden_proposals: There is no hidden notifications.
|
||||
settings:
|
||||
flash:
|
||||
updated: Value updated
|
||||
|
||||
@@ -940,6 +940,15 @@ es:
|
||||
without_confirmed_hide: Pendientes
|
||||
title: Propuestas ocultas
|
||||
no_hidden_proposals: No hay propuestas ocultas.
|
||||
proposal_notifications:
|
||||
index:
|
||||
filter: Filtro
|
||||
filters:
|
||||
all: Todas
|
||||
with_confirmed_hide: Confirmadas
|
||||
without_confirmed_hide: Pendientes
|
||||
title: Notificaciones ocultas
|
||||
no_hidden_proposals: No hay notificaciones ocultas.
|
||||
settings:
|
||||
flash:
|
||||
updated: Valor actualizado
|
||||
|
||||
Reference in New Issue
Block a user