Misc. updates.

see #204
This commit is contained in:
Antoine Nguyen
2012-04-03 12:56:06 +02:00
parent 975b40e7d8
commit 9db910254d
10 changed files with 87 additions and 64 deletions
+1 -2
View File
@@ -126,6 +126,5 @@ def render_link(linkdef, mdclass=None):
class="{{ mdclass }}{% if link.class %} {{ link.class }}{% endif %}"
{% if link.confirm %} onclick="return confirm('{{ link.confirm }}')"{% endif %}>
{% if link.img %}<i class="{{ link.img }}"></i>{% endif %}
{{ link.label }}
</a>""")
{{ link.label }}</a>""")
return t.render(Context(dict(link=linkdef, mdclass=mdclass)))
+3 -11
View File
@@ -35,18 +35,10 @@ def _render_error(request, errortpl="error", user_context={}):
context_instance=template.RequestContext(request))
def render_actions(actions):
t = template.Template("""
{% for a in actions %}
<a href="{{ a.url }}" name="{{ a.name }}"
{% if a.modal %}data-toggle="ajaxmodal"{% endif %}
{% if a.modalcb %}modalcb="{{ a.modalcb }}"{% endif %}
{% if a.confirm %}onclick="return confirm('{{ a.confirm }}')"{% endif %}>
<i class="{{ a.img }}" title="{{ a.title }}"></i></a>
{% endfor %}
t = template.Template("""{% load libextras %}
{% for a in actions %}{% render_link a %}{% endfor %}
""")
return t.render(template.Context({
"actions" : actions
}))
return t.render(template.Context(dict(actions=actions)))
def _ctx_ok(url):
return {"status" : "ok", "url" : url}