/doc/tpl/admin/_admin_dashboard_example.tpl

https://code.google.com/p/zotonic/ · Smarty Template · 47 lines · 36 code · 11 blank · 0 comment · 3 complexity · 3e63ced178f7b1c1caad75cc417aafb1 MD5 · raw file

  1. {% extends "admin_widget_dashboard.tpl" %}
  2. {# Renders admin dashboard widget. 5 latest resources of category "mycat" will be displayed. #}
  3. {# Headline block. Caption, some buttons, etc #}
  4. {% block widget_headline %}
  5. {_ My stuff _}
  6. {# A button may be displayed at right corner of widget heading. #}
  7. {% button class="right" action={redirect dispatch="admin_overview_rsc" qcat="mycat"} text=_"show all" %}
  8. {% endblock %}
  9. {# Additional css-class for container. Optional. #}
  10. {% block widget_class %}last{% endblock %}
  11. {# Your data goes here. For example, it could be usual zotonic admin listing: #}
  12. {% block widget_content %}
  13. <ul class="short-list">
  14. <li class="headers clearfix">
  15. <span class="zp-5">#</span>
  16. <span class="zp-65">{_ Title _}</span>
  17. <span class="zp-25">{_ Actions _}</span>
  18. </li>
  19. {% for id in m.search[{latest cat="mycat" pagelen="5"}] %}
  20. <li {% if not m.rsc[id].is_published %}class="unpublished" {% endif %}>
  21. <a href="{% url admin_edit_rsc id=id %}" class="clearfix">
  22. <span class="zp-5">{% forloop.counter %}</span>
  23. <span class="zp-65">{{ m.rsc[id].title|striptags|default:"<em>untitled</em>" }}</span>
  24. <span class="zp-25">
  25. {% button text=_"view" action={redirect id=id} %}
  26. {% button text=_"edit" action={redirect dispatch="admin_edit_rsc" id=id} %}
  27. </span>
  28. </a>
  29. </li>
  30. {% empty %}
  31. <li>
  32. {_ No stuff. _}
  33. </li>
  34. {% endfor %}
  35. </ul>
  36. {% endblock %}