diff --git a/benchmark/scripts/templates/base.html b/benchmark/scripts/templates/base.html deleted file mode 100644 index c9c25a4..0000000 --- a/benchmark/scripts/templates/base.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - {{ title }} - {% if framework == "bootstrap" %} - - - {% else %} - - - {% endif %} - - - - - {% block content %} {% endblock %} - - - {% block jscript %} {% endblock %} - diff --git a/benchmark/scripts/templates/base_bootstrap.html b/benchmark/scripts/templates/base_bootstrap.html new file mode 100644 index 0000000..fc61da9 --- /dev/null +++ b/benchmark/scripts/templates/base_bootstrap.html @@ -0,0 +1,55 @@ + + + + {{ title }} + + + + + + + + + + + {% block content %} {% endblock %} + + + {% block jscript %} {% endblock %} + diff --git a/benchmark/scripts/templates/base_bulma.html b/benchmark/scripts/templates/base_bulma.html new file mode 100644 index 0000000..cc27f4f --- /dev/null +++ b/benchmark/scripts/templates/base_bulma.html @@ -0,0 +1,42 @@ + + + + {{ title }} + + + + + + + + {% block content %} {% endblock %} + + + {% block jscript %} {% endblock %} + diff --git a/benchmark/scripts/templates/datasets.html b/benchmark/scripts/templates/datasets.html index 809bbf0..207bde3 100644 --- a/benchmark/scripts/templates/datasets.html +++ b/benchmark/scripts/templates/datasets.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "base_" ~ framework ~ ".html" %} {% if framework == "bootstrap" %} {% set close_button = '' %} {% set button_class = "btn btn-primary btn-small" %} diff --git a/benchmark/scripts/templates/partials/cfg_select_bootstrap.jinja b/benchmark/scripts/templates/partials/cfg_select_bootstrap.jinja new file mode 100644 index 0000000..b7e33ed --- /dev/null +++ b/benchmark/scripts/templates/partials/cfg_select_bootstrap.jinja @@ -0,0 +1,47 @@ +{%- macro header(title) -%} +
+

{{ title }}

+
+{%- endmacro -%} +{%- macro get_table_class() -%} +table table-striped table-hover table-bordered +{%- endmacro -%} +{%- macro icon(icon) -%} + +{%- endmacro -%} +{%- macro get_button(text, action) -%} + +{%- endmacro -%} +{%- macro get_button_class() -%} + button btn-primary btn-small +{%- endmacro %} +{%- macro get_button_view(file) -%} + +{%- endmacro -%} +{%- macro get_button_reset() -%} + +{%- endmacro -%} +{%- macro get_button_all() -%} + +{%- endmacro -%} +{%- macro get_tag_class() -%} +badge bg-info bg-small +{%- endmacro -%} +{%- macro get_container_class() -%} +container-fluid +{%- endmacro -%} +{%- macro selected() -%} +selected +{%- endmacro -%} +{%- macro get_level_class() -%} +navbar +{%- endmacro -%} +{%- macro get_align_right() -%} +text-end +{%- endmacro -%} +{%- macro get_left_position() -%} +float-left +{%- endmacro -%} +{%- macro get_right_position() -%} +float-right +{%- endmacro -%} \ No newline at end of file diff --git a/benchmark/scripts/templates/partials/cfg_select_bulma.jinja b/benchmark/scripts/templates/partials/cfg_select_bulma.jinja new file mode 100644 index 0000000..47fdd89 --- /dev/null +++ b/benchmark/scripts/templates/partials/cfg_select_bulma.jinja @@ -0,0 +1,46 @@ +{%- macro header(title) -%} +
+
+

{{ title }}

