Compare commits
1 Commits
backport/6
...
calendarLi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8d58e6b584 |
@@ -28,25 +28,32 @@ use OCP\IRequest;
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
use OCP\AppFramework\Controller;
|
||||
use OCP\IL10N;
|
||||
use OCP\IConfig;
|
||||
use OCP\IInitialStateService;
|
||||
|
||||
class PageController extends Controller {
|
||||
|
||||
private $permissionService;
|
||||
private $userId;
|
||||
private $l10n;
|
||||
private $config;
|
||||
|
||||
public function __construct(
|
||||
$AppName,
|
||||
IRequest $request,
|
||||
PermissionService $permissionService,
|
||||
IL10N $l10n,
|
||||
$userId
|
||||
$userId,
|
||||
IConfig $config,
|
||||
IInitialStateService $initialStateService
|
||||
) {
|
||||
parent::__construct($AppName, $request);
|
||||
|
||||
$this->userId = $userId;
|
||||
$this->permissionService = $permissionService;
|
||||
$this->l10n = $l10n;
|
||||
$this->config = $config;
|
||||
$this->initialStateService = $initialStateService;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -63,6 +70,8 @@ class PageController extends Controller {
|
||||
'canCreate' => $this->permissionService->canCreate()
|
||||
];
|
||||
|
||||
$this->initialStateService->provideInitialState($this->appName, 'calendar', $this->config->getAppValue('calendar', 'enabled', 'no') === 'yes');
|
||||
|
||||
return new TemplateResponse('deck', 'main', $params);
|
||||
}
|
||||
|
||||
|
||||
25
package-lock.json
generated
25
package-lock.json
generated
@@ -3539,6 +3539,21 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"@nextcloud/initial-state": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@nextcloud/initial-state/-/initial-state-1.1.0.tgz",
|
||||
"integrity": "sha512-c8VNSv7CbcPdaMNQO3ERJUMhsGyCvAgSBlvBHhugYHxGqlySjE+J+SqkpXmqB+eQ/DujDTahBX1IwoF3zjPtOw==",
|
||||
"requires": {
|
||||
"core-js": "3.6.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"core-js": {
|
||||
"version": "3.6.1",
|
||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.1.tgz",
|
||||
"integrity": "sha512-186WjSik2iTGfDjfdCZAxv2ormxtKgemjC3SI6PL31qOA0j5LhTDVjHChccoc7brwLvpvLPiMyRlcO88C4l1QQ=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"@nextcloud/l10n": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@nextcloud/l10n/-/l10n-1.0.1.tgz",
|
||||
@@ -13369,7 +13384,7 @@
|
||||
},
|
||||
"mkdirp": {
|
||||
"version": "0.5.1",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
|
||||
"resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
|
||||
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
@@ -14049,7 +14064,7 @@
|
||||
},
|
||||
"os-homedir": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
|
||||
"resolved": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
|
||||
"integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
|
||||
"dev": true
|
||||
},
|
||||
@@ -14066,7 +14081,7 @@
|
||||
},
|
||||
"os-tmpdir": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
|
||||
"resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
|
||||
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
|
||||
"dev": true
|
||||
},
|
||||
@@ -14238,7 +14253,7 @@
|
||||
},
|
||||
"path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
|
||||
},
|
||||
"path-key": {
|
||||
@@ -17177,7 +17192,7 @@
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
||||
"resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
||||
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
|
||||
"requires": {
|
||||
"safe-buffer": "~5.1.0"
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
"@babel/runtime": "^7.8.3",
|
||||
"@nextcloud/auth": "^1.2.1",
|
||||
"@nextcloud/axios": "^1.3.1",
|
||||
"@nextcloud/initial-state": "^1.1.0",
|
||||
"@nextcloud/l10n": "^1.0.1",
|
||||
"@nextcloud/router": "^1.0.0",
|
||||
"@nextcloud/vue": "^1.3.0",
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
:boards="sharedBoards"
|
||||
icon="icon-shared" />
|
||||
<AppNavigationAddBoard />
|
||||
<AppNavigationCalendar />
|
||||
</ul>
|
||||
<div v-if="isAdmin"
|
||||
id="app-settings"
|
||||
@@ -73,6 +74,7 @@ import { Multiselect } from '@nextcloud/vue/dist/Components/Multiselect'
|
||||
|
||||
import AppNavigationAddBoard from './AppNavigationAddBoard'
|
||||
import AppNavigationBoardCategory from './AppNavigationBoardCategory'
|
||||
import AppNavigationCalendar from './AppNavigationCalendar'
|
||||
|
||||
export default {
|
||||
name: 'AppNavigation',
|
||||
@@ -80,6 +82,7 @@ export default {
|
||||
AppNavigationAddBoard,
|
||||
AppNavigationBoardCategory,
|
||||
Multiselect,
|
||||
AppNavigationCalendar,
|
||||
},
|
||||
directives: {
|
||||
ClickOutside,
|
||||
|
||||
72
src/components/navigation/AppNavigationCalendar.vue
Normal file
72
src/components/navigation/AppNavigationCalendar.vue
Normal file
@@ -0,0 +1,72 @@
|
||||
<!--
|
||||
- @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
|
||||
-
|
||||
- @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
-
|
||||
- @license GNU AGPL version 3 or any later version
|
||||
-
|
||||
- This program is free software: you can redistribute it and/or modify
|
||||
- it under the terms of the GNU Affero General Public License as
|
||||
- published by the Free Software Foundation, either version 3 of the
|
||||
- License, or (at your option) any later version.
|
||||
-
|
||||
- This program is distributed in the hope that it will be useful,
|
||||
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
- GNU Affero General Public License for more details.
|
||||
-
|
||||
- You should have received a copy of the GNU Affero General Public License
|
||||
- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-
|
||||
-->
|
||||
<template>
|
||||
<li id="deck-navigation-add"
|
||||
:title="t('deck', 'Calendar')"
|
||||
:class="[{'icon-loading-small': loading, 'editing': editing}, classes]">
|
||||
<a class="icon-calendar" href="/calendar" @click.prevent.stop="startCreateBoard">
|
||||
{{ t('deck', 'Calendar') }}
|
||||
</a>
|
||||
</li>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'AppNavigationCalendar',
|
||||
components: { },
|
||||
directives: {},
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
mounted() {},
|
||||
methods: {
|
||||
startCreateBoard(e) {
|
||||
|
||||
},
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
#app-navigation .app-navigation-entry-edit div {
|
||||
width: auto;
|
||||
display: block;
|
||||
}
|
||||
.app-navigation-entry-bullet-wrapper {
|
||||
position: absolute;
|
||||
left: 33px;
|
||||
width: 44px !important;
|
||||
margin: 6px;
|
||||
height: 44px;
|
||||
.color0 {
|
||||
width: 30px !important;
|
||||
height: 30px;
|
||||
border-radius: 50%;
|
||||
background-size: 14px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -29,13 +29,28 @@ import Board from './components/board/Board'
|
||||
import Sidebar from './components/Sidebar'
|
||||
import BoardSidebar from './components/board/BoardSidebar'
|
||||
import CardSidebar from './components/card/CardSidebar'
|
||||
import IsCalendarInstalled from '../src/services/IsCalendarInstalled'
|
||||
|
||||
Vue.use(Router)
|
||||
|
||||
let calendarPath = generateUrl('/apps/calendar')
|
||||
if (!IsCalendarInstalled) {
|
||||
calendarPath = generateUrl('/settings/apps/integration/calendar')
|
||||
}
|
||||
|
||||
|
||||
|
||||
export default new Router({
|
||||
base: generateUrl('/apps/deck/'),
|
||||
linkActiveClass: 'active',
|
||||
routes: [
|
||||
{
|
||||
path: '/calendar',
|
||||
name: 'calendar',
|
||||
beforeEnter() {
|
||||
location.href = calendarPath
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
name: 'main',
|
||||
|
||||
26
src/services/IsCalendarInstalled.js
Normal file
26
src/services/IsCalendarInstalled.js
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
import { loadState } from '@nextcloud/initial-state'
|
||||
|
||||
const calendar = loadState('deck', 'calendar')
|
||||
export default calendar
|
||||
Reference in New Issue
Block a user