From e84ee5b4a29c7e1b81e12984790a253d82f8dfb8 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 21 May 2018 21:59:34 +0000 Subject: [PATCH] Add filters to compare page --- app/templates/appci_compare.html | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/app/templates/appci_compare.html b/app/templates/appci_compare.html index 1ec4b32..9e33157 100644 --- a/app/templates/appci_compare.html +++ b/app/templates/appci_compare.html @@ -6,6 +6,10 @@
+
+ + +
@@ -18,7 +22,7 @@ {% for result in results %} - +
{% if result.app.list.name == "official" %} @@ -75,7 +79,22 @@ window.onload = function () { }] }); chart.render(); + update_filters(); } + +function toggle(e) { + $(e).toggleClass("btn-default"); + $(e).toggleClass("btn-primary"); + update_filters(); +} +function update_filters() { + var onlyDiffs = $("#filter_onlyDiffs").hasClass("btn-primary"); + var onlyOfficials = $("#filter_onlyOfficials").hasClass("btn-primary"); + $(".ci-branch-comparison").show(); + if (onlyDiffs) { $(".ci-branch-comparison[value='same']").hide(); } + if (onlyOfficials) { $(".ci-branch-comparison:not(.official)").hide(); } +} +