Skip to content

Commit aefc184

Browse files
committed
Track Sidebar on public page
Signed-off-by: Arne Hamann <git@arne.email>
1 parent 7140c43 commit aefc184

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

src/components/Sidebar.vue

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
@cancel="$emit('cancel-photo-suggestions')"
2424
@save="$emit('save-photo-suggestions-selection',$event)"
2525
@zoom="$emit('zoom-photo-suggestion', $event)" />
26+
<TrackMetadataTab v-if="isPublic() && activeTab === 'maps-track-metadata' && !fileInfo"
27+
:track="track" />
2628
<!-- TODO: create a standard to allow multiple elements here? -->
2729
<template v-if="fileInfo" #description>
2830
<LegacyView v-for="view in views"
@@ -86,12 +88,14 @@ import moment from '@nextcloud/moment'
8688
import { Type as ShareTypes } from '@nextcloud/sharing'
8789
import axios from '@nextcloud/axios'
8890
import FileInfo from '../services/FileInfo'
89-
import {isPublic} from "../utils/common";
91+
import { isPublic } from '../utils/common'
92+
import TrackMetadataTab from './TrackMetadataTab'
9093
9194
export default {
9295
name: 'Sidebar',
9396
9497
components: {
98+
TrackMetadataTab,
9599
// NcActionButton,
96100
NcAppSidebar,
97101
FavoriteSidebarTab,
@@ -128,6 +132,11 @@ export default {
128132
required: true,
129133
type: Array,
130134
},
135+
track: {
136+
required: false,
137+
validator: prop => typeof prop === 'object' || prop === null,
138+
default: null,
139+
},
131140
},
132141
133142
data() {
@@ -228,7 +237,7 @@ export default {
228237
background() {
229238
const iconColor = OCA.Accessibility?.theme === 'dark' ? 'ffffff' : '000000'
230239
if (this.typeOpened === 'track') {
231-
return generateUrl('/svg/maps/road?color=' + iconColor)
240+
return generateFilePath('maps', 'img', 'road.svg')
232241
}
233242
if (this.typeOpened === 'maps') {
234243
return generateFilePath('maps', 'img', 'maps.png')
@@ -299,6 +308,19 @@ export default {
299308
'app-sidebar--full': this.isFullScreen,
300309
},
301310
}
311+
} else if (this.activeTab === 'maps-track-metadata') {
312+
const iconColor = OCA.Accessibility?.theme === 'dark' ? 'ffffff' : '000000'
313+
return {
314+
title: t('maps', 'Track metadata'),
315+
compact: true,
316+
background: this.background,
317+
subtitle: '',
318+
active: this.activeTab,
319+
class: {
320+
'app-sidebar--has-preview': false,
321+
'app-sidebar--full': this.isFullScreen,
322+
},
323+
}
302324
} else {
303325
return {
304326
loading: false,
@@ -388,6 +410,9 @@ export default {
388410
watch: {
389411
},
390412
methods: {
413+
isPublic() {
414+
return isPublic()
415+
},
391416
/**
392417
* Can this tab be displayed ?
393418
*

0 commit comments

Comments
 (0)