-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2658 from BKapelari/More-Dashboard-Widgets-#2643
- Loading branch information
Showing
11 changed files
with
519 additions
and
57 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
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,85 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* @copyright Copyright (c) 2020 Julius Härtl <jus@bitgrid.net> | ||
* | ||
* @author Julius Härtl <jus@bitgrid.net> | ||
* | ||
* @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\Deck\Dashboard; | ||
|
||
use OCP\Dashboard\IWidget; | ||
use OCP\IL10N; | ||
|
||
class DeckWidgetToday implements IWidget { | ||
|
||
/** | ||
* | ||
* @var IL10N | ||
*/ | ||
private $l10n; | ||
|
||
public function __construct(IL10N $l10n) { | ||
$this->l10n = $l10n; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getId(): string { | ||
return 'deckToday'; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getTitle(): string { | ||
return $this->l10n->t('Cards due today'); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getOrder(): int { | ||
return 20; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getIconClass(): string { | ||
return 'icon-deck'; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getUrl(): ?string { | ||
return null; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function load(): void { | ||
\OCP\Util::addScript('deck', '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,85 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* @copyright Copyright (c) 2020 Julius Härtl <jus@bitgrid.net> | ||
* | ||
* @author Julius Härtl <jus@bitgrid.net> | ||
* | ||
* @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\Deck\Dashboard; | ||
|
||
use OCP\Dashboard\IWidget; | ||
use OCP\IL10N; | ||
|
||
class DeckWidgetTomorrow implements IWidget { | ||
|
||
/** | ||
* | ||
* @var IL10N | ||
*/ | ||
private $l10n; | ||
|
||
public function __construct(IL10N $l10n) { | ||
$this->l10n = $l10n; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getId(): string { | ||
return 'deckTomorrow'; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getTitle(): string { | ||
return $this->l10n->t('Cards due tomorrow'); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getOrder(): int { | ||
return 20; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getIconClass(): string { | ||
return 'icon-deck'; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getUrl(): ?string { | ||
return null; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function load(): void { | ||
\OCP\Util::addScript('deck', '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
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,79 @@ | ||
<template> | ||
<a :key="card.id" | ||
:href="cardLink" | ||
target="_blank" | ||
class="card"> | ||
<div class="card--header"> | ||
<DueDate class="right" :card="card" /> | ||
<span class="title">{{ card.title }}</span> | ||
</div> | ||
<ul v-if="card.labels && card.labels.length" | ||
class="labels"> | ||
<li v-for="label in card.labels" :key="label.id" :style="labelStyle(label)"> | ||
<span>{{ label.title }}</span> | ||
</li> | ||
</ul> | ||
</a> | ||
</template> | ||
|
||
<script> | ||
import DueDate from '../cards/badges/DueDate.vue' | ||
import { generateUrl } from '@nextcloud/router' | ||
import labelStyle from '../../mixins/labelStyle.js' | ||
export default { | ||
name: 'Card', | ||
components: { DueDate }, | ||
mixins: [labelStyle], | ||
props: { | ||
card: { | ||
type: Object, | ||
required: true, | ||
}, | ||
}, | ||
computed: { | ||
cardLink() { | ||
return generateUrl('/apps/deck') + `#/board/${this.card.boardId}/card/${this.card.id}` | ||
}, | ||
}, | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
@import '../../css/labels'; | ||
.card { | ||
display: block; | ||
border-radius: var(--border-radius-large); | ||
padding: 8px; | ||
height: 60px; | ||
&:hover { | ||
background-color: var(--color-background-hover); | ||
} | ||
} | ||
.card--header { | ||
overflow: hidden; | ||
.title { | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
display: block; | ||
} | ||
} | ||
.labels { | ||
margin-left: 0; | ||
} | ||
.duedate:deep(.due) { | ||
margin: 0 0 0 10px; | ||
padding: 2px 4px; | ||
font-size: 90%; | ||
} | ||
.right { | ||
float: right; | ||
} | ||
</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
Oops, something went wrong.