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">
|
2018-09-17 09:03:40 +08:00
|
|
|
|
2018-09-17 19:31:00 +08:00
|
|
|
{% if linenum == 0 %}
|
|
|
|
{% if isdir == 0 %}
|
|
|
|
<p class="ques-title">
|
2018-09-27 23:37:06 +08:00
|
|
|
{% comment %} 您可见{{ annos|length }}个注释 {% endcomment %}
|
2018-09-30 22:22:48 +08:00
|
|
|
该代码文件共有{{ annotation_length }}个注释
|
2018-09-17 19:31:00 +08:00
|
|
|
</p>
|
|
|
|
{% endif %}
|
|
|
|
{% if isdir == 1 %}
|
|
|
|
<p class="ques-title">
|
2018-09-30 22:22:48 +08:00
|
|
|
该代码模块共有{{ annotation_length }}个注释
|
2018-09-17 09:03:40 +08:00
|
|
|
</p>
|
|
|
|
{% endif %}
|
2018-09-17 19:31:00 +08:00
|
|
|
{% else %}
|
|
|
|
<p class="ques-title">
|
2018-09-30 22:22:48 +08:00
|
|
|
该行或该代码块共有{{annotation_length}}个注释
|
2018-09-17 19:31:00 +08:00
|
|
|
</p>
|
|
|
|
{% endif %}
|
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 %}
|
2018-09-18 09:42:31 +08:00
|
|
|
{% if self_anno.voteup == 0 %}
|
|
|
|
<p class="thumbsThisnth2 thumbsThisnthnew"><span id="annosum_{{self_anno.id}}">{{ self_anno.voteup | add:self_anno.votedown }}</span></p>
|
|
|
|
{% endif %}
|
2018-09-23 18:27:44 +08:00
|
|
|
{% if self_anno.voteup > 9 %}
|
2018-09-27 09:07:39 +08:00
|
|
|
<p class="thumbsThisnth2 thumbsThisnthnew" style="margin-left: -3px;"><span id="annosum_{{self_anno.id}}">{{ self_anno.voteup | add:self_anno.votedown }}</span></p>
|
2018-09-18 09:42:31 +08:00
|
|
|
{% endif %}
|
2018-09-23 18:27:44 +08:00
|
|
|
{% if self_anno.voteup > 99 %}
|
2018-09-27 09:07:39 +08:00
|
|
|
<p class="thumbsThisnth2 thumbsThisnthnew" style="margin-left: -7px;"><span id="annosum_{{self_anno.id}}">{{ self_anno.voteup | add:self_anno.votedown }}</span></p>
|
2018-09-18 09:42:31 +08:00
|
|
|
{% endif %}
|
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 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-09-15 13:18:37 +08:00
|
|
|
<textarea id="modify_anno_textarea" class="fl break_word color-grey-des colorblack inlineBlock wi216" oninput="Input_modifyAnno(this,{{self_anno.file_id}},{{self_anno.linenum}},{{self_anno.id}})" style="border:none" readonly>{{ self_anno.content }}</textarea>
|
2018-09-29 11:50:45 +08:00
|
|
|
<a class="modify-anno btn fr mt10 mb10" style="background-color:brown;margin-left:5px" id="delete_anno" href="javascript:void(0)" onclick="delete_anno({{self_anno.file_id}},{{self_anno.linenum}},{{self_anno.id}})">删除</a>
|
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>
|
2018-09-20 08:34:59 +08:00
|
|
|
{% endif %}
|
|
|
|
{% if self_anno.user.nick_name == "" %}
|
|
|
|
<span class="color-grey-des inlineBlock marbox fr mt11">{{self_anno.user.username}}</span>
|
|
|
|
{% else %}
|
|
|
|
<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-09-15 13:18:37 +08:00
|
|
|
|
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-09-06 08:51:33 +08:00
|
|
|
<div class="comment-btn clearfix borderbottom borderbottombox">
|
2018-09-17 09:03:40 +08:00
|
|
|
<a href="javascript:void(0)" class="btn btn-blue fr" onclick="addcomments(this,{{ self_anno.pk }})" >评论</a>
|
2018-08-07 23:17:22 +08:00
|
|
|
<div class="comment-write clearfix none">
|
2018-09-15 13:18:37 +08:00
|
|
|
<textarea class="writetext" id="writetext_{{ self_anno.pk }}" oninput="Input_writetext(this,{{ self_anno.pk }})" placehoder="请输入评论内容"></textarea>
|
2018-08-07 23:17:22 +08:00
|
|
|
<a href="javascript:void(0)" class="btn fr" onclick="cancelcom(this)">取消</a>
|
2018-09-17 09:03:40 +08:00
|
|
|
<a href="javascript:void(0)" class="btn btn-blue fr" style="margin-right:10px;" onclick='add_comment_action(this,{{ self_anno.pk }},"annotation")'>评论</a>
|
2018-08-07 23:17:22 +08:00
|
|
|
</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-10-10 08:55:25 +08:00
|
|
|
{% comment %}
|
2018-09-27 09:07:39 +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-09-15 13:18:37 +08:00
|
|
|
<p style="height:10px;" class="margin003"><i class="fa fa-play thumbs_active deg270" aria-hidden="true" onclick="thumbsComment(this,{{comment.pk}},1)"></i> </p>
|
2018-08-14 11:24:40 +08:00
|
|
|
{% else %}
|
2018-09-15 13:18:37 +08:00
|
|
|
<p class="margin003"><i class="fa fa-play deg270" aria-hidden="true" onclick="thumbsComment(this,{{comment.pk}},1)"></i> </p>
|
2018-08-14 11:24:40 +08:00
|
|
|
{% endif %}
|
2018-09-28 09:50:55 +08:00
|
|
|
<p class="margin023 thumbsThisnth2"><span id="comment_{{comment.pk}}">{{ comment.voteup | add:comment.votedown}}</span></p>
|
2018-08-14 11:24:40 +08:00
|
|
|
|
|
|
|
{% 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>
|
2018-10-10 08:55:25 +08:00
|
|
|
{% endcomment %}
|
2018-08-14 11:24:40 +08:00
|
|
|
|
|
|
|
<div class="comment-item fl">
|
2018-10-10 09:17:43 +08:00
|
|
|
<span class="color-grey-des mr10 colorgray inlineBlock fl ellipsis" title="{{ comment.content }}">{{ comment.content }}</span>
|
2018-10-31 09:57:31 +08:00
|
|
|
{% comment %} <textarea id="modify_anno_textarea" class="fl break_word color-grey-des colorblack inlineBlock wi216" oninput="Input_modifyAnno(this,{{self_anno.file_id}},{{self_anno.linenum}},{{self_anno.id}})" style="border:none" readonly>{{ self_anno.content }}</textarea> {% endcomment %}
|
|
|
|
|
|
|
|
{% if is_annoy_comment %}
|
|
|
|
<span class="color-grey-des inlineBlock marbox fr mt11">用户-{{comment.user.id}}</span>
|
2018-09-20 08:34:59 +08:00
|
|
|
{% else %}
|
2018-10-31 09:57:31 +08:00
|
|
|
{% if comment.user.nick_name == "" %}
|
|
|
|
<span class="color-grey-des inlineBlock marbox fr mt11">{{comment.user.username}}</span>
|
|
|
|
{% else %}
|
|
|
|
<span class="color-grey-des inlineBlock fr inlineBlockfont">{{ comment.user.nick_name }}</span>
|
|
|
|
{% endif %}
|
2018-09-20 08:34:59 +08:00
|
|
|
{% endif %}
|
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-09-15 13:18:37 +08:00
|
|
|
|
|
|
|
|
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>
|
2018-09-15 13:18:37 +08:00
|
|
|
{% if anno.id in anno_vote_map and anno_vote_map|keyValue:anno.id == -1 %}
|
2018-08-22 00:47:49 +08:00
|
|
|
<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">
|
2018-09-06 08:51:33 +08:00
|
|
|
<div class="comment-btn clearfix borderbottom">
|
2018-09-17 09:03:40 +08:00
|
|
|
<a href="javascript:void(0)" class="btn btn-blue fr" onclick="addcomments(this,{{ anno.pk }})" >评论</a>
|
2018-09-20 08:34:59 +08:00
|
|
|
{% if anno.user.nick_name == "" %}
|
|
|
|
<span class="color-grey-des inlineBlock fr inlineBlockfont">{{ anno.user.username }}</span>
|
|
|
|
{% else %}
|
|
|
|
<span class="color-grey-des inlineBlock fr inlineBlockfont">{{ anno.user.nick_name }}</span>
|
|
|
|
{% endif %}
|
2018-08-22 00:47:49 +08:00
|
|
|
<div class="comment-write clearfix none">
|
2018-09-15 13:18:37 +08:00
|
|
|
<textarea class="writetext" id="writetext_{{ anno.pk }}" oninput="Input_writetext(this,{{ anno.pk }})" placehoder="请输入评论内容"></textarea>
|
2018-08-22 00:47:49 +08:00
|
|
|
<a href="javascript:void(0)" class="btn fr" onclick="cancelcom(this)">取消</a>
|
2018-09-17 09:03:40 +08:00
|
|
|
<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">
|
2018-10-10 08:55:25 +08:00
|
|
|
{% comment %}
|
2018-09-27 09:07:39 +08:00
|
|
|
<div class="fl">
|
2018-08-22 00:47:49 +08:00
|
|
|
{% if comment.id in comment_vote_map and comment_vote_map|keyValue:comment.id == 1 %}
|
2018-09-15 13:18:37 +08:00
|
|
|
<p class="margin003"><i class="fa fa-play thumbs_active deg270" aria-hidden="true" onclick="thumbsComment(this,{{comment.pk}},1)"></i> </p>
|
2018-08-22 00:47:49 +08:00
|
|
|
{% else %}
|
2018-09-15 13:18:37 +08:00
|
|
|
<p class="margin003"><i class="fa fa-play deg270" aria-hidden="true" onclick="thumbsComment(this,{{comment.pk}},1)"></i> </p>
|
2018-08-22 00:47:49 +08:00
|
|
|
{% endif %}
|
2018-09-28 09:50:55 +08:00
|
|
|
<p class="margin023 thumbsThisnth2"><span id="comment_{{comment.pk}}">{{ comment.voteup | add:comment.votedown}}</span></p>
|
2018-08-22 00:47:49 +08:00
|
|
|
|
|
|
|
{% 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-10-10 08:55:25 +08:00
|
|
|
{% endcomment %}
|
2018-08-22 00:47:49 +08:00
|
|
|
<div class="fl comment-item">
|
2018-10-10 09:17:43 +08:00
|
|
|
<span class="color-grey-des mr10 colorgray inlineBlock fl ellipsis" title="{{ comment.content }}">{{ comment.content }}</span>
|
2018-10-31 09:57:31 +08:00
|
|
|
|
|
|
|
{% if is_annoy_comment %}
|
|
|
|
<span class="color-grey-des inlineBlock marbox fr mt11">用户-{{comment.user.id}}</span>
|
2018-09-20 08:34:59 +08:00
|
|
|
{% else %}
|
2018-10-31 09:57:31 +08:00
|
|
|
{% if comment.user.nick_name == "" %}
|
|
|
|
<span class="color-grey-des inlineBlock marbox fr mt11">{{comment.user.username}}</span>
|
|
|
|
{% else %}
|
|
|
|
<span class="color-grey-des inlineBlock fr inlineBlockfont">{{ comment.user.nick_name }}</span>
|
|
|
|
{% endif %}
|
2018-09-20 08:34:59 +08:00
|
|
|
{% endif %}
|
2018-08-22 00:47:49 +08:00
|
|
|
<div class="clear"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
2018-09-15 13:18:37 +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>
|