re-ordering middleware and logon system

This commit is contained in:
Philip Sargent
2021-03-27 18:22:07 +00:00
parent e7947069a2
commit ffaaea497c
9 changed files with 65 additions and 17 deletions

View File

@@ -23,7 +23,7 @@
You are logged in as {{ user.username }}
{% if user.person %}(<a href="{{ user.person.get_absolute_url }}">{{ user.person }}</a>)
{% endif %}.
| <a href="{% url "auth_logout" %}">Log out</a> {% else %} <a href='{% url "registration_register" %}'>Sign up</a> | <a href='{% url "auth_login" %}'>Log in</a> {% endif %}
| <a href="{% url "auth_logout" %}">Log out</a> {% else %} <a href='/accounts/logout'>Sign up</a> | <a href='{% url "auth_login" %}'>Log in</a> {% endif %}
{% endblock%}
{% block editLink %}

View File

@@ -4,7 +4,7 @@
{% block title %}Cambridge Expeditions to Austria{% endblock %}
{% block related %}
<h2>Recent Actions</h2>
<h2>Recent Actions - admin user</h5>
{% load log %}
{% get_admin_log 10 as admin_log for_user 1 %}
{% if not admin_log %}
@@ -16,7 +16,7 @@
{% if entry.is_deletion %}
{{ entry.object_repr }}
{% else %}
<a href="admin/{{ entry.get_admin_url }}/">{{ entry.object_repr }}</a>
<a href="{{ entry.get_admin_url }}/">{{ entry.object_repr }}</a>
{% endif %}
<br/>
{% if entry.content_type %}

View File

@@ -2,6 +2,9 @@
{% block title %}Page not found {{ path }}{% endblock %}
{% block body %}
<h1>Page not found {{ path }}</h1>
<a href="{%url "editflatpage" path %}">Create this page.</a>
<p>Probably a mistake. But you can use <a href="{%url "editflatpage" path %}">this link</a>
<p>
or 'Edit this page' in the menu on the left to create this page if you aare logged in.
<p>If you can't see that option in the menu, then you are not logged in and you can't create anything.
{% include "menu.html" %}
{% endblock %}

View File

@@ -7,14 +7,21 @@
<p>Your username and password didn't match. Please try again.</p>
{% endif %}
<div align="center">
<pre>This uses the registration/login.html template</pre>
<form method="post" action=".">{% csrf_token %}
<table>
<tr><td>{{ form.username.label_tag }}</td><td>{{ form.username }}</td></tr>
<tr><td>{{ form.password.label_tag }}</td><td>{{ form.password }}</td></tr>
</table>
<input type="submit" value="login" />
<input type="hidden" name="next" value="{{ next }}" />
</form>
</div>
{% endblock %}

View File

@@ -4,6 +4,33 @@
{% block title %}Cambridge Expeditions to Austria{% endblock %}
{% block related %}
<h2>Recent Actions - admin user</h5>
{% load log %}
{% get_admin_log 10 as admin_log for_user 1 %}
{% if not admin_log %}
<p>No recent actions</p>
{% else %}
<ul class="actionlist">
{% for entry in admin_log %}
<li class="{% if entry.is_addition %}addlink{% endif %}{% if entry.is_change %}changelink{% endif %}{% if entry.is_deletion %}deletelink{% endif %}">
{% if entry.is_deletion %}
{{ entry.object_repr }}
{% else %}
<a href="{{ entry.get_admin_url }}/">{{ entry.object_repr }}</a>
{% endif %}
<br/>
{% if entry.content_type %}
<span class="mini quiet">{% filter capfirst %}{{entry.content_type.name}}{% endfilter %}</span>
{% else %}
<span class="mini quiet">Unknown content</span>
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
{% endblock %}
{% block content %}
<h2>This is not fully working currently</h2>
<h2>The code behind this page is under repair</h2>