2013-08-16 17:17:18 +04:00
{% raw %}{% extends "account/base.html" %}
2013-08-16 16:07:28 +04:00
{% load i18n %}
{% load url from future %}
2013-08-16 17:17:18 +04:00
{% load crispy_forms_tags %}
2013-08-16 16:07:28 +04:00
{% block head_title %}{% trans "Account" %}{% endblock %}
{% block content %}
2013-08-16 17:17:18 +04:00
< div class = "container" >
< 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" >
2013-08-16 16:07:28 +04:00
2013-08-16 17:17:18 +04:00
{% for emailaddress in user.emailaddress_set.all %}
< div class = "ctrlHolder" >
< label for = "email_radio_{{forloop.counter}}" class = "{% if emailaddress.primary %}primary_email{%endif%}" >
2013-08-16 16:07:28 +04:00
2013-08-16 17:17:18 +04:00
< input id = "email_radio_{{forloop.counter}}" type = "radio" name = "email" { % if emailaddress . primary % } checked = "checked" { % endif % } value = "{{emailaddress.email}}" / >
2013-08-16 16:07:28 +04:00
2013-08-16 17:17:18 +04:00
{{ 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 %}
2013-08-16 16:07:28 +04:00
2013-08-16 17:17:18 +04:00
< div class = "buttonHolder" >
< button class = "secondaryAction" type = "submit" name = "action_primary" > {% trans 'Make Primary' %}< / button >
< button class = "secondaryAction" type = "submit" name = "action_send" > {% trans 'Re-send Verification' %}< / button >
< button class = "primaryAction" type = "submit" name = "action_remove" > {% trans 'Remove' %}< / button >
< / div >
2013-08-16 16:07:28 +04:00
2013-08-16 17:17:18 +04:00
< / fieldset >
< / form >
2013-08-16 16:07:28 +04:00
2013-08-16 17:17:18 +04:00
{% else %}
< p > < strong > {% trans 'Warning:'%}< / strong > {% trans "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." %}< / p >
2013-08-16 16:07:28 +04:00
2013-08-16 17:17:18 +04:00
{% endif %}
2013-08-16 16:07:28 +04:00
2013-08-16 17:17:18 +04:00
< h2 > {% trans "Add E-mail Address" %}< / h2 >
2013-11-12 19:58:28 +04:00
< form method = "post" action = "." class = "add_email" >
2013-08-16 17:17:18 +04:00
{% csrf_token %}
{{ form|crispy }}
< button class = "btn" name = "action_add" type = "submit" > {% trans "Add E-mail" %}< / button >
< / form >
2013-11-12 19:58:28 +04:00
< / div >
< / div >
< / div >
2013-08-16 16:07:28 +04:00
{% 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 %}
2013-08-16 17:17:18 +04:00
{% endraw %}