topic_list_base.html 2.6 KB

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