-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Julius Härtl <[email protected]>
- Loading branch information
1 parent
437d06e
commit 0f502a2
Showing
6 changed files
with
219 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* @copyright Copyright (c) 2020 Julius Härtl <[email protected]> | ||
* | ||
* @author Julius Härtl <[email protected]> | ||
* | ||
* @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/>. | ||
* | ||
*/ | ||
|
||
namespace OCA\Mail\Dashboard; | ||
|
||
use OCP\Dashboard\IPanel; | ||
use OCP\IL10N; | ||
use OCP\IURLGenerator; | ||
|
||
class MailPanel implements IPanel { | ||
|
||
/** @var IL10N */ | ||
private $l10n; | ||
/** @var IURLGenerator */ | ||
private $urlGenerator; | ||
|
||
public function __construct(IL10N $l10n, IURLGenerator $urlGenerator) { | ||
$this->l10n = $l10n; | ||
$this->urlGenerator = $urlGenerator; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getId(): string { | ||
return 'mail'; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getTitle(): string { | ||
return $this->l10n->t('Important mail'); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getOrder(): int { | ||
return 4; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getIconClass(): string { | ||
return 'icon-mail'; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getUrl(): ?string { | ||
return $this->urlGenerator->getAbsoluteURL($this->urlGenerator->linkToRoute('mail.page.index')); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function load(): void { | ||
\OCP\Util::addScript('mail', 'dashboard'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* @copyright Copyright (c) 2020 Julius Härtl <[email protected]> | ||
* | ||
* @author Julius Härtl <[email protected]> | ||
* | ||
* @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/>. | ||
* | ||
*/ | ||
|
||
|
||
|
||
namespace OCA\Mail\Listener; | ||
|
||
|
||
use OCA\Mail\Dashboard\MailPanel; | ||
use OCP\Dashboard\RegisterPanelEvent; | ||
use OCP\EventDispatcher\Event; | ||
use OCP\EventDispatcher\IEventListener; | ||
|
||
class DashboardPanelListener implements IEventListener { | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function handle(Event $event): void { | ||
if (!($event instanceof RegisterPanelEvent)) { | ||
return; | ||
} | ||
|
||
$event->registerPanel(MailPanel::class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* @copyright Copyright (c) 2020 Julius Härtl <[email protected]> | ||
* | ||
* @author Julius Härtl <[email protected]> | ||
* | ||
* @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 Vue from 'vue' | ||
import {getRequestToken} from '@nextcloud/auth' | ||
import {generateFilePath} from '@nextcloud/router' | ||
|
||
import App from './App' | ||
import Nextcloud from './mixins/Nextcloud' | ||
import Dashboard from './views/Dashboard' | ||
|
||
__webpack_nonce__ = btoa(getRequestToken()) | ||
__webpack_public_path__ = generateFilePath('mail', '', 'js/') | ||
|
||
Vue.mixin(Nextcloud) | ||
|
||
document.addEventListener('DOMContentLoaded', function() { | ||
OCA.Dashboard.register('mail', (el) => { | ||
const View = Vue.extend(Dashboard) | ||
new View({ | ||
propsData: {}, | ||
}).$mount(el) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!-- | ||
- @copyright Copyright (c) 2020 Julius Härtl <jus@bitgrid.net> | ||
- | ||
- @author Julius Härtl <[email protected]> | ||
- | ||
- @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> | ||
<div> | ||
No mails | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'Dashboard', | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
|
||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters