mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
Fixed signal.
This commit is contained in:
@@ -101,5 +101,10 @@ def extra_static_content(caller, st_type, user):
|
||||
@register.filter(name='localize_header_name')
|
||||
def localize_header_name(headername):
|
||||
""" Localizes the header names """
|
||||
names = {"From": _("From"), "To": _("To"), "Date": _("Date"), "Subject": _("Subject")}
|
||||
names = {
|
||||
"From": _("From"),
|
||||
"To": _("To"),
|
||||
"Date": _("Date"),
|
||||
"Subject": _("Subject")
|
||||
}
|
||||
return names.get(headername, headername)
|
||||
|
||||
@@ -220,9 +220,9 @@ def get_static_content(sender, caller, st_type, user, **kwargs):
|
||||
user.role in ["SuperAdmins", "SimpleUsers"]
|
||||
)
|
||||
if condition:
|
||||
return []
|
||||
return ""
|
||||
if st_type == "css":
|
||||
return ["""<style>
|
||||
return """<style>
|
||||
.resource {
|
||||
padding: 10px 15px;
|
||||
}
|
||||
@@ -235,14 +235,14 @@ def get_static_content(sender, caller, st_type, user, **kwargs):
|
||||
color: #000000;
|
||||
}
|
||||
</style>
|
||||
"""]
|
||||
return ["""
|
||||
"""
|
||||
return """
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$(".progress").tooltip();
|
||||
});
|
||||
</script>
|
||||
"""]
|
||||
"""
|
||||
|
||||
|
||||
@receiver(admin_signals.extra_admin_content)
|
||||
|
||||
@@ -70,7 +70,7 @@ def extra_role_permissions(sender, role, **kwargs):
|
||||
def static_content(sender, caller, st_type, user, **kwargs):
|
||||
"""Add extra static content."""
|
||||
if caller != "domains" or st_type != "js":
|
||||
return []
|
||||
return ""
|
||||
|
||||
t = Template("""<script src="{{ STATIC_URL }}relaydomains/js/relay_domains.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
@@ -80,7 +80,7 @@ def static_content(sender, caller, st_type, user, **kwargs):
|
||||
});
|
||||
</script>
|
||||
""")
|
||||
return [t.render(Context({"STATIC_URL": settings.STATIC_URL}))]
|
||||
return t.render(Context({"STATIC_URL": settings.STATIC_URL}))
|
||||
|
||||
|
||||
@receiver(admin_signals.extra_domain_filters)
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ urlpatterns += patterns(
|
||||
extra_routes = core_signals.extra_uprefs_routes.send(sender="urls")
|
||||
if extra_routes:
|
||||
extra_routes = reduce(
|
||||
lambda a, b: a + b, [route for route in extra_routes])
|
||||
lambda a, b: a + b, [route[1] for route in extra_routes])
|
||||
urlpatterns += patterns(
|
||||
'',
|
||||
*extra_routes
|
||||
|
||||
Reference in New Issue
Block a user