wip: global UI refactoring

* Templates cleanup (page titles for everyone)
* Fixed unicode issues
This commit is contained in:
Antoine Nguyen
2012-04-20 12:59:55 +02:00
parent 260dbf9b58
commit e9a8842a5d
16 changed files with 33 additions and 34 deletions
+1 -1
View File
@@ -179,7 +179,7 @@ def param(app, definition):
selected = ""
if value == v[0]:
selected = " selected='selected'"
result += "<option value='%s'%s>%s</option>\n" % (v[0], selected, v[1])
result += "<option value='%s'%s>%s</option>\n" % (v[0], selected, v[1].decode("utf-8"))
result += """
</select>
"""
@@ -56,7 +56,7 @@ Quarantine.prototype = {
e.preventDefault();
var $link = $(e.target).parent();
this.navobj.deleteParam("rcpt");
this.navobj.delparam("rcpt");
this.navobj.from_string($link.attr("href")).update();
},
@@ -1,4 +1,5 @@
{% extends "fixed.html" %}
{% extends "fixed.html" %}{% load i18n %}
{% block pagetitle %}{% trans "Quarantine management" %}{% endblock %}
{% block html_head %}
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}amavis_quarantine/css/quarantine.css" />
<script type="text/javascript" src="{{ MEDIA_URL }}js/jquery.htmltable.js"></script>
@@ -1,5 +1,5 @@
{% extends "twocols.html" %}
{% load i18n sfilters_tags %}
{% extends "twocols.html" %}{% load i18n sfilters_tags %}
{% block pagetitle %}{% trans "Message filters" %}{% endblock %}
{% block html_head %}
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}sievefilters/css/style.css" />
<script type="text/javascript" src="{{ MEDIA_URL }}js/history.js"></script>
+7 -7
View File
@@ -40,10 +40,10 @@ def destroy():
@events.observe("UserMenuDisplay")
def menu(target, user):
if target == "top_menu":
return [
{"name" : "stats",
"label" : ugettext("Statistics"),
"url" : reverse('fullindex')}
]
return []
if target != "top_menu" or user.group == "SimpleUsers":
return []
return [
{"name" : "stats",
"label" : ugettext("Statistics"),
"url" : reverse('fullindex')}
]
+2 -2
View File
@@ -1,5 +1,5 @@
{% extends "fixed.html" %}
{% load i18n %}
{% extends "fixed.html" %}{% load i18n %}
{% block pagetitle %}{% trans "Graphical statistics" %}{% endblock %}
{% block html_head %}
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}stats/css/stats.css" />
<script type="text/javascript" src="{{ MEDIA_URL }}js/history.js"></script>
@@ -1,5 +1,5 @@
{% extends "fixed.html" %}
{% load i18n libextras %}
{% extends "fixed.html" %}{% load i18n libextras %}
{% block pagetitle %}Webmail{% endblock %}
{% block html_head %}
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}webmail/css/webmail.css" />
<script type="text/javascript" src="{{ MEDIA_URL }}js/jquery-ui.js"></script>
+2 -2
View File
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# coding: utf-8
"""
:mod:`tables` --- simple tabular renderer
-----------------------------------------
@@ -206,7 +206,7 @@ class Table(object):
except AttributeError:
return value
def __str__(self):
def __unicode__(self):
return self.render()
def render(self, withheader=True):
+2 -2
View File
@@ -1,5 +1,5 @@
{% extends "admin/listing.html" %}
{% load i18n admin_extras libextras %}
{% extends "admin/listing.html" %}{% load i18n admin_extras libextras %}
{% block pagetitle %}{% trans "Domains" %}{% endblock %}
{% block html_head %}
{{ block.super }}
<script type="text/javascript">
+2 -2
View File
@@ -1,5 +1,5 @@
{% extends "admin/settings_header.html" %}
{% load i18n %}
{% extends "admin/settings_header.html" %}{% load i18n %}
{% block pagetitle %}{% trans "Extensions" %}{% endblock %}
{% block apparea %}
<form method="POST" action="{% url admin.views.saveextensions %}">
{{ extensions|safe }}
+2 -2
View File
@@ -1,5 +1,5 @@
{% extends "admin/listing.html" %}
{% load admin_extras libextras %}
{% extends "admin/listing.html" %}{% load admin_extras libextras i18n %}
{% block pagetitle %}{% trans "Identities" %}{% endblock %}
{% block html_head %}
{{ block.super }}
<script type="text/javascript" src="{{ MEDIA_URL }}js/creation_wizard.js"></script>
+2 -2
View File
@@ -1,5 +1,5 @@
{% extends "admin/settings_header.html" %}
{% load i18n %}
{% extends "admin/settings_header.html" %}{% load i18n %}
{% block pagetitle %}{% trans "Parameters" %}{% endblock %}
{% block apparea %}
{% url admin.views.saveparameters as action %}
<form method="POST" action="{{ action }}" id="params_form" class="form-horizontal">
+3 -4
View File
@@ -1,9 +1,8 @@
<!DOCTYPE html>
{% load i18n admin_extras uprefs_extras libextras %}
<html lang="en">
<!DOCTYPE html>{% load i18n admin_extras uprefs_extras libextras %}
<html lang="{{ LANGUAGE_CODE }}">
<head>
<meta charset="utf-8" />
<title>Modoboa - {% block pagetitle %}{% endblock %}</title>
<title>{% block pagetitle %}{% endblock %}</title>
<link rel="icon" type="image/png" href="{{ MEDIA_URL }}css/logo-icon.png" />
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/bootstrap-responsive.css" />
+1 -1
View File
@@ -1,5 +1,5 @@
<!DOCTYPE html>{% load i18n libextras %}
<html lang="en">
<html lang="{{ LANGUAGE_CODE }}">
<head>
<meta charset="utf-8" />
<title>{% trans "Welcome to Modoboa" %}</title>
+2 -2
View File
@@ -1,5 +1,5 @@
{% extends "twocols.html" %}
{% load i18n uprefs_extras libextras %}
{% extends "twocols.html" %}{% load i18n uprefs_extras libextras %}
{% block pagetitle %}{% trans "Settings" %}{% endblock %}
{% block html_head %}
<script type="text/javascript">
function forwardform_cb() {
-1
View File
@@ -91,7 +91,6 @@ def setforward(request, tplname="common/generic_modal_form.html"):
return ajax_response(request, status="ko", template=tplname, **ctx)
form = ForwardForm()
print al
if al is not None:
form.fields["dest"].initial = al.extmboxes
try: