topic_list_base.html 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. {% import 'base/link.html' as link_base %}
  2. {% for topic in topics %}
  3. {% set author = topic.author %}
  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=author.username) }}">
  9. <img class="media-object img-circle" src="{{ link_base.avatar(author) }}" alt="avatar" style="width:48px;height:48px">
  10. </a>
  11. </div>
  12. <div class="media-body">
  13. <div class="media-heading">
  14. {% if topic.is_top %}
  15. <span><i class="icon-pushpin text-danger">&nbsp</i></span>
  16. {% endif %}
  17. <a href="{{url_for('topic.topic',topicId=topic.uid)}}" style="color:#555">{{ topic.title}}</a>
  18. </div>
  19. <span class="visible-xs-inline">
  20. <small style="font-size:10px;">由{{ link_base.user(topic.author.username) }}</small>
  21. <small style="color:#999;font-size:10px;">
  22. {{ topic.publish | timesince }}
  23. 发布
  24. </small>
  25. </span>
  26. <div class="hidden-xs">
  27. {% for tag in topic.tags %}
  28. {{ link_base.tag(tag)}}
  29. {% endfor %}
  30. </div>
  31. </div>
  32. </div>
  33. <div class="col-md-2 hidden-xs" style="padding-top:5px;">
  34. <small>{{ link_base.user(topic.author.username) }}</small>
  35. <br/>
  36. <small style="color:#999;">
  37. {{ topic.publish | timesince }}
  38. </small>
  39. </div>
  40. <div class="col-md-2 hidden-xs" style="padding:5px 5px 5px 20px;margin:0">
  41. {% set rep,read = topic.id | get_read_count %}
  42. <span>{{ rep }}</span> /
  43. <span style="font-size:12px;color:#999;">
  44. {{ read }}
  45. </span>
  46. </div>
  47. <div class="col-md-2 hidden-xs" style="padding:5px;margin:0;">
  48. {% set last_reply = topic.replies.first() %}
  49. {% if last_reply %}
  50. <span style="font-size:12px">{{ link_base.user(last_reply.author.username) }}</span>
  51. <br/>
  52. <span style="font-size:12px;color:#999;">{{ last_reply.publish | timesince }}</span>
  53. {% else %}
  54. <span style="font-size:12px">{{ link_base.user(topic.author.username) }}</span>
  55. <br/>
  56. <span style="font-size:12px;color:#999;">{{ topic.publish | timesince }}</span>
  57. {% endif %}
  58. </div>
  59. </div>
  60. </div>
  61. {% endfor %}