+
+
+{%- endmacro -%} +{%- macro get_table_class() -%} +table is-striped is-hoverable cell-border is-bordered +{%- endmacro -%} +{%- macro icon(icon) -%} + +{%- endmacro -%} +{%- macro get_button(text, action) -%} + +{%- endmacro -%} +{%- macro get_button_view(file) -%} + +{%- endmacro -%} +{%- macro get_button_reset() -%} + +{%- endmacro -%} +{%- macro get_button_all() -%} + +{%- endmacro -%} +{%- macro get_tag_class() -%} +tag is-info is-small +{%- endmacro -%} +{%- macro get_container_class() -%} +container is-fluid +{%- endmacro -%} +{%- macro selected() -%} +is-selected +{%- endmacro -%} +{%- macro get_level_class() -%} +level +{%- endmacro -%} +{%- macro get_align_right() -%} +has-text-right +{%- endmacro -%} +{%- macro get_left_position() -%} +float-left +{%- endmacro -%} +{%- macro get_right_position() -%} +float-right +{%- endmacro -%} \ No newline at end of file diff --git a/benchmark/scripts/templates/partials/datasets_table.html b/benchmark/scripts/templates/partials/datasets_table.html index 1130914..234ac23 100644 --- a/benchmark/scripts/templates/partials/datasets_table.html +++ b/benchmark/scripts/templates/partials/datasets_table.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "base_" ~ framework ~ ".html" %} {% block content %} diff --git a/benchmark/scripts/templates/partials/select.js b/benchmark/scripts/templates/partials/select.js index f4eb84f..ab76399 100644 --- a/benchmark/scripts/templates/partials/select.js +++ b/benchmark/scripts/templates/partials/select.js @@ -16,11 +16,11 @@ $(document).ready(function () { }); // Check if row is selected $('#file-table tbody').on('click', 'tr', function () { - if ($(this).hasClass('{{ selected }}')) { - $(this).removeClass('{{ selected }}'); + if ($(this).hasClass('{{ select.selected() }}')) { + $(this).removeClass('{{ select.selected() }}'); } else { - table.$('tr.{{ selected }}').removeClass('{{ selected }}'); - $(this).addClass('{{ selected }}'); + table.$('tr.{{ select.selected() }}').removeClass('{{ select.selected() }}'); + $(this).addClass('{{ select.selected() }}'); } }); // Show file with doubleclick diff --git a/benchmark/scripts/templates/partials/table_select.html b/benchmark/scripts/templates/partials/table_select.html index 7fac6bb..dfa1649 100644 --- a/benchmark/scripts/templates/partials/table_select.html +++ b/benchmark/scripts/templates/partials/table_select.html @@ -1,4 +1,4 @@ -
+
@@ -9,7 +9,7 @@ - + @@ -24,12 +24,11 @@ - +
ModelStratified Title Score{{ button_reset|safe }} {{ button_all|safe }}{{ select.get_button_reset()|safe }} {{ select.get_button_all()|safe }}
{{ parts[5] }} {{ 'True' if stratified =='1' else 'False' }} {{ "%s" % data["title"] }}{{ "%.6f" % data["score"] }}{{ "%.6f" % data["score"] }} - {{ button_pre | safe }}{{ file }}{{ button_post | safe }} + {{ select.get_button_view(file) | safe }} diff --git a/benchmark/scripts/templates/partials/table_select_design.html b/benchmark/scripts/templates/partials/table_select_design.html index ad0d97e..e598d74 100644 --- a/benchmark/scripts/templates/partials/table_select_design.html +++ b/benchmark/scripts/templates/partials/table_select_design.html @@ -1,15 +1,14 @@ -
-

Benchmark Results

-
-
- - - +
+ {{ select.header("Benchmark Results") }} +
+
+ {{ select.get_button("Use " ~ candidate, "redirectIndex('" ~ candidate ~ "')")|safe }} + {{ select.get_button(select.icon("excel") ~ " Excel", "excel()")|safe }} + {{ select.get_button(select.icon("database-eye") ~ " Datasets", "redirectDatasets()")|safe }}
-
+
- Comparing with best results + Comparing with best results
{% include "partials/table_select.html" %} diff --git a/benchmark/scripts/templates/report.html b/benchmark/scripts/templates/report.html index 238660b..6c16165 100644 --- a/benchmark/scripts/templates/report.html +++ b/benchmark/scripts/templates/report.html @@ -1,5 +1,5 @@ {% set title = "Report Viewer" %} -{% extends "base.html" %} +{% extends "base_" ~ framework ~ ".html" %} {% block content%} {% if framework == "bootstrap" %} {% set center = "text-center" %} diff --git a/benchmark/scripts/templates/select.html b/benchmark/scripts/templates/select.html index 1787b07..2fcd44c 100644 --- a/benchmark/scripts/templates/select.html +++ b/benchmark/scripts/templates/select.html @@ -1,36 +1,6 @@ {% set title = "Benchmark Results" %} -{% extends "base.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 button_pre = '' %} - {% set selected = "selected" %} - {% set tag_class = "badge bg-info bg-small" %} - {% set frbutton_position = "float-left" %} - {% set frtag_position = "float-right" %} - {% set level = "navbar" %} - {% set align_right = "text-end" %} - {% set container = "container-fluid" %} - {% set button_reset = '' %} - {% set button_all = '' %} -{% else %} - {% 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 button_pre = '' %} - {% set selected = "is-selected" %} - {% set align_right = "has-text-right" %} - {% set level = "level" %} - {% set tag_class = "tag is-info is-small" %} - {% set container = "container is-fluid" %} - {% set button_reset = '' %} - {% set button_all = '' %} -{% endif %} +{% extends "base_" ~ framework ~ ".html" %} +{% import "partials/cfg_select_" ~ framework ~ ".jinja" as select %} {% block content %} {% include "partials/table_select_design.html" %} {% endblock %}