/modules/mod_comment/templates/admin_comments.tpl

http://github.com/zotonic/zotonic · Smarty Template · 66 lines · 61 code · 5 blank · 0 comment · 5 complexity · 8a13be7e9ee30ece5ad3e8588f10f369 MD5 · raw file

  1. {% extends "admin_base.tpl" %}
  2. {% block title %}
  3. {_ Recent Comments _}
  4. {% endblock %}
  5. {% block content %}
  6. <div class="admin-header">
  7. <h2>{_ Recent comments _}</h2>
  8. </div>
  9. <div class="well">
  10. <a class="btn btn-default btn-sm" href="{% url admin_comments_settings %}">{_ Settings _}</a>
  11. </div>
  12. <div>
  13. <table class="table table-striped do_adminLinkedTable">
  14. <thead>
  15. <tr>
  16. <th width="15%">{_ Added on _}</th>
  17. <th width="15%">{_ Page _}</th>
  18. <th width="35%">{_ Message _}</th>
  19. <th width="35%">{_ Name _} / {_ Email _}</th>
  20. </tr>
  21. </thead>
  22. <tbody>
  23. {% with m.search.paged[{recent_comments page=q.page}] as result %}
  24. {% for comment in result %}
  25. {% with comment.id as id %}
  26. <tr id="{{ #comment.id }}" {% if not comment.is_visible %}class="unpublished" {% endif %} data-href="{{ m.rsc[comment.rsc_id].page_url }}#comment-{{ id }}">
  27. <td>{{ comment.created|date:_"d M Y, H:i" }}</td>
  28. <td>{{ m.rsc[comment.rsc_id].title|truncate:20 }}</td>
  29. <td>{{ comment.message|striptags|truncate:40 }}</td>
  30. <td title="{{ comment.email|escape }}">
  31. <div class="pull-right buttons">
  32. {% button class="btn btn-default btn-xs" text=_"view" action={redirect location=[m.rsc[comment.rsc_id].page_url,"#comment-",id|format_integer]|join } %}
  33. {% include "_admin_comments_toggledisplay.tpl" element=#comment.id %}
  34. {% button class="btn btn-default btn-xs"
  35. text=_"delete"
  36. action={confirm text=_"Are you sure you wish to delete that comment?"
  37. action={postback delegate="controller_admin_comments"
  38. postback={comment_delete id=id on_success={slide_fade_out target=#comment.id}}}} %}
  39. </div>
  40. {% if comment.user_id %}
  41. {{ m.rsc[comment.user_id].title }} (#{{ comment.user_id }})
  42. {% else %}
  43. {{ comment.name|truncate:20 }} &ndash;
  44. {{ comment.email|truncate:20|escape }}
  45. {% endif %}
  46. </td>
  47. </tr>
  48. {% endwith %}
  49. {% empty %}
  50. <tr>
  51. <td colspan="4">
  52. {_ There are no comments. _}
  53. </td>
  54. </tr>
  55. {% endfor %}
  56. </tbody>
  57. </table>
  58. {% pager result=result dispatch="admin_comments" qargs %}
  59. {% endwith %}
  60. </div>
  61. {% endblock %}