From 845852660b916e443640cccff1df46e76137ca57 Mon Sep 17 00:00:00 2001 From: Lukas Hirt Date: Mon, 26 Apr 2021 13:28:58 +0200 Subject: [PATCH] feat: move breadcrumbs out of location picker heading --- .../src/views/LocationPicker.vue | 98 +++++++++---------- 1 file changed, 47 insertions(+), 51 deletions(-) diff --git a/packages/web-app-files/src/views/LocationPicker.vue b/packages/web-app-files/src/views/LocationPicker.vue index 68a340db3fb..c287e71212e 100644 --- a/packages/web-app-files/src/views/LocationPicker.vue +++ b/packages/web-app-files/src/views/LocationPicker.vue @@ -2,31 +2,29 @@
-

- - -

+

+


-
- -
- - Cancel - -
-
- - - -
-
-
+ + +
+ + Cancel + +
+
+ + + +
+

@@ -94,6 +92,12 @@ import CopySidebarMainContent from '../components/LocationPicker/CopySidebarMain import ListLoader from '../components/ListLoader.vue' export default { + metaInfo() { + const title = `${this.title} - ${this.configuration.theme.general.name}` + + return { title } + }, + components: { NoContentMessage, ListLoader @@ -138,6 +142,17 @@ export default { ]), ...mapGetters('configuration'), + title() { + const translated = + this.currentAction === 'move' + ? this.$gettext('Move into %{ target }') + : this.$gettext('Copy into %{ target }') + const target = basename(this.target) || this.$gettext('All files') + const title = this.$gettextInterpolate(translated, { target }) + + return title + }, + currentAction() { return this.$route.params.action }, @@ -180,7 +195,7 @@ export default { breadcrumbs.push(this.createBreadcrumbNode(i + 1, pathSegments[i], itemPath)) } } else { - breadcrumbs.push(this.createBreadcrumbNode(0, this.$gettext('Home'), '/')) + breadcrumbs.push(this.createBreadcrumbNode(0, this.$gettext('All files'), '/')) for (let i = 0; i < pathSegments.length; i++) { const itemPath = encodeURIComponent(join.apply(null, pathSegments.slice(0, i + 1))) breadcrumbs.push(this.createBreadcrumbNode(i + 1, pathSegments[i], itemPath)) @@ -197,31 +212,6 @@ export default { return this.currentFolder && this.currentFolder.canCreate() }, - title() { - const count = this.resourcesCount - let title = '' - - switch (this.currentAction) { - case batchActions.move: { - title = this.$ngettext( - 'Selected %{ count } resource to move into:', - 'Selected %{ count } resources to move into:', - count - ) - break - } - case batchActions.copy: { - title = this.$ngettext( - 'Selected %{ count } resource to copy into:', - 'Selected %{ count } resources to copy into:', - count - ) - } - } - - return this.$gettextInterpolate(title, { count: count }, false) - }, - confirmBtnText() { switch (this.currentAction) { case batchActions.move: @@ -476,7 +466,7 @@ export default { .files-list-wrapper { display: grid; grid-template-columns: 1fr; - grid-template-rows: max-content max-content 1fr; + grid-template-rows: max-content 1fr; gap: 0 0; grid-template-areas: 'header' @@ -500,4 +490,10 @@ export default { #files-view { grid-area: main; } + +#files-location-picker-table ::deep tr { + td:first-of-type { + padding-left: 30px; + } +}