mirror of
https://github.com/Doctorado-ML/benchmark.git
synced 2025-08-17 00:15:55 +00:00
Fix checkboxes on change page
This commit is contained in:
@@ -1,28 +1,44 @@
|
|||||||
{% extends "base_" ~ framework ~ ".html" %}
|
{% extends 'base_' ~ framework ~ '.html' %}
|
||||||
{% if framework == "bootstrap" %}
|
{% if framework == 'bootstrap' %}
|
||||||
{% set close_button = '<button type="button" class="btn-close btn-small" aria-label="Close" onclick="location.href = \'/index/' ~ compare ~ '\'"></button>' %}
|
{% set button_class = 'btn btn-primary btn-small' %}
|
||||||
{% set button_class = "btn btn-primary btn-small" %}
|
{% set h1_class = 'text-center' %}
|
||||||
{% set h1_class = "text-center" %}
|
{% set table_class = 'table table-striped table-hover table-bordered' %}
|
||||||
{% set table_class = "table table-striped table-hover table-bordered" %}
|
{% set head_class = 'bg-primary text-white' %}
|
||||||
{% set head_class = "bg-primary text-white" %}
|
{% set text_right = 'text-end' %}
|
||||||
{% set text_right = "text-end" %}
|
{% set container = 'container' %}
|
||||||
{% set container = "container" %}
|
{% set selected = 'selected' %}
|
||||||
{% set selected = "selected" %}
|
{%- macro header(title, close, url) -%}
|
||||||
|
<div class="p-4 bg-primary text-white">
|
||||||
|
{%- if close -%}
|
||||||
|
<button type="button" class="btn-close" aria-label="Close" onclick="location.href = '{{ url }}'"></button>
|
||||||
|
{%- endif -%}
|
||||||
|
<h1 class="alternate-font">{{ title }}</h1>
|
||||||
|
</div>
|
||||||
|
{%- endmacro -%}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% set close_button = '<button class="delete is-large" onclick="location.href = \'/index/' ~ compare ~ '\'"></button>' %}
|
{% set button_class = 'button is-primary is-small' %}
|
||||||
{% set button_class = "button is-primary is-small" %}
|
{% set h1_class = 'title is-1 has-text-centered' %}
|
||||||
{% set h1_class = "title is-1 has-text-centered" %}
|
{% set table_class = 'table is-striped is-hoverable cell-border is-bordered' %}
|
||||||
{% set table_class = "table is-striped is-hoverable cell-border is-bordered" %}
|
{% set head_class = 'is-selected' %}
|
||||||
{% set head_class = "is-selected" %}
|
{% set text_right = 'has-text-right' %}
|
||||||
{% set text_right = "has-text-right" %}
|
{% set container = 'container' %}
|
||||||
{% set container = "container" %}
|
{% set selected = 'is-selected' %}
|
||||||
{% set selected = "is-selected" %}
|
{%- macro header(title, close, url) -%}
|
||||||
|
<div class="hero is-info is-bold">
|
||||||
|
<div class="hero-body">
|
||||||
|
{%- if close -%}
|
||||||
|
<button class="delete is-large" onclick="location.href = '{{ url }}'"></button>
|
||||||
|
{%- endif -%}
|
||||||
|
<h1 class="is-size-3 alternate-font">{{ title }}</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{%- endmacro -%}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="{{ container }}">
|
<div class="{{ container }}">
|
||||||
<h1 class="{{ h1_class }}">{{ close_button|safe }} Benchmark Datasets Report</h1>
|
{{ header('Benchmark Datasets Report', True, url_for('main.index', compare = compare)) }}
|
||||||
<button class="{{ button_class }}" onclick="excelFiles(['datasets'], false)"><i class="mdi mdi-file-excel"></i> Excel</button>
|
<button class="{{ button_class }}" onclick="excelFiles(['datasets'], false)"><i class="mdi mdi-file-excel"></i> Excel</button>
|
||||||
{% include "partials/datasets_table.html" %}
|
{% include 'partials/datasets_table.html' %}
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block jscript %}
|
{% block jscript %}
|
||||||
@@ -46,4 +62,4 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@@ -16,6 +16,9 @@ $(document).ready(function () {
|
|||||||
// "lengthMenu": "_MENU_"
|
// "lengthMenu": "_MENU_"
|
||||||
//}
|
//}
|
||||||
});
|
});
|
||||||
|
$('#file-table').on( 'draw.dt', function () {
|
||||||
|
enable_disable_best_buttons();
|
||||||
|
} );
|
||||||
// Check if row is selected
|
// Check if row is selected
|
||||||
$("#file-table tbody").on("click", "tr", function () {
|
$("#file-table tbody").on("click", "tr", function () {
|
||||||
if ($(this).hasClass("{{ select.selected() }}")) {
|
if ($(this).hasClass("{{ select.selected() }}")) {
|
||||||
@@ -38,22 +41,19 @@ $(document).ready(function () {
|
|||||||
$("body").removeClass("ajaxLoading");
|
$("body").removeClass("ajaxLoading");
|
||||||
});
|
});
|
||||||
$('#compare').change(function() {
|
$('#compare').change(function() {
|
||||||
if ($(this).is(':checked')) {
|
enable_disable_best_buttons();
|
||||||
$("[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");
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
if ($('#compare').is(':checked')) {
|
enable_disable_best_buttons();
|
||||||
$("[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");
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
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) {
|
function showFile(selectedFile) {
|
||||||
var form = $(
|
var form = $(
|
||||||
'<form action="/show" method="post">' +
|
'<form action="/show" method="post">' +
|
||||||
|
@@ -2,8 +2,8 @@
|
|||||||
{% extends "base_" ~ framework ~ ".html" %}
|
{% extends "base_" ~ framework ~ ".html" %}
|
||||||
{% import "partials/cfg_select_" ~ framework ~ ".jinja" as select %}
|
{% import "partials/cfg_select_" ~ framework ~ ".jinja" as select %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{{ select.header(title, True, url_for("main.index", compare=compare)) }}
|
<div class="container">
|
||||||
<container class="{{select.get_container_class() }}">
|
{{ select.header(title, True, url_for("main.index", compare=compare)) }}
|
||||||
<table id="file-table" class="{{ select.get_table_class() }}">
|
<table id="file-table" class="{{ select.get_table_class() }}">
|
||||||
<thead>
|
<thead>
|
||||||
<tr class="{{ select.get_row_head_class() }}">
|
<tr class="{{ select.get_row_head_class() }}">
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</container>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block jscript %}
|
{% block jscript %}
|
||||||
<script>
|
<script>
|
||||||
|
Reference in New Issue
Block a user