user_body.html 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <div class="panel panel-default">
  2. <div class="panel-heading" id="topic_list" style="padding-bottom:2px;">
  3. <span id="topic"><a href="{{ url_for('user.category',category='topic') }}">{{ g.user_url }}创建的主题</a></span>
  4. <span id="rep"><a href="{{ url_for('user.category',category='rep') }}">{{ g.user_url }}的回复</a></span>
  5. <span id="ntb"><a href="{{ url_for('user.category',category='ntb') }}">{{ g.user_url }}的笔记</a></span>
  6. <span id="collect"><a href="{{ url_for('user.category',category='collect') }}">{{ g.user_url }}的收藏</a></span>
  7. </div>
  8. <div class="panel-body" style="border-bottom:1px solid #f6e1e1;padding:0">
  9. {% import 'user/topic.html' as list %}
  10. {% set collect_list = user.setting.collect_list %}
  11. {% set topic_list = user.setting.topic_list %}
  12. {% set ntb_list = user.setting.ntb_list %}
  13. {% set rep_list = user.setting.rep_list %}
  14. {% if not g.user.is_authenticated %}
  15. {% if category == 'collect' %}
  16. {% if collect_list == 1 %}
  17. {{ list.collect(user) }}
  18. {% else %}
  19. {{ list.list() }}
  20. {% endif %}
  21. {% elif category == 'rep' %}
  22. {% if rep_list == 1 %}
  23. {{ list.replies(user) }}
  24. {% else %}
  25. {{ list.list() }}
  26. {% endif %}
  27. {% elif category == 'ntb' %}
  28. {% if ntb_list == 1 %}
  29. {{ list.ntb(user) }}
  30. {% else %}
  31. {{ list.list() }}
  32. {% endif %}
  33. {% else %}
  34. {% if topic_list == 1 %}
  35. {{ list.topic(user) }}
  36. {% else %}
  37. {{ list.list() }}
  38. {% endif %}
  39. {% endif %}
  40. {% elif g.user.is_authenticated and current_user.name != g.user_url %}
  41. {% if category == 'collect' %}
  42. {% if collect_list == 1 or collect_list == 2 %}
  43. {{ list.collect(user) }}
  44. {% else %}
  45. {{ list.list() }}
  46. {% endif %}
  47. {% elif category == 'rep' %}
  48. {% if rep_list == 1 or rep_list == 2 %}
  49. {{ list.replies(user) }}
  50. {% else %}
  51. {{ list.list() }}
  52. {% endif %}
  53. {% elif category == 'ntb'%}
  54. {% if ntb_list == 1 or ntb_list == 2 %}
  55. {{ list.ntb(user) }}
  56. {% else %}
  57. {{ list.list() }}
  58. {% endif %}
  59. {% else %}
  60. {% if topic_list == 1 or topic_list == 2 %}
  61. {{ list.topic(user) }}
  62. {% else %}
  63. {{ list.list() }}
  64. {% endif %}
  65. {% endif %}
  66. {% else %}
  67. {% if category == 'collect' %}
  68. {{ list.collect(user) }}
  69. {% elif category == 'rep' %}
  70. {{ list.replies(user) }}
  71. {% elif category == 'ntb'%}
  72. {{ list.ntb(user) }}
  73. {% else %}
  74. {{ list.topic(user) }}
  75. {% endif %}
  76. {% endif %}
  77. </div>
  78. </div>