Skip to content

Commit a7ffd15

Browse files
authoredAug 11, 2021
优化模版渲染逻辑
优化模版渲染逻辑
1 parent 57b0a02 commit a7ffd15

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed
 

‎templates/library.html

+3-6
Original file line numberDiff line numberDiff line change
@@ -237,18 +237,15 @@ <h4>文章列表(<font color="red">共{{ all_article_num }}篇</font>)</h4>
237237
<div class="nestable">
238238
<div class="dd" id="nestable">
239239
<ol class="dd-list">
240-
{% for classify in all_classify %}
240+
{% for classify,articles in all_article.items %}
241241
<li class="dd-item" data-id="{{ classify.id }}">
242242
<div class="dd-handle">{{ classify.name }}</div>
243243
<ol class="dd-list">
244-
{% for article in all_article %}
245-
{% if article.classify.id == classify.id %}
244+
{% for article in articles %}
246245
<li class="dd-item" data-id="{{ article.id }}" >
247246
<a class="dd-handle" href="/Gr33kLibrary/article_detail/{{ article.id }}/" target="_blank">{{ article.title }}{% if article.type == 1 %}<font color="#006400">(原创)</font>{% endif %}&nbsp;&nbsp;&nbsp;<font color="red">{{ article.update_time|date:'Y-m-d H:i:s' }}</font></a>
248247
</li>
249-
{% else %}
250-
{% endif %}
251-
{% endfor %}
248+
{% endfor %}
252249
</ol>
253250
</li>
254251
{% endfor %}

0 commit comments

Comments
 (0)
Please sign in to comment.