Add account settings page with YouTube connection management and user update functionality
This commit is contained in:
parent
da1c750771
commit
cd0ca2f5ea
7 changed files with 62 additions and 8 deletions
37
base/templates/auth/user_settings.html
Normal file
37
base/templates/auth/user_settings.html
Normal file
|
@ -0,0 +1,37 @@
|
|||
{% extends "base.html" %}
|
||||
{% load form %}
|
||||
{% block content %}
|
||||
<h1>
|
||||
<i class="ri-user-settings-fill"></i> Mon compte
|
||||
</h1>
|
||||
{% for error in form.non_field_errors %}<article class="message error">{{ error }}</article>{% endfor %}
|
||||
<form method="post" {% if action %}action="{% url action %}"{% endif %}>
|
||||
{% csrf_token %}
|
||||
<fieldset>
|
||||
{% if not user.youtubecredentials.credentials %}
|
||||
<a href="{% url "youtube_login" %}" role="button"><i class="ri-youtube-fill"></i> Me connecter au compte Youtube</a>
|
||||
{% else %}
|
||||
<button type="submit"
|
||||
formaction="{% url "youtube_logout" %}"
|
||||
class="secondary">
|
||||
<i class="ri-youtube-fill"></i> Déconnecter le compte Youtube <strong>{{ user.youtubecredentials.title }}</strong>
|
||||
</button>
|
||||
{% endif %}
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
{% for field in form %}
|
||||
<label for="{{ field.id_for_label }}">
|
||||
{{ field.label }}
|
||||
{{ field }}
|
||||
{% if field.errors %}
|
||||
<small id="{{ field.errors.field_id }}_error" class="form-error">{{ field.errors|join:", " }}</small>
|
||||
{% endif %}
|
||||
</label>
|
||||
{% endfor %}
|
||||
<button type="submit">Mettre à jour mon compte</button>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<a href="{% url "password_change" %}" role="button" class="secondary">Changer mon mot de passe</a>
|
||||
</fieldset>
|
||||
</form>
|
||||
{% endblock content %}
|
Loading…
Add table
Add a link
Reference in a new issue