WebsiteBench / tasks /change /environment /reference /clone /frontend /templates /notification_settings.html
AgPerry's picture
Add files using upload-large-folder tool
aec61e4 verified
Raw History Blame Contribute Delete
1.92 kB
{% 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 %}