topic_list_base.html 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. {% from 'base/link.html' import user %}
  2. {% if topics.items %}
  3. <div class="panel-body" style="padding-top:0;">
  4. {% for topic in topics.items %}
  5. <div class="row" style="padding:5px 0;border-bottom:1px solid #f6e1e1;">
  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)}}">{{ topic.title}}</a></div>
  14. {% for tag in topic.tags %}
  15. <span class="label label-default" style="font-size:12px;background:rgba(1,126,102,.08);color:#337ab7;display: inline-block">
  16. <a href="{{ url_for('tag.tag',tag = tag.tagname) }}" style="font-weight:normal">{{ tag.tagname }}</a>
  17. </span>
  18. {% endfor %}
  19. </div>
  20. </div>
  21. <div class="col-md-2" style="padding:5px;margin:0">
  22. <span style="font-size:12px">{{ user(topic.author.username) }}</span>
  23. <br/>
  24. <span style="font-size:12px;color:#999;">
  25. {{ topic.publish | timesince }}
  26. </span>
  27. </div>
  28. <div class="col-md-2 hidden-xs" style="padding:5px 5px 5px 20px;margin:0">
  29. {% set rep,read = topic.id | get_read_count %}
  30. <span>{{ rep }}</span> /
  31. <span style="font-size:12px;color:#999;">
  32. {{ read }}
  33. </span>
  34. </div>
  35. <div class="col-md-2 hidden-xs" style="padding:5px;margin:0;">
  36. {% set last_reply = topic.replies.first() %}
  37. {% if last_reply %}
  38. <span style="font-size:12px">{{ user(last_reply.author.username) }}</span>
  39. <br/>
  40. <span style="font-size:12px;color:#999;">{{ last_reply.publish | timesince }}</span>
  41. {% else %}
  42. <span style="font-size:12px">{{ user(topic.author.username) }}</span>
  43. <br/>
  44. <span style="font-size:12px;color:#999;">{{ topic.publish | timesince }}</span>
  45. {% endif %}
  46. </div>
  47. </div>
  48. {% endfor %}
  49. </div>
  50. {% else %}
  51. <div class="panel-body">
  52. <span class="text-center" style="display:block;width:100%;color:#999">
  53. 没有帖子
  54. </span>
  55. </div>
  56. {% endif %}