From ef063f77ccaf10c6bdf06d1c48f7514cbf1b3be3 Mon Sep 17 00:00:00 2001 From: Matthieu Leproux Date: Thu, 7 Oct 2021 15:43:19 +0200 Subject: [PATCH] better summary positionning and dark mode filters added --- admin/themes/default/js/history.js | 50 ++++++++++++++++++----- admin/themes/default/template/history.tpl | 17 ++++---- admin/themes/default/theme.css | 6 +++ admin/themes/roma/theme.css | 6 +++ 4 files changed, 58 insertions(+), 21 deletions(-) diff --git a/admin/themes/default/js/history.js b/admin/themes/default/js/history.js index 7a3ecbe04..6ab344989 100644 --- a/admin/themes/default/js/history.js +++ b/admin/themes/default/js/history.js @@ -112,17 +112,23 @@ function fillSummaryResult(summary) { $(".summary-users .summary-data").html(summary.USERS); $(".summary-guests .summary-data").html(summary.GUESTS); - (summary.GUESTS.split(" ")[0] != "0") ? $(".summary-guests .summary-data").addClass("icon-plus-circled").on("click", function () { - if (current_param.user == "-1") { - current_param.user = guest_id; - addUserFilter(str_guest); - fillHistoryResult(current_param); - } - }).hover(function () { - $(this).css({ - cursor : "pointer" - }) - }) : console.log(); + if ((summary.GUESTS.split(" ")[0] != "0")) { + $(".summary-guests .summary-data").addClass("icon-plus-circled").on("click", function () { + if (current_param.user == "-1") { + current_param.user = guest_id; + addGuestFilter(str_guest); + fillHistoryResult(current_param); + } + }).hover(function () { + $(this).css({ + cursor : "pointer" + }) + }); + + $(".summary-guests").show(); + } else { + $(".summary-guests").hide(); + } var id_of = []; var user_dot_title = ""; @@ -374,6 +380,28 @@ function addUserFilter(username) { newFilter.find(".filter-title").html(username); newFilter.find(".filter-icon").addClass("icon-user"); + newFilter.find(".remove-filter").on("click", function () { + $(this).parent().remove(); + + current_param.user = "-1"; + current_param.pageNumber = 0; + fillHistoryResult(current_param); + checkFilters(); + $(".summary-guests").show(); + }) + + $(".summary-guests").hide(); + $(".filter-container").append(newFilter); + checkFilters(); +} + +function addGuestFilter(username) { + var newFilter = $("#default-filter").clone(); + newFilter.removeClass("hide"); + + newFilter.find(".filter-title").html(username); + newFilter.find(".filter-icon").addClass("icon-user-secret"); + newFilter.find(".remove-filter").on("click", function () { $(this).parent().remove(); diff --git a/admin/themes/default/template/history.tpl b/admin/themes/default/template/history.tpl index 5dfe382d2..5f65d655a 100644 --- a/admin/themes/default/template/history.tpl +++ b/admin/themes/default/template/history.tpl @@ -363,12 +363,6 @@ jQuery(document).ready( function() { cursor: default; } -.filter-title, .remove-filter, .filter-icon { - color: #777; - background: #fff; - padding: 5px 0; -} - .filter-title { padding-right: 2px; } @@ -629,7 +623,11 @@ jQuery(document).ready( function() { .summary-icons { padding: 10px; border-radius: 50%; - margin: 0 5px; + margin: 0 5px 0 15px; +} + +.summary-lines .summary-icons { + margin-left: 5px; } .summary-users { @@ -663,12 +661,11 @@ jQuery(document).ready( function() { .summary-data { font-weight: bold; - margin: 0 15px 0 0; } -.user-list { +{* .user-list { margin-right: 10px; -} +} *} #start_unset, #end_unset { text-decoration: none; diff --git a/admin/themes/default/theme.css b/admin/themes/default/theme.css index bc6f76108..130e0bba1 100644 --- a/admin/themes/default/theme.css +++ b/admin/themes/default/theme.css @@ -5615,4 +5615,10 @@ color:#FF7B00; .selectable-filter .elem-type-select { margin-top: 5px !important; +} + +.filter-title, .remove-filter, .filter-icon { + color: #777; + background: #fff; + padding: 5px 0; } \ No newline at end of file diff --git a/admin/themes/roma/theme.css b/admin/themes/roma/theme.css index f428b4685..906689a8c 100644 --- a/admin/themes/roma/theme.css +++ b/admin/themes/roma/theme.css @@ -1688,4 +1688,10 @@ li.plupload_delete a:hover {background: url("images/cancelhover.svg")!important; background: #252525 !important; border-color: transparent !important; color: #777; +} + +.filter-title, .remove-filter, .filter-icon { + color: #777; + background: #252525; + padding: 5px 0; } \ No newline at end of file