user_category.html 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. {% macro category(category,questions) -%}
  2. {% set fl = 0 %}
  3. {% if category == 'topic' %}
  4. {% set chname = '创建的主题' %}
  5. {% set chlist = ['的回复','的笔记','的收藏'] %}
  6. {% set enlist = ['rep','ntb','collect'] %}
  7. {% set fl = 1 %}
  8. {% elif category == 'rep' %}
  9. {% set chname = '的回复' %}
  10. {% set chlist = ['的回复','的笔记','的收藏'] %}
  11. {% set enlist = ['rep','ntb','collect'] %}
  12. {% set fl = 1 %}
  13. {% elif category == 'ntb' %}
  14. {% set chname = '的笔记' %}
  15. {% set chlist = ['的回复','的笔记','的收藏'] %}
  16. {% set enlist = ['rep','ntb','collect'] %}
  17. {% set fl = 1 %}
  18. {% else %}
  19. {% set chname = '的收藏' %}
  20. {% set chlist = ['的回复','的笔记','的收藏'] %}
  21. {% set enlist = ['rep','ntb','collect'] %}
  22. {% set fl = 1 %}
  23. {% endif %}
  24. <div class="panel panel-default">
  25. <div class="panel-heading" style="padding-bottom:2px;">
  26. {% if fl == 1 %}
  27. <span class="fl"><a href="{{ url_for('user.category',category=category) }}">{{ g.user_url }}{{ chname }}</a></span>
  28. {% else %}
  29. <span><a href="{{ url_for('user.category',category=category) }}">{{ g.user_url }}{{ chname }}</a></span>
  30. {% endif %}
  31. {% for list in chlist %}
  32. {% set num = 0 %}
  33. <span><a href="{{ url_for('user.category',category=enlist[num]) }}">{{ g.user_url }}{{ list }}</a></span>
  34. {% set num = num + 1 %}
  35. {% endfor %}
  36. </div>
  37. {% for question in questions %}
  38. <div class="panel-body" style="border-bottom:1px solid #f6e1e1;">
  39. <span>
  40. <a href="#">{{ question.title }}</a>
  41. </span>
  42. <div style="font-size:12px;color:#999;">
  43. 创建日期:{{ question.time.strftime('%Y-%m-%d %H:%M') }}
  44. 最后回复来自
  45. <a href="{{ url_for('user.index',user_url=question.last_reply) }}">{{ question.last_reply }}</a>
  46. </div>
  47. </div>
  48. {% endfor %}
  49. </div>
  50. {%- endmacro %}