diff --git a/var/www/Flask_server.py b/var/www/Flask_server.py index 56f43907..d605c118 100755 --- a/var/www/Flask_server.py +++ b/var/www/Flask_server.py @@ -626,8 +626,6 @@ def terms_management_query_paste(): set_paste_name = "tracked_" + term track_list_path = r_serv_term.smembers(set_paste_name) - print set_paste_name - print track_list_path for path in track_list_path: paste = Paste.Paste(path) @@ -635,14 +633,13 @@ def terms_management_query_paste(): p_date = p_date[6:]+'/'+p_date[4:6]+'/'+p_date[0:4] p_source = paste.p_source p_encoding = paste._get_p_encoding() - p_language = paste._get_p_language() p_size = paste.p_size p_mime = paste.p_mime p_lineinfo = paste.get_lines_info() p_content = paste.get_p_content().decode('utf-8', 'ignore') if p_content != 0: p_content = p_content[0:400] - paste_info.append({"path": path, "date": p_date, "source": p_source, "encoding": p_encoding, "language": p_language, "size": p_size, "mime": p_mime, "lineinfo": p_lineinfo, "content": p_content}) + paste_info.append({"path": path, "date": p_date, "source": p_source, "encoding": p_encoding, "size": p_size, "mime": p_mime, "lineinfo": p_lineinfo, "content": p_content}) return jsonify(paste_info) diff --git a/var/www/templates/terms_management.html b/var/www/templates/terms_management.html index 4dc5a05e..d070715c 100644 --- a/var/www/templates/terms_management.html +++ b/var/www/templates/terms_management.html @@ -220,48 +220,44 @@ // On click, get html content from url and update the corresponding modal $("[data-toggle='modal']").on("click.openmodal", function (event) { + //console.log(data); event.preventDefault(); var the_modal=$(this); var url = "{{ url_for('terms_management_query_paste') }}?term=" + $(this).attr('data-term'); $.getJSON(url, function (data) { - //console.log(data); if (data.length != 0) { + var html_to_add = ""; + html_to_add += ""; + html_to_add += ""; + html_to_add += ""; + html_to_add += ""; + html_to_add += ""; + html_to_add += ""; + html_to_add += ""; + html_to_add += ""; + html_to_add += ""; + html_to_add += ""; + html_to_add += ""; + html_to_add += ""; + html_to_add += ""; for (i=0; i"; - html_to_add += ""; - html_to_add += ""; - html_to_add += ""; - html_to_add += ""; - html_to_add += ""; - html_to_add += ""; - html_to_add += ""; - html_to_add += ""; - html_to_add += ""; - html_to_add += ""; - html_to_add += ""; - html_to_add += ""; - html_to_add += ""; - html_to_add += ""; html_to_add += ""; html_to_add += ""; html_to_add += ""; html_to_add += ""; - html_to_add += ""; html_to_add += ""; html_to_add += ""; - html_to_add += ""; - html_to_add += ""; + html_to_add += ""; html_to_add += ""; html_to_add += ""; - html_to_add += ""; - html_to_add += "
SourceDateEncodingSize (Kb)Mime(# lines, Max line length)Preview
SourceDateEncodingLanguageSize (Kb)MimeNumber of linesMax line lengthPreview
"+curr_data.source+""+curr_data.date+""+curr_data.encoding+""+curr_data.language+""+curr_data.size+""+curr_data.mime+""+curr_data.lineinfo[0]+""+curr_data.lineinfo[1]+"("+curr_data.lineinfo[0]+", "+curr_data.lineinfo[1]+")
"; - $("#mymodalbody").html(html_to_add); - $("[data-toggle=popover]").popover(); - $("#button_show_plot").attr("href", "{{ url_for('terms_plot_tool')}}"+"?term="+the_modal.attr('data-term') ); } + html_to_add += ""; + html_to_add += ""; + $("#mymodalbody").html(html_to_add); + $("[data-toggle=popover]").popover(); + $("#button_show_plot").attr("href", "{{ url_for('terms_plot_tool')}}"+"?term="+the_modal.attr('data-term') ); } else { $("#mymodalbody").html("No paste containing this term has been received yet."); $("#button_show_plot").attr("href", "{{ url_for('terms_plot_tool')}}"+"?term="+the_modal.attr('data-term') );