PageRenderTime 41ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/admin/themes/default/pages/manage_posts.twig

http://github.com/vito/chyrp
Twig Template | 74 lines | 72 code | 2 blank | 0 comment | 6 complexity | 687ddb9a527ab977fff68217eac1201f MD5 | raw file
  1. {% extends "layout.twig" %}
  2. {% block title %}${ "Manage Posts" | 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_posts" />
  8. <div class="left pad margin-right">
  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. <div class="left pad">
  16. <h3>${ "Browse by month:" | translate }</h3>
  17. <select name="month">
  18. <option value="">----------</option>
  19. {% for archive in theme.archives_list %}
  20. <option value="${ archive.when | strftime("%Y-%m") }"${ GET.month | option_selected(archive.when | strftime("%Y-%m")) }>${ archive.when | strftime("%B %Y") } ($archive.count)</option>
  21. {% endfor %}
  22. </select>
  23. <button type="submit" class="inline">${ "Show &rarr;" | translate }</button>
  24. </div>
  25. <div class="clear"></div>
  26. </fieldset>
  27. </form>
  28. <br />
  29. <h2>{% if GET.query %}${ "Search Results" | translate }{% else %}${ "Last 25 Posts" | translate }{% endif %}</h2>
  30. <table border="0" cellspacing="0" cellpadding="0" class="wide">
  31. <thead>
  32. <tr class="head">
  33. <th>${ "Title" | translate }</th>
  34. <th>${ "Posted" | translate }</th>
  35. <th>${ "Status" | translate }</th>
  36. <th>${ "Author" | translate }</th>
  37. ${ trigger.call("manage_posts_column_header") }
  38. <th colspan="2">${ "Controls" | translate }</th>
  39. </tr>
  40. </thead>
  41. <tbody>
  42. {% for post in posts.paginated %}
  43. <tr id="post_$post.id" class="post $post.status_class{% if loop.last %} last{% endif %}">
  44. <td class="main"><a href="$post.url">${ post.title | truncate }</a></td>
  45. <td>${ post.created_at | strftime }</td>
  46. <td>$post.status_name</td>
  47. <td>$post.user.login</td>
  48. ${ trigger.call("manage_posts_column", post) }
  49. {% if post.editable and post.deletable %}
  50. <td class="controls">${ post.edit_link('<img src="'~ theme_url ~'/images/icons/edit.png" alt="edit" /> '~("edit" | translate)) }</td>
  51. <td class="controls">${ post.delete_link('<img src="'~ theme_url ~'/images/icons/delete.png" alt="delete" /> '~("delete" | translate)) }</td>
  52. {% elseif post.editable or post.deletable %}
  53. ${ post.edit_link('<img src="'~ theme_url ~'/images/icons/edit.png" alt="edit" /> '~("edit" | translate), '<td class="controls" colspan="2">', '</td>') }
  54. ${ post.delete_link('<img src="'~ theme_url ~'/images/icons/delete.png" alt="delete" /> '~("delete" | translate), '<td class="controls" colspan="2">', '</td>') }
  55. {% endif %}
  56. </tr>
  57. {% else %}
  58. <tr class="last">
  59. <td colspan="6" class="center"><span class="sub">${ "(none)" | translate }</span></td>
  60. </tr>
  61. {% endfor %}
  62. </tbody>
  63. </table>
  64. {% if posts.paginated and posts.pages > 1 %}
  65. <br />
  66. <div class="pagination">
  67. $posts.next_link
  68. $posts.prev_link
  69. <span class="pages">${ "Page %d of %d" | translate | format(posts.page, posts.pages) }</span>
  70. </div>
  71. {% endif %}
  72. {% endblock %}