diff --git a/benchmark/scripts/app/templates/datasets.html b/benchmark/scripts/app/templates/datasets.html index 207bde3..c11c1ae 100644 --- a/benchmark/scripts/app/templates/datasets.html +++ b/benchmark/scripts/app/templates/datasets.html @@ -1,28 +1,44 @@ -{% extends "base_" ~ framework ~ ".html" %} -{% if framework == "bootstrap" %} - {% set close_button = '' %} - {% set button_class = "btn btn-primary btn-small" %} - {% set h1_class = "text-center" %} - {% set table_class = "table table-striped table-hover table-bordered" %} - {% set head_class = "bg-primary text-white" %} - {% set text_right = "text-end" %} - {% set container = "container" %} - {% set selected = "selected" %} +{% extends 'base_' ~ framework ~ '.html' %} +{% if framework == 'bootstrap' %} + {% set button_class = 'btn btn-primary btn-small' %} + {% set h1_class = 'text-center' %} + {% set table_class = 'table table-striped table-hover table-bordered' %} + {% set head_class = 'bg-primary text-white' %} + {% set text_right = 'text-end' %} + {% set container = 'container' %} + {% set selected = 'selected' %} + {%- macro header(title, close, url) -%} +
+ {%- if close -%} + + {%- endif -%} +

{{ title }}

+
+ {%- endmacro -%} {% else %} - {% set close_button = '' %} - {% set button_class = "button is-primary is-small" %} - {% set h1_class = "title is-1 has-text-centered" %} - {% set table_class = "table is-striped is-hoverable cell-border is-bordered" %} - {% set head_class = "is-selected" %} - {% set text_right = "has-text-right" %} - {% set container = "container" %} - {% set selected = "is-selected" %} + {% set button_class = 'button is-primary is-small' %} + {% set h1_class = 'title is-1 has-text-centered' %} + {% set table_class = 'table is-striped is-hoverable cell-border is-bordered' %} + {% set head_class = 'is-selected' %} + {% set text_right = 'has-text-right' %} + {% set container = 'container' %} + {% set selected = 'is-selected' %} + {%- macro header(title, close, url) -%} +
+
+ {%- if close -%} + + {%- endif -%} +

{{ title }}

+
+
+ {%- endmacro -%} {% endif %} {% block content %}
-

{{ close_button|safe }} Benchmark Datasets Report

+ {{ header('Benchmark Datasets Report', True, url_for('main.index', compare = compare)) }} - {% include "partials/datasets_table.html" %} + {% include 'partials/datasets_table.html' %}
{% endblock %} {% block jscript %} @@ -46,4 +62,4 @@ } }); -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/benchmark/scripts/app/templates/partials/select.js b/benchmark/scripts/app/templates/partials/select.js index 4baf072..d20a897 100644 --- a/benchmark/scripts/app/templates/partials/select.js +++ b/benchmark/scripts/app/templates/partials/select.js @@ -16,6 +16,9 @@ $(document).ready(function () { // "lengthMenu": "_MENU_" //} }); + $('#file-table').on( 'draw.dt', function () { + enable_disable_best_buttons(); + } ); // Check if row is selected $("#file-table tbody").on("click", "tr", function () { if ($(this).hasClass("{{ select.selected() }}")) { @@ -38,22 +41,19 @@ $(document).ready(function () { $("body").removeClass("ajaxLoading"); }); $('#compare').change(function() { - if ($(this).is(':checked')) { - $("[name='best_buttons']").removeAttr("hidden"); - $("[name='best_buttons']").addClass("tag is-link is-normal"); - } else { - $("[name='best_buttons']").attr("hidden", true); - $("[name='best_buttons']").removeClass("tag is-link is-normal"); - } + enable_disable_best_buttons(); }); - if ($('#compare').is(':checked')) { - $("[name='best_buttons']").removeAttr("hidden"); - $("[name='best_buttons']").addClass("tag is-link is-normal"); - } else { - $("[name='best_buttons']").attr("hidden", true); - $("[name='best_buttons']").removeClass("tag is-link is-normal"); - } + enable_disable_best_buttons(); }); +function enable_disable_best_buttons(){ + if ($('#compare').is(':checked')) { + $("[name='best_buttons']").addClass("tag is-link is-normal"); + $("[name='best_buttons']").removeAttr("hidden"); + } else { + $("[name='best_buttons']").removeClass("tag is-link is-normal"); + $("[name='best_buttons']").attr("hidden", true); + } +} function showFile(selectedFile) { var form = $( '
' + diff --git a/benchmark/scripts/app/templates/report_best.html b/benchmark/scripts/app/templates/report_best.html index bada157..442a74b 100644 --- a/benchmark/scripts/app/templates/report_best.html +++ b/benchmark/scripts/app/templates/report_best.html @@ -2,8 +2,8 @@ {% extends "base_" ~ framework ~ ".html" %} {% import "partials/cfg_select_" ~ framework ~ ".jinja" as select %} {% block content %} - {{ select.header(title, True, url_for("main.index", compare=compare)) }} - +
+ {{ select.header(title, True, url_for("main.index", compare=compare)) }} @@ -27,7 +27,7 @@ {% endfor %}
- +
{% endblock %} {% block jscript %}