KXStudio Website https://kx.studio/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

manage_pages.twig 4.9KB

9 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. {% extends "layout.twig" %}
  2. {% block title %}${ "Manage Pages" | translate }{% endblock %}
  3. {% block content %}
  4. <h2>${ "Need more detail?" | translate }</h2>
  5. <form class="detail" action="index.php" method="get" accept-charset="utf-8">
  6. <fieldset>
  7. <input type="hidden" name="action" value="manage_pages" />
  8. <div class="pad">
  9. <h3>
  10. ${ "Search&hellip;" | translate }
  11. <a href="{% admin "help&id=filtering_results" %}" class="help emblem"><img src="$theme_url/images/icons/help.png" alt="help" /></a>
  12. </h3>
  13. <input class="text" type="text" name="query" value="${ GET.query | escape }" id="query" /> <button type="submit" class="inline">${ "Search &rarr;" | translate }</button>
  14. </div>
  15. </fieldset>
  16. </form>
  17. <br />
  18. <h2>{% if GET.query %}${ "Search Results" | translate }{% else %}${ "Last 25 Pages" | translate }{% endif %}</h2>
  19. <table border="0" cellspacing="0" cellpadding="0" class="wide">
  20. <thead>
  21. <tr class="head">
  22. <th>${ "Title" | translate }</th>
  23. <th>${ "Created" | translate }</th>
  24. <th>${ "Last Updated" | translate }</th>
  25. <th>${ "Author" | translate }</th>
  26. ${ trigger.call("manage_pages_column_header") }
  27. <th colspan="2">${ "Controls" | translate }</th>
  28. </tr>
  29. </thead>
  30. <tbody>
  31. {% for page in pages.paginated %}
  32. <tr id="page_$page.id" class="page{% if loop.last %} last{% endif %}">
  33. <td class="main"><a href="$page.url">${ page.title | truncate }</a></td>
  34. <td>${ page.created_at | strftime }</td>
  35. <td>{% if page.updated %}${ page.updated_at | strftime }{% else %}<span class="sub">${ "never" | translate }</span>{% endif %}</td>
  36. <td>$page.user.login</td>
  37. ${ trigger.call("manage_pages_column", page) }
  38. {% if page.editable and page.deletable %}
  39. <td class="controls">${ page.edit_link('<img src="'~ theme_url ~'/images/icons/edit.png" alt="edit" /> '~("edit" | translate)) }</td>
  40. <td class="controls">${ page.delete_link('<img src="'~ theme_url ~'/images/icons/delete.png" alt="delete" /> '~("delete" | translate)) }</td>
  41. {% else %}
  42. ${ page.edit_link('<img src="'~ theme_url ~'/images/icons/edit.png" alt="edit" /> '~("edit" | translate), '<td class="controls" colspan="2">', '</td>') }
  43. ${ page.delete_link('<img src="'~ theme_url ~'/images/icons/delete.png" alt="delete" /> '~("delete" | translate), '<td class="controls" colspan="2">', '</td>') }
  44. {% endif %}
  45. </tr>
  46. {% else %}
  47. <tr class="last">
  48. <td colspan="6" class="center"><span class="sub">${ "(none)" | translate }</span></td>
  49. </tr>
  50. {% endfor %}
  51. </tbody>
  52. </table>
  53. {% if pages.paginated and pages.pages > 1 %}
  54. <br />
  55. <div class="pagination">
  56. $pages.next_link
  57. $pages.prev_link
  58. <span class="pages">${ "Page %d of %d" | translate | format(pages.page, pages.pages) }</span>
  59. </div>
  60. {% endif %}
  61. {% if pages.total %}
  62. <br />
  63. <h2>${ "Reorder Pages" | translate }</h2>
  64. <form id="reorder_pages" action="{% admin "reorder_pages" %}" method="post">
  65. <ul class="sort_pages">
  66. {% for item in theme.pages_list %}
  67. <li class="page-item" id="page_list_$item.page.id">
  68. <noscript><input type="text" size="2" name="list_order[$item.page.id]" value="$item.page.list_order" class="center" /></noscript>
  69. <div>$item.page.title</div>
  70. {% if item.has_children %}<ul>{% endif %}
  71. {% if not item.has_children %}</li>{% endif %}
  72. {% for ul, li in item.end_tags %}
  73. $ul
  74. $li
  75. {% endfor %}
  76. {% endfor %}
  77. </ul>
  78. <noscript>
  79. <div class="buttons">
  80. <button type="submit" class="yay">
  81. <img src="$theme_url/images/icons/success.png" alt="success" />${ "Reorder" | translate }
  82. </button>
  83. </div>
  84. </noscript>
  85. </form>
  86. {% endif %}
  87. {% endblock %}