From b9cbcace91cbca701fea9ec9c68da7b78fa2baa6 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Tue, 1 May 2018 08:47:07 +0200 Subject: [PATCH] rename dashboard to gallery The dashboard was never really a dashboard. --- .../main/resources/resources/css/design.css | 20 +-- pdb-ui/src/main/resources/resources/js/ui.js | 163 +++++++++--------- .../main/resources/templates/main.mustache | 4 +- 3 files changed, 98 insertions(+), 89 deletions(-) diff --git a/pdb-ui/src/main/resources/resources/css/design.css b/pdb-ui/src/main/resources/resources/css/design.css index b55e2d2..2fdab3d 100644 --- a/pdb-ui/src/main/resources/resources/css/design.css +++ b/pdb-ui/src/main/resources/resources/css/design.css @@ -182,7 +182,7 @@ textarea { top: 0; } -.dashboard-item { +.gallery-item { width: 300px; height: 200px; margin: 10px; @@ -192,18 +192,18 @@ textarea { position: relative; } -.dashboard-item img { +.gallery-item img { max-width: 300px; max-height: 200px; display:block; /* removes 3 pixels extra height around the image */ } -.dashboard-item .fieldValue{ +.gallery-item .fieldValue{ position: absolute; bottom: 0; } -#result-view-dashboard-image-viewer { +#result-view-gallery-image-viewer { position: absolute; top: 0; left: 0; @@ -211,11 +211,11 @@ textarea { z-index: 1; overflow-y:hidden; } -#result-view-dashboard-image-viewer img{ +#result-view-gallery-image-viewer img{ display:block; /* removes 3 pixels extra height around the image */ } -#result-view-dashboard-image-viewer-close { +#result-view-gallery-image-viewer-close { position: absolute; top: 0; right: 0; @@ -223,18 +223,18 @@ textarea { opacity: 0.3; } -#result-view-dashboard-image-viewer-close:hover { +#result-view-gallery-image-viewer-close:hover { opacity: 1.0; } -#dashboardControls { +#galleryControls { margin-left: 1em; } -#dashboardControls progress { +#galleryControls progress { text-align: center; } -#dashboardControls progress:after { +#galleryControls progress:after { content: attr(percentage)'%'; } diff --git a/pdb-ui/src/main/resources/resources/js/ui.js b/pdb-ui/src/main/resources/resources/js/ui.js index 824480a..063aa7a 100644 --- a/pdb-ui/src/main/resources/resources/js/ui.js +++ b/pdb-ui/src/main/resources/resources/js/ui.js @@ -215,31 +215,31 @@ Vue.component('result-view', { ` }); -Vue.component('result-view-dashboard', { - props: ['dashboard'], +Vue.component('result-view-gallery', { + props: ['gallery'], methods: { closeImage: function() { - this.dashboard.image = ""; + this.gallery.image = ""; } }, template: ` -
-
- +
+ + v-bind:galleryItem="item" + >
+ id="result-view-gallery-image-viewer" + v-if="gallery.image">
-
{{ dashboardItem.error }}
+ ` }); -Vue.component('navigation-bar-dashboard', { - props: ['dashboard'], +Vue.component('navigation-bar-gallery', { + props: ['gallery'], methods: { sort: function() { sortTiles(); }, abort: function() { - data.dashboard.toBeRendered = []; + data.gallery.toBeRendered = []; + data.gallery.progress.show = false; } }, computed: { navigationVisible: function() { - return data.mode == 'dashboard'; + return data.mode == 'gallery'; }, showProgressBar: function(){ - return data.dashboard.toBeRendered.length > 0; + // TODO remove? + // data.gallery.toBeRendered.length > 0 && + return data.gallery.progress.show; }, percentage: function() { - if (data.dashboard.progress.max > 100){ - return Math.round(10000*data.dashboard.progress.value / data.dashboard.progress.max)/100.0; + if (data.gallery.progress.max > 100){ + return Math.round(10000*data.gallery.progress.value / data.gallery.progress.max)/100.0; }else{ - return Math.round(100*data.dashboard.progress.value / data.dashboard.progress.max); + return Math.round(100*data.gallery.progress.value / data.gallery.progress.max); } } }, template: ` -