Refactor settings page
This commit is contained in:
parent
edaa89a5d7
commit
b2eaf0411f
3 changed files with 29 additions and 39 deletions
|
|
@ -1,5 +1,4 @@
|
|||
{% extends "components/form/form.html" %}
|
||||
|
||||
{% load i18n %}
|
||||
|
||||
{% block actions %}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
{% extends "components/form/form.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block actions %}
|
||||
<section class="section form__section--last">
|
||||
<fieldset class="fieldset form__fieldset">
|
||||
{% if cancel_url %}
|
||||
<a class="link button button--cancel" href="{{ cancel_url }}">{% trans "Cancel" %}</a>
|
||||
{% endif %}
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="fieldset form__fieldset">
|
||||
<a class="link button button--primary" href="{% url 'accounts:password-change' %}">
|
||||
{% trans "Change password" %}
|
||||
</a>
|
||||
|
||||
<button class="button button--confirm">
|
||||
{% if confirm_text %}
|
||||
{{ confirm_text }}
|
||||
{% else %}
|
||||
{% trans "Save" %}
|
||||
{% endif %}
|
||||
</button>
|
||||
</fieldset>
|
||||
</section>
|
||||
{% endblock actions %}
|
||||
|
|
@ -1,42 +1,7 @@
|
|||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block content %}
|
||||
<main id="settings--page" class="main">
|
||||
<form class="form settings-form" method="post">
|
||||
{% csrf_token %}
|
||||
|
||||
<div class="form__header">
|
||||
<h1 class="h1 form__title">{% trans "User settings" %}</h1>
|
||||
</div>
|
||||
|
||||
{{ form.non_field_errors }}
|
||||
|
||||
<section class="section form__section settings-form__section">
|
||||
<fieldset class="form__fieldset settings-form__fieldset">
|
||||
<label class="label settings-form__label" for="first_name">{% trans "First name" %}</label>
|
||||
{{ form.first_name.errors }}
|
||||
{{ form.first_name }}
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="form__fieldset settings-form__fieldset">
|
||||
<label class="label settings-form__label" for="last_name">{% trans "Last name" %}</label>
|
||||
{{ form.last_name.errors }}
|
||||
{{ form.last_name }}
|
||||
</fieldset>
|
||||
</section>
|
||||
|
||||
<section class="section form__section settings-form__section">
|
||||
<fieldset class="form__fieldset settings-form__fieldset">
|
||||
<a class="link button button--cancel" href="{% url 'index' %}">Cancel</a>
|
||||
<span class="span">
|
||||
<a class="link button button--primary" href="{% url 'accounts:password-change' %}">
|
||||
{% trans "Change password" %}
|
||||
</a>
|
||||
<button class="button button--confirm">Save</button>
|
||||
</span>
|
||||
</fieldset>
|
||||
</section>
|
||||
</form>
|
||||
{% include "accounts/components/settings-form.html" with form=form title="User profile" confirm_text="Save" %}
|
||||
</main>
|
||||
{% endblock %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue