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 += "
Source | "; + html_to_add += "Date | "; + html_to_add += "Encoding | "; + html_to_add += "Size (Kb) | "; + html_to_add += "Mime | "; + html_to_add += "(# lines, Max line length) | "; + html_to_add += "Preview | "; + html_to_add += "|||
---|---|---|---|---|---|---|---|---|---|
Source | "; - html_to_add += "Date | "; - html_to_add += "Encoding | "; - html_to_add += "Language | "; - html_to_add += "Size (Kb) | "; - html_to_add += "Mime | "; - html_to_add += "Number of lines | "; - html_to_add += "Max line length | "; - html_to_add += "Preview | "; - html_to_add += "|
"+curr_data.source+" | "; html_to_add += ""+curr_data.date+" | "; html_to_add += ""+curr_data.encoding+" | "; - html_to_add += ""+curr_data.language+" | "; html_to_add += ""+curr_data.size+" | "; html_to_add += ""+curr_data.mime+" | "; - html_to_add += ""+curr_data.lineinfo[0]+" | "; - html_to_add += ""+curr_data.lineinfo[1]+" | "; + html_to_add += "("+curr_data.lineinfo[0]+", "+curr_data.lineinfo[1]+") | "; html_to_add += ""; html_to_add += " |