wip: #65, more messages added. Ticket reported to a future release.

This commit is contained in:
tonio
2010-07-27 10:37:06 +02:00
parent 5043789aa7
commit 9888be1ba9
11 changed files with 63 additions and 20 deletions
+22
View File
@@ -1,6 +1,7 @@
import os
from django.conf import settings
from django import template
from django.contrib import messages
from modoboa.lib import exec_cmd
register = template.Library()
@@ -26,3 +27,24 @@ def join(items, sep=','):
res += sep
res += "%s : '%s'" % (k, v)
return res
@register.simple_tag
def display_messages(msgs):
from django.contrib import messages
text = ""
level = "info"
for m in msgs:
level = m.tags
text += str(m) + "\\\n"
return """
<script type="text/javascript">
window.addEvent("domready", function() {
infobox.%s("%s");
infobox.hide(3);
});
</script>
""" % (level, text)