diff options
| author | J08nY | 2017-08-12 01:49:35 +0200 |
|---|---|---|
| committer | J08nY | 2017-08-12 01:49:35 +0200 |
| commit | 9e33fdaea8eaf5825542254afb55f25c1a63fc6b (patch) | |
| tree | 2f0a7fe44eab13f9746ead7da5a60b1f03d0adfe /src | |
| parent | b6df3c3cdcb4ca25b48cc316502ec39482afe20e (diff) | |
| download | django-pgpmailman-9e33fdaea8eaf5825542254afb55f25c1a63fc6b.tar.gz django-pgpmailman-9e33fdaea8eaf5825542254afb55f25c1a63fc6b.tar.zst django-pgpmailman-9e33fdaea8eaf5825542254afb55f25c1a63fc6b.zip | |
Diffstat (limited to 'src')
11 files changed, 146 insertions, 20 deletions
diff --git a/src/django_pgpmailman/templates/django_pgpmailman/base.html b/src/django_pgpmailman/templates/django_pgpmailman/base.html index 3d1075d..4dfba80 100644 --- a/src/django_pgpmailman/templates/django_pgpmailman/base.html +++ b/src/django_pgpmailman/templates/django_pgpmailman/base.html @@ -80,7 +80,7 @@ </a></li> {% endif %} <li role="separator" class="divider"></li> - <li><a href="{% url LOGOUT_URL %}?next={% url 'list_index' %}"> + <li><a href="{% url LOGOUT_URL %}?next={% url 'pgp_list_index' %}"> <span class="glyphicon glyphicon-log-out"></span> {% trans 'Logout' %} </a></li> diff --git a/src/django_pgpmailman/templates/django_pgpmailman/list/encryption_settings.html b/src/django_pgpmailman/templates/django_pgpmailman/list/encryption_settings.html new file mode 100644 index 0000000..4e54afc --- /dev/null +++ b/src/django_pgpmailman/templates/django_pgpmailman/list/encryption_settings.html @@ -0,0 +1,13 @@ +{% extends "django_pgpmailman/base.html" %} +{% load i18n %} + +{% block head_title %} + {% trans 'PGP List' %} - {{ block.super }} +{% endblock %} + +{% block content %} + {% with mlist=pgp_list.mlist %} + {% include 'django_pgpmailman/list/nav.html' with nav_tab='encryption_settings' nav_title='Encryption settings'%} + + {% endwith %} +{% endblock content %} diff --git a/src/django_pgpmailman/templates/django_pgpmailman/list/key_management.html b/src/django_pgpmailman/templates/django_pgpmailman/list/key_management.html new file mode 100644 index 0000000..739c604 --- /dev/null +++ b/src/django_pgpmailman/templates/django_pgpmailman/list/key_management.html @@ -0,0 +1,13 @@ +{% extends "django_pgpmailman/base.html" %} +{% load i18n %} + +{% block head_title %} + {% trans 'PGP List' %} - {{ block.super }} +{% endblock %} + +{% block content %} + {% with mlist=pgp_list.mlist %} + {% include 'django_pgpmailman/list/nav.html' with nav_tab='key_management' nav_title='List key management' %} + + {% endwith %} +{% endblock content %} diff --git a/src/django_pgpmailman/templates/django_pgpmailman/list/nav.html b/src/django_pgpmailman/templates/django_pgpmailman/list/nav.html new file mode 100644 index 0000000..2cf9483 --- /dev/null +++ b/src/django_pgpmailman/templates/django_pgpmailman/list/nav.html @@ -0,0 +1,33 @@ +{% load i18n %} +{% if user.is_authenticated %} + <ul class="nav nav-pills"> + <li role="presentation" + class="{% if nav_tab == 'info' %}active{% endif %}"> + <a href="{% url 'pgp_list_summary' mlist.list_id %}">{% trans 'Info' %}</a> + </li> + <li role="presentation" + class="{% if nav_tab == 'key_management' %}active{% endif %}"> + <a href="{% url 'pgp_list_key_management' mlist.list_id %}">{% trans 'Key management' %}</a> + </li> + <li role="presentation" + class="{% if nav_tab == 'encryption_settings' %}active{% endif %}"> + <a href="{% url 'pgp_list_encryption_settings' mlist.list_id %}">{% trans 'Encryption settings' %}</a> + </li> + <li role="presentation" + class="{% if nav_tab == 'signature_settings' %}active{% endif %}"> + <a href="{% url 'pgp_list_signature_settings' mlist.list_id %}">{% trans 'Signature settings' %}</a> + </li> + </ul> +{% else %} + +{% endif %} +<div class="page-header"> + {% if nav_tab == 'info' %} + <h1>{{ mlist.display_name }} + <small>{{ mlist.fqdn_listname }}</small> + </h1> + {% else %} + <h3>{{ nav_title }} {% if nav_subtitle %} + <small>{{ nav_subtitle }}</small>{% endif %}</h3> + {% endif %} +</div> diff --git a/src/django_pgpmailman/templates/django_pgpmailman/list/signature_settings.html b/src/django_pgpmailman/templates/django_pgpmailman/list/signature_settings.html new file mode 100644 index 0000000..f71554e --- /dev/null +++ b/src/django_pgpmailman/templates/django_pgpmailman/list/signature_settings.html @@ -0,0 +1,13 @@ +{% extends "django_pgpmailman/base.html" %} +{% load i18n %} + +{% block head_title %} + {% trans 'PGP List' %} - {{ block.super }} +{% endblock %} + +{% block content %} + {% with mlist=pgp_list.mlist %} + {% include 'django_pgpmailman/list/nav.html' with nav_tab='signature_settings' nav_title='Signature settings' %} + + {% endwith %} +{% endblock content %} diff --git a/src/django_pgpmailman/templates/django_pgpmailman/list/summary.html b/src/django_pgpmailman/templates/django_pgpmailman/list/summary.html new file mode 100644 index 0000000..bbbb79c --- /dev/null +++ b/src/django_pgpmailman/templates/django_pgpmailman/list/summary.html @@ -0,0 +1,17 @@ +{% extends "django_pgpmailman/base.html" %} +{% load i18n %} + +{% block head_title %} + {% trans 'PGP List' %} - {{ block.super }} +{% endblock %} + +{% block content %} + {% with mlist=pgp_list.mlist %} + {% include 'django_pgpmailman/list/nav.html' with nav_tab='info' %} + + <p>{{ mlist.settings.description }}</p> + {% if mlist.settings.info %} + <p>{{ mlist.settings.info }}</p> + {% endif %} + {% endwith %} +{% endblock content %} diff --git a/src/django_pgpmailman/templates/django_pgpmailman/summary.html b/src/django_pgpmailman/templates/django_pgpmailman/summary.html deleted file mode 100644 index 5b5a60d..0000000 --- a/src/django_pgpmailman/templates/django_pgpmailman/summary.html +++ /dev/null @@ -1,14 +0,0 @@ -{% extends "django_pgpmailman/base.html" %} -{% load i18n %} - -{% block head_title %} -{% trans 'PGP List' %} - {{ block.super }} -{% endblock %} - -{% block content %} - - <div class="page-header"> - <h1>{% trans 'PGP enabled Mailing List' %}</h1> - </div> - -{% endblock content %} diff --git a/src/django_pgpmailman/templates/django_pgpmailman/user/summary.html b/src/django_pgpmailman/templates/django_pgpmailman/user/summary.html new file mode 100644 index 0000000..aab98eb --- /dev/null +++ b/src/django_pgpmailman/templates/django_pgpmailman/user/summary.html @@ -0,0 +1 @@ +{% extends "django_pgpmailman/base.html" %}
\ No newline at end of file diff --git a/src/django_pgpmailman/urls.py b/src/django_pgpmailman/urls.py index d10fa1c..a5620f1 100644 --- a/src/django_pgpmailman/urls.py +++ b/src/django_pgpmailman/urls.py @@ -19,15 +19,27 @@ from __future__ import absolute_import, unicode_literals from django.conf.urls import url, include -from django_pgpmailman.views.list import (pgp_list_index, pgp_list_summary, - pgp_list_pubkey) +from django_pgpmailman.views.list import ( + pgp_list_index, pgp_list_summary, pgp_list_pubkey, pgp_list_key_management, + pgp_list_signature_settings, pgp_list_encryption_settings) +from django_pgpmailman.views.user import pgp_user_profile list_patterns = [ url(r'^$', pgp_list_summary, name='pgp_list_summary'), + url(r'^key/$', pgp_list_key_management, name='pgp_list_key_management'), + url(r'^signatures/$', pgp_list_signature_settings, + name='pgp_list_signature_settings'), + url(r'^encryption/$', pgp_list_encryption_settings, + name='pgp_list_encryption_settings'), url(r'^pubkey$', pgp_list_pubkey, name='pgp_list_pubkey') ] +user_patterns = [ + url(r'^$', pgp_user_profile, name='pgp_user_profile') +] + urlpatterns = [ url(r'^$', pgp_list_index, name='pgp_list_index'), - url(r'^lists/(?P<list_id>[^/]+)/', include(list_patterns)) + url(r'^lists/(?P<list_id>[^/]+)/', include(list_patterns)), + url(r'^accounts/', include(user_patterns)) ] diff --git a/src/django_pgpmailman/views/list.py b/src/django_pgpmailman/views/list.py index b99e332..dfab2f5 100644 --- a/src/django_pgpmailman/views/list.py +++ b/src/django_pgpmailman/views/list.py @@ -26,12 +26,28 @@ from django_pgpmailman.plugin import get_pgp_plugin def pgp_list_index(request): - return render(request, 'django_pgpmailman/index.html', + return render(request, + 'django_pgpmailman/index.html', {'lists': get_pgp_plugin().lists}) def pgp_list_summary(request, list_id): - return render(request, 'django_pgpmailman/summary.html', + return render(request, 'django_pgpmailman/list/summary.html', + {'pgp_list': get_pgp_plugin().get_list(list_id)}) + + +def pgp_list_key_management(request, list_id): + return render(request, 'django_pgpmailman/list/key_management.html', + {'pgp_list': get_pgp_plugin().get_list(list_id)}) + + +def pgp_list_encryption_settings(request, list_id): + return render(request, 'django_pgpmailman/list/encryption_settings.html', + {'pgp_list': get_pgp_plugin().get_list(list_id)}) + + +def pgp_list_signature_settings(request, list_id): + return render(request, 'django_pgpmailman/list/signature_settings.html', {'pgp_list': get_pgp_plugin().get_list(list_id)}) diff --git a/src/django_pgpmailman/views/user.py b/src/django_pgpmailman/views/user.py new file mode 100644 index 0000000..efc694d --- /dev/null +++ b/src/django_pgpmailman/views/user.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2017 Jan Jancar +# +# This file is a part of the Django Mailman PGP plugin. +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free +# Software Foundation, either version 3 of the License, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along with +# this program. If not, see <http://www.gnu.org/licenses/>. +from django.shortcuts import render + + +def pgp_user_profile(request): + return render(request, 'django_pgpmailman/user/summary.html') |
