Added emails download views

This commit is contained in:
María Checa
2018-02-15 16:24:20 +01:00
committed by Bertocq
parent 6c36e17ce2
commit 1c458d4be3
3 changed files with 25 additions and 2 deletions

View File

@@ -22,7 +22,7 @@ App.PreventDoubleSubmission =
initialize: ->
$('form').on('submit', (event) ->
unless event.target.id == "new_officing_voter"
unless event.target.id == "new_officing_voter" || "admin_download_emails"
buttons = $(this).find(':button, :submit')
App.PreventDoubleSubmission.disable_buttons(buttons)
).on('ajax:success', (event) ->

View File

@@ -203,10 +203,13 @@
<span class="icon-zip"></span>
<strong><%= t("admin.menu.emails") %></strong>
</a>
<ul id="emails_menu" <%= "class=is-active" if controller_name == "newsletters" %>>
<ul id="emails_menu" <%= "class=is-active" if controller_name == "newsletters" || "emails_download" %>>
<li <%= "class=active" if controller_name == "newsletters" %>>
<%= link_to t("admin.menu.newsletters"), admin_newsletters_path %>
</li>
<li <%= "class=active" if controller_name == "emails_download" %>>
<%= link_to t("admin.menu.emails_download"), admin_emails_download_index_path %>
</li>
</ul>
</li>
</ul>

View File

@@ -0,0 +1,20 @@
<h2 class="inline-block"><%= t("admin.emails_download.index.title") %></h2>
<div class="small-6">
<%= form_tag generate_csv_admin_emails_download_index_path,
method: :get,
id: "admin_download_emails" do %>
<label><%= t('admin.emails_download.index.download_segment') %></label>
<p class="help-text" id="emails-help-text">
<%= t('admin.emails_download.index.download_segment_help_text') %>
</p>
<%= select_tag :users_segment, options_for_select(UserSegments::SEGMENTS
.collect { |s| [t("admin.segment_recipient.#{s}"), s] }) %>
<div class="margin-top">
<%= submit_tag t('admin.emails_download.index.download_emails_button'), class: "button" %>
</div>
<% end %>
</div>