From 0fb7d1322960739154e2885a4812f72e4ba6ae96 Mon Sep 17 00:00:00 2001 From: iagirre Date: Fri, 25 May 2018 11:43:24 +0200 Subject: [PATCH] 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. --- app/views/admin/_menu.html.erb | 4 ++ .../proposal_notifications/index.html.erb | 49 +++++++++++++++++++ config/locales/en/admin.yml | 9 ++++ config/locales/es/admin.yml | 9 ++++ 4 files changed, 71 insertions(+) create mode 100644 app/views/admin/proposal_notifications/index.html.erb diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb index 8cf4f45af..d04fdc5c6 100644 --- a/app/views/admin/_menu.html.erb +++ b/app/views/admin/_menu.html.erb @@ -142,6 +142,10 @@ <%= link_to t("admin.menu.hidden_comments"), admin_comments_path %> +
  • > + <%= link_to t("admin.menu.hidden_proposal_notifications"), admin_proposal_notifications_path %> +
  • +
  • > <%= link_to t("admin.menu.hidden_users"), admin_hidden_users_path %>
  • diff --git a/app/views/admin/proposal_notifications/index.html.erb b/app/views/admin/proposal_notifications/index.html.erb new file mode 100644 index 000000000..a67dbb44f --- /dev/null +++ b/app/views/admin/proposal_notifications/index.html.erb @@ -0,0 +1,49 @@ +

    <%= t("admin.proposal_notifications.index.title") %>

    +

    <%= t("admin.shared.moderated_content") %>

    + +<%= render 'shared/filter_subnav', i18n_namespace: "admin.proposal_notifications.index" %> + +<% if @proposal_notifications.any? %> +

    <%= page_entries_info @proposal_notifications %>

    + + + + + + + + + <% @proposal_notifications.each do |proposal_notification| %> + + + + + + <% end %> + +
    <%= t("admin.shared.title") %><%= t("admin.shared.description") %><%= t("admin.shared.actions") %>
    + <%= proposal_notification.title %> + +
    + <%= proposal_notification.body %> +
    +
    + <%= 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 %> +
    + + <%= paginate @proposal_notifications %> +<% else %> +
    + <%= t("admin.proposal_notifications.index.no_hidden_proposals") %> +
    +<% end %> diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index 377841d43..f65f048be 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -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 diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index 11c3cf423..a2bb3a685 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -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