diff --git a/app/controllers/admin/system_emails_controller.rb b/app/controllers/admin/system_emails_controller.rb new file mode 100644 index 000000000..de09c7c1f --- /dev/null +++ b/app/controllers/admin/system_emails_controller.rb @@ -0,0 +1,7 @@ +class Admin::SystemEmailsController < Admin::BaseController + + def index + @system_emails = %w(proposal_notification_digest) + end + +end diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb index e1d6cc0de..ffec03232 100644 --- a/app/views/admin/_menu.html.erb +++ b/app/views/admin/_menu.html.erb @@ -79,7 +79,7 @@ <% end %> - <% messages_sections = %w(newsletters emails_download admin_notifications) %> + <% messages_sections = %w(newsletters emails_download admin_notifications system_emails) %> <% messages_menu_active = messages_sections.include?(controller_name) %>
  • > @@ -93,6 +93,9 @@
  • > <%= link_to t("admin.menu.admin_notifications"), admin_admin_notifications_path %>
  • +
  • > + <%= link_to t("admin.menu.system_emails"), admin_system_emails_path %> +
  • > <%= link_to t("admin.menu.emails_download"), admin_emails_download_index_path %>
  • diff --git a/app/views/admin/system_emails/index.html.erb b/app/views/admin/system_emails/index.html.erb new file mode 100644 index 000000000..d2962fba2 --- /dev/null +++ b/app/views/admin/system_emails/index.html.erb @@ -0,0 +1,29 @@ +

    <%= t("admin.menu.system_emails") %>

    + + + + + + + + + + + <% @system_emails.each do |system_email| %> + + + + + + <% end %> + +
    <%= t("admin.shared.title") %><%= t("admin.shared.description") %><%= t("admin.shared.actions") %>
    + <%= t("admin.system_emails.#{system_email}.title") %> + + <%= t("admin.system_emails.#{system_email}.description") %> + + <%= link_to t("admin.shared.view"), admin_system_email_view_path(system_email), + class: "button hollow" %> + <%= link_to t("admin.shared.preview"), admin_system_email_preview_path(system_email), + class: "button" %> +
    diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index 43f91eda1..ea01f35d6 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -521,6 +521,7 @@ en: messaging_users: Messages to users newsletters: Newsletters admin_notifications: Notifications + system_emails: System Emails emails_download: Emails download valuators: Valuators poll_officers: Poll officers @@ -649,6 +650,10 @@ en: preview_guide: "This is how the users will see the notification:" sent_guide: "This is how the users see the notification:" send_alert: Are you sure you want to send this notification to %{n} users? + system_emails: + proposal_notification_digest: + title: Proposal Notification Digest + description: Gathers all proposal notifications for an user in a single message, to avoid too much emails. emails_download: index: title: Emails download @@ -1045,6 +1050,8 @@ en: image: Image show_image: Show image moderated_content: "Check the content moderated by the moderators, and confirm if the moderation has been done correctly." + view: View + preview: Preview spending_proposals: index: geozone_filter_all: All zones diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index 4c261ae1f..62e806ffb 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -522,6 +522,7 @@ es: messaging_users: Mensajes a usuarios newsletters: Newsletters admin_notifications: Notificaciones + system_emails: Emails del sistema emails_download: Descarga de emails valuators: Evaluadores poll_officers: Presidentes de mesa @@ -650,6 +651,10 @@ es: preview_guide: "Así es como los usuarios verán la notificación:" sent_guide: "Así es como los usuarios ven la notificación:" send_alert: ¿Estás seguro/a de que quieres enviar esta notificación a %{n} usuarios? + system_emails: + proposal_notification_digest: + title: Resumen de Notificationes de Propuestas + description: Reune todas las notificaciones de propuestas en un único mensaje, para evitar demasiados emails. emails_download: index: title: Descarga de emails @@ -1046,6 +1051,8 @@ es: image: Imagen show_image: Mostrar imagen moderated_content: "Revisa el contenido moderado por los moderadores, y confirma si la moderación se ha realizado correctamente." + view: Ver + preview: Previsualizar spending_proposals: index: geozone_filter_all: Todos los ámbitos de actuación diff --git a/config/routes/admin.rb b/config/routes/admin.rb index ec7e4bb5f..7652ecefc 100644 --- a/config/routes/admin.rb +++ b/config/routes/admin.rb @@ -165,6 +165,11 @@ namespace :admin do end end + resources :system_emails, only: [:index] do + get :view + get :preview + end + resources :emails_download, only: :index do get :generate_csv, on: :collection end