1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- {% macro category(category,questions) -%}
- {% set fl = 0 %}
- {% if category == 'topic' %}
- {% set chname = '创建的主题' %}
- {% set chlist = ['的回复','的笔记','的收藏'] %}
- {% set enlist = ['rep','ntb','collect'] %}
- {% set fl = 1 %}
- {% elif category == 'rep' %}
- {% set chname = '的回复' %}
- {% set chlist = ['的回复','的笔记','的收藏'] %}
- {% set enlist = ['rep','ntb','collect'] %}
- {% set fl = 1 %}
- {% elif category == 'ntb' %}
- {% set chname = '的笔记' %}
- {% set chlist = ['的回复','的笔记','的收藏'] %}
- {% set enlist = ['rep','ntb','collect'] %}
- {% set fl = 1 %}
- {% else %}
- {% set chname = '的收藏' %}
- {% set chlist = ['的回复','的笔记','的收藏'] %}
- {% set enlist = ['rep','ntb','collect'] %}
- {% set fl = 1 %}
- {% endif %}
- <div class="panel panel-default">
- <div class="panel-heading" style="padding-bottom:2px;">
- {% if fl == 1 %}
- <span class="fl"><a href="{{ url_for('user.category',category=category) }}">{{ g.user_url }}{{ chname }}</a></span>
- {% else %}
- <span><a href="{{ url_for('user.category',category=category) }}">{{ g.user_url }}{{ chname }}</a></span>
- {% endif %}
- {% for list in chlist %}
- {% set num = 0 %}
- <span><a href="{{ url_for('user.category',category=enlist[num]) }}">{{ g.user_url }}{{ list }}</a></span>
- {% set num = num + 1 %}
- {% endfor %}
- </div>
- {% for question in questions %}
- <div class="panel-body" style="border-bottom:1px solid #f6e1e1;">
- <span>
- <a href="#">{{ question.title }}</a>
- </span>
- <div style="font-size:12px;color:#999;">
- 创建日期:{{ question.time.strftime('%Y-%m-%d %H:%M') }}
- 最后回复来自
- <a href="{{ url_for('user.index',user_url=question.last_reply) }}">{{ question.last_reply }}</a>
- </div>
- </div>
- {% endfor %}
- </div>
- {%- endmacro %}
|