diff --git a/INSTALL b/INSTALL index 65aca03d8..6a528e415 100644 --- a/INSTALL +++ b/INSTALL @@ -26,6 +26,11 @@ Initialise the database by running the following command:: Create the super admin account (just follow the procedure). +Run the initialisation script. It will insert needed data into the database : + + export PYTHONPATH=$PWD/.. + DJANGO_SETTINGS_MODULE=mailng.settings ./scripts/populate.py + Host configuration ------------------ diff --git a/admin/templatetags/admin_extras.py b/admin/templatetags/admin_extras.py index d8802dee0..11993e6b8 100644 --- a/admin/templatetags/admin_extras.py +++ b/admin/templatetags/admin_extras.py @@ -14,6 +14,11 @@ def domain_menu(domain_id, selection): {"selection" : selection, "domain_id" : domain_id}) +@register.simple_tag +def settings_menu(selection): + return render_to_string('admin/settings_menu.html', + {"selection" : selection}) + @register.filter def gender(value, target): if genders.has_key(value): diff --git a/admin/urls.py b/admin/urls.py index 466d752d3..b33fc9c26 100644 --- a/admin/urls.py +++ b/admin/urls.py @@ -15,4 +15,5 @@ urlpatterns = patterns('mailng.admin.views', url(r'^domains/(?P\d+)/aliases/$', "aliases", name="full-aliases"), url(r'^domains/(?P\d+)/aliases/(?P\d+)/$', "aliases", name="mbox-aliases"), (r'^domains/(?P\d+)/delalias/(?P\d+)/$', 'delalias'), + (r'^settings/$', 'settings'), ) diff --git a/admin/views.py b/admin/views.py index 9fad0d22c..097a1d659 100644 --- a/admin/views.py +++ b/admin/views.py @@ -278,3 +278,6 @@ def delalias(request, dom_id, alias_id): return HttpResponseRedirect(reverse(admin.views.aliases, args=[dom_id])) +@login_required +def settings(request): + return _render(request, 'admin/permissions.html', {}) diff --git a/scripts/populate.py b/scripts/populate.py new file mode 100755 index 000000000..6b7c4c772 --- /dev/null +++ b/scripts/populate.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from django.contrib.auth.models import Group + +if __name__ == "__main__": + for gname in ["DomainAdmins", "Users"]: + grp = Group() + grp.name = gname + grp.save() diff --git a/static/pics/permissions.png b/static/pics/permissions.png new file mode 100644 index 000000000..04666196e Binary files /dev/null and b/static/pics/permissions.png differ diff --git a/templates/admin/layout.html b/templates/admin/layout.html index 7685f86dc..3548d4a99 100644 --- a/templates/admin/layout.html +++ b/templates/admin/layout.html @@ -1,7 +1,6 @@ {% extends "layout.html" %} {% block content %} {% load i18n %} -{% url admin.views.domains as dom_url %}
@@ -30,13 +29,15 @@
  • - + {% url admin.views.domains as dom_url %} + {% trans "Domains" %}
  • - + {% url admin.views.settings as settings_url %} + {% trans "Settings" %} diff --git a/templates/admin/permissions.html b/templates/admin/permissions.html new file mode 100644 index 000000000..f2453ce18 --- /dev/null +++ b/templates/admin/permissions.html @@ -0,0 +1,5 @@ +{% extends "admin/settings_header.html" %} +{% block menu %} +{% load admin_extras %} +{% settings_menu "permissions" %} +{% endblock %} \ No newline at end of file diff --git a/templates/admin/settings_header.html b/templates/admin/settings_header.html new file mode 100644 index 000000000..6e6ed95d7 --- /dev/null +++ b/templates/admin/settings_header.html @@ -0,0 +1,17 @@ +{% extends "admin/layout.html" %} +{% block html_head %} +{% endblock %} +{% block mainframe %} +{% load i18n %} +
    +

    {% trans "Settings" %}

    +
    + + + +
    +{% block setcontent %}{% endblock %} +
    +{% endblock %} diff --git a/templates/admin/settings_menu.html b/templates/admin/settings_menu.html new file mode 100644 index 000000000..842b48141 --- /dev/null +++ b/templates/admin/settings_menu.html @@ -0,0 +1,10 @@ +{% load i18n %} +