PageRenderTime 41ms CodeModel.GetById 31ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

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