forked from CGM_Public/pretix_original
* First stab at notification settings * Add "global" setting for notification levels * Trigger notification task * Get users with permission for event * Actually send notification emails * More notifications * Allow to turn off notifications * Link in email to pause all notifications * Add NotificationType to wordlist * Add notification tests * Add documentation * Rebase fixes
90 lines
4.1 KiB
HTML
90 lines
4.1 KiB
HTML
{% extends "pretixcontrol/base.html" %}
|
||
{% load i18n %}
|
||
{% load bootstrap3 %}
|
||
{% block title %}{% trans "Notification settings" %}{% endblock %}
|
||
{% block content %}
|
||
<h1>{% trans "Notification settings" %}</h1>
|
||
<form method="post">
|
||
{% csrf_token %}
|
||
<fieldset>
|
||
{% if request.user.notifications_send %}
|
||
<div class="alert alert-info">
|
||
<button name="notifications_send" value="off" type="submit" class="pull-right btn btn-default">
|
||
<span class="fa fa-bell-slash"></span>
|
||
{% trans "Disable" %}
|
||
</button>
|
||
{% trans "Notifications are turned on according to the settings below." %}
|
||
<div class="clearfix"></div>
|
||
</div>
|
||
{% else %}
|
||
<div class="alert alert-warning">
|
||
<button name="notifications_send" value="on" type="submit" class="pull-right btn btn-default">
|
||
<span class="fa fa-bell"></span>
|
||
{% trans "Enable" %}
|
||
</button>
|
||
{% trans "All notifications are turned off globally." %}
|
||
<div class="clearfix"></div>
|
||
</div>
|
||
{% endif %}
|
||
</fieldset>
|
||
</form>
|
||
<form class="form-inline" method="get">
|
||
<fieldset>
|
||
<legend>{% trans "Choose event" %}</legend>
|
||
<p>
|
||
<select name="event" class="form-control">
|
||
<option value="">{% trans "All my events" %}</option>
|
||
{% for e in events %}
|
||
<option value="{{ e.pk }}"
|
||
{% if e.pk|floatformat:0 == request.GET.event %}selected="selected"{% endif %}>
|
||
{{ e.name }} – {{ e.get_date_range_display }}
|
||
</option>
|
||
{% endfor %}
|
||
</select>
|
||
<button class="btn btn-primary" type="submit">{% trans "Choose" %}</button>
|
||
<span class="help-block">{% trans "Save your modifications before switching events." %}</span>
|
||
</p>
|
||
</fieldset>
|
||
</form>
|
||
<form method="post">
|
||
{% csrf_token %}
|
||
<fieldset>
|
||
<legend>{% trans "Choose notifications to get" %}</legend>
|
||
<table class="table">
|
||
<thead>
|
||
<tr>
|
||
<th>{% trans "Notification type" %}</th>
|
||
<th class="text-center">{% trans "E-Mail notification" %}</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{% for type, enabled, global in types %}
|
||
<tr>
|
||
<td>
|
||
{{ type.verbose_name }}
|
||
</td>
|
||
<td class="text-center">
|
||
{% if not event or type.required_permission in permset %}
|
||
<select name="mail:{{ type.action_type }}" class="form-control">
|
||
{% if event %}
|
||
<option value="global">{% trans "Global" %} ({% if global.mail %}{% trans "On" %}{% else %}{% trans "Off" %}{% endif %})</option>{% endif %}
|
||
<option value="off" {% if "mail" in enabled and enabled.mail == False %}selected{% endif %}>{% trans "Off" %}</option>
|
||
<option value="on" {% if enabled.mail %}selected{% endif %}>{% trans "On" %}</option>
|
||
</select>
|
||
{% else %}
|
||
<span class="fa fa-lock" data-toggle="tooltip" title="{% trans "You have no permission to receive this notification" %}"></span>
|
||
{% endif %}
|
||
</td>
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
</fieldset>
|
||
<div class="form-group submit-group">
|
||
<button type="submit" class="btn btn-primary btn-save">
|
||
{% trans "Save" %}
|
||
</button>
|
||
</div>
|
||
</form>
|
||
{% endblock %}
|