From 1f9ae66df8e9d213b488e112ff2c1862a0ebe89d Mon Sep 17 00:00:00 2001 From: Davide Alberani Date: Tue, 23 Jan 2018 23:12:25 +0100 Subject: [PATCH] hide empty changes --- dist/base.html | 2 -- dist/history.html | 19 +++++++++++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/dist/base.html b/dist/base.html index 6d4bf64..dc16df2 100644 --- a/dist/base.html +++ b/dist/base.html @@ -7,13 +7,11 @@ - - {% block body %}{% end %} diff --git a/dist/history.html b/dist/history.html index 78f8644..417258b 100644 --- a/dist/history.html +++ b/dist/history.html @@ -15,9 +15,9 @@ - + -

History

+ show entries with no changes
@@ -44,8 +44,10 @@ var app = new Vue({ el: '#app', delimiters: ['${', '}'], data: { + show_empty: false, schedule: {}, history: [], + filtered_history: [], oldid: null, diff: null, lasstid: null, @@ -63,9 +65,22 @@ var app = new Vue({ self = this; var data = axios.get('/api/history/' + this.id).then(function(response) { self.history = response.data.history; + self.updateFilter(); self.schedule = response.data.schedule; self.lastid = response.data.lastid; }); + }, + updateFilter: function() { + self = this; + this.filtered_history = _.filter(self.history, function(o) { + if (self.show_empty) { + return true; + } + return o.changes; + }); + }, + toggleShowEmpty: function() { + this.updateFilter(); } } });