itemlist.html 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. {% from 'topic/reply/_macro.html' import like,no_replies %}
  2. {% set replies = topic.replies.paginate(1,10) %}
  3. <style>
  4. .like-active {
  5. color:#a40004;
  6. }
  7. .like-no-active {
  8. color:#ccc;
  9. }
  10. .reply-order a{
  11. padding: 1px 2px;
  12. color: #778087;
  13. text-decoration: none;
  14. font-size:13px;
  15. }
  16. .reply-count {
  17. font-size:12px;
  18. color:#999;
  19. }
  20. .reply-content a {
  21. color:#778087;
  22. }
  23. </style>
  24. <div class="panel panel-default">
  25. <div class="panel-heading">
  26. {{ _('Received %(total)s replies',total=replies.total) }}
  27. <ul class="pull-right list-inline reply-order">
  28. <li><a href="{{ url_for('topic.topic',topicId=topic.id,orderby='time')}}"> <i class="icon icon-time"></i>{{_('time')}}</a></li>
  29. <li><a href="{{ url_for('topic.topic',topicId=topic.id,orderby='like')}}"> <i class="icon icon-thumbs-up"></i>{{_('likers')}}</a></li>
  30. </ul>
  31. </div>
  32. {% if replies.items %}
  33. {% set num = 1 %}
  34. {% for reply in replies.items %}
  35. {% set user = reply.author %}
  36. <div class="panel-body media" id="reply-{{ reply.id }}" style="border-bottom:1px solid #eee;margin:0">
  37. <div class="media-left">
  38. <a href="{{ url_for('user.user',username=reply.author.username) }}">
  39. <img class="media-object img-circle" src="{{ url_for('avatar',text=user.username) }}" alt="avatar" style="width:64px;height:64px"/>
  40. </a>
  41. </div>
  42. <div class="media-body">
  43. <small class="media-heading" style="color:#999">
  44. <span>{{ link.user(reply.author.username)}}</span>
  45. <span>{{ reply.created_at | timesince }}</span>
  46. <a name="reply{{ reply.id }}" class="anchor" href="#reply{{ num }}" aria-hidden="true">#{{ num }}</a>
  47. </small>
  48. <div class="reply-content">
  49. {{ reply.content | safe_clean }}
  50. </div>
  51. </div>
  52. <div class="media-right">
  53. {{ like(reply) }}
  54. </div>
  55. <div class="media-right">
  56. <a href="javascript:void(0);" style="color:#ccc;padding:0" class="reply-author btn btn-sm" data-id="{{ reply.author.username }}" title="回复">
  57. <i class="fa fa-reply"></i>
  58. </a>
  59. </div>
  60. </div>
  61. {% set num = num + 1 %}
  62. {% endfor %}
  63. {{ p_footer(replies,'topic.topic',dict(topicId=topic.id))}}
  64. {% else %}
  65. {{ no_replies() }}
  66. {% endif %}
  67. </div>
  68. {% include "topic/reply/form.html" %}