added new_domain view/template/form
1 parent c968211 commit 6bb629119db0be06728dad40f82128851371bfca
@benste benste authored on 1 Jun 2011
Showing 4 changed files
View
28
forms.py
from django import forms
from django.utils.translation import gettext as _
from fieldset_forms import FieldsetForm
 
class DomainNew(FieldsetForm):
"""
Form field to add a new domain
"""
domain_name = forms.CharField(
label = _('Domain Name'),
required = True,
)
contact_address = forms.EmailField(
label = _('Your email address'),
error_messages = {'required': _('Please enter an email address.'),
'invalid': _('Please enter a valid email address.')})
description = forms.CharField(
label = _('Description'),
required = False,
)
class Meta:
"""
Class to handle the automatic insertion of fieldsets and divs.
To use it: add a list for each wished fieldset. The first item in
the list should be the wished name of the fieldset, the following
the fields that should be included in the fieldset.
"""
layout = [["New Domain","domain_name", "contact_address",],
["Description", "description"]]
 
class ListNew(FieldsetForm):
"""
Form fields to add a new list. Languages are hard coded which should
be replaced by a REST lookup of available languages.
View
4
templates/mailman-django/base.html
This is a draft of a Mailman3 django client. It's not a finished design. For now you can view a <a href="{{ url_list_index }}">list</a> of existing mailing lists and you can <a href="{{ url_list_new }}">create</a> new lists.
{% endblocktrans %}
{% block links %}{% endblock %}
</p>
Testing
<ul>
<li> <a href="/new_domain">New Domain</a></li>
</ul>
 
{% block content %}{% endblock %}
 
View
urls.py
View
views.py