diff --git a/static/mailman_django/css/forms.css b/static/mailman_django/css/forms.css new file mode 100755 index 0000000..b24a066 --- /dev/null +++ b/static/mailman_django/css/forms.css @@ -0,0 +1,89 @@ +/************************* + * 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 +} + diff --git a/views.py b/views.py index d139afe..11c22a1 100644 --- a/views.py +++ b/views.py @@ -103,16 +103,22 @@ 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'): @@ -289,7 +295,7 @@ # 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)})