Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add accounts/email #28

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions allauth_ui/templates/account/email.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{% extends "account/base.html" %}

{% load i18n %}

{% block head_title %}E-mail Addresses{% endblock %}

{% block whitebox %}
<h1 class="mb-5 text-3xl text-center">E-mail Addresses</h1>

{% if user.emailaddress_set.all %}
<p class="mb-6">The following e-mail addresses are associated with your account:</p>

<form action="{% url 'account_email' %}" class="my-5" method="post" novalidate>
{% csrf_token %}
<fieldset class="blockLabels">

{% for emailaddress in user.emailaddress_set.all %}
<div class="flex my-3">
<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">
<label for="email-{{ forloop.counter }}" class="flex justify-between block ml-2 text-sm font-bold w-100">
<span>{{emailaddress.email}}</span>
<div class="ml-4">
{% if emailaddress.verified %}
<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>
{% else %}
<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>
{% endif %}
{% if emailaddress.primary %}
<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>
{% endif %}
</div>
</label>
</div>

{# <div class="flex"> #}
{# <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 or user.emailaddress_set.count == 1 %}checked="checked"{%endif %} value="{{emailaddress.email}}"/> #}
{# {{ emailaddress.email }} #}
{# #}
{# {% if emailaddress.verified %} #}
{# <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> #}
{# {% else %} #}
{# <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> #}
{# {% endif %} #}
{# {% if emailaddress.primary %} #}
{# <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> #}
{# {% endif %} #}
{# </label> #}
{# </div> #}
{% endfor %}

<div class="flex content-around">
<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">
Make Primary
</button>
<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">
Re-send Verification
</button>

<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">
Remove
</button>
{# {% include "account/_button.html" with text="Make Primary" %} #}
{# {% include "account/_button.html" with text="Re-send Verification" %} #}
{# {% include "account/_button.html" with text="Remove" base_color="bg-red" %} #}
</div>

</fieldset>
</form>
<hr class="w-full">

{% endif %}
# TODO: Logic for adding a new email

{% endblock %}