diff --git a/forms.py b/forms.py index 48633f5..328b4f9 100644 --- a/forms.py +++ b/forms.py @@ -752,9 +752,7 @@ if settings: for section in self.layout: for option in section[1:]: - #raise Exception(settings) self.fields[option].initial = settings[option] - #raise Exception(self.fields[option].initial) class Meta: diff --git a/static/mailman_django/css/basics.css b/static/mailman_django/css/basics.css index 9a54524..c902c11 100644 --- a/static/mailman_django/css/basics.css +++ b/static/mailman_django/css/basics.css @@ -6,7 +6,6 @@ light_blue #cfdcec → rgba(207, 220, 236, 0.6) blue #186aaf → rgba(24, 106, 175, 1) dark_blue #40486f - **/ @media screen, projection { @@ -150,5 +149,12 @@ } +#message { + background-color:rgba(207, 220, 236, 0.6); + border:1px solid rgba(24, 106, 175, 1); + padding:3px; + border-radius:5px; +} + @media screen and (max-width: 600px) { } diff --git a/templates/mailman-django/base.html b/templates/mailman-django/base.html index 4df888a..b032398 100644 --- a/templates/mailman-django/base.html +++ b/templates/mailman-django/base.html @@ -36,6 +36,9 @@ + {% if message %} +

{{ message }}

+ {% endif %}
{% block content %}{% endblock %}
diff --git a/templates/mailman-django/domains.html b/templates/mailman-django/domains.html index 36dd3bc..6f2cc4c 100644 --- a/templates/mailman-django/domains.html +++ b/templates/mailman-django/domains.html @@ -4,7 +4,6 @@ {% block content %}

{% trans "Add a new Domain" %}

-

{% trans "Logout" %}

diff --git a/templates/mailman-django/list_selector.html b/templates/mailman-django/list_selector.html index cafd4ab..93f7f8a 100644 --- a/templates/mailman-django/list_selector.html +++ b/templates/mailman-django/list_selector.html @@ -2,6 +2,7 @@ {% block selector %} +{%if lists %} - +{%endif%} {% endblock %} diff --git a/templates/mailman-django/lists/settings.html b/templates/mailman-django/lists/settings.html index d882f8c..4ee045c 100644 --- a/templates/mailman-django/lists/settings.html +++ b/templates/mailman-django/lists/settings.html @@ -20,11 +20,6 @@

{% trans "This page visualizes all list settings. Currently the page is not connected to the rest server so the settings will not be saved when changing them. However, this gives an idea of what the settings page could look like." %}

- -{% if message %} -

{{ message }}

-{% endif %} - {{ form.as_div }} diff --git a/views.py b/views.py index 3be7734..4263145 100644 --- a/views.py +++ b/views.py @@ -78,6 +78,7 @@ @login_required def domains(request, template = 'mailman-django/domains.html'): + message="" if request.method == 'POST': form = DomainNew(request.POST) try: @@ -91,8 +92,7 @@ try: domain = c.create_domain(mail_host,web_host,description) except Exception, e: - form._errors["NON_FIELD_ERRORS"]=forms.util.ErrorList() - form._errors["NON_FIELD_ERRORS"].append(e) + message=e else: try: c = Client('http://localhost:8001/3.0', API_USER, API_PASS) @@ -105,7 +105,10 @@ except Exception, e: return HttpResponse(e) - return render_to_response(template, {'form': form,'domains':existing_domains},context_instance=RequestContext(request)) + return render_to_response(template, {'form': form, + 'domains':existing_domains, + 'message':message, + },context_instance=RequestContext(request)) @login_required def administration(request, template = 'mailman-django/lists/new.html'): @@ -316,10 +319,12 @@ if request.method == 'POST': form = ListSettings(request.POST,visible_section,visible_option) if form.is_valid(): - the_list.update_config(request.POST) - message = "The list has been updated." - #Provide a form with existing values - else: + the_list.update_config(request.POST)#TODO + message = _("The list has been updated.") + else: + message = _("Validation Error - The list has not been updated.") + + else:#Provide a form with existing values #create form to get layout form = ListSettings(None,visible_section,visible_option) #create a Dict of all settings which are used in the form @@ -329,13 +334,7 @@ used_settings[option] = the_list.settings[option] #recreate the form using the settings form = ListSettings(used_settings,visible_section,visible_option) - - #TODO - # USE different Forms for each fieldset NO META SETTINGS !! - # querry settings when creating the fields not parsing the whole settings - # - #raise Exception(form)#debug return render_to_response(template, {'form': form, 'message': message, 'fqdn_listname': the_list.settings['fqdn_listname'],