FEATURE: Allow users to tone down digest emails (#7353)

* FEATURE: Allow user to tone down email digest insteand of only unsubscribing

* Reordered options and select the next slowest frequency by default
This commit is contained in:
Roman Rizzi
2019-04-17 12:14:40 -03:00
committed by GitHub
parent c687e2b921
commit 12a5c69abd
4 changed files with 182 additions and 97 deletions

View File

@@ -52,15 +52,26 @@
</p>
<% end %>
<% if !@topic %>
<% unless SiteSetting.disable_digest_emails %>
<% if @digest_unsubscribe %>
<p>
<label>
<%= check_box_tag 'disable_digest_emails', 1, @type=="digest" %>
<%= t 'unsubscribe.disable_digest_emails' %>
</label>
<% if @digest_frequencies[:current] %>
<h3>
<%= t(
'unsubscribe.digest_frequency.title',
frequency: t("unsubscribe.digest_frequency.#{@digest_frequencies[:current]}")
) %>
</h3>
<br/>
<% end %>
<label><%= t 'unsubscribe.digest_frequency.select_title' %></label>
<%=
select_tag :digest_after_minutes,
options_for_select(@digest_frequencies[:frequencies], @digest_frequencies[:selected]),
class: 'combobox'
%>
</p>
<% end %>
<% end %>
<p>
@@ -71,7 +82,8 @@
</p>
<br/>
<%= submit_tag t('unsubscribe.title'), class: 'btn btn-danger' %>
<% text = @type=='digest' ? t('unsubscribe.submit') : t('unsubscribe.title') %>
<%= submit_tag text, class: 'btn btn-danger' %>
<%- end %>