panel.html 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. {% macro ol(category) -%}
  2. <ol class="breadcrumb" style="margin-bottom:0;">
  3. <li><a href="{{ url_for('index.forums') }}"><span class="glyphicon glyphicon-home" aria-hidden="true"></span>社区首页</a></li>
  4. <li class="active">{{ category | chname }}</li>
  5. </ol>
  6. {%- endmacro %}
  7. {% macro header(category) -%}
  8. <div class="panel-heading" style="background:#2e609b;">
  9. <a href="{{ url_for('campus.category',category=category,campus_url='forums') }}" style="color:#fff">{{ category | chname }}</a>
  10. </div>
  11. {%- endmacro %}
  12. {% macro body(category) -%}
  13. {% set classify = category | get_tags('index_tag') %}
  14. {% for key,value in classify.items() %}
  15. <div class="panel-body" style="border-bottom:1px solid #f6e1e1;">
  16. <div class="row" style="padding:0;margin:0;">
  17. <div class="col-sm-2" style="font-size:12px;">
  18. <dl style="margin:0;">
  19. {% set topic,all_topic = key | display_academy(category) %}
  20. {% if category == 'campus' -%}
  21. <dd><a href="{{ url_for('campus.index',campus_url=key) }}" style="font-size:14px;">{{ value }}</a></dd>
  22. {%- else %}
  23. <dd><a href="{{ url_for('tags.index',campus_url='forums',class_url=category,tag_url=key) }}" style="font-size:14px;">{{ value }}</a></dd>
  24. {%- endif %}
  25. <dd>
  26. <span style="color:#999;">主题:</span>
  27. <span>{{ topic }}</span>
  28. <span style="color:#999;">帖子:</span>
  29. <span>{{ all_topic }}</span>
  30. </dd>
  31. </dl>
  32. </div>
  33. <div class="col-sm-offset-8 col-sm-2" style="font-size:12px;">
  34. <dl style="margin:0;">
  35. {% set last_question = key | get_last_question %}
  36. {% set last_question = last_question[0] %}
  37. {% if last_question == 0 %}
  38. 没有帖子
  39. {% else %}
  40. {%- import 'base/link.html' as link -%}
  41. <dt>{{ link.link(last_question) }}</dt>
  42. <dd>由{{ link.userlink(last_question.author) }}发表</dd>
  43. <dd>{{ last_question.time.strftime('%Y-%m-%d %H:%M') }}</dd>
  44. {% endif %}
  45. </dl>
  46. </div>
  47. </div>
  48. </div>
  49. {% endfor %}
  50. {%- endmacro %}