diff --git a/templates/admin/parameters.html b/templates/admin/parameters.html
new file mode 100644
index 000000000..f8f01c661
--- /dev/null
+++ b/templates/admin/parameters.html
@@ -0,0 +1,22 @@
+{% extends "admin/settings_header.html" %}
+{% block menu %}
+{% load admin_extras %}
+{% settings_menu "parameters" perms %}
+{% endblock %}
+{% block setcontent %}
+{% load i18n %}
+{% url admin.views.saveparameters as action %}
+
+{% endblock %}
diff --git a/templates/admin/permissions.html b/templates/admin/permissions.html
index 1ecd1dee8..6295edf95 100644
--- a/templates/admin/permissions.html
+++ b/templates/admin/permissions.html
@@ -1,7 +1,7 @@
{% extends "admin/settings_header.html" %}
{% block menu %}
{% load admin_extras %}
-{% settings_menu "permissions" %}
+{% settings_menu "permissions" perms %}
{% endblock %}
{% block setcontent %}
{% load i18n %}
diff --git a/templates/admin/settings_header.html b/templates/admin/settings_header.html
index 9748e53fd..814bfa687 100644
--- a/templates/admin/settings_header.html
+++ b/templates/admin/settings_header.html
@@ -1,4 +1,4 @@
-{% extends "layout.html" %}
+{% extends "nlayout.html" %}
{% load i18n %}
{% block html_head %}
diff --git a/templates/admin/settings_menu.html b/templates/admin/settings_menu.html
deleted file mode 100644
index 5463b8fd3..000000000
--- a/templates/admin/settings_menu.html
+++ /dev/null
@@ -1,18 +0,0 @@
-{% load i18n %}
-
diff --git a/templates/common/email_listing.html b/templates/common/email_listing.html
new file mode 100644
index 000000000..10f1abd1e
--- /dev/null
+++ b/templates/common/email_listing.html
@@ -0,0 +1,79 @@
+{% extends "nlayout.html" %}
+{% load i18n %}
+{% block html_head %}
+
+
+{% endblock %}
+{% block content %}
+{% block leftcol %}{% endblock %}
+
{{ listing }}
+
+{% endblock %}
+{% block footer %}
{{ navbar }}
{% endblock %}
+
diff --git a/templates/common/email_searchbar.html b/templates/common/email_searchbar.html
new file mode 100644
index 000000000..99b7e9f9f
--- /dev/null
+++ b/templates/common/email_searchbar.html
@@ -0,0 +1,10 @@
+{% load i18n %}
+
diff --git a/templates/common/error.html b/templates/common/error.html
new file mode 100644
index 000000000..11677caf5
--- /dev/null
+++ b/templates/common/error.html
@@ -0,0 +1,6 @@
+{% extends "nlayout.html" %}
+{% load i18n %}
+{% block middletitle %}{% trans "Error" %}{% endblock %}
+{% block content %}
+
+{% endblock %}
diff --git a/templates/admin/genericform.html b/templates/common/genericform.html
similarity index 87%
rename from templates/admin/genericform.html
rename to templates/common/genericform.html
index 5f993d07c..d07b5af55 100644
--- a/templates/admin/genericform.html
+++ b/templates/common/genericform.html
@@ -1,7 +1,8 @@
{% for field in form %}
{% if field.help_text %}
-
{{ field.help_text}}
{% endif %}
+
{{ field.help_text}}
+ {% endif %}
{{ field.label_tag }} {{ field }} {% ifequal noerrors False %}{{ field.errors }}{% endifequal %}
{% endfor %}
diff --git a/templates/common/getmailcontent.html b/templates/common/getmailcontent.html
new file mode 100644
index 000000000..872bdaf88
--- /dev/null
+++ b/templates/common/getmailcontent.html
@@ -0,0 +1 @@
+{% if pre %}
{% endif %}{{ body }}{% if pre %}{% endif %}
diff --git a/templates/common/navbar.html b/templates/common/navbar.html
new file mode 100644
index 000000000..668152024
--- /dev/null
+++ b/templates/common/navbar.html
@@ -0,0 +1,19 @@
+{% load i18n %}
+
+
+{% if page.previous_page %}
+
+
+
+
+
+
+{% endif %}
+{% if page.next_page %}
+
+
+
+
+
+
+{% endif %}
diff --git a/templates/common/table_body.html b/templates/common/table_body.html
new file mode 100644
index 000000000..425f5d962
--- /dev/null
+++ b/templates/common/table_body.html
@@ -0,0 +1,13 @@
+
+ {% for row in table.rows %}
+
+ {% for cell in row.cols %}
+ {% if cell.safe %}
+ | {{ cell.value|safe }} |
+ {% else %}
+ {{ cell.value }} |
+ {% endif %}
+ {% endfor %}
+
+ {% endfor %}
+
diff --git a/templates/common/table_head.html b/templates/common/table_head.html
new file mode 100644
index 000000000..9c70f8c89
--- /dev/null
+++ b/templates/common/table_head.html
@@ -0,0 +1,14 @@
+
+
+ {% for c in table.columns %}
+ {% if c.sortable %}
+ |
+ {% else %}
+ |
+ {% endif %}
+ {{ c|safe }}
+
+ |
+ {% endfor %}
+
+
diff --git a/templates/common/tables.html b/templates/common/tables.html
new file mode 100644
index 000000000..37fa156d3
--- /dev/null
+++ b/templates/common/tables.html
@@ -0,0 +1,26 @@
+
+
+
+ {% for c in table.columns %}
+
+ {{ c|safe }}
+
+ |
+ {% endfor %}
+
+
+
+
+ {% for row in table.rows %}
+
+ {% for cell in row.cols %}
+ {% if cell.safe %}
+ | {{ cell.value|safe }} |
+ {% else %}
+ {{ cell.value }} |
+ {% endif %}
+ {% endfor %}
+
+ {% endfor %}
+
+
diff --git a/templates/common/viewmail.html b/templates/common/viewmail.html
new file mode 100644
index 000000000..1c49fc399
--- /dev/null
+++ b/templates/common/viewmail.html
@@ -0,0 +1,54 @@
+{% load i18n %}
+
+
+
+
+
+
+
+
+
+
+ {{ headers }}
+
+ {% if pre %}
{% endif %}{{ mailbody }}{% if pre %}{% endif %}
+
+
diff --git a/templates/genericform.html b/templates/genericform.html
deleted file mode 100644
index 728f1c91a..000000000
--- a/templates/genericform.html
+++ /dev/null
@@ -1,5 +0,0 @@
-{% for field in form %}
-
- {{ field.label_tag }} {{ field }} {% ifequal noerrors False %}{{ field.errors }}{% endifequal %}
-
-{% endfor %}
diff --git a/templates/main/autoreply.html b/templates/main/autoreply.html
index 512235191..029ff881f 100644
--- a/templates/main/autoreply.html
+++ b/templates/main/autoreply.html
@@ -1,8 +1,10 @@
{% extends "main/header.html" %}
{% load i18n %}
{% block html_head %}
-
+
+
+
{% endblock %}
{% block menu %}
{% load main_extras %}
@@ -10,11 +12,11 @@
{% endblock %}
{% block subcontent %}
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/templates/main/chpassword.html b/templates/main/chpassword.html
index 93aeac38b..47656ab04 100644
--- a/templates/main/chpassword.html
+++ b/templates/main/chpassword.html
@@ -9,10 +9,10 @@
{% if error %}
{{ error }}
{% endif %}
{% url main.views.changepassword as action_url %}
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/templates/main/header.html b/templates/main/header.html
index 37d898d43..a9bdddaf9 100644
--- a/templates/main/header.html
+++ b/templates/main/header.html
@@ -1,7 +1,9 @@
-{% extends "layout.html" %}
+{% extends "nlayout.html" %}
{% load i18n %}
{% block html_head %}
+
+
{% endblock %}
{% block middletitle %}{% trans "General" %}{% endblock %}
{% block content %}
diff --git a/templates/main/menu.html b/templates/main/menu.html
index 083ae8336..1de27a857 100644
--- a/templates/main/menu.html
+++ b/templates/main/menu.html
@@ -2,14 +2,14 @@
{% for entry in entries %}
{% if entry.menu %}
- -
+
-
- {{ entry.label }}
+
@@ -26,4 +26,4 @@
{% endif %}
{% endfor %}
-
\ No newline at end of file
+
diff --git a/templates/nlayout.html b/templates/nlayout.html
new file mode 100644
index 000000000..ad3092f79
--- /dev/null
+++ b/templates/nlayout.html
@@ -0,0 +1,94 @@
+{% load i18n %}
+{% load main_extras %}
+
+
+
+
+
MailNG - {%block pagetitle %}{% endblock %}
+
+
+
+
+
+
+
+
+
+ {% url django.views.i18n.javascript_catalog as catalog_url %}
+
+ {%block html_head %}{% endblock %}
+
+
+
+
+
+
+
+
+
+ {% block content %}{% endblock %}
+
+
+
+
+
+
+
diff --git a/templates/registration/login.html b/templates/registration/login.html
index 53c8a1e2f..f5b23a6bc 100644
--- a/templates/registration/login.html
+++ b/templates/registration/login.html
@@ -1,26 +1,40 @@
-{% extends "layout.html" %}
{% load i18n %}
-{% block html_head %}
-
-{% endblock %}
-{% block content %}
-
-
{% trans "Welcome" %}
-{% if form.errors %}
-
-
{% trans "Your username and password didn't match. Please try again." %}
+
+
+
+
+
{% trans "Welcome to MailNG" %}
+
+
+
+
+
+ {% url django.views.i18n.javascript_catalog as catalog_url %}
+
+
+
+
+
+
+

