添加cache-loader,debug模式下不再使用template缓存,修复一些 bug

This commit is contained in:
undefined committed 2020-07-11 20:00:43 +08:00
1 parent dd7914e1fb
commit 11368bc831
21 files changed
+248 -266

No files matched your search

@@ -31,12 +31,12 @@
{% if handler.user.hasPerm(reply_post_perm) %}
<a href="javascript:;" data-tooltip="{{ _('Reply') }}" name="dczcomments__op-reply-reply"><span class="icon icon-reply"></span></a>
{% endif %}
{% if doc.owner == handler.state.user._id or handler.user.hasPerm(reply_edit_perm) %}
{% if doc.owner == handler.user._id or handler.user.hasPerm(reply_edit_perm) %}
<a href="javascript:;" data-tooltip="{{ _('Edit') }}" name="dczcomments__op-edit-reply"
data-form="{{ {operation: reply_edit_op, drid: doc._id, drrid: rdoc._id}|json }}"
><span class="icon icon-edit"></span></a>
{% endif %}
{% if doc.owner == handler.state.user._id or handler.user.hasPerm(reply_delete_perm) %}
{% if doc.owner == handler.user._id or handler.user.hasPerm(reply_delete_perm) %}
<a href="javascript:;" data-tooltip="{{ _('Delete') }}" name="dczcomments__op-delete-reply"
data-form="{{ {operation: reply_delete_op, drid: doc._id, drrid: rdoc._id}|json }}"
><span class="icon icon-delete"></span></a>
@@ -75,7 +75,7 @@
<li class="dczcomments__item">
<div class="media">
<div class="media__left top">
<img src="{{ gravatar(udoc.gravatar) }}" width="60" height="60" class="medium user-profile-avatar">
<img src="{{ gravatar(handler.user.gravatar) }}" width="60" height="60" class="medium user-profile-avatar">
</div>
<div class="media__body top no-heading">
<div class="hasjs--hide">
@@ -96,7 +96,7 @@
</div>
<div class="commentbox-placeholder"></div>
<ul style="display:none">
{{ reply(true, udoc) }}
{{ reply(true, handler.user) }}
</ul>
</div>
</div>
+7 -7
View File
@@ -41,7 +41,7 @@
<div class="media__body top no-heading">
<div class="clearfix">
<div class="supplementary dczcomments__supplementary">
{{ user.render_inline(udoc) }}
{{ user.render_inline(handler.user) }}
</div>
</div>
<div class="hasjs--hide">
@@ -67,7 +67,7 @@
<div class="media__body top no-heading">
<div class="clearfix">
<div class="supplementary dczcomments__supplementary">
{{ user.render_inline(udoc, badge=false) }}
{{ user.render_inline(handler.user, badge=false) }}
</div>
</div>
<div class="commentbox-placeholder"></div>
@@ -115,22 +115,22 @@
<div class="dczcomments__operations nojs--hide">
{% if handler.user.hasPerm(reply_post_perm) %}
<a href="javascript:;" data-tooltip="{{ _('Reply') }}" name="dczcomments__op-reply-comment"
data-form="{{ {operation: reply_post_op, psrid: doc._id}|json }}"
data-form="{{ {operation: reply_post_op, psid: doc._id}|json }}"
><span class="icon icon-reply"></span></a>
{% endif %}
{% if doc.owner == handler.state.user._id or handler.user.hasPerm(comment_edit_perm) %}
<a href="javascript:;" data-tooltip="{{ _('Edit') }}" name="dczcomments__op-edit-comment"
data-form="{{ {operation: comment_edit_op, psrid: doc._id}|json }}"
data-form="{{ {operation: comment_edit_op, psid: doc._id}|json }}"
><span class="icon icon-edit"></span></a>
{% endif %}
{% if doc.owner == handler.state.user._id or handler.user.hasPerm(comment_delete_perm) %}
<a href="javascript:;" data-tooltip="{{ _('Delete') }}" name="dczcomments__op-delete-comment"
data-form="{{ {operation: comment_delete_op, psrid: doc._id}|json }}"
data-form="{{ {operation: comment_delete_op, psid: doc._id}|json }}"
><span class="icon icon-delete"></span></a>
{% endif %}
</div>
</div>
<div class="typo" data-emoji-enabled data-raw-url="{{ url('problem_solution_raw', pid=doc.pid, psid=doc._id) }}">
<div class="typo" data-emoji-enabled data-raw-url="{{ url('problem_solution_raw', pid=doc.parentId, psid=doc._id) }}">
{{ doc['content']|markdown|safe }}
</div>
<div class="commentbox-edit-target"></div>
@@ -160,7 +160,7 @@
{% endif %}
</div>
</div>
<div class="typo" data-emoji-enabled data-raw-url="{{ url('problem_solution_reply_raw', pid=doc.pid, psid=doc._id, psrid=rdoc._id) }}">
<div class="typo" data-emoji-enabled data-raw-url="{{ url('problem_solution_reply_raw', pid=doc.parentId, psid=doc._id, psrid=rdoc._id) }}">
{{ rdoc['content']|markdown|safe }}
</div>
<div class="commentbox-edit-target"></div>
+4
View File
@@ -1,11 +1,15 @@
{% if tdoc %}
{% if tdoc.docType == 60 %}
{% include "partials/problem_sidebar_homework.html" %}
{% if not owner_udoc %}
{% set owner_udoc = udoc %}
{% endif %}
{% include "partials/homework_sidebar.html" %}
{% else %}
{% include "partials/problem_sidebar_contest.html" %}
{% if not owner_udoc %}
{% set owner_udoc = udoc %}
{% endif %}
{% include "partials/contest_sidebar.html" %}
{% endif %}
{% else %}