@@ -23,41 +23,42 @@
|
||||
<template>
|
||||
<div id="app-navigation" :class="{'icon-loading': loading}">
|
||||
<ul id="deck-navigation">
|
||||
<app-navigation-board-category
|
||||
<AppNavigationBoardCategory
|
||||
id="deck-navigation-all"
|
||||
:text="t('deck', 'All boards')"
|
||||
:boards="noneArchivedBoards"
|
||||
:open-on-add-boards="true"
|
||||
icon="icon-deck"
|
||||
/>
|
||||
<app-navigation-board-category
|
||||
icon="icon-deck" />
|
||||
<AppNavigationBoardCategory
|
||||
id="deck-navigation-archived"
|
||||
:text="t('deck', 'Archived boards')"
|
||||
:boards="archivedBoards"
|
||||
icon="icon-archive"
|
||||
/>
|
||||
<app-navigation-board-category
|
||||
icon="icon-archive" />
|
||||
<AppNavigationBoardCategory
|
||||
id="deck-navigation-shared"
|
||||
:text="t('deck', 'Shared boards')"
|
||||
:boards="sharedBoards"
|
||||
icon="icon-shared"
|
||||
/>
|
||||
<app-navigation-add-board />
|
||||
icon="icon-shared" />
|
||||
<AppNavigationAddBoard />
|
||||
</ul>
|
||||
<div v-if="isAdmin" id="app-settings"
|
||||
v-click-outside="closeMenu" :class="{open: opened}"
|
||||
>
|
||||
<div v-if="isAdmin"
|
||||
id="app-settings"
|
||||
v-click-outside="closeMenu"
|
||||
:class="{open: opened}">
|
||||
<div id="app-settings-header">
|
||||
<button class="settings-button" @click="toggleMenu">
|
||||
{{ t('deck', 'Settings') }}
|
||||
</button>
|
||||
</div>
|
||||
<div id="app-settings-content">
|
||||
<Multiselect v-model="groupLimit" :class="{'icon-loading-small': groupLimitDisabled}" :options="groups"
|
||||
<Multiselect v-model="groupLimit"
|
||||
:class="{'icon-loading-small': groupLimitDisabled}"
|
||||
:options="groups"
|
||||
:multiple="true"
|
||||
:disabled="groupLimitDisabled" label="displayname" track-by="id"
|
||||
@input="updateConfig"
|
||||
/>
|
||||
:disabled="groupLimitDisabled"
|
||||
label="displayname"
|
||||
track-by="id"
|
||||
@input="updateConfig" />
|
||||
<p>{{ t('deck', 'Limiting Deck will block users not part of those groups from creating their own boards. Users will still be able to work on boards that have been shared with them.') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -78,36 +79,36 @@ export default {
|
||||
components: {
|
||||
AppNavigationAddBoard,
|
||||
AppNavigationBoardCategory,
|
||||
Multiselect
|
||||
Multiselect,
|
||||
},
|
||||
directives: {
|
||||
ClickOutside
|
||||
ClickOutside,
|
||||
},
|
||||
props: {
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
opened: false,
|
||||
groups: [],
|
||||
groupLimit: [],
|
||||
groupLimitDisabled: true
|
||||
groupLimitDisabled: true,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'noneArchivedBoards',
|
||||
'archivedBoards',
|
||||
'sharedBoards'
|
||||
'sharedBoards',
|
||||
]),
|
||||
isAdmin() {
|
||||
// eslint-disable-next-line
|
||||
//return oc_isadmin
|
||||
return OC.isUserAdmin()
|
||||
}
|
||||
},
|
||||
},
|
||||
beforeMount() {
|
||||
if (this.isAdmin) {
|
||||
@@ -121,7 +122,7 @@ export default {
|
||||
this.groups = response.data.ocs.data.groups.reduce((obj, item) => {
|
||||
obj.push({
|
||||
id: item,
|
||||
displayname: item
|
||||
displayname: item,
|
||||
})
|
||||
return obj
|
||||
}, [])
|
||||
@@ -140,14 +141,14 @@ export default {
|
||||
updateConfig() {
|
||||
this.groupLimitDisabled = true
|
||||
axios.post(OC.generateUrl('apps/deck/config/groupLimit'), {
|
||||
value: this.groupLimit
|
||||
value: this.groupLimit,
|
||||
}).then(() => {
|
||||
this.groupLimitDisabled = false
|
||||
}, (error) => {
|
||||
console.error('Error while saving groupLimit', error.response)
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
-->
|
||||
<template>
|
||||
<li id="deck-navigation-add"
|
||||
:title="t('deck', 'Create new board')" :class="[{'icon-loading-small': loading, 'editing': editing}, classes]"
|
||||
>
|
||||
:title="t('deck', 'Create new board')"
|
||||
:class="[{'icon-loading-small': loading, 'editing': editing}, classes]">
|
||||
<a class="icon-add" href="#" @click.prevent.stop="startCreateBoard">
|
||||
{{ t('deck', 'Create new board') }}
|
||||
</a>
|
||||
@@ -32,9 +32,10 @@
|
||||
<form @submit.prevent.stop="createBoard">
|
||||
<input :placeholder="t('deck', 'New board title')" type="text" required>
|
||||
<input type="submit" value="" class="icon-confirm">
|
||||
<input type="submit" value="" class="icon-close"
|
||||
@click.stop.prevent="cancelEdit"
|
||||
>
|
||||
<input type="submit"
|
||||
value=""
|
||||
class="icon-close"
|
||||
@click.stop.prevent="cancelEdit">
|
||||
</form>
|
||||
<ColorPicker v-model="color" />
|
||||
</div>
|
||||
@@ -53,7 +54,7 @@ export default {
|
||||
classes: [],
|
||||
editing: false,
|
||||
loading: false,
|
||||
color: '#000000'
|
||||
color: '#000000',
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
@@ -67,15 +68,15 @@ export default {
|
||||
const title = e.currentTarget.childNodes[0].value
|
||||
this.$store.dispatch('createBoard', {
|
||||
title: title,
|
||||
color: this.color.substring(1)
|
||||
color: this.color.substring(1),
|
||||
})
|
||||
this.editing = false
|
||||
},
|
||||
cancelEdit(e) {
|
||||
this.editing = false
|
||||
this.item.edit.reset(e)
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
@@ -21,9 +21,10 @@
|
||||
-->
|
||||
<template>
|
||||
<router-link :id="`board-${board.id}`"
|
||||
:title="board.title" :class="[{'icon-loading-small': loading, deleted: deleted, editing: editing }, classes]"
|
||||
:to="routeTo" tag="li"
|
||||
>
|
||||
:title="board.title"
|
||||
:class="[{'icon-loading-small': loading, deleted: deleted, editing: editing }, classes]"
|
||||
:to="routeTo"
|
||||
tag="li">
|
||||
<div :style="{ backgroundColor: `#${board.color}` }" class="app-navigation-entry-bullet" />
|
||||
<a href="#">
|
||||
{{ board.title }}
|
||||
@@ -32,9 +33,10 @@
|
||||
<div v-if="actions.length > 0" class="app-navigation-entry-utils">
|
||||
<ul>
|
||||
<li class="app-navigation-entry-utils-menu-button">
|
||||
<button v-if="board.acl.length === 0" class="icon-shared" style="opacity: 0.3"
|
||||
@click="showSidebar"
|
||||
/>
|
||||
<button v-if="board.acl.length === 0"
|
||||
class="icon-shared"
|
||||
style="opacity: 0.3"
|
||||
@click="showSidebar" />
|
||||
<button v-else class="icon-shared" @click="showSidebar" />
|
||||
</li>
|
||||
<li class="app-navigation-entry-utils-menu-button">
|
||||
@@ -43,7 +45,7 @@
|
||||
</ul>
|
||||
</div>
|
||||
<div :class="{ 'open': menuOpen }" class="app-navigation-entry-menu">
|
||||
<popover-menu :menu="actions" />
|
||||
<PopoverMenu :menu="actions" />
|
||||
</div>
|
||||
|
||||
<!-- undo action -->
|
||||
@@ -54,8 +56,7 @@
|
||||
<button
|
||||
:title="t('settings', 'Undo')"
|
||||
class="app-navigation-entry-deleted-button icon-history"
|
||||
@click="unDelete"
|
||||
/>
|
||||
@click="unDelete" />
|
||||
</div>
|
||||
|
||||
<!-- edit entry -->
|
||||
@@ -63,9 +64,10 @@
|
||||
<form @submit.prevent.stop="applyEdit">
|
||||
<input v-model="editTitle" type="text" required>
|
||||
<input type="submit" value="" class="icon-confirm">
|
||||
<input type="submit" value="" class="icon-close"
|
||||
@click.stop.prevent="cancelEdit"
|
||||
>
|
||||
<input type="submit"
|
||||
value=""
|
||||
class="icon-close"
|
||||
@click.stop.prevent="cancelEdit">
|
||||
</form>
|
||||
<ColorPicker v-model="editColor" />
|
||||
</div>
|
||||
@@ -81,16 +83,16 @@ export default {
|
||||
name: 'AppNavigationBoard',
|
||||
components: {
|
||||
ColorPicker,
|
||||
PopoverMenu
|
||||
PopoverMenu,
|
||||
},
|
||||
directives: {
|
||||
ClickOutside
|
||||
ClickOutside,
|
||||
},
|
||||
props: {
|
||||
board: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -101,7 +103,7 @@ export default {
|
||||
menuOpen: false,
|
||||
undoTimeoutHandle: null,
|
||||
editTitle: '',
|
||||
editColor: ''
|
||||
editColor: '',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -112,7 +114,7 @@ export default {
|
||||
routeTo: function() {
|
||||
return {
|
||||
name: 'board',
|
||||
params: { id: this.board.id }
|
||||
params: { id: this.board.id },
|
||||
}
|
||||
},
|
||||
actions: function() {
|
||||
@@ -131,7 +133,7 @@ export default {
|
||||
this.editing = true
|
||||
},
|
||||
icon: 'icon-rename',
|
||||
text: t('deck', 'Edit board')
|
||||
text: t('deck', 'Edit board'),
|
||||
})
|
||||
|
||||
actions.push({
|
||||
@@ -150,7 +152,7 @@ export default {
|
||||
}
|
||||
},
|
||||
icon: 'icon-clone',
|
||||
text: t('deck', 'Clone board')
|
||||
text: t('deck', 'Clone board'),
|
||||
})
|
||||
|
||||
if (!this.board.archived) {
|
||||
@@ -161,7 +163,7 @@ export default {
|
||||
this.$store.dispatch('archiveBoard', this.board)
|
||||
},
|
||||
icon: 'icon-archive',
|
||||
text: t('deck', 'Archive board')
|
||||
text: t('deck', 'Archive board'),
|
||||
})
|
||||
} else {
|
||||
actions.push({
|
||||
@@ -171,7 +173,7 @@ export default {
|
||||
this.$store.dispatch('unarchiveBoard', this.board)
|
||||
},
|
||||
icon: 'icon-archive',
|
||||
text: t('deck', 'Unarchive board')
|
||||
text: t('deck', 'Unarchive board'),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -189,7 +191,7 @@ export default {
|
||||
})
|
||||
},
|
||||
icon: 'icon-delete',
|
||||
text: t('deck', 'Delete board')
|
||||
text: t('deck', 'Delete board'),
|
||||
})
|
||||
|
||||
actions.push({
|
||||
@@ -199,13 +201,13 @@ export default {
|
||||
this.$router.push(route)
|
||||
},
|
||||
icon: 'icon-settings-dark',
|
||||
text: t('deck', 'Board details')
|
||||
text: t('deck', 'Board details'),
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
return actions
|
||||
}
|
||||
},
|
||||
},
|
||||
watch: {},
|
||||
mounted() {
|
||||
@@ -246,11 +248,11 @@ export default {
|
||||
const route = this.routeTo
|
||||
route.name = 'board.details'
|
||||
this.$router.push(route)
|
||||
}
|
||||
},
|
||||
},
|
||||
inject: [
|
||||
'boardApi'
|
||||
]
|
||||
'boardApi',
|
||||
],
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -20,15 +20,16 @@
|
||||
-
|
||||
-->
|
||||
<template>
|
||||
<li v-if="boards.length > 0" :id="id" :title="text"
|
||||
:class="{'open': opened, 'collapsible': collapsible }"
|
||||
>
|
||||
<li v-if="boards.length > 0"
|
||||
:id="id"
|
||||
:title="text"
|
||||
:class="{'open': opened, 'collapsible': collapsible }">
|
||||
<button v-if="collapsible" class="collapse" @click.prevent.stop="toggleCollapse" />
|
||||
<a :class="icon" href="#">
|
||||
{{ text }}
|
||||
</a>
|
||||
<ul v-if="boards.length > 0">
|
||||
<app-navigation-board v-for="board in boards" :key="board.id" :board="board" />
|
||||
<AppNavigationBoard v-for="board in boards" :key="board.id" :board="board" />
|
||||
</ul>
|
||||
</li>
|
||||
</template>
|
||||
@@ -40,27 +41,27 @@ import AppNavigationBoard from './AppNavigationBoard'
|
||||
export default {
|
||||
name: 'AppNavigationBoardCategory',
|
||||
components: {
|
||||
AppNavigationBoard
|
||||
AppNavigationBoard,
|
||||
},
|
||||
directives: {
|
||||
ClickOutside
|
||||
ClickOutside,
|
||||
},
|
||||
props: {
|
||||
id: {
|
||||
type: String,
|
||||
required: true
|
||||
required: true,
|
||||
},
|
||||
text: {
|
||||
type: String,
|
||||
required: true
|
||||
required: true,
|
||||
},
|
||||
icon: {
|
||||
type: String,
|
||||
required: true
|
||||
required: true,
|
||||
},
|
||||
boards: {
|
||||
type: Array,
|
||||
required: true
|
||||
required: true,
|
||||
},
|
||||
/**
|
||||
* Control whether the category should be opened when adding boards.
|
||||
@@ -68,31 +69,31 @@ export default {
|
||||
*/
|
||||
openOnAddBoards: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
opened: false
|
||||
opened: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
collapsible() {
|
||||
return this.boards.length > 0
|
||||
}
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
boards: function(newVal, prevVal) {
|
||||
if (this.openOnAddBoards === true && prevVal.length < newVal.length) {
|
||||
this.opened = true
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
toggleCollapse() {
|
||||
this.opened = !this.opened
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user