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>
|
||||
Reference in New Issue
Block a user