Commit 6d8d12aa authored by J08nY's avatar J08nY

Setup base Django project structure.

parent e71bd4a8
......@@ -35,6 +35,10 @@ from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^pgp/', include('django_pgpmailman.urls')),
# url(r'^postorius/', include('postorius.urls')),
# url(r'^hyperkitty/', include('hyperkitty.urls')),
url(r'', include('django_mailman3.urls')),
url(r'^accounts/', include('allauth.urls')),
url(r'^admin/', admin.site.urls),
]
from setuptools import find_packages, setup
setup(
name='django-pgpmailman',
name='django_pgpmailman',
version='0.1',
description='A web interface extension for the GNU Mailman apps Postorius and HyperKitty.',
long_description="""""",
......@@ -24,7 +24,7 @@ setup(
install_requires=[
'Django>=1.8',
'Django<1.12',
'django-mailman3',
'django_mailman3',
'mailmanclient',
]
)
# -*- 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'
{% extends "django_pgpmailman/base.html" %}
\ No newline at end of file
{% extends "django_pgpmailman/base.html" %}
\ No newline at end of file
{% 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>
{% 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 %}
# -*- 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)
]
# -*- 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': []})
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