forked from vikunja/frontend
47 lines
1.2 KiB
Vue
47 lines
1.2 KiB
Vue
<template>
|
|
<modal @close="close()">
|
|
<card class="has-background-white has-no-shadow" :title="$t('keyboardShortcuts.title')">
|
|
<template v-for="s in shortcuts">
|
|
<h3>{{ $t(s.title) }}</h3>
|
|
|
|
<div class="message is-primary" v-if="s.available($route) === null">
|
|
<div class="message-body">
|
|
{{ $t('keyboardShortcuts.allPages') }}
|
|
</div>
|
|
</div>
|
|
<div class="message is-primary" v-if="s.available($route)">
|
|
<div class="message-body">
|
|
{{ $t('keyboardShortcuts.currentPageOnly') }}
|
|
</div>
|
|
</div>
|
|
|
|
<p v-for="sc in s.shortcuts">
|
|
<strong>{{ $t(sc.title) }}</strong>
|
|
<shortcut :keys="sc.keys"
|
|
:combination="typeof sc.combination !== 'undefined' ? $t(`keyboardShortcuts.${sc.combination}`) : null"/>
|
|
</p>
|
|
</template>
|
|
</card>
|
|
</modal>
|
|
</template>
|
|
|
|
<script>
|
|
import {KEYBOARD_SHORTCUTS_ACTIVE} from '@/store/mutation-types'
|
|
import Shortcut from '@/components/misc/shortcut.vue'
|
|
import {KEYBOARD_SHORTCUTS} from './shortcuts'
|
|
|
|
export default {
|
|
name: 'keyboard-shortcuts',
|
|
components: {Shortcut},
|
|
data() {
|
|
return {
|
|
shortcuts: KEYBOARD_SHORTCUTS,
|
|
}
|
|
},
|
|
methods: {
|
|
close() {
|
|
this.$store.commit(KEYBOARD_SHORTCUTS_ACTIVE, false)
|
|
},
|
|
},
|
|
}
|
|
</script> |