/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. {% block title %}{_ Predicates _}{% endblock %}
  3. {% block content %}
  4. {% with m.acl.is_admin as editable %}
  5. <div class="admin-header">
  6. <h2>{_ Predicates _}</h2>
  7. <p>{_ A predicate denotes traits or aspects of a page and expresses a relationship between two pages.
  8. 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>
  9. </div>
  10. {% if editable %}
  11. <div class="well">
  12. {% button class="btn btn-primary" text=_"Make a new predicate" action={dialog_predicate_new title=""} %}
  13. </div>
  14. {% endif %}
  15. <div>
  16. <table class="table table-striped do_adminLinkedTable">
  17. <thead>
  18. <tr>
  19. <th width="20%">{_ Title _}</th>
  20. <th width="20%">{_ Name _}</th>
  21. <th width="40%">{_ URI _}</th>
  22. <th width="20%">&nbsp;</th>
  23. </tr>
  24. </thead>
  25. <tbody id="predicate-list">
  26. {% for name,p in m.predicate %}
  27. <tr id="{{ #li.name }}" data-href="{% url admin_edit_rsc id=p.id %}" data-id="{{ p.id }}">
  28. <td>{{ p.title|default:"&nbsp;" }}</td>
  29. <td>{{ p.name|default:"&nbsp;" }}</td>
  30. <td>{{ p.uri|default:"&nbsp;" }}</td>
  31. <td>
  32. <div class="pull-right buttons">
  33. {% button class="btn btn-default btn-xs" disabled=p.is_protected text=_"delete" action={dialog_delete_rsc id=p.id} %}
  34. <a href="{% url admin_edit_rsc id=p.id %}" class="btn btn-default btn-xs">{_ edit _}</a>
  35. </div>
  36. {{ p.reversed|yesno:"reversed,&nbsp;" }}
  37. </td>
  38. </li>
  39. {% empty %}
  40. <li>
  41. {_ No predicates found. _}
  42. </li>
  43. {% endfor %}
  44. </ul>
  45. </div>
  46. </div>
  47. {% endwith %}
  48. {% javascript %}
  49. pubzub.subscribe("~site/rsc/+", function(_topic, args) {
  50. if (args.payload._record == 'rsc_update_done' && args.payload.action == 'delete') {
  51. $('#predicate-list tr[data-id='+args.payload.id+']').remove();
  52. }
  53. });
  54. {% endjavascript %}
  55. {% endblock %}