mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-21 06:18:45 +02:00
wip: #65, more messages added. Ticket reported to a future release.
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user