web/quotes: format templates

This commit is contained in:
Luke Granger-Brown 2021-01-21 00:49:22 +00:00
parent 2909cc2bcb
commit e266f5bb2f
7 changed files with 68 additions and 68 deletions

View file

@ -15,15 +15,15 @@
<p>...or</p> <p>...or</p>
<form method="POST" action="{% url 'account_login' %}"> <form method="POST" action="{% url 'account_login' %}">
{% csrf_token %} {% csrf_token %}
{% if redirect_field_value %} {% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" /> <input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
{% endif %} {% endif %}
<div class="grid grid-cols-formSideBySide gap-4 my-5"> <div class="grid grid-cols-formSideBySide gap-4 my-5">
<label class="text-right" for="login">Username:</label> {{ form.login }} <label class="text-right" for="login">Username:</label> {{ form.login }}
<label class="text-right" for="password">Password:</label> {{ form.password }} <label class="text-right" for="password">Password:</label> {{ form.password }}
<button class="border border-bfobGray col-span-2 p-2" type="submit">{% trans "Log In" %}</button> <button class="border border-bfobGray col-span-2 p-2" type="submit">{% trans "Log In" %}</button>
</div> </div>
</form> </form>
{% endblock %} {% endblock %}

View file

@ -3,12 +3,12 @@
{% block content_extra_classes %}flex justify-center{% endblock %} {% block content_extra_classes %}flex justify-center{% endblock %}
{% block content %} {% block content %}
<div class="w-4/6 m-8"> <div class="w-4/6 m-8">
<h1 class="text-7xl font-bnto uppercase"> <h1 class="text-7xl font-bnto uppercase">
{% block content_title %}{% endblock %} {% block content_title %}{% endblock %}
</h1> </h1>
{% block content_wrap %} {% block content_wrap %}
<p class="text-3xl">{% block content_text %}{% endblock %}</p> <p class="text-3xl">{% block content_text %}{% endblock %}</p>
{% endblock %} {% endblock %}
</div> </div>
{% endblock %} {% endblock %}

View file

@ -1,45 +1,45 @@
{% load static %} {% load static %}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge"> <meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>{% block fulltitle %}{% block title %}{% endblock title %} | BFOB Quotes{% endblock %}</title> <title>{% block fulltitle %}{% block title %}{% endblock title %} | BFOB Quotes{% endblock %}</title>
<link rel="stylesheet" href="{% static 'webfonts/fonts.css' %}" type="text/css"> <link rel="stylesheet" href="{% static 'webfonts/fonts.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'css/styles.css' %}"> <link rel="stylesheet" href="{% static 'css/styles.css' %}">
</head> </head>
<body class="bg-bfobGray-dark text-bfobGray font-sans leading-normal tracking-normal text-lg"> <body class="bg-bfobGray-dark text-bfobGray font-sans leading-normal tracking-normal text-lg">
<div class="container mx-auto max-w-screen-md"> <div class="container mx-auto max-w-screen-md">
<section class="flex justify-between items-center"> <section class="flex justify-between items-center">
<h1 class="text-5xl font-bnto uppercase"> <h1 class="text-5xl font-bnto uppercase">
<a href="/"> <a href="/">
BFOB <span class="text-bfobOrange">Quotes</span> BFOB <span class="text-bfobOrange">Quotes</span>
</a> </a>
</h1> </h1>
<div class="flex justify-between"> <div class="flex justify-between">
{% if user.is_authenticated %} {% if user.is_authenticated %}
<a href="/new/" class="px-4 py-1 rounded-l-full text-sm border border-bfobOrange border-r-0 text-bfobOrange hover:border-transparent hover:bg-bfobOrange hover:text-bfobGray-dark">+</a> <a href="/new/" class="px-4 py-1 rounded-l-full text-sm border border-bfobOrange border-r-0 text-bfobOrange hover:border-transparent hover:bg-bfobOrange hover:text-bfobGray-dark">+</a>
<a href="/all/" class="px-4 py-1 text-sm border border-bfobOrange border-r-0 text-bfobOrange hover:border-transparent hover:bg-bfobOrange hover:text-bfobGray-dark">all</a> <a href="/all/" class="px-4 py-1 text-sm border border-bfobOrange border-r-0 text-bfobOrange hover:border-transparent hover:bg-bfobOrange hover:text-bfobGray-dark">all</a>
<form action="/accounts/logout/" method="POST"> <form action="/accounts/logout/" method="POST">
{% csrf_token %} {% csrf_token %}
<input type="hidden" name="next" value="/accounts/logged_out/"> <input type="hidden" name="next" value="/accounts/logged_out/">
<button type="submit" class="px-4 py-1 rounded-r-full text-sm border border-bfobOrange text-bfobOrange hover:border-transparent hover:bg-bfobOrange hover:text-bfobGray-dark">logout</button> <button type="submit" class="px-4 py-1 rounded-r-full text-sm border border-bfobOrange text-bfobOrange hover:border-transparent hover:bg-bfobOrange hover:text-bfobGray-dark">logout</button>
</form> </form>
{% else %} {% else %}
<a href="/accounts/discord/login/?process=login&next={{ request.path }}" class="px-4 py-1 rounded-full text-sm border border-bfobOrange text-bfobOrange hover:border-transparent hover:bg-bfobOrange hover:text-bfobGray-dark">login</a> <a href="/accounts/discord/login/?process=login&next={{ request.path }}" class="px-4 py-1 rounded-full text-sm border border-bfobOrange text-bfobOrange hover:border-transparent hover:bg-bfobOrange hover:text-bfobGray-dark">login</a>
{% endif %} {% endif %}
</div> </div>
</section> </section>
</div> </div>
<div class="container mx-auto max-w-screen-md {% block content_extra_classes %}{% endblock %}"> <div class="container mx-auto max-w-screen-md {% block content_extra_classes %}{% endblock %}">
{% block content %}{% endblock %} {% block content %}{% endblock %}
</div> </div>
</body> </body>
</html> </html>

View file

@ -1,8 +1,8 @@
<div> <div>
<p><a href="/{{ quote.id }}/">#{{ quote.id }}</a></p> <p><a href="/{{ quote.id }}/">#{{ quote.id }}</a></p>
<p class="whitespace-pre-wrap font-mono">{{ quote.quote }}</p> <p class="whitespace-pre-wrap font-mono">{{ quote.quote }}</p>
<p class="text-sm">added by <span class="font-mono">{{ quote.added_by.username }}</span> on <span class="font-mono">{{ quote.added_at }}</span></p> <p class="text-sm">added by <span class="font-mono">{{ quote.added_by.username }}</span> on <span class="font-mono">{{ quote.added_at }}</span></p>
{% if request.user == quote.added_by %} {% if request.user == quote.added_by %}
<a href="/{{ quote.id }}/delete/" class="text-sm underline">del</a> <a href="/{{ quote.id }}/delete/" class="text-sm underline">del</a>
{% endif %} {% endif %}
</div> </div>

View file

@ -8,7 +8,7 @@
<pre>{{ quote.quote }}</pre> <pre>{{ quote.quote }}</pre>
<form action="" method="POST"> <form action="" method="POST">
{% csrf_token %} {% csrf_token %}
<button class="border border-bfobOrange text-bfobOrange p-2 hover:border-transparent hover:bg-bfobOrange hover:text-bfobGray-dark" type="submit">Delete it forever</button> <button class="border border-bfobOrange text-bfobOrange p-2 hover:border-transparent hover:bg-bfobOrange hover:text-bfobGray-dark" type="submit">Delete it forever</button>
</form> </form>
{% endblock %} {% endblock %}

View file

@ -6,19 +6,19 @@
<h2 class="text-bfobOrange font-bnto text-2xl">quote list</h2> <h2 class="text-bfobOrange font-bnto text-2xl">quote list</h2>
<div class="border-b border-bfobGray"> <div class="border-b border-bfobGray">
{% if page.has_previous %}<a href="?page={{ page.previous_page_number }}">prev</a>{% endif %} {% if page.has_previous %}<a href="?page={{ page.previous_page_number }}">prev</a>{% endif %}
{% if page.has_next %}{% if page.has_previous %} | {% endif %}<a href="?page={{ page.next_page_number }}">next</a>{% endif %} {% if page.has_next %}{% if page.has_previous %} | {% endif %}<a href="?page={{ page.next_page_number }}">next</a>{% endif %}
</div> </div>
{% comment %}{% include "quotedb/_quote.html" %}{% endcomment %} {% comment %}{% include "quotedb/_quote.html" %}{% endcomment %}
{% for quote in page %} {% for quote in page %}
<div class="border-b border-bfobGray"> <div class="border-b border-bfobGray">
{% include "quotedb/_quote.html" %} {% include "quotedb/_quote.html" %}
</div> </div>
{% endfor %} {% endfor %}
<div> <div>
{% if page.has_previous %}<a href="?page={{ page.previous_page_number }}">prev</a>{% endif %} {% if page.has_previous %}<a href="?page={{ page.previous_page_number }}">prev</a>{% endif %}
{% if page.has_next %}{% if page.has_previous %} | {% endif %}<a href="?page={{ page.next_page_number }}">next</a>{% endif %} {% if page.has_next %}{% if page.has_previous %} | {% endif %}<a href="?page={{ page.next_page_number }}">next</a>{% endif %}
</div> </div>
{% endblock %} {% endblock %}

View file

@ -6,10 +6,10 @@
<h2 class="text-bfobOrange font-bnto text-2xl">gimme quote</h2> <h2 class="text-bfobOrange font-bnto text-2xl">gimme quote</h2>
<form method="POST"> <form method="POST">
{% csrf_token %} {% csrf_token %}
<div class="grid grid-cols-1 gap-4 my-5"> <div class="grid grid-cols-1 gap-4 my-5">
<textarea name="quote" class="font-mono h-24 bg-bfobGray-dark border border-bfobOrange text-bfobGray placeholder-current" placeholder="&lt;lukegb&gt; hello I am luke, type things in me owo" autofocus></textarea> <textarea name="quote" class="font-mono h-24 bg-bfobGray-dark border border-bfobOrange text-bfobGray placeholder-current" placeholder="&lt;lukegb&gt; hello I am luke, type things in me owo" autofocus></textarea>
<button class="border border-bfobOrange text-bfobOrange p-2 hover:border-transparent hover:bg-bfobOrange hover:text-bfobGray-dark" type="submit">Add Quote</button> <button class="border border-bfobOrange text-bfobOrange p-2 hover:border-transparent hover:bg-bfobOrange hover:text-bfobGray-dark" type="submit">Add Quote</button>
</div> </div>
</form> </form>
{% endblock %} {% endblock %}