File size: 1,921 Bytes
aec61e4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{% extends "base.html" %}
{% block content %}
<section class="settings-page">
  <p class="eyebrow">Preferences</p>
  <h1>Notification settings</h1>
  {% if settings_error %}<p class="form-errors" role="alert">{{ settings_error }}</p>{% endif %}
  <form class="notification-settings" action="/settings/notifications" method="post" data-csrf="{{ csrf }}" data-version="{{ preferences.row_version }}">
    <input type="hidden" name="csrf" value="{{ csrf }}">
    <input type="hidden" name="row_version" value="{{ preferences.row_version }}">
    <fieldset>
      <legend>Where to receive updates</legend>
      <label><input type="checkbox" name="in_app_enabled" {% if preferences.in_app_enabled %}checked{% endif %}> In-app notifications</label>
      <label for="email-mode">Email frequency</label>
      <select id="email-mode" name="email_mode">
        {% for value, label in [('off','Off'),('immediate','Immediately'),('digest','Daily digest')] %}
          <option value="{{ value }}" {% if preferences.email_mode == value %}selected{% endif %}>{{ label }}</option>
        {% endfor %}
      </select>
      <label><input type="checkbox" name="double_opt_in" {% if preferences.double_opt_in %}checked{% endif %}> Confirmed campaign email subscription</label>
    </fieldset>
    <fieldset>
      <legend>What to receive</legend>
      {% for field, label in [('petition_updates','Petition updates'),('organization_updates','New petitions targeting followed organizations'),('topic_recommendations','Topic recommendations'),('growth_tips','Campaign growth tips')] %}
        <label><input type="checkbox" name="{{ field }}" {% if preferences[field] %}checked{% endif %}> {{ label }}</label>
      {% endfor %}
    </fieldset>
    <button class="primary" type="submit">Save settings</button>
    <p class="settings-status" role="status">{% if saved %}Settings saved.{% endif %}</p>
  </form>
</section>
{% endblock %}