+ {% if error %}
+
+ {% endif %}
+
2010 - Version 0.7-dev
+
+
+
{% trans "Welcome" %}
+
+
+
-{% endif %}
-
-
-{% endblock %}
+
+
diff --git a/urls.py b/urls.py
index 9d999ca52..54827847f 100644
--- a/urls.py
+++ b/urls.py
@@ -21,7 +21,7 @@ urlpatterns = patterns('',
(r'^mailng/admin/', include('mailng.admin.urls')),
(r'^mailng/main/', include('mailng.main.urls')),
- (r'^accounts/login/$', 'django.contrib.auth.views.login'),
+ (r'^accounts/login/$', 'mailng.auth.views.dologin'),
(r'^accounts/logout/$', 'django.contrib.auth.views.logout_then_login'),
(r'^jsi18n/$', 'django.views.i18n.javascript_catalog',
{'packages': ('mailng',),})
@@ -33,6 +33,15 @@ if menus != ():
if settings.DEBUG:
urlpatterns += patterns(
'',
- (r'^static/(?P
.*)$', 'django.views.static.serve', {'document_root': '/home/tonio/projets/mailng/static'})
+ (r'^static/(?P.*)$', 'django.views.static.serve',
+ {'document_root': settings.STATIC_ROOTDIR})
)
-
+ # Stats
+ if 'mailng.extensions.stats' in settings.INSTALLED_APPS:
+ urlpatterns += patterns(
+ '',
+ (r'^img/stats/(?P.*)/$', 'django.views.static.serve',
+ {'document_root': settings.IMG_ROOTDIR})
+ )
+
+