replies.html 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <div class="panel panel-default">
  2. <div class="panel-heading">
  3. 共收到{{ replies.total }}条回复
  4. </div>
  5. {% if replies.items %}
  6. {% set num = 1 %}
  7. {% for reply in replies.items %}
  8. <div class="panel-body media" style="border-bottom:1px solid #eee;margin:0">
  9. <div class="media-left">
  10. <a href="#">
  11. <img class="media-object img-circle" src="{{ url_for('static',filename='images/Moo.png')}}" alt="..." style="width:48px;height:48px">
  12. </a>
  13. </div>
  14. <div class="media-body">
  15. <small class="media-heading" style="color:#999">
  16. <span>{{ link_base.user(reply.author.username)}}</span>
  17. <span>{{ reply.publish}}</span>
  18. <a name="reply{{ num }}" class="anchor" href="#reply{{ num }}" aria-hidden="true">#{{ num }}</a>
  19. </small>
  20. <div>
  21. {{ reply.content}}
  22. </div>
  23. </div>
  24. </div>
  25. {% set num = num + 1 %}
  26. {% endfor %}
  27. {% if replies.pages > 1 %}
  28. <div class="panel-footer">
  29. {% from 'base/paginate.html' import paginate %}
  30. {{ paginate(replies,'topic.topic',dict(uid=topic.uid))}}
  31. </div>
  32. {% endif %}
  33. {% else %}
  34. <div class="panel-body">
  35. <span class="text-center" style="display:block;width:100%;color:#999">
  36. 暂无回复
  37. </span>
  38. </div>
  39. {% endif %}
  40. </div>
  41. <div class="panel panel-default">
  42. {% if g.user.is_authenticated %}
  43. <div class="panel-heading">
  44. 回帖
  45. </div>
  46. <div class="panel-body">
  47. <form action="{{ url_for('topic.reply',uid=topic.id)}}" method="POST">
  48. {{ form.hidden_tag() }}
  49. {{ form.content(class='form-control')}}
  50. <button class="btn btn-sm btn-primary" type="submit">提交问题</button>
  51. </form>
  52. </div>
  53. {% else %}
  54. <div class="panel-body" style="border:1px dashed #337ab7;margin:5px;">
  55. <span class="text-center" style="display:block;width:100%;color:#999">
  56. <span class="glyphicon glyphicon-lock" aria-hidden="true" style="font-size:16px;"></span>
  57. 你需要<a href="{{ url_for('auth.login') }}">登陆</a>后才能发表回复
  58. </span>
  59. </div>
  60. {% endif %}
  61. </div>