aboutsummaryrefslogtreecommitdiff
path: root/viewer
diff options
context:
space:
mode:
Diffstat (limited to 'viewer')
-rw-r--r--viewer/src/locales/en.json6
-rw-r--r--viewer/src/plugins/fontawesome.ts6
-rw-r--r--viewer/src/store/uiStore.ts5
-rw-r--r--viewer/src/views/MainLayout.vue7
-rw-r--r--viewer/src/views/PanelTop.vue64
-rw-r--r--viewer/src/views/TopBreadcrumb.vue63
-rw-r--r--viewer/src/views/TopCommand.vue68
7 files changed, 162 insertions, 57 deletions
diff --git a/viewer/src/locales/en.json b/viewer/src/locales/en.json
index d44a116..987d4d1 100644
--- a/viewer/src/locales/en.json
+++ b/viewer/src/locales/en.json
@@ -7,5 +7,9 @@
7 "mode.search": "Search", 7 "mode.search": "Search",
8 "search.no-results": "No results", 8 "search.no-results": "No results",
9 "panelLeft.propositions": "Proposed tags", 9 "panelLeft.propositions": "Proposed tags",
10 "gallery.unknowntype": "Unknown item type" 10 "gallery.unknowntype": "Unknown item type",
11 "title.tags": "Tags",
12 "title.home": "Home",
13 "title.back": "Back",
14 "title.parent": "Parent"
11} \ No newline at end of file 15} \ No newline at end of file
diff --git a/viewer/src/plugins/fontawesome.ts b/viewer/src/plugins/fontawesome.ts
index bf2ff5f..fdbfcdb 100644
--- a/viewer/src/plugins/fontawesome.ts
+++ b/viewer/src/plugins/fontawesome.ts
@@ -24,27 +24,29 @@ import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
24import { 24import {
25 faFolder, 25 faFolder,
26 faSearch, 26 faSearch,
27 faTag,
28 faPlus, 27 faPlus,
29 faMinus, 28 faMinus,
30 faImage, 29 faImage,
31 faHome, 30 faHome,
32 faArrowLeft, 31 faArrowLeft,
32 faLevelUpAlt,
33 faTags, 33 faTags,
34 faAngleRight, 34 faAngleRight,
35 faWindowClose,
35} from "@fortawesome/free-solid-svg-icons"; 36} from "@fortawesome/free-solid-svg-icons";
36 37
37library.add( 38library.add(
38 faFolder, 39 faFolder,
39 faSearch, 40 faSearch,
40 faTag,
41 faPlus, 41 faPlus,
42 faMinus, 42 faMinus,
43 faImage, 43 faImage,
44 faHome, 44 faHome,
45 faArrowLeft, 45 faArrowLeft,
46 faLevelUpAlt,
46 faTags, 47 faTags,
47 faAngleRight, 48 faAngleRight,
49 faWindowClose,
48); 50);
49 51
50Vue.component("fa-icon", FontAwesomeIcon); 52Vue.component("fa-icon", FontAwesomeIcon);
diff --git a/viewer/src/store/uiStore.ts b/viewer/src/store/uiStore.ts
index 6bcc538..f7484de 100644
--- a/viewer/src/store/uiStore.ts
+++ b/viewer/src/store/uiStore.ts
@@ -27,6 +27,7 @@ const VuexModule = createModule({
27export default class UIStore extends VuexModule { 27export default class UIStore extends VuexModule {
28 28
29 fullscreen: boolean = false; 29 fullscreen: boolean = false;
30 fullWidth: boolean = true;
30 mode: "navigation" | "search" = "navigation"; 31 mode: "navigation" | "search" = "navigation";
31 currentTags: Tag.Search[] = []; 32 currentTags: Tag.Search[] = [];
32 33
@@ -46,6 +47,10 @@ export default class UIStore extends VuexModule {
46 this.fullscreen = !this.fullscreen; 47 this.fullscreen = !this.fullscreen;
47 } 48 }
48 49
50 @mutation toggleFullWidth() {
51 this.fullWidth = !this.fullWidth;
52 }
53
49 @mutation setModeNavigation() { 54 @mutation setModeNavigation() {
50 this.mode = "navigation"; 55 this.mode = "navigation";
51 } 56 }
diff --git a/viewer/src/views/MainLayout.vue b/viewer/src/views/MainLayout.vue
index f0809b6..c202def 100644
--- a/viewer/src/views/MainLayout.vue
+++ b/viewer/src/views/MainLayout.vue
@@ -18,7 +18,7 @@
18--> 18-->
19 19
20<template> 20<template>
21 <div :class="{fullscreen: $uiStore.fullscreen}"> 21 <div :class="{fullscreen: $uiStore.fullscreen, fullWidth: $uiStore.fullWidth}">
22 <panel-top v-if="!isLoading" class="layout layout-top" /> 22 <panel-top v-if="!isLoading" class="layout layout-top" />
23 <panel-left v-if="!isLoading" class="layout layout-left" /> 23 <panel-left v-if="!isLoading" class="layout layout-left" />
24 <router-view v-if="!isLoading" class="layout layout-content scrollbar" /> 24 <router-view v-if="!isLoading" class="layout layout-content scrollbar" />
@@ -98,8 +98,11 @@ html {
98 } 98 }
99} 99}
100.fullscreen { 100.fullscreen {
101 --layout-left: 0px;
102 --layout-top: 0px; 101 --layout-top: 0px;
102 @extend .fullWidth;
103}
104.fullWidth {
105 --layout-left: 0px;
103 .layout { 106 .layout {
104 &.layout-left { 107 &.layout-left {
105 transform: translate(-$layout-left, 0); 108 transform: translate(-$layout-left, 0);
diff --git a/viewer/src/views/PanelTop.vue b/viewer/src/views/PanelTop.vue
index e7421f0..3553789 100644
--- a/viewer/src/views/PanelTop.vue
+++ b/viewer/src/views/PanelTop.vue
@@ -19,64 +19,24 @@
19 19
20<template> 20<template>
21 <div class="flex"> 21 <div class="flex">
22 <div class="command-btns"> 22 <top-command />
23 <fa-icon icon="tags" size="lg" class="disabled" /> 23 <top-breadcrumb />
24 <router-link to="/" :class="{disabled: $galleryStore.currentItemPath.length <= 1}">
25 <fa-icon icon="home" size="lg" />
26 </router-link>
27 <div class="link" @click="$router.go(-1)">
28 <fa-icon icon="arrow-left" size="lg" />
29 </div>
30 </div>
31 <ul class="pathBreadcrumb">
32 <li v-for="(item,idx) in $galleryStore.currentItemPath" :key="item.path">
33 <router-link :to="item.path">
34 <fa-icon :icon="getIcon(item)" size="lg" />
35 {{item.title}}
36 </router-link>
37 <fa-icon v-if="(idx+1) < $galleryStore.currentItemPath.length" icon="angle-right" />
38 </li>
39 </ul>
40 </div> 24 </div>
41</template> 25</template>
42 26
43<script lang="ts"> 27<script lang="ts">
44import { Component, Vue, Prop, Watch } from "vue-property-decorator"; 28import { Component, Vue } from "vue-property-decorator";
45import Gallery from "./Gallery.vue"; 29import TopBreadcrumb from "./TopBreadcrumb.vue";
30import TopCommand from "./TopCommand.vue";
46 31
47@Component 32@Component({
48export default class PanelTop extends Vue { 33 components: {
49 getIcon(item: Gallery.Item) { 34 TopCommand,
50 if (item.path.length <= 1) return "home"; 35 TopBreadcrumb,
51 switch (item.properties.type) { 36 },
52 case "picture": 37})
53 return "image"; 38export default class PanelTop extends Vue {}
54 case "directory":
55 return "folder";
56 }
57 }
58}
59</script> 39</script>
60 40
61<style lang="scss"> 41<style lang="scss">
62@import "@/assets/scss/theme.scss";
63
64.pathBreadcrumb {
65 display: flex;
66 list-style: none;
67 margin: 5px;
68 a {
69 margin-right: 5px;
70 }
71 li:not(:first-child) {
72 margin-left: 10px;
73 }
74}
75.command-btns {
76 display: flex;
77 justify-content: space-around;
78 vertical-align: middle;
79 align-items: center;
80 width: $layout-left;
81}
82</style> 42</style>
diff --git a/viewer/src/views/TopBreadcrumb.vue b/viewer/src/views/TopBreadcrumb.vue
new file mode 100644
index 0000000..1a14123
--- /dev/null
+++ b/viewer/src/views/TopBreadcrumb.vue
@@ -0,0 +1,63 @@
1<!-- ldgallery - A static generator which turns a collection of tagged
2-- pictures into a searchable web gallery.
3--
4-- Copyright (C) 2019-2020 Guillaume FOUET
5--
6-- This program is free software: you can redistribute it and/or modify
7-- it under the terms of the GNU Affero General Public License as
8-- published by the Free Software Foundation, either version 3 of the
9-- License, or (at your option) any later version.
10--
11-- This program is distributed in the hope that it will be useful,
12-- but WITHOUT ANY WARRANTY; without even the implied warranty of
13-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14-- GNU Affero General Public License for more details.
15--
16-- You should have received a copy of the GNU Affero General Public License
17-- along with this program. If not, see <https://www.gnu.org/licenses/>.
18-->
19
20<template>
21 <ul class="pathBreadcrumb">
22 <li v-for="(item,idx) in $galleryStore.currentItemPath" :key="item.path">
23 <router-link :to="item.path">
24 <fa-icon :icon="getIcon(item)" size="lg" />
25 {{item.title}}
26 </router-link>
27 <fa-icon v-if="(idx+1) < $galleryStore.currentItemPath.length" icon="angle-right" />
28 </li>
29 </ul>
30</template>
31
32<script lang="ts">
33import { Component, Vue } from "vue-property-decorator";
34
35@Component