Added missing CSS file + modified choice to only display the lists from current domain
1 parent 5570be8 commit 2425f06325ccae21936beab9d22ff47af7a47a0b
@benste benste authored on 28 Jun 2011
Showing 2 changed files
View
90
static/mailman_django/css/forms.css 0 → 100755
/*************************
* Forms
*************************/
fieldset {
clear: both;
border: 1px solid #b2b2b2;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
padding: 10px 10px 20px 10px;
margin-bottom: 20px;
}
 
fieldset legend,
a.toggleFieldset {
padding: 2px 5px;
border: 1px solid #b2b2b2;
border-radius: 3px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
background-color: #fff;
text-shadow: 0 1px silver;
line-height: 1.5em;
color: #444;
}
fieldset.optional legend,
a.toggleFieldset {
display: block;
padding-left: 25px;
background: #fff url('../img/icons/plus.png') no-repeat 5px 2px;
cursor: pointer;
}
fieldset.optional legend {
background-image: url('../img/icons/minus.png');
}
legend {
margin-left: 0px;
}
a.toggleFieldset {
clear: both;
float: left;
margin-bottom: 20px;
margin-left: 13px;
}
input {
border: 1px solid #b2b2b2;
border-radius: 3px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
width: 400px;
padding: 2px;
}
.errorlist {
float: right;
width: 300px;
list-style: none;
margin: 0 0 0 15px;
padding: 0;
color: red;
}
form div.field {
clear: both;
padding-top: 15px;
}
label {
clear: both;
display: block;
}
button {
margin-top: 5px;
}
 
/*************************
* Special form styles
*************************/
.newlist .listname input {
font-size: 1.5em;
width: 400px;
padding: 2px;
}
.newlist .listname .errorlist {
margin-top: .5em;
}
 
.languages ul {
column-count: 3;
-moz-column-count: 3; /** CSS
}
 
View
20
views.py
try:
existing_domains = c.domains
#WEB List selector → TODO → MOVE to Context Processors
web_host = request.META["HTTP_HOST"].split(":")
if len(web_host) == 2:
try:
web_host = request.META["HTTP_HOST"].split(":")#TODO Django DEV only !
web_host = web_host[0]
except:
web_host = request.META["HTTP_HOST"]
d = c.get_domain(None,web_host)
all_lists = c.lists #TODO get filtered by Domain !
domainname= d.email_host
domain_lists = []
for list in c.lists:
if list.host_name == domainname:
domain_lists.append(list)
except Exception, e:
return HttpResponse(e)
return render_to_response(template, {'form': form,'domains':existing_domains,'lists':all_lists})
return render_to_response(template, {'form': form,'domains':existing_domains,'lists':domain_lists})
 
@login_required
def administration(request, template = 'mailman-django/lists/new.html'):
"""
the_list.delete()
# let the user return to the list index page
try:
lists = c.lists
return render_to_response(template, {'lists': lists})
return redirect("/lists/")
except Exception, e:
return render_to_response('mailman-django/errors/generic.html',
{'message': "Unexpected error:"+ str(e)})