content.html 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. {% extends 'base/base.html' %}
  2. {% block style %}
  3. {{ super() }}
  4. <style>
  5. .vote {
  6. font-size: 10px;
  7. line-height: 1;
  8. padding: 2px 8px;
  9. border: 1px solid #C4C4C4;
  10. border-radius: 3px;
  11. color: #778;
  12. display: inline-block;
  13. vertical-align: baseline;
  14. text-align: center;
  15. background-color: #fff;
  16. text-decoration: none;
  17. }
  18. </style>
  19. {% endblock %}
  20. {% block script -%}
  21. {{ super() }}
  22. <script type="text/javascript">
  23. var voteData = {
  24. 'vote_up': "{{ url_for('topic.vote_up',topicId=topic.uid)}}",
  25. 'vote_down': "{{ url_for('topic.vote_down',topicId=topic.uid)}}"
  26. };
  27. DoVote(voteData);
  28. </script>
  29. {%- endblock script %}
  30. {% block content %}
  31. {% set board = topic.board %}
  32. {{ breadcrumb(hrefs={board.parent_board:url_for('board.board',parent_b=board.parent_board),
  33. board.board:url_for('board.board',parent_b=board.parent_board,child_b=board.board)},active=topic.title)}}
  34. {% set last_reply = topic.replies.first() %}
  35. {% from 'base/paginate.html' import footer as p_footer %}
  36. <div class="row">
  37. <div class="col-md-9">
  38. <div class="panel panel-default">
  39. <div class="panel-heading media ">
  40. <div class="media-body">
  41. <h3 class="media-heading">{{ topic.title}}</h3>
  42. <small style="color:#999">
  43. <div class="votes">
  44. {% if topic.vote and topic.vote > 0 -%}
  45. <a id="topic-up-vote" class="vote" href="javascript:void(0)" style="text-decoration:none;">
  46. <i class="icon-chevron-up">{{ topic.vote}}</i>
  47. </a>
  48. {% else %}
  49. <a id="topic-up-vote" class="vote" href="javascript:void(0)" style="text-decoration:none;">
  50. <i class="icon-chevron-up"></i>
  51. </a>
  52. {%- endif %}
  53. {% if topic.vote and topic.vote < 0 %}
  54. <a id="topic-down-vote" class="vote" href="javascript:void(0)" style="text-decoration:none;">
  55. <i class="icon-chevron-down">{{ topic.vote}}</i>
  56. </a>
  57. {% else %}
  58. <a id="topic-down-vote" class="vote" href="javascript:void(0)" style="text-decoration:none;">
  59. <i class="icon-chevron-down"></i>
  60. </a>
  61. {%- endif %}
  62. </div>
  63. {% for tag in topic.tags %}
  64. {{ link_base.tag(tag) }}
  65. {% endfor %}
  66. <br/>
  67. {{ link_base.user(topic.author.username )}}
  68. 于 <abbr class="timeago" title="{{ topic.publish}}">{{ topic.publish | timesince }}</abbr>发布
  69. {% if last_reply %}
  70. 最后由{{ link_base.user(last_reply.author.username )}}于
  71. <abbr class="timeago" title="{{ topic.publish}}">{{ last_reply.publish | timesince }}</abbr>回复
  72. {% endif %}
  73. </small>
  74. </div>
  75. <div class="media-right">
  76. <a href="{{ url_for('user.user',user_url=topic.author.username)}}">
  77. <img class="media-object img-circle" src="{{ link_base.avatar(topic.author) }}" alt="avatar" style="width:64px;height:64px">
  78. </a>
  79. </div>
  80. </div>
  81. <div class="panel-body topic-content">
  82. {% if topic.is_markdown %}
  83. {{ topic.content | markdown }}
  84. {% else %}
  85. {{ topic.content | safe_clean }}
  86. {% endif %}
  87. </div>
  88. </div>
  89. {% include 'topic/replies.html' %}
  90. </div>
  91. <div class="col-md-3" style="padding-left:0">
  92. {% set ask_url = url_for('topic.ask',boardId=topic.board.id) %}
  93. {% include 'topic/panel.html' %}
  94. </div>
  95. </div>
  96. {% endblock %}