trentpalmerdotorg/tp/templates/base_form.html

64 lines
2.4 KiB
HTML

{% extends "base.html" %}
{% load crispy_forms_tags %}
{% block content %}
{% url 'accounts:login' as login_url %}
{% url 'accounts:edit_profile' as edit_profile_url %}
{% url 'accounts:password_change' as password_change_url %}
{% url 'audio:new_feed' as new_feed_url %}
{% url 'accounts:password_reset' as password_reset_url %}
{% if request.path == login_url %}
{% firstof 'Login' as submit %}
{% elif request.path == edit_profile_url %}
{% firstof 'Update' as submit %}
{% elif request.path == password_change_url %}
{% firstof 'Update' as submit %}
{% elif request.path == new_feed_url %}
{% firstof 'Submit' as submit %}
{% elif request.path == password_reset_url %}
{% firstof 'Reset Password' as submit %}
{% endif %}
{% include "base_navbar.html" %}
{% include "base_heading.html" %}
<div class="container">
<div class="d-flex flex-column offset-sm-3 col-sm-6 col-xs-12 px-0">
{% if request.path == new_feed_url %}
<form method="POST" enctype="multipart/form-data">
{% elif form_data == "TRUE" %}
<form method="POST" enctype="multipart/form-data">
{% else %}
<form method="POST">
{% endif %}
{% csrf_token %}
{{ form | crispy }}
<div class="mt-3 d-flex justify-content-between">
<input type="submit" class="btn btn-dark btn-lg" value="{{ submit }}">
{% if edit_feed %}
<a type="button" class="btn btn-lg btn-dark" href="{% url 'audio:confirm_delete_feed' pk=feed_pk %}">Delete Feed?</a>
{% endif %}
</div>
</form><br>
{% if request.path == edit_profile_url %}
<div class="container px-0">
<div class="d-flex flex-column align-items-start">
{% if user.account.use_totp %}
<a type="button" class="btn btn-lg btn-dark mb-4" href="{% url 'accounts:disable_totp' %}">Disable 2fa</a>
{% else %}
<a type="button" class="btn btn-lg btn-dark mb-4" href="{% url 'accounts:enable_totp' %}">Enable 2fa</a>
{% endif %}
<a type="button" class="btn btn-lg btn-dark" href="{% url 'accounts:password_change' %}">Change Password</a>
</div>
</div>
{% endif %}
{% if request.path == login_url %}
<p>Forgot Password? <a href="{% url 'accounts:password_reset' %}">Reset Password</a></p>
{% endif %}
</div>
</div>
{% endblock %}