Commit 556b2ff3 authored by David Seaward's avatar David Seaward

* add title and byline to site settings (use on front page)

* standardise login/logout widget in templates
parent bc535e62
......@@ -2,34 +2,38 @@
<html lang="en">
<head>
<link rel="stylesheet" href="{% static 'PuristFlex.css' %}"/>
<title>Purist - Easy, secure communication for everyone</title>
<title>{{ site_title }} - {{ site_byline }}</title>
<link rel="icon" sizes="960x960" href="{% static 'favicon.png' %}">
<meta name="application-name" content="Purist">
</head>
<body style="text-align: center">
{% if username %}
<p style="text-align: right">
You are logged in as {{username}}.<br />
<a href="/accounts/logout/">Log out</a>
</p>
{% if username %}
{% trans "Your are logged in as" %} {{ username }}<br/>
<a href="{% url 'auth_password_change' %}">{% trans "Change password" %}</a><br/>
<a href="{% url 'auth_logout' %}">{% trans "Log out" %}</a>
{% else %}
<p style="text-align: right">
You are not logged in.<br />
<a href="/accounts/login/">Log in</a> or <a href="/accounts/register/">register</a>.
</p>
{% trans "You are not logged in." %}<br/>
<a href="{% url 'auth_login' %}">{% trans "Log in" %}</a> {% trans "or" %}
<a href="{% url 'registration_register' %}">{% trans "register" %}</a>
{% endif %}
</p>
<h1><img style="max-height: 30%; max-width: 50%" src="{% static 'logo.png' %}" alt="Purist"/></h1>
<h1><img style="max-height: 40vh; max-width: 40vw" src="{% static 'logo.png' %}" alt="{{ site_title }}"/></h1>
<p>Easy, secure communication for everyone</p>
<p>{{ site_byline }}</p>
<p><a href="https://plan.puri.st">plan</a> | <a href="https://code.puri.sm/purist">code</a> | <a
href="http://dev.comms.puri.st:8000">test</a> | <a href="/admin/">admin</a></p>
<p>
<a href="https://plan.puri.st">plan</a> | <a href="https://code.puri.sm/purist">code</a> |
<a href="http://dev.comms.puri.st:8000">test</a> | <a href="/admin/">admin</a>
</p>
<p style="font-size: small">Services provided by <a href="https://puri.sm">Purism SPC</a>. Stand-in logo from <a
href="https://openclipart.org/detail/158443/kawaii-rainbow">Openclipart</a> [CC0].</p>
<p style="font-size: small">
Services provided by <a href="https://puri.sm">Purism SPC</a>. Stand-in logo from
<a href="https://openclipart.org/detail/158443/kawaii-rainbow">Openclipart</a> [CC0].
</p>
</body>
</html>
......@@ -18,23 +18,25 @@
<body>
<header>
<a href="{% url 'home_page' %}"><img class="logo" src="{% static 'logo.png' %}" alt="Purist"/></a>
<div>
<h1>{% block header %}Base{% endblock %}</h1>
<!-- p></p -->
<p>
{% block byline %}Byline{% endblock %} |
{% if user.is_authenticated %}
{% trans "Logged in" %}: {{ user.username }}
(<a href="{% url 'auth_logout' %}">{% trans "Log out" %}</a> |
<a href="{% url 'auth_password_change' %}">{% trans "Change password" %}</a>)
{% else %}
<a href="{% url 'auth_login' %}">{% trans "Log in" %}</a>
{% endif %}
</p>
<header style="justify-content: space-between;">
<div id="title_box">
<a href="{% url 'home_page' %}"><img class="logo" src="{% static 'logo.png' %}" alt="Purist"/></a>
<div id="title_text">
<h1>{% block header %}Base{% endblock %}</h1>
<p>{% block byline %}Byline{% endblock %}</p>
</div>
</div>
<div id="log_state">
{% if user.is_authenticated %}
{% trans "Logged in as" %} {{ user.username }}<br/>
<a href="{% url 'auth_password_change' %}">{% trans "Change password" %}</a><br/>
<a href="{% url 'auth_logout' %}">{% trans "Log out" %}</a>
{% else %}
{% trans "You are not logged in." %}<br/>
<a href="{% url 'auth_login' %}">{% trans "Log in" %}</a> {% trans "or" %}
<a href="{% url 'registration_register' %}">{% trans "register" %}</a>
{% endif %}
</div>
</header>
......
......@@ -21,6 +21,7 @@
</section>
</main>
<p class="text-center">{% trans "No account yet?" %} <a href="{% url 'registration_register' %}">{% trans "Register!"
%}</a></p>
<p class="text-center">{% trans "No account yet?" %}
<a href="{% url 'registration_register' %}">{% trans "Register!" %}</a>
</p>
{% endblock %}
......@@ -4,9 +4,7 @@
{% block title %}{% trans 'Log out' %}{% endblock %}
{% block header %}{% trans 'Log out' %}{% endblock %}
{% block byline %}{% endblock %}
{% block byline %}{% trans 'You have been logged out' %}{% endblock %}
{% block content %}
<br/>
<p>{% trans "You have been logged out" %}</p>
{% endblock %}
from django.shortcuts import render
# from registration.backends.simple.views import
from purist_account import settings
def home_page(request):
render_data = {
"username": request.user.get_username(),
"site_title": settings.SITE_TITLE,
"site_byline": settings.SITE_BYLINE,
}
return render(request, 'ldapregister/home.html', render_data)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment