Add System emails menu & list to admin panel
We need a section to list all System Emails to view the templates and preview an example of what would be sent.
This commit is contained in:
7
app/controllers/admin/system_emails_controller.rb
Normal file
7
app/controllers/admin/system_emails_controller.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class Admin::SystemEmailsController < Admin::BaseController
|
||||
|
||||
def index
|
||||
@system_emails = %w(proposal_notification_digest)
|
||||
end
|
||||
|
||||
end
|
||||
@@ -79,7 +79,7 @@
|
||||
</li>
|
||||
<% 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) %>
|
||||
<li class="section-title" <%= "class=is-active" if messages_menu_active %>>
|
||||
<a href="#">
|
||||
@@ -93,6 +93,9 @@
|
||||
<li <%= "class=is-active" if controller_name == "admin_notifications" %>>
|
||||
<%= link_to t("admin.menu.admin_notifications"), admin_admin_notifications_path %>
|
||||
</li>
|
||||
<li <%= "class=is-active" if controller_name == "system_emails" %>>
|
||||
<%= link_to t("admin.menu.system_emails"), admin_system_emails_path %>
|
||||
</li>
|
||||
<li <%= "class=is-active" if controller_name == "emails_download" %>>
|
||||
<%= link_to t("admin.menu.emails_download"), admin_emails_download_index_path %>
|
||||
</li>
|
||||
|
||||
29
app/views/admin/system_emails/index.html.erb
Normal file
29
app/views/admin/system_emails/index.html.erb
Normal file
@@ -0,0 +1,29 @@
|
||||
<h2 class="inline-block"><%= t("admin.menu.system_emails") %></h2>
|
||||
|
||||
<table id="system_emails">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t("admin.shared.title") %></th>
|
||||
<th><%= t("admin.shared.description") %></th>
|
||||
<th class="small-5 text-right"><%= t("admin.shared.actions") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @system_emails.each do |system_email| %>
|
||||
<tr id="<%= system_email %>" class="system_email">
|
||||
<td>
|
||||
<%= t("admin.system_emails.#{system_email}.title") %>
|
||||
</td>
|
||||
<td>
|
||||
<%= t("admin.system_emails.#{system_email}.description") %>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<%= 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" %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user