aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJ08nY2017-08-11 00:19:16 +0200
committerJ08nY2017-08-11 00:19:16 +0200
commit6d8d12aa2965f0a9b8ae7b4dd1962d34724c8e7a (patch)
tree08a04a2e67562c3ae2b7215357ff91822be059b0 /src
parente71bd4a81d772c73b5673a4299107d4730458790 (diff)
downloaddjango-pgpmailman-6d8d12aa2965f0a9b8ae7b4dd1962d34724c8e7a.tar.gz
django-pgpmailman-6d8d12aa2965f0a9b8ae7b4dd1962d34724c8e7a.tar.zst
django-pgpmailman-6d8d12aa2965f0a9b8ae7b4dd1962d34724c8e7a.zip
Diffstat (limited to 'src')
-rw-r--r--src/django_pgpmailman/__init__.py (renamed from src/django-pgpmailman/__init__.py)0
-rw-r--r--src/django_pgpmailman/apps.py25
-rw-r--r--src/django_pgpmailman/static/django-pgpmailman/img/favicon.icobin0 -> 5558 bytes
-rw-r--r--src/django_pgpmailman/static/django-pgpmailman/img/mailman_logo.pngbin0 -> 11742 bytes
-rw-r--r--src/django_pgpmailman/static/django-pgpmailman/img/mailman_logo_small_trans.pngbin0 -> 1369 bytes
-rw-r--r--src/django_pgpmailman/static/django-pgpmailman/img/mailman_logo_trans.pngbin0 -> 8027 bytes
-rw-r--r--src/django_pgpmailman/templates/account/base.html1
-rw-r--r--src/django_pgpmailman/templates/django_mailman3/base.html1
-rw-r--r--src/django_pgpmailman/templates/django_pgpmailman/base.html124
-rw-r--r--src/django_pgpmailman/templates/django_pgpmailman/index.html49
-rw-r--r--src/django_pgpmailman/urls.py26
-rw-r--r--src/django_pgpmailman/views/__init__.py0
-rw-r--r--src/django_pgpmailman/views/list.py26
13 files changed, 252 insertions, 0 deletions
diff --git a/src/django-pgpmailman/__init__.py b/src/django_pgpmailman/__init__.py
index e69de29..e69de29 100644
--- a/src/django-pgpmailman/__init__.py
+++ b/src/django_pgpmailman/__init__.py
diff --git a/src/django_pgpmailman/apps.py b/src/django_pgpmailman/apps.py
new file mode 100644
index 0000000..47cfbc3
--- /dev/null
+++ b/src/django_pgpmailman/apps.py
@@ -0,0 +1,25 @@
+# -*- 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 __future__ import absolute_import, unicode_literals
+
+from django.apps import AppConfig
+
+
+class PGPMailmanConfig(AppConfig):
+ name = 'pgp'
+ verbose_name = 'PGPMailman'
diff --git a/src/django_pgpmailman/static/django-pgpmailman/img/favicon.ico b/src/django_pgpmailman/static/django-pgpmailman/img/favicon.ico
new file mode 100644
index 0000000..e7df10b
--- /dev/null
+++ b/src/django_pgpmailman/static/django-pgpmailman/img/favicon.ico
Binary files differ
diff --git a/src/django_pgpmailman/static/django-pgpmailman/img/mailman_logo.png b/src/django_pgpmailman/static/django-pgpmailman/img/mailman_logo.png
new file mode 100644
index 0000000..eada26e
--- /dev/null
+++ b/src/django_pgpmailman/static/django-pgpmailman/img/mailman_logo.png
Binary files differ
diff --git a/src/django_pgpmailman/static/django-pgpmailman/img/mailman_logo_small_trans.png b/src/django_pgpmailman/static/django-pgpmailman/img/mailman_logo_small_trans.png
new file mode 100644
index 0000000..66ab32c
--- /dev/null
+++ b/src/django_pgpmailman/static/django-pgpmailman/img/mailman_logo_small_trans.png
Binary files differ
diff --git a/src/django_pgpmailman/static/django-pgpmailman/img/mailman_logo_trans.png b/src/django_pgpmailman/static/django-pgpmailman/img/mailman_logo_trans.png
new file mode 100644
index 0000000..4c4f824
--- /dev/null
+++ b/src/django_pgpmailman/static/django-pgpmailman/img/mailman_logo_trans.png
Binary files differ
diff --git a/src/django_pgpmailman/templates/account/base.html b/src/django_pgpmailman/templates/account/base.html
new file mode 100644
index 0000000..6db00ba
--- /dev/null
+++ b/src/django_pgpmailman/templates/account/base.html
@@ -0,0 +1 @@
+{% extends "django_pgpmailman/base.html" %} \ No newline at end of file
diff --git a/src/django_pgpmailman/templates/django_mailman3/base.html b/src/django_pgpmailman/templates/django_mailman3/base.html
new file mode 100644
index 0000000..6db00ba
--- /dev/null
+++ b/src/django_pgpmailman/templates/django_mailman3/base.html
@@ -0,0 +1 @@
+{% extends "django_pgpmailman/base.html" %} \ No newline at end of file
diff --git a/src/django_pgpmailman/templates/django_pgpmailman/base.html b/src/django_pgpmailman/templates/django_pgpmailman/base.html
new file mode 100644
index 0000000..3472cd9
--- /dev/null
+++ b/src/django_pgpmailman/templates/django_pgpmailman/base.html
@@ -0,0 +1,124 @@
+{% load i18n %}
+{% load staticfiles %}
+{% load gravatar %}
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>{% block head_title %}{{ site_name|title }}{% endblock %}</title>
+ <link rel="shortcut icon" href="{% static 'django_pgpmailman/img/favicon.ico' %}">
+ <link rel="stylesheet" href="{% static 'django_pgpmailman/libs/bootstrap/css/bootstrap.min.css' %}">
+ <link rel="stylesheet" href="{% static 'django_mailman3/css/main.css' %}">
+</head>
+<body>
+
+ <nav class="navbar navbar-default">
+ <div class="container">
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#header-nav" aria-expanded="false">
+ <span class="sr-only">Toggle navigation</span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="navbar-brand" href="{% url 'pgp_list_index' %}"><span><img src="{% static 'django_pgpmailman/img/mailman_logo_small_trans.png' %}" /> PGPMailman</span></a>
+ </div>
+ <div class="collapse navbar-collapse" id="header-nav">
+ <ul class="nav navbar-nav">
+ {% if 'postorius' in INSTALLED_APPS %}
+ <ul class="nav navbar-nav navbar-right"><li>
+ {% if mlist %}
+ <a href="{% url 'list_summary' mlist.list_id %}">
+ <span class="fa fa-cog"></span>
+ {% trans 'Manage this list' %}
+ </a>
+ {% else %}
+ <a href="{% url 'list_index' %}">
+ <span class="fa fa-cog"></span>
+ {% trans 'Manage lists' %}
+ </a>
+ {% endif %}
+ </li></ul>
+ {% endif %}
+ {% if 'hyperkitty' in INSTALLED_APPS %}
+ <li><a href="{% url 'hk_root' %}">
+ <span class="glyphicon glyphicon-comment"></span>
+ {% trans 'Archives' %}
+ </a></li>
+ {% endif %}
+ </ul>
+ <ul class="nav navbar-nav navbar-right">
+ {% if user.is_authenticated %}
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown"
+ role="button" aria-haspopup="true" aria-expanded="false">
+ {% gravatar user.email 20 %}
+ {{ user.username|truncatechars:"35" }}
+ <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ <li><a href="{% url 'mm_user_profile' %}">
+ <span class="glyphicon glyphicon-user"></span>
+ {% trans 'Account' %}
+ </a></li>
+ <li><a href="{% url 'pgp_user_profile' %}">
+ <span class="glyphicon glyphicon-lock"></span>
+ {% trans 'PGP settings' %}
+ </a></li>
+ {% if 'postorius' in INSTALLED_APPS %}
+ <li><a href="{% url 'ps_user_profile' %}">
+ <span class="fa fa-cog"></span>
+ {% trans 'Mailman settings' %}
+ </a></li>
+ {% endif %}
+ {% if 'hyperkitty' in INSTALLED_APPS %}
+ <li><a href="{% url 'hk_user_profile' %}">
+ <span class="glyphicon glyphicon-comment"></span>
+ {% trans 'Posting activity' %}
+ </a></li>
+ {% endif %}
+ <li role="separator" class="divider"></li>
+ <li><a href="{% url LOGOUT_URL %}?next={% url 'list_index' %}">
+ <span class="glyphicon glyphicon-log-out"></span>
+ {% trans 'Logout' %}
+ </a></li>
+ </ul>
+ </li>
+ {% else %}
+ <li><a href="{% url LOGIN_URL %}?next={{ next|default:request.path|urlencode }}">
+ <span class="glyphicon glyphicon-log-in"></span>
+ {% trans 'Login' %}
+ </a></li>
+ <li><a href="{% url 'account_signup' %}?next={{next|default:request.path|urlencode}}">
+ <span class="glyphicon glyphicon-plus-sign"></span>
+ {% trans 'Sign Up' %}
+ </a></li>
+ {% endif %}
+ </ul>
+ </div>
+ </div>
+ </nav>
+
+ <div class="container">
+ {% for message in messages %}
+ <div class="alert alert-{{ message.tags }}">{{ message }}</div>
+ {% endfor %}
+ {% block content %}{% endblock content %}
+ </div>
+
+ <footer class="footer">
+ <div class="container">
+ <p class="text-center">
+ <a href="http://list.org">GNU Mailman</a>
+ </p>
+ </div>
+ </footer>
+
+ <script src="{% static 'django_pgpmailman/libs/jquery/jquery-1.11.3.min.js' %}"></script>
+ <script src="{% static 'django_pgpmailman/libs/bootstrap/js/bootstrap.min.js' %}"></script>
+ <script src="{% static 'django_mailman3/js/main.js' %}"></script>
+ {% block additionaljs %}{% endblock %}
+</body>
+</html>
diff --git a/src/django_pgpmailman/templates/django_pgpmailman/index.html b/src/django_pgpmailman/templates/django_pgpmailman/index.html
new file mode 100644
index 0000000..5a5d93a
--- /dev/null
+++ b/src/django_pgpmailman/templates/django_pgpmailman/index.html
@@ -0,0 +1,49 @@
+{% extends "django_pgpmailman/base.html" %}
+{% load i18n %}
+{% load pagination %}
+
+{% block head_title %}
+{% trans 'PGP List Index' %} - {{ block.super }}
+{% endblock %}
+
+{% block content %}
+
+ <div class="page-header">
+ <h1>{% trans 'PGP enabled Mailing Lists' %}</h1>
+ </div>
+
+ {% if lists|length > 0 %}
+ <div class="table-responsive">
+ <table class="table table-bordered table-striped">
+ <thead>
+ <tr>
+ <th>{% trans 'List name' %}</th>
+ <th>{% trans 'Post address' %}</th>
+ <th>{% trans 'Description' %}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for pgp_list in lists %}
+ {% with pgp_list.mlist as mlist %}
+ <tr>
+ <td>
+ <a href="{% url 'pgp_list_summary' list_id=mlist.list_id %}">{{ mlist.display_name }}</a>
+ {% if user.is_superuser and not mlist.settings.advertised %} ({% trans 'unadvertised' %}*){% endif %}
+ </td>
+ <td>{{ mlist.fqdn_listname }}</td>
+ <td>{{ pgp_list.key.fingerprint }}</td>
+ <td>{{ mlist.settings.description }}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
+ {% if user.is_superuser %}
+ <small>* {% trans 'Only admins see unadvertised lists in the list index.' %}</small>
+ {% endif %}
+ {% paginator lists %}
+ {% else %}
+ <p>{% trans 'There are currently no PGP enabled mailing lists.' %}</p>
+ {% endif %}
+
+{% endblock content %}
diff --git a/src/django_pgpmailman/urls.py b/src/django_pgpmailman/urls.py
new file mode 100644
index 0000000..8c63141
--- /dev/null
+++ b/src/django_pgpmailman/urls.py
@@ -0,0 +1,26 @@
+# -*- 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 __future__ import absolute_import, unicode_literals
+
+from django.conf.urls import url
+
+from django_pgpmailman.views.list import pgp_list_index
+
+urlpatterns = [
+ url(r'^$', pgp_list_index)
+]
diff --git a/src/django_pgpmailman/views/__init__.py b/src/django_pgpmailman/views/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/django_pgpmailman/views/__init__.py
diff --git a/src/django_pgpmailman/views/list.py b/src/django_pgpmailman/views/list.py
new file mode 100644
index 0000000..4bdfdff
--- /dev/null
+++ b/src/django_pgpmailman/views/list.py
@@ -0,0 +1,26 @@
+# -*- 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 __future__ import absolute_import, unicode_literals
+
+from django.shortcuts import render
+
+
+def pgp_list_index(request):
+ return render(request, 'django_pgpmailman/index.html',
+ {'lists': []})