initial commit

This commit is contained in:
2021-02-24 20:13:54 -08:00
commit dfeca6a325
50 changed files with 1467 additions and 0 deletions

49
tp/templates/base.html Normal file
View File

@ -0,0 +1,49 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>
{% url 'audio:home' as home_url %}
{% url 'accounts:login' as login_url %}
{% url 'accounts:logout' as logout_url %}
{% url 'accounts:edit_profile' as edit_profile_url %}
{% url 'accounts:password_change' as password_change_url %}
{% url 'accounts:enable_totp' as enable_totp_url %}
{% url 'accounts:disable_totp' as disable_totp_url %}
{% url 'audio:new_feed' as new_feed_url %}
{% url 'audio:feeds' as feeds_url %}
{% if request.path == home_url %}
Home
{% elif request.path == login_url %}
Login?
{% elif request.path == logout_url %}
Logout?
{% elif request.path == edit_profile_url %}
Edit Profile?
{% elif request.path == password_change_url %}
Change Password?
{% elif request.path == enable_totp_url %}
Enable 2fa?
{% elif request.path == disable_totp_url %}
Disable 2fa?
{% elif request.path == new_feed_url %}
New Feed?
{% elif request.path == feeds_url %}
Feeds
{% endif %}
{{ title }}
</title>
{% load bootstrap4 %}
{% bootstrap_css %}
{% bootstrap_messages %}
</head>
<body>
{% block content %}{% endblock content %}
{% bootstrap_javascript jquery='full' %}
</body>
</html>

View File

@ -0,0 +1,54 @@
{% 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 %}
{% 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 %}
{% 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">
<input type="submit" class="btn btn-dark btn-lg" value="{{ submit }}">
</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 %}
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,35 @@
<div class="container">
<div class="row justify-content-center my-2 mx-0">
<h1 class="">
{% url 'accounts:login' as login_url %}
{% url 'accounts:edit_profile' as edit_profile_url %}
{% url 'accounts:password_change' as password_change_url %}
{% url 'accounts:enable_totp' as enable_totp_url %}
{% url 'accounts:disable_totp' as disable_totp_url %}
{% url 'audio:new_feed' as new_feed_url %}
{% url 'audio:feeds' as feeds_url %}
{% url 'audio:home' as home_url %}
{% if request.path == login_url %}
Login?
{% elif request.path == edit_profile_url %}
Edit Profile?
{% elif request.path == password_change_url %}
Change Password?
{% elif request.path == enable_totp_url %}
Enable 2fa?
{% elif request.path == disable_totp_url %}
Disable 2fa?
{% elif request.path == new_feed_url %}
New Feed?
{% elif request.path == feeds_url %}
Feeds
{% elif request.path == home_url %}
Home
{% endif %}
{{ heading }}
</h1>
</div>
</div>

View File

@ -0,0 +1,20 @@
<div class="d-flex justify-content-center bg-dark">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark" style="width: 950px; max-width: 95vw;">
<a class="navbar-brand" href="{% url 'audio:home' %}">Home</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
<div class="navbar-nav">
<a class="nav-item nav-link" href="{% url 'audio:feeds' %}">Feeds</a>
{% if user.is_authenticated %}
<a class="nav-item nav-link" href="{% url 'accounts:logout' %}">Logout</a>
<a class="nav-item nav-link" href="{% url 'accounts:edit_profile' %}">Profile</a>
<a class="nav-item nav-link" href="{% url 'audio:new_feed' %}">NewFeed</a>
{% else %}
<a class="nav-item nav-link" href="{% url 'accounts:login' %}">Login</a>
{% endif %}
</div>
</div>
</nav>
</div>

View File

@ -0,0 +1,26 @@
{% extends "base.html" %}
{% load crispy_forms_tags %}
{% block content %}
{% url 'accounts:logout' as logout_url %}
{% url 'accounts:disable_totp' as disable_totp_url %}
{% if request.path == logout_url %}
{% firstof 'Logout' as submit %}
{% elif request.path == disable_totp_url %}
{% firstof 'OK' as submit %}
{% endif %}
{% include "base_navbar.html" %}
<div style="height: 10vh;"></div>
{% include "base_heading.html" %}
<div style="height: 30vh;" class="">
<div class="h-100 col-sm-12 col-xs-12 d-flex justify-content-center align-content-center row p-0 mx-0">
<form method="POST">
{% csrf_token %}
<input type="submit" class="btn btn-dark btn-lg" value="{{ submit }}">
</form>
</div>
</div>
{% endblock %}