lots of changes

Added a creation_time field to thinks - using the modified time on the
  filesystem wasn't reliable.

Styled the login page.

The index shows the most recent thinks at the top.

Allow authentication by an Authorization header, with a token specified
in settings.py.

Lots of improvements to the editor, including showing the log, and a
form to install Elm packages when editing .elm files.

The Makefile for a project is automatically run each time a file is saved.
This commit is contained in:
Christian Lawson-Perfect 2025-02-07 07:02:35 +00:00
parent 3d5c0c6c73
commit 500eb38774
13 changed files with 1474 additions and 396 deletions

View file

@ -3,7 +3,7 @@
{% block body_class %}login {{block.super}}{% endblock %}
{% block header %}
<h1>Login</h1>
<h1>Log in</h1>
{% endblock %}
{% block main %}
@ -15,9 +15,9 @@
{% if next %}
{% if user.is_authenticated %}
<p>Your account doesn't have access to this page. To proceed,
please login with an account that has access.</p>
please log in with an account that has access.</p>
{% else %}
<p>Please login to see this page.</p>
<p>Please log in to see this page.</p>
{% endif %}
{% endif %}

View file

@ -20,14 +20,32 @@
</ul>
</section>
<section id="recent">
<h2>Recent</h2>
<ul class="thinks-list">
{% for think in recent_thinks %}
<li class="think">
<a href="{% url 'think' think.slug %}">{{think.slug}}</a>
<time datetime="{{think.creation_time|date:"c"}}">{{think.creation_time}}</time>
{% with readme=think.get_readme %}
{% if readme %}
<pre class="readme">{{readme|safe}}</pre>
{% endif %}
{% endwith %}
</li>
{% endfor %}
</ul>
</section>
<section id="thinks">
<h2>Thinks</h2>
<p><a href="{% url 'new_think' %}">New think</a></p>
{% regroup thinks by category as categories %}
<ul id="thinks-list">
<ul class="thinks-list">
{% for category in categories %}
<li>
<details {% if not category.grouper %}open{% endif %}>
<details open>
<summary>{% if category.grouper %}{{category.grouper}}{% else %}Uncategorised{% endif %}</summary>
<ul>
{% for think in category.list %}