diff --git a/src/mailmanweb/templates/mailmanweb/base.html b/src/mailmanweb/templates/mailmanweb/base.html index 370c886..b95c546 100644 --- a/src/mailmanweb/templates/mailmanweb/base.html +++ b/src/mailmanweb/templates/mailmanweb/base.html @@ -28,10 +28,10 @@ {% if user.is_authenticated %}
  • - Todos + Todos
  • - Settings + Settings
  • {% endif %}
  • diff --git a/src/mailmanweb/templates/mailmanweb/domain_index.html b/src/mailmanweb/templates/mailmanweb/domain_index.html index 4e5872d..7c18c15 100644 --- a/src/mailmanweb/templates/mailmanweb/domain_index.html +++ b/src/mailmanweb/templates/mailmanweb/domain_index.html @@ -1,37 +1,30 @@ {% extends "mailmanweb/base.html" %} {% load i18n %} -{% block heading %} - {% trans "Domain Index" %} -{% endblock %} +{% block main %} + {% include 'mailmanweb/menu/settings_nav.html' %} +

    {% trans "Domain Index" %}

    -{% block header %} -
    -
    {% trans "About" %}
    - Register new Domains. -

    -
    -{% endblock %} -{% block actionButtonsList %} - -{% endblock %} - -{% block smallBoxLeft %} - {% for domain in domains %} -
    -
    {{ domain.contact_address }} ({{ domain.base_url }})
    - {% if domain.description %} - {{ domain.description }} - {% endif %} -
    - {% endfor %} -{% endblock %} + + + + + + + + + + + + {% for domain in domains %} + + + + + + + + {% endfor %} + +
    Mail HostURL HostContact AddressDescription 
    {{ domain.mail_host }}{{ domain.url_host }}{{ domain.contact_address }}{{ domain.description }}{% trans 'Delete' %}
    +{% endblock main %} diff --git a/src/mailmanweb/templates/mailmanweb/domain_new.html b/src/mailmanweb/templates/mailmanweb/domain_new.html index a862a6e..331d299 100644 --- a/src/mailmanweb/templates/mailmanweb/domain_new.html +++ b/src/mailmanweb/templates/mailmanweb/domain_new.html @@ -1,18 +1,13 @@ {% extends extend_template %} {% load i18n %} -{% block heading %} - {% trans "Add a new Domain" %} -{% endblock %} - -{% block header %} - -
    - {{ form.as_div }} -
    - -
    -
    - -{% endblock %} +{% block main %} + {% include 'mailmanweb/menu/settings_nav.html' %} +

    {% trans "Add a new Domain" %}

    +
    + {{ form.as_p }} +
    + +
    +
    +{% endblock main %} diff --git a/src/mailmanweb/templates/mailmanweb/menu/settings_nav.html b/src/mailmanweb/templates/mailmanweb/menu/settings_nav.html new file mode 100644 index 0000000..fa0b82d --- /dev/null +++ b/src/mailmanweb/templates/mailmanweb/menu/settings_nav.html @@ -0,0 +1,6 @@ +{% load i18n %} + diff --git a/src/mailmanweb/templates/mailmanweb/menu/user_nav.html b/src/mailmanweb/templates/mailmanweb/menu/user_nav.html index 233b875..c7dee40 100644 --- a/src/mailmanweb/templates/mailmanweb/menu/user_nav.html +++ b/src/mailmanweb/templates/mailmanweb/menu/user_nav.html @@ -1,6 +1,6 @@ {% load i18n %} diff --git a/src/mailmanweb/templates/mailmanweb/site_settings.html b/src/mailmanweb/templates/mailmanweb/site_settings.html new file mode 100644 index 0000000..1caec3b --- /dev/null +++ b/src/mailmanweb/templates/mailmanweb/site_settings.html @@ -0,0 +1,7 @@ +{% extends extend_template %} +{% load i18n %} + +{% block main %} + {% include 'mailmanweb/menu/settings_nav.html' %} +

    General Settings

    +{% endblock main %} diff --git a/src/mailmanweb/templates/mailmanweb/user_settings.html b/src/mailmanweb/templates/mailmanweb/user_settings.html index fb01182..91fa63c 100644 --- a/src/mailmanweb/templates/mailmanweb/user_settings.html +++ b/src/mailmanweb/templates/mailmanweb/user_settings.html @@ -3,6 +3,8 @@ {% block main %} + {% include 'mailmanweb/menu/user_nav.html' %} +

    Membership

    {% ifequal tab "membership"%} {% trans "Membership Settings" %} {% if list %}{% trans "for"%}{% endif %} {{ list.fqdn_listname }} diff --git a/src/mailmanweb/templates/mailmanweb/user_todos.html b/src/mailmanweb/templates/mailmanweb/user_todos.html new file mode 100644 index 0000000..617c8a7 --- /dev/null +++ b/src/mailmanweb/templates/mailmanweb/user_todos.html @@ -0,0 +1,7 @@ +{% extends extend_template %} +{% load i18n %} + +{% block main %} + {% include 'mailmanweb/menu/user_nav.html' %} +

    Your Todos

    +{% endblock main %} diff --git a/src/mailmanweb/urls.py b/src/mailmanweb/urls.py index 01a887f..4db7978 100644 --- a/src/mailmanweb/urls.py +++ b/src/mailmanweb/urls.py @@ -23,12 +23,19 @@ urlpatterns = patterns('mailmanweb.views', (r'^$', 'user_profile'), + # /account/ url(r'^accounts/login/$', 'user_login', name='user_login'), url(r'^accounts/logout/$', 'user_logout', name='user_logout'), url(r'^accounts/profile/$', 'user_profile', name='user_profile'), - url(r'^administration/$', 'administration', name='administration'), - url(r'^domains/$', 'domain_index', name='domain_index'), - url(r'^domains/new/$', 'domain_new', name='domain_new'), + url(r'^accounts/todos/$', 'user_todos', name='user_todos'), + url(r'^accounts/membership/(?:(?P[^/]+)/)?$', + 'user_settings', kwargs={"tab": "membership"}, + name='membership_settings'), + # /settings/ + url(r'^settings/$', 'site_settings', name="site_settings"), + url(r'^settings/domains/$', 'domain_index', name='domain_index'), + url(r'^settings/domains/new/$', 'domain_new', name='domain_new'), + # /lists/ url(r'^lists/$', 'list_index', name='list_index'), url(r'^lists/new/$', 'list_new', name='list_new'), url(r'^lists/(?P[^/]+)/metrics$', 'list_metrics', @@ -39,16 +46,13 @@ 'list_subscribe', name='list_subscribe'), url(r'^lists/(?P[^/]+)/subscriptions$', 'list_subscriptions', name='list_subscriptions'), - url(r'^subscriptions/(?P[^/]+)/mass_subscribe/$', + url(r'^lists/(?P[^/]+)/mass_subscribe/$', 'mass_subscribe', name='mass_subscribe'), - url(r'^delete_list/(?P[^/]+)/$', 'list_delete', + url(r'^lists/(?P[^/]+)/delete$', 'list_delete', name='list_delete'), url(r'^user_settings/$', 'user_settings', kwargs={"tab": "user"}, name='user_settings'), - url(r'^membership_settings/(?:(?P[^/]+)/)?$', - 'user_settings', kwargs={"tab": "membership"}, - name='membership_settings'), - url(r'^settings/(?P[^/]+)/(?P[^/]+)?(?:/(?P.*))?$', + url(r'^lists/(?P[^/]+)/settings/(?P[^/]+)?(?:/(?P.*))?$', 'list_settings', name='list_settings'), ) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) diff --git a/src/mailmanweb/views.py b/src/mailmanweb/views.py index e8a0ae0..f1ebe6f 100644 --- a/src/mailmanweb/views.py +++ b/src/mailmanweb/views.py @@ -43,18 +43,24 @@ @login_required @permission_required('server_admin') -def domain_index(request, template = 'mailmanweb/domain_index.html'): +def site_settings(request): + return render_to_response('mailmanweb/site_settings.html', + context_instance=RequestContext(request)) + +@login_required +@permission_required('server_admin') +def domain_index(request): try: existing_domains = Domain.objects.all() logger.debug(Domain.objects) except MailmanApiError: return utils.render_api_error(request) - return render_to_response(template, {'domains':existing_domains,}, + return render_to_response('mailmanweb/domain_index.html', {'domains':existing_domains,}, context_instance=RequestContext(request)) @login_required @permission_required('server_admin') -def domain_new(request, template = 'mailmanweb/domain_new.html'): +def domain_new(request): message = None if request.method == 'POST': form = DomainNew(request.POST) @@ -71,20 +77,11 @@ return redirect("domain_index") else: form = DomainNew() - return render_to_response(template, + return render_to_response('mailmanweb/domain_new.html', {'form': form,'message': message}, context_instance=RequestContext(request)) @login_required -def administration(request): - """ - Administration dashboard used for Menu navigation - """ - - return render_to_response('mailmanweb/errors/generic.html', - {'message': "This Site is in preperation."}) - -@login_required def list_new(request, template = 'mailmanweb/lists/new.html'): """ Add a new mailing list. @@ -454,14 +451,12 @@ user_object = the_list.get_member(member) else: message = ("Using a workaround to replace missing Client functionality → LP:820827") - #### BEGIN workaround - for mlist in Lists.objects.all(): + for mlist in List.objects.all(): try: mlist.get_member(member) membership_lists.append(mlist) - except: # if user is not subscribed to this list + except: pass - #### END workaround else: # address_choices for the 'address' field must be a list of # tuples of length 2 @@ -567,3 +562,7 @@ return render_to_response('mailmanweb/user_profile.html', context_instance=RequestContext(request)) +def user_todos(request): + return render_to_response('mailmanweb/user_todos.html', + context_instance=RequestContext(request)) +