|
| 1 | +{% extends "account/base.html" %} |
| 2 | + |
| 3 | +{% load i18n %} |
| 4 | + |
| 5 | +{% block head_title %}E-mail Addresses{% endblock %} |
| 6 | + |
| 7 | +{% block whitebox %} |
| 8 | +<h1 class="mb-5 text-3xl text-center">E-mail Addresses</h1> |
| 9 | + |
| 10 | +{% if user.emailaddress_set.all %} |
| 11 | +<p class="mb-6">The following e-mail addresses are associated with your account:</p> |
| 12 | + |
| 13 | +<form action="{% url 'account_email' %}" class="my-5" method="post" novalidate> |
| 14 | + {% csrf_token %} |
| 15 | + <fieldset class="blockLabels"> |
| 16 | + |
| 17 | + {% for emailaddress in user.emailaddress_set.all %} |
| 18 | + <div class="flex my-3"> |
| 19 | + <input id="email-{{ forloop.counter }}" type="radio" value="{{emailaddress.email}}" name="email" class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"> |
| 20 | + <label for="email-{{ forloop.counter }}" class="flex justify-between block ml-2 text-sm font-bold w-100"> |
| 21 | + <span>{{emailaddress.email}}</span> |
| 22 | + <div class="ml-4"> |
| 23 | + {% if emailaddress.verified %} |
| 24 | + <span class="bg-blue-100 text-blue-800 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-blue-200 dark:text-blue-800">Verified</span> |
| 25 | + {% else %} |
| 26 | + <span class="bg-red-100 text-red-800 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-red-200 dark:text-red-900">Unverified</span> |
| 27 | + {% endif %} |
| 28 | + {% if emailaddress.primary %} |
| 29 | + <span class="bg-gray-100 text-gray-800 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-gray-300">Primary</span> |
| 30 | + {% endif %} |
| 31 | + </div> |
| 32 | + </label> |
| 33 | + </div> |
| 34 | + |
| 35 | + {# <div class="flex"> #} |
| 36 | + {# <label for="email_radio_{{forloop.counter}}" class="{% if emailaddress.primary %}primary_email{%endif%}"> #} |
| 37 | + {# <input id="email_radio_{{forloop.counter}}" type="radio" name="email" {% if emailaddress.primary or user.emailaddress_set.count == 1 %}checked="checked"{%endif %} value="{{emailaddress.email}}"/> #} |
| 38 | + {# {{ emailaddress.email }} #} |
| 39 | + {# #} |
| 40 | + {# {% if emailaddress.verified %} #} |
| 41 | + {# <span class="bg-blue-100 text-blue-800 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-blue-200 dark:text-blue-800">Verified</span> #} |
| 42 | + {# {% else %} #} |
| 43 | + {# <span class="bg-red-100 text-red-800 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-red-200 dark:text-red-900">Unverified</span> #} |
| 44 | + {# {% endif %} #} |
| 45 | + {# {% if emailaddress.primary %} #} |
| 46 | + {# <span class="bg-gray-100 text-gray-800 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-gray-300">Primary</span> #} |
| 47 | + {# {% endif %} #} |
| 48 | + {# </label> #} |
| 49 | + {# </div> #} |
| 50 | + {% endfor %} |
| 51 | + |
| 52 | +<div class="flex content-around"> |
| 53 | + <button type="submit" class="h-10 px-6 mt-8 mr-2 text-xs text-white uppercase bg-blue-600 rounded w-23 text text-bold hover:bg-blue-700"> |
| 54 | + Make Primary |
| 55 | + </button> |
| 56 | + <button type="submit" class="h-10 px-6 mt-8 mr-2 text-xs text-white uppercase rounded bg-stone-600 w-23 text text-bold hover:bg-stone-700"> |
| 57 | + Re-send Verification |
| 58 | + </button> |
| 59 | + |
| 60 | + <button type="submit" class="h-10 px-6 mt-8 text-xs text-white uppercase bg-red-600 rounded w-23 text text-bold hover:bg-red-700"> |
| 61 | + Remove |
| 62 | + </button> |
| 63 | + {# {% include "account/_button.html" with text="Make Primary" %} #} |
| 64 | + {# {% include "account/_button.html" with text="Re-send Verification" %} #} |
| 65 | + {# {% include "account/_button.html" with text="Remove" base_color="bg-red" %} #} |
| 66 | +</div> |
| 67 | + |
| 68 | +</fieldset> |
| 69 | +</form> |
| 70 | +<hr class="w-full"> |
| 71 | + |
| 72 | +{% endif %} |
| 73 | +# TODO: Logic for adding a new email |
| 74 | + |
| 75 | +{% endblock %} |
0 commit comments