ccdb-api/ccdb/templates/account/email.html
Matthew Dillon 7ba937ef66 INITIAL
2016-01-19 15:10:09 -07:00

76 lines
2.9 KiB
HTML

{% extends "account/base.html" %}
{% block navbar_class-users:detail %}active{% endblock %}
{% load i18n %}
{% load crispy_forms_tags %}
{% block head_title %}{% trans "Account" %}{% endblock %}
{% block content %}
<div class="row">
<div class="col-md-5">
<h2>{% trans "E-mail Addresses" %}</h2>
{% if user.emailaddress_set.all %}
<p>{% trans 'The following e-mail addresses are associated with your account:' %}</p>
<form action="{% url 'account_email' %}" class="email_list" method="post">
{% csrf_token %}
<fieldset class="blockLabels">
{% for emailaddress in user.emailaddress_set.all %}
<div class="ctrlHolder">
<label for="email_radio_{{ forloop.counter }}" class="{% if emailaddress.primary %}primary_email{% endif %}">
<input id="email_radio_{{ forloop.counter }}" type="radio" name="email" {% if emailaddress.primary %}checked="checked"{% endif %} value="{{ emailaddress.email }}"/>
{{ emailaddress.email }}
{% if emailaddress.verified %}
<span class="verified">{% trans "Verified" %}</span>
{% else %}
<span class="unverified">{% trans "Unverified" %}</span>
{% endif %}
{% if emailaddress.primary %}
<span class="primary">{% trans "Primary" %}</span>
{% endif %}
</label>
</div>
{% endfor %}
<div class="btn-group" role="group">
<input class="btn btn-primary" type="submit" value="{% trans 'Make Primary' %}" name="action_primary" />
<input class="btn btn-success" type="submit" value="{% trans 'Re-send Verification' %}" name="action_send" />
<input class="btn btn-danger" type="submit" value="{% trans 'Remove' %}" name="action_remove" />
</div>
</fieldset>
</form>
{% else %}
<p>
<strong>{% trans 'Warning:'%}</strong>
{% blocktrans %}
You currently do not have any e-mail address set up. You should
really add an e-mail address so you can receive notifications,
reset your password, etc.
{% endblocktrans %}
</p>
{% endif %}
<h2>{% trans "Add E-mail Address" %}</h2>
<form method="post" action="." class="add_email">
{% csrf_token %}
{{ form|crispy }}
<button class="btn btn-primary" name="action_add" type="submit">{% trans "Add E-mail" %}</button>
</form>
</div>
</div>
{% endblock %}
{% block extra_body %}
<script type="text/javascript">
(function() {
var message = "{% trans 'Do you really want to remove the selected e-mail address?' %}";
var actions = document.getElementsByName('action_remove');
if (actions.length) {
actions[0].addEventListener("click", function(e) {
if (! confirm(message)) {
e.preventDefault();
}
});
}
})();
</script>
{% endblock %}