2018-08-08 11:32:43 +08:00
|
|
|
{% load base_filter %}
|
|
|
|
|
2018-07-31 10:46:48 +08:00
|
|
|
<div class="pr">
|
|
|
|
<div class="commentPanel" id="commentPanel">
|
|
|
|
<p class="ques-title">
|
2018-08-30 16:06:16 +08:00
|
|
|
该代码块共有{{annotation_length}}个注释
|
2018-07-31 10:46:48 +08:00
|
|
|
</p>
|
2018-08-07 18:20:33 +08:00
|
|
|
|
2018-08-22 00:47:49 +08:00
|
|
|
{% for self_anno in self_annos%}
|
2018-08-07 23:17:22 +08:00
|
|
|
<div class="fl thumbsThis topthumbsThis">
|
2018-08-08 11:32:43 +08:00
|
|
|
{% if self_anno.id in anno_vote_map and anno_vote_map|keyValue:self_anno.id == 1 %}
|
|
|
|
<p><i class="fa fa-play thumbs_active deg270" aria-hidden="true" onclick="thumbsAnno(this,{{self_anno.pk}},1)"></i> </p>
|
|
|
|
{% else %}
|
|
|
|
<p><i class="fa fa-play deg270" aria-hidden="true" onclick="thumbsAnno(this,{{self_anno.pk}},1)"></i> </p>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
<p class="thumbsThisnth2"><span id="annosum_{{self_anno.id}}">{{ self_anno.voteup | add:self_anno.votedown }}</span></p>
|
|
|
|
|
|
|
|
{% if self_anno.id in anno_vote_map and anno_vote_map|keyValue:self_anno.id == -1 %}
|
|
|
|
<p><i class="fa fa-play thumbs_active deg90" aria-hidden="true" onclick="thumbsAnno(this,{{self_anno.pk}},-1)"></i> </p>
|
|
|
|
{% else %}
|
|
|
|
<p><i class="fa fa-play deg90" aria-hidden="true" onclick="thumbsAnno(this,{{self_anno.pk}},-1)"></i> </p>
|
|
|
|
{% endif %}
|
|
|
|
|
2018-08-07 23:17:22 +08:00
|
|
|
</div>
|
|
|
|
<div class="fl commentparthalf">
|
|
|
|
<div class="parthalf_con clearfix">
|
2018-08-25 19:40:25 +08:00
|
|
|
<textarea id="modify_anno_textarea" class="fl break_word color-grey-des colorblack inlineBlock wi216" style="border:none" readonly>{{ self_anno.content }}</textarea>
|
2018-08-07 23:30:36 +08:00
|
|
|
{% if allow_modify %}
|
2018-08-26 09:49:30 +08:00
|
|
|
<a class="modify-anno btn btn-blue fr mt10 mb10" id="modification" href="javascript:void(0)" onclick="inject_modifyAnno_html(this,{{self_anno.file_id}},{{self_anno.linenum}},{{self_anno.id}})">修改</a>
|
|
|
|
<span class="color-grey-des inlineBlock marbox fr mt11">{{self_anno.user.nick_name}}</span>
|
2018-08-07 23:30:36 +08:00
|
|
|
{% endif %}
|
2018-08-07 23:17:22 +08:00
|
|
|
</div>
|
2018-08-07 23:30:36 +08:00
|
|
|
|
|
|
|
|
2018-08-07 21:49:20 +08:00
|
|
|
</div>
|
|
|
|
|
2018-08-08 15:35:38 +08:00
|
|
|
<div class="parthalf_comment">
|
2018-08-07 23:17:22 +08:00
|
|
|
<div class="comment-btn clearfix">
|
2018-08-08 15:35:38 +08:00
|
|
|
<a href="javascript:void(0)" class="btn btn-blue fr" onclick="addcomments(this)" >添加评论</a>
|
2018-08-07 23:17:22 +08:00
|
|
|
<div class="comment-write clearfix none">
|
|
|
|
<textarea class="writetext" id="writetext_{{ self_anno.pk }}" placehoder="请输入评论内容"></textarea>
|
|
|
|
<a href="javascript:void(0)" class="btn fr" onclick="cancelcom(this)">取消</a>
|
|
|
|
<a href="javascript:void(0)" class="btn btn-blue fr" style="margin-right:10px;" onclick='add_comment_action(this,{{ self_anno.pk }},"annotation")'>添加评论</a>
|
|
|
|
</div>
|
2018-08-07 18:20:33 +08:00
|
|
|
</div>
|
2018-08-07 21:49:20 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
2018-08-07 23:17:22 +08:00
|
|
|
{% for comment in anno_comments %}
|
2018-08-08 15:35:38 +08:00
|
|
|
{% if comment.annotation.pk == self_anno.pk %}
|
2018-08-08 11:32:43 +08:00
|
|
|
<div class="fl thumbsThis newtopthumbs">
|
2018-08-14 11:24:40 +08:00
|
|
|
<div class="fl">
|
2018-08-21 20:03:44 +08:00
|
|
|
{% if comment.id in comment_vote_map and comment_vote_map|keyValue:comment.id == 1 %}
|
2018-08-14 11:24:40 +08:00
|
|
|
<p><i class="fa fa-play thumbs_active deg270" aria-hidden="true" onclick="thumbsComment(this,{{comment.pk}},1)"></i> </p>
|
|
|
|
{% else %}
|
|
|
|
<p><i class="fa fa-play deg270" aria-hidden="true" onclick="thumbsComment(this,{{comment.pk}},1)"></i> </p>
|
|
|
|
{% endif %}
|
|
|
|
<p class="thumbsThisnth2 thumbsmarginLeft"><span id="comment_{{comment.pk}}">{{ comment.voteup | add:comment.votedown}}</span></p>
|
|
|
|
|
|
|
|
{% if comment.id in comment_vote_map and comment_vote_map|keyValue:comment.id == -1 %}
|
|
|
|
<p><i class="fa fa-play thumbs_active deg90" aria-hidden="true" onclick="thumbsComment(this,{{comment.pk}},-1)"></i> </p>
|
|
|
|
{% else %}
|
|
|
|
<p><i class="fa fa-play deg90" aria-hidden="true" onclick="thumbsComment(this,{{comment.pk}},-1)"></i> </p>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="comment-item fl">
|
2018-08-07 23:17:22 +08:00
|
|
|
<span class="color-grey-des mr10 colorblack inlineBlock fl ellipsis" title="{{ comment.content }}">{{ comment.content }}</span>
|
2018-08-14 11:24:40 +08:00
|
|
|
<span class="color-grey-des inlineBlock fr inlineBlockfont">{{ comment.user.nick_name }}</span>
|
2018-08-07 23:17:22 +08:00
|
|
|
<div class="clear"></div>
|
2018-08-14 11:24:40 +08:00
|
|
|
</div>
|
2018-08-07 23:17:22 +08:00
|
|
|
</div>
|
2018-08-14 11:24:40 +08:00
|
|
|
|
2018-08-07 23:17:22 +08:00
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
2018-08-22 00:47:49 +08:00
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
|
2018-08-07 23:17:22 +08:00
|
|
|
|
2018-08-22 00:47:49 +08:00
|
|
|
{% for anno in annos%}
|
|
|
|
{% if anno not in self_annos %}
|
2018-08-07 23:17:22 +08:00
|
|
|
|
2018-08-22 00:47:49 +08:00
|
|
|
<div class="fl thumbsThis topthumbsThis">
|
|
|
|
<!-- 是否已经点过赞的判断 -->
|
|
|
|
{% if anno.id in anno_vote_map and anno_vote_map|keyValue:anno.id == 1 %}
|
|
|
|
<p><i class="fa fa-play thumbs_active deg270" aria-hidden="true" onclick="thumbsAnno(this,{{anno.pk}},1)"></i> </p>
|
|
|
|
{% else %}
|
|
|
|
<p><i class="fa fa-play deg270" aria-hidden="true" onclick="thumbsAnno(this,{{anno.pk}},1)"></i> </p>
|
|
|
|
{% endif %}
|
2018-08-08 11:32:43 +08:00
|
|
|
|
2018-08-22 00:47:49 +08:00
|
|
|
<p class="thumbsThisnth2"><span id="annosum_{{anno.id}}">{{ anno.voteup | add:anno.votedown }}</span></p>
|
|
|
|
{% if anno.id in anno_vote_map and anno_vote_map|keyValue:anno.id == -1 %}
|
|
|
|
<p><i class="fa fa-play thumbs_active deg90" aria-hidden="true" onclick="thumbsAnno(this,{{anno.pk}},-1)"></i> </p>
|
|
|
|
{% else %}
|
|
|
|
<p><i class="fa fa-play deg90" aria-hidden="true" onclick="thumbsAnno(this,{{anno.pk}},-1)"></i> </p>
|
|
|
|
{% endif %}
|
2018-08-08 11:32:43 +08:00
|
|
|
|
2018-08-22 00:47:49 +08:00
|
|
|
</div>
|
|
|
|
<div class="fl commentparthalf">
|
2018-08-07 23:17:22 +08:00
|
|
|
|
2018-08-22 00:47:49 +08:00
|
|
|
<div class="parthalf_con clearfix">
|
|
|
|
<span class="fl break_word color-grey-des colorblack inlineBlock wi216" >{{ forloop.counter }}.{{ anno.content }}</span>
|
2018-08-07 23:30:36 +08:00
|
|
|
</div>
|
2018-08-22 00:47:49 +08:00
|
|
|
</div>
|
2018-08-07 23:17:22 +08:00
|
|
|
|
2018-08-22 00:47:49 +08:00
|
|
|
<div class="parthalf_comment">
|
|
|
|
<div class="comment-btn clearfix">
|
|
|
|
<span class="color-grey-des inlineBlock marbox">{{anno.user.nick_name}}</span>
|
|
|
|
<a href="javascript:void(0)" class="btn btn-blue fr" onclick="addcomments(this)" >添加评论</a>
|
|
|
|
<div class="comment-write clearfix none">
|
|
|
|
<textarea class="writetext" id="writetext_{{ anno.pk }}" placehoder="请输入评论内容"></textarea>
|
|
|
|
<a href="javascript:void(0)" class="btn fr" onclick="cancelcom(this)">取消</a>
|
|
|
|
<a href="javascript:void(0)" class="btn btn-blue fr" style="margin-right:10px;" onclick='add_comment_action(this,{{ anno.pk }},"annotation")'>添加评论</a>
|
2018-08-07 23:30:36 +08:00
|
|
|
</div>
|
2018-08-07 23:17:22 +08:00
|
|
|
</div>
|
2018-08-22 00:47:49 +08:00
|
|
|
</div>
|
2018-08-07 21:49:20 +08:00
|
|
|
|
2018-08-07 23:17:22 +08:00
|
|
|
|
2018-08-22 00:47:49 +08:00
|
|
|
{% for comment in anno_comments %}
|
|
|
|
{% if comment.annotation.pk == anno.pk %}
|
|
|
|
<div class="fl thumbsThis newtopthumbs">
|
|
|
|
<div class="fl">
|
|
|
|
{% if comment.id in comment_vote_map and comment_vote_map|keyValue:comment.id == 1 %}
|
|
|
|
<p><i class="fa fa-play thumbs_active deg270" aria-hidden="true" onclick="thumbsComment(this,{{comment.pk}},1)"></i> </p>
|
|
|
|
{% else %}
|
|
|
|
<p><i class="fa fa-play deg270" aria-hidden="true" onclick="thumbsComment(this,{{comment.pk}},1)"></i> </p>
|
|
|
|
{% endif %}
|
|
|
|
<p class="thumbsThisnth2 thumbsmarginLeft"><span id="comment_{{comment.pk}}">{{ comment.voteup | add:comment.votedown}}</span></p>
|
|
|
|
|
|
|
|
{% if comment.id in comment_vote_map and comment_vote_map|keyValue:comment.id == -1 %}
|
|
|
|
<p><i class="fa fa-play thumbs_active deg90" aria-hidden="true" onclick="thumbsComment(this,{{comment.pk}},-1)"></i> </p>
|
|
|
|
{% else %}
|
|
|
|
<p><i class="fa fa-play deg90" aria-hidden="true" onclick="thumbsComment(this,{{comment.pk}},-1)"></i> </p>
|
|
|
|
{% endif %}
|
2018-08-07 23:30:36 +08:00
|
|
|
</div>
|
2018-08-22 00:47:49 +08:00
|
|
|
<div class="fl comment-item">
|
|
|
|
<span class="color-grey-des mr10 colorblack inlineBlock fl ellipsis" title="{{ comment.content }}">{{ comment.content }}</span>
|
|
|
|
<span class="color-grey-des inlineBlock fr inlineBlockfont">{{ comment.user.nick_name }}</span>
|
|
|
|
<div class="clear"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
2018-08-07 23:17:22 +08:00
|
|
|
|
2018-07-31 10:46:48 +08:00
|
|
|
</div>
|
2018-08-07 21:49:20 +08:00
|
|
|
|
2018-07-09 15:14:57 +08:00
|
|
|
</div>
|