Refactored extension API

* Modoboa extensions must now declare themselves
* Now using django 1.3 *staticfiles* module
* Better distinction between *static* content and *media* content

see #197
This commit is contained in:
Antoine Nguyen
2012-05-22 11:40:50 +02:00
parent 184177b405
commit 86f855220a
49 changed files with 441 additions and 436 deletions
+1 -1
View File
@@ -110,7 +110,7 @@ class EmailListing(object):
def render_navbar(page, baseurl=None):
if page is None:
return ""
context = {"page" : page, "MEDIA_URL" : settings.MEDIA_URL, "baseurl" : baseurl}
context = {"page" : page, "STATIC_URL" : settings.STATIC_URL, "baseurl" : baseurl}
return render_to_string("common/pagination_bar.html", context)
def fetch(self, request, id_start, id_stop):
+2 -2
View File
@@ -17,7 +17,7 @@ def _render(request, tpl, user_context):
"""Custom rendering function
Just a wrapper which automatically adds a RequestContext instance
(useful to use settings variables like MEDIA_URL inside templates)
(useful to use settings variables like STATIC_URL inside templates)
"""
return render_to_response(tpl, user_context,
context_instance=template.RequestContext(request))
@@ -109,7 +109,7 @@ def static_url(path):
"""
if path.startswith("/"):
path = path[1:]
return "%s%s" % (settings.MEDIA_URL, path)
return "%s%s" % (settings.STATIC_URL, path)
def size2integer(value):
"""Try to convert a string representing a size to an integer value