PageRenderTime 25ms CodeModel.GetById 16ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/modules/mod_admin_predicate/templates/admin_predicate.tpl

http://github.com/zotonic/zotonic
Smarty Template | 67 lines | 55 code | 12 blank | 0 comment | 6 complexity | 689701ce546de1e3d237a85e7e46a78c MD5 | raw file
 1{% extends "admin_base.tpl" %}
 2
 3{% block title %}{_ Predicates _}{% endblock %}
 4
 5{% block content %}
 6{% with m.acl.is_admin as editable %}
 7<div class="admin-header">
 8
 9    <h2>{_ Predicates _}</h2>
10
11    <p>{_ A predicate denotes traits or aspects of a page and expresses a relationship between two pages.
12    The relation is always directed, from the subject to the object.<br/>Predicates are defined in ontologies like <a href="http://sioc-project.org/">SIOC</a>.  On this page you can define the predicates known to Zotonic. _}</p>
13</div>
14
15{% if editable %}
16<div class="well">
17    {% button class="btn btn-primary" text=_"Make a new predicate" action={dialog_predicate_new title=""} %}
18</div>
19{% endif %}
20
21<div>
22    <table class="table table-striped do_adminLinkedTable">
23        <thead>
24            <tr>
25                <th width="20%">{_ Title _}</th>
26                <th width="20%">{_ Name _}</th>
27                <th width="40%">{_ URI _}</th>
28                <th width="20%">&nbsp;</th>
29            </tr>
30        </thead>
31
32        <tbody id="predicate-list">
33            {% for name,p in m.predicate %}
34            <tr id="{{ #li.name }}" data-href="{% url admin_edit_rsc id=p.id %}" data-id="{{ p.id }}">
35                <td>{{ p.title|default:"&nbsp;" }}</td>
36                <td>{{ p.name|default:"&nbsp;" }}</td>
37                <td>{{ p.uri|default:"&nbsp;" }}</td>
38                <td>
39                    <div class="pull-right buttons">
40                        {% button class="btn btn-default btn-xs" disabled=p.is_protected text=_"delete" action={dialog_delete_rsc id=p.id} %}
41                        <a href="{% url admin_edit_rsc id=p.id %}" class="btn btn-default btn-xs">{_ edit _}</a>
42                    </div>
43                    {{ p.reversed|yesno:"reversed,&nbsp;" }}
44                </td>
45            </li>
46            {% empty %}
47            <li>
48                {_ No predicates found. _}
49            </li>
50            {% endfor %}
51        </ul>
52
53    </div>
54</div>
55{% endwith %}
56
57{% javascript %}
58    pubzub.subscribe("~site/rsc/+", function(_topic, args) {
59        if (args.payload._record == 'rsc_update_done' && args.payload.action == 'delete') {
60            $('#predicate-list tr[data-id='+args.payload.id+']').remove();
61        }
62    });
63{% endjavascript %}
64
65{% endblock %}
66
67