From adbbcfa458db36ffb84acddc09a1636e3f164545 Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Fri, 8 Apr 2011 17:07:09 +0200 Subject: [PATCH] Finally, create only one symlink to the plugin's static directory inside modoboa's root static directory. It is more compliant with the way django applications work. close #17 --- admin/models.py | 18 +++--------------- .../templates/amavis_quarantine/index.html | 5 +++-- .../webmail/templates/webmail/folder.html | 4 ++-- .../webmail/templates/webmail/index.html | 8 ++++---- 4 files changed, 12 insertions(+), 23 deletions(-) diff --git a/admin/models.py b/admin/models.py index 5b8a76291..04981887a 100644 --- a/admin/models.py +++ b/admin/models.py @@ -256,12 +256,8 @@ class Extension(models.Model): staticpath = "%s/%s" % (extdir, "static") if os.path.exists(staticpath): - for d in ['css', 'js']: - subpath = "%s/%s" % (staticpath, d) - if not os.path.exists(subpath): - continue - exec_cmd("ln -s %s %s/static/%s/%s" % (subpath, settings.MODOBOA_DIR, - d, self.name)) + exec_cmd("ln -s %s/static %s/static/%s" % \ + (extdir, settings.MODOBOA_DIR, self.name)) def off(self): self.unload() @@ -274,12 +270,4 @@ class Extension(models.Model): staticpath = "%s/%s" % (extdir, "static") if os.path.exists(staticpath): - for d in ['css', 'js']: - subpath = "%s/static/%s/%s" % (settings.MODOBOA_DIR, d, self.name) - exec_cmd("rm -f %s" % subpath) - - - - - - + exec_cmd("rm -r %s/static/%s" % (settings.MODOBOA_DIR, self.name)) diff --git a/extensions/amavis_quarantine/templates/amavis_quarantine/index.html b/extensions/amavis_quarantine/templates/amavis_quarantine/index.html index b926d19d6..5c979149c 100644 --- a/extensions/amavis_quarantine/templates/amavis_quarantine/index.html +++ b/extensions/amavis_quarantine/templates/amavis_quarantine/index.html @@ -1,7 +1,8 @@ {% extends "common/email_listing.html" %} {% load i18n %} -{% block css %} - +{% block html_head %} + +{{ block.super }} {% endblock %} {% block js %} mysubmit = function(event, name) { diff --git a/extensions/webmail/templates/webmail/folder.html b/extensions/webmail/templates/webmail/folder.html index 70f4de066..1abc6a5b2 100644 --- a/extensions/webmail/templates/webmail/folder.html +++ b/extensions/webmail/templates/webmail/folder.html @@ -1,9 +1,9 @@ {% extends "layout_simple.html" %} {% load i18n %} {% block html_head %} - + - + - + + + + {{ block.super }}