diff --git a/gitinspector/format.py b/gitinspector/format.py index ef751be..5c14c57 100644 --- a/gitinspector/format.py +++ b/gitinspector/format.py @@ -69,12 +69,11 @@ def output_header(repos): if __selected_format__ == "html" or __selected_format__ == "htmlembedded": base = basedir.get_basedir() html_header = __output_html_template__(base + "/html/html.header") - tablesorter_js = __get_zip_file_content__("jquery.tablesorter.min.js", - "/html/jquery.tablesorter.min.js.zip").encode("latin-1", "replace") - tablesorter_js = tablesorter_js.decode("utf-8", "ignore") - flot_js = __get_zip_file_content__("jquery.flot.js") - pie_js = __get_zip_file_content__("jquery.flot.pie.js") - resize_js = __get_zip_file_content__("jquery.flot.resize.js") + + # The version of the table sorter is a modified version with support for the "euro" sign removed from the code. + # This is because it's been found that on Windows environments it can cause trouble with certain character maps. + tablesorter_js = __get_zip_file_content__("jquery.tablesorter.min.js", "/html/jquery.tablesorter.min.js.zip"). \ + encode("latin-1", "replace").decode("utf-8", "ignore") logo_file = open(base + "/html/gitinspector_piclet.png", "rb") logo = logo_file.read() @@ -83,8 +82,20 @@ def output_header(repos): if __selected_format__ == "htmlembedded": jquery_js = ">" + __get_zip_file_content__("jquery.js") + flot_js = ">" + __get_zip_file_content__("jquery.flot.js") + pie_js = ">" + __get_zip_file_content__("jquery.flot.pie.js") + resize_js = ">" + __get_zip_file_content__("jquery.flot.resize.js") + bootstrap_js = ">" + __get_zip_file_content__("bootstrap.min.js", "/html/bootstrap.zip") + bootstrap_css = "" % \ + __get_zip_file_content__("bootstrap.min.css", "/html/bootstrap.zip") else: jquery_js = " src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js\">" + flot_js = " src=\"https://cdnjs.cloudflare.com/ajax/libs/flot/0.8.3/jquery.flot.min.js\">" + pie_js = " src=\"https://cdnjs.cloudflare.com/ajax/libs/flot/0.8.3/jquery.flot.pie.min.js\">" + resize_js = " src=\"https://cdnjs.cloudflare.com/ajax/libs/flot/0.8.3/jquery.flot.resize.min.js\">" + bootstrap_js = " src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js\">" + bootstrap_css = "" print(html_header.format(title=_("Repository statistics for '{0}'").format(repos_string), jquery=jquery_js, @@ -92,6 +103,8 @@ def output_header(repos): jquery_flot=flot_js, jquery_flot_pie=pie_js, jquery_flot_resize=resize_js, + bootstrap=bootstrap_js, + bootstrap_css=bootstrap_css, logo=logo.decode("utf-8", "replace"), logo_text=_("The output has been generated by {0} {1}. The statistical analysis tool" " for git repositories.").format( diff --git a/gitinspector/html/bootstrap.zip b/gitinspector/html/bootstrap.zip new file mode 100644 index 0000000..517021e Binary files /dev/null and b/gitinspector/html/bootstrap.zip differ diff --git a/gitinspector/html/html.header b/gitinspector/html/html.header index 8cba24f..922e049 100644 --- a/gitinspector/html/html.header +++ b/gitinspector/html/html.header @@ -5,9 +5,11 @@ {title} - - - + +