trentpalmerdotorg/tp/templates/base_form.html

70 lines
2.9 KiB
HTML
Raw Permalink Normal View History

2021-02-24 20:13:54 -08:00
{% 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 %}
2021-03-06 01:43:07 -08:00
{% url 'accounts:password_reset' as password_reset_url %}
2021-03-13 13:40:41 -08:00
{% url 'accounts:register' as register_url %}
2021-02-24 20:13:54 -08:00
{% 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 %}
2021-03-06 01:43:07 -08:00
{% elif request.path == password_reset_url %}
{% firstof 'Reset Password' as submit %}
2021-03-13 13:40:41 -08:00
{% elif request.path == register_url %}
{% firstof 'Register' as submit %}
2021-02-24 20:13:54 -08:00
{% 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 }}
2021-03-13 07:49:20 -08:00
<div class="mt-3 d-flex justify-content-between">
2021-02-24 20:13:54 -08:00
<input type="submit" class="btn btn-dark btn-lg" value="{{ submit }}">
2021-03-13 07:49:20 -08:00
{% if edit_feed %}
<a type="button" class="btn btn-lg btn-dark" href="{% url 'audio:confirm_delete_feed' pk=feed_pk %}">Delete Feed?</a>
2021-03-13 08:50:04 -08:00
{% elif edit_episode %}
<a type="button" class="btn btn-lg btn-dark" href="{% url 'audio:confirm_delete_episode' pk=episode_pk %}">Delete Episode?</a>
2021-03-13 07:49:20 -08:00
{% endif %}
2021-02-24 20:13:54 -08:00
</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 %}
2021-03-06 01:43:07 -08:00
{% if request.path == login_url %}
2021-03-28 23:27:46 -07:00
<p>Forgot Password? <a href="{% url 'accounts:password_reset' %}" class="text-dark" style="text-decoration: underline">Reset Password</a></p>
<p>Need an account? <a href="{% url 'accounts:register' %}" class="text-dark" style="text-decoration: underline">Register</a></p>
2021-03-06 01:43:07 -08:00
{% endif %}
2021-02-24 20:13:54 -08:00
</div>
</div>
{% endblock %}