Skip to content

Commit

Permalink
Add link to maps (fix #121)
Browse files Browse the repository at this point in the history
  • Loading branch information
pulsejet committed Oct 26, 2022
1 parent 87952fa commit 1bf6773
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public function main()
// Apps enabled
$this->initialState->provideInitialState('systemtags', true === $this->appManager->isEnabledForUser('systemtags'));
$this->initialState->provideInitialState('recognize', true === $this->appManager->isEnabledForUser('recognize'));
$this->initialState->provideInitialState('maps', true === $this->appManager->isEnabledForUser('maps'));
$this->initialState->provideInitialState('version', $this->appManager->getAppInfo('memories')['version']);

$policy = new ContentSecurityPolicy();
Expand Down
6 changes: 6 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
:title="t('memories', 'Tags')">
<TagsIcon slot="icon" :size="20" />
</NcAppNavigationItem>
<NcAppNavigationItem :to="{name: 'maps'}" v-if="config_mapsEnabled"
:title="t('memories', 'Maps')">
<MapIcon slot="icon" :size="20" />
</NcAppNavigationItem>
</template>
<template #footer>
<NcAppNavigationSettings :title="t('memories', 'Settings')">
Expand Down Expand Up @@ -78,6 +82,7 @@ import ArchiveIcon from 'vue-material-design-icons/PackageDown.vue';
import CalendarIcon from 'vue-material-design-icons/Calendar.vue';
import PeopleIcon from 'vue-material-design-icons/AccountBoxMultiple.vue';
import TagsIcon from 'vue-material-design-icons/Tag.vue';
import MapIcon from 'vue-material-design-icons/Map.vue';
@Component({
components: {
Expand All @@ -99,6 +104,7 @@ import TagsIcon from 'vue-material-design-icons/Tag.vue';
CalendarIcon,
PeopleIcon,
TagsIcon,
MapIcon,
},
})
export default class App extends Mixins(GlobalMixin, UserConfig) {
Expand Down
2 changes: 2 additions & 0 deletions src/mixins/UserConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ export default class UserConfig extends Vue {
config_timelinePath: string = loadState('memories', 'timelinePath') || '';
config_foldersPath: string = loadState('memories', 'foldersPath') || '/';
config_showHidden = loadState('memories', 'showHidden') === "true";

config_tagsEnabled = Boolean(loadState('memories', 'systemtags'));
config_recognizeEnabled = Boolean(loadState('memories', 'recognize'));
config_mapsEnabled = Boolean(loadState('memories', 'maps'));

config_squareThumbs = localStorage.getItem('memories_squareThumbs') === '1';
config_showFaceRect = localStorage.getItem('memories_showFaceRect') === '1';
Expand Down
9 changes: 9 additions & 0 deletions src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,14 @@
rootTitle: t('memories', 'Tags'),
}),
},

{
path: '/maps',
name: 'maps',
// router-link doesn't support external url, let's force the redirect
beforeEnter() {
window.open(generateUrl('/apps/maps'), '_blank')
},
},
],
})

0 comments on commit 1bf6773

Please sign in to comment.