topic_list_base.html 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. {% import 'base/link.html' as link_base %}
  2. {% if topics.items %}
  3. {% for topic in topics.items %}
  4. {% set author = topic.author %}
  5. <div class="panel-body" style="padding:6px;border-bottom:1px solid #eee">
  6. <div class="row">
  7. <div class="col-md-6 media">
  8. <div class="media-left">
  9. <a href="{{ url_for('user.user',user_url=author.username) }}">
  10. <img class="media-object img-circle" src="{{ link_base.avatar(author.infor) }}" alt="avatar" style="width:48px;height:48px">
  11. </a>
  12. </div>
  13. <div class="media-body">
  14. <div class="media-heading"> <a href="{{url_for('topic.topic',uid=topic.uid)}}" style="color:#555">{{ topic.title}}</a></div>
  15. <span class="visible-xs-inline">
  16. <small style="font-size:10px;">由{{ link_base.user(topic.author.username) }}</small>
  17. <small style="color:#999;font-size:10px;">
  18. {{ topic.publish | timesince }}
  19. 发布
  20. </small>
  21. </span>
  22. <div class="hidden-xs">
  23. {% for tag in topic.tags %}
  24. {{ link_base.tag(tag)}}
  25. {% endfor %}
  26. </div>
  27. </div>
  28. </div>
  29. <div class="col-md-2 hidden-xs" style="padding-top:5px;">
  30. <small>{{ link_base.user(topic.author.username) }}</small>
  31. <br/>
  32. <small style="color:#999;">
  33. {{ topic.publish | timesince }}
  34. </small>
  35. </div>
  36. <div class="col-md-2 hidden-xs" style="padding:5px 5px 5px 20px;margin:0">
  37. {% set rep,read = topic.id | get_read_count %}
  38. <span>{{ rep }}</span> /
  39. <span style="font-size:12px;color:#999;">
  40. {{ read }}
  41. </span>
  42. </div>
  43. <div class="col-md-2 hidden-xs" style="padding:5px;margin:0;">
  44. {% set last_reply = topic.replies.first() %}
  45. {% if last_reply %}
  46. <span style="font-size:12px">{{ link_base.user(last_reply.author.username) }}</span>
  47. <br/>
  48. <span style="font-size:12px;color:#999;">{{ last_reply.publish | timesince }}</span>
  49. {% else %}
  50. <span style="font-size:12px">{{ link_base.user(topic.author.username) }}</span>
  51. <br/>
  52. <span style="font-size:12px;color:#999;">{{ topic.publish | timesince }}</span>
  53. {% endif %}
  54. </div>
  55. </div>
  56. </div>
  57. {% endfor %}
  58. {% else %}
  59. <div class="panel-body">
  60. <span class="text-center" style="display:block;width:100%;color:#999">
  61. 没有帖子
  62. </span>
  63. </div>
  64. {% endif %}