FIX RIGHT AREA
This commit is contained in:
wrmswindmill 2018-09-18 13:47:22 +08:00
parent 245ffa17d9
commit 2e5374ddc2
4 changed files with 27 additions and 11 deletions

View File

@ -354,7 +354,7 @@ class AddAnnotationView(View):
# exist_record = Annotation.objects.filter(file_id=file_id, linenum=linenum, user_id=request.user.id)
exist_record = Annotation.objects.filter(file_id=file_id, linenum=linenum, user_id=request.user.id)
if exist_record:
return HttpResponse('{"status":"fail","msg":"你已经添加过注释,无法再次添加"}', content_type='application/json')
return HttpResponse('{"status":"fail","msg":"你已经添加过注释,无法再次添加,如需修改注释,请点击查看注释按钮进行修改"}', content_type='application/json')
else:
try:
annotation = Annotation()
@ -506,7 +506,7 @@ class ModifyAnnotationView(View):
# 把之前的is_latest设置为0
annotation.is_latest = 0
annotation.save()
anno_content = annotation.content
anno_content = get_currentfile_comment_anno(file,new_annotation.content)
return HttpResponse(json.dumps({"status": "success", "msg":"修改成功","anno_content":anno_content}), content_type='application/json')
else:
return HttpResponse(json.dumps({"status": "fail", "msg":"修改失败"}), content_type='application/json')
@ -1381,7 +1381,7 @@ class RightView(View):
# 获取方法个数
method_num = getMethodNum(project_path,file_path);
if method_num == -1:
return ""
method_num = 0
# 获得文件的行数
filelinenum = getFileLineNum(project_path,file_path)
# 获得注释个数
@ -1400,6 +1400,7 @@ class RightView(View):
question_num = 0
issue_question_num = issue_num + question_num
print(filelinenum,anno_num,issue_num)
# 获得观看数
file = File.objects.get(id=file_id)
view_num = file.views
@ -1420,11 +1421,12 @@ class RightView(View):
file = File.objects.get(project_id=project_id,path=file_path)
isDir = (len(FileSummary.objects.filter(project_id=project_id,parent_path=file_path))>0)
print(isDir)
if isDir:
html_str = self.get_dir_right_content(file.id)
else:
html_str = self.get_file_right_content(project_path,file_path,file.pk)
print("rightview htmlstr:"+html_str)
return HttpResponse(json.dumps({"status": "success", "html_str": html_str}), content_type='application/json')

View File

@ -683,11 +683,16 @@ function show_navigation() {
function deal_for_navigation_tree(){
$("#navigation_tree").jstree();
$("#navigation_tree").jstree().open_all();
$("#navigation_tree li").click(function(){
location.href = $(this).find("a").attr("href");
});
try{
$("#navigation_tree").jstree();
$("#navigation_tree").jstree().open_all();
$("#navigation_tree li").click(function(){
location.href = $(this).find("a").attr("href");
});
}catch(error){
console.log(error)
}
}
function show_currentLine(linenum) {
// document.getElementById("code_" + linenum).style.backgroundColor = '#f1efec';
@ -923,7 +928,7 @@ function open_tab(path,archor) {
// }
show_navigation();
}catch(error) {
console.error(error);
console.log(error);
// expected output: SyntaxError: unterminated string literal
// Note - error messages will vary depending on browser
}

View File

@ -23971,3 +23971,13 @@ Tue Sep 18 09:26:44 2018 - uwsgi_response_writev_headers_and_body_do(): Broken p
Tue Sep 18 09:59:13 2018 - uwsgi_response_writev_headers_and_body_do(): Broken pipe [core/writer.c line 306] during GET /robots.txt (216.244.66.203)
--- no python application found, check your startup logs for errors ---
[pid: 8048|app: -1|req: -1/279] 216.244.66.203 () {34 vars in 518 bytes} [Tue Sep 18 09:59:13 2018] GET /robots.txt => generated 0 bytes in 1 msecs (HTTP/1.1 500) 2 headers in 0 bytes (0 switches on core 1)
SIGINT/SIGQUIT received...killing workers...
worker 1 buried after 1 seconds
worker 2 buried after 1 seconds
worker 3 buried after 1 seconds
worker 4 buried after 1 seconds
worker 5 buried after 1 seconds
worker 6 buried after 1 seconds
goodbye to uWSGI.
VACUUM: pidfile removed.
VACUUM WARNING: unix socket /projects/codepedia/codepedia2/my_sock.sock changed inode. Skip removal

View File

@ -1 +0,0 @@
8043