summaryrefslogtreecommitdiff
path: root/plugins/Boardcustomizer
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Boardcustomizer')
-rw-r--r--plugins/Boardcustomizer/Controller/SettingsController.php62
-rw-r--r--plugins/Boardcustomizer/Locale/de_DE/translations.php21
-rw-r--r--plugins/Boardcustomizer/Makefile6
-rw-r--r--plugins/Boardcustomizer/Plugin.php44
-rw-r--r--plugins/Boardcustomizer/README.md51
-rw-r--r--plugins/Boardcustomizer/Template/layout/head.php173
-rw-r--r--plugins/Boardcustomizer/Template/project/dropdown.php3
-rw-r--r--plugins/Boardcustomizer/Template/user/settings.php29
-rw-r--r--plugins/Boardcustomizer/Template/user/sidebar.php3
9 files changed, 392 insertions, 0 deletions
diff --git a/plugins/Boardcustomizer/Controller/SettingsController.php b/plugins/Boardcustomizer/Controller/SettingsController.php
new file mode 100644
index 00000000..e98ffbde
--- /dev/null
+++ b/plugins/Boardcustomizer/Controller/SettingsController.php
@@ -0,0 +1,62 @@
+<?php
+
+namespace Kanboard\Plugin\BoardCustomizer\Controller;
+
+use Kanboard\Controller\BaseController;
+
+class SettingsController extends BaseController
+{
+
+ public function showSettings()
+ {
+ $user = $this->getUser();
+
+ $options = [
+ t('Board: only show first column header') => 'boardcustomizer_onlyfirstcolumnheaders',
+ t('Board: top selection without scollbar') => 'boardcustomizer_topnavhiddenscrollbar',
+ t('Card: material design') => 'boardcustomizer_materialcard',
+ t('Card: white background') => 'boardcustomizer_whitebackground',
+ t('Card: hide owner name') => 'boardcustomizer_hideownername',
+ t('Card: hide category') => 'boardcustomizer_hidecategory',
+ t('Card: hide tags') => 'boardcustomizer_hidetags',
+ t('Card: hide all footer icons') => 'boardcustomizer_hidefooter',
+ t('Card: hide task priority') => 'boardcustomizer_hidetaskpriority',
+ t('Card: hide task age') => 'boardcustomizer_hidetaskage',
+ t('Card: hide reference') => 'boardcustomizer_hidereference',
+ t('Card: hide score') => 'boardcustomizer_hidescore',
+ t('Card: hide time estimated') => 'boardcustomizer_hidetimeestimated',
+ t('Card: hide task date') => 'boardcustomizer_hidetaskdate'
+ ];
+
+ // additional options is other plugin is installed
+ $pluginFGroupAssign = PLUGINS_DIR . DIRECTORY_SEPARATOR . basename('Group_assign');
+ if (file_exists($pluginFGroupAssign)) {
+ $plugin_groupassign = [
+ t('Card: hide group labels') => 'boardcustomizer_groupassign_hidecardlabels'
+ ];
+ $options = array_merge($options, $plugin_groupassign);
+ }
+
+ $this->response->html($this->helper->layout->user('boardcustomizer:user/settings', [
+ 'title' => t('My display settings'),
+ 'user' => $user,
+ 'options' => $options,
+ ]));
+ }
+
+ public function disable()
+ {
+ $user = $this->getUser();
+ $key = $this->request->getStringParam('key');
+ $this->userMetadataModel->remove($user['id'], $key);
+ return $this->response->redirect($this->helper->url->to('SettingsController', 'showSettings', ['plugin' => 'boardcustomizer']), true);
+ }
+
+ public function enable()
+ {
+ $user = $this->getUser();
+ $key = $this->request->getStringParam('key');
+ $this->userMetadataModel->save($user['id'], [$key => true]);
+ return $this->response->redirect($this->helper->url->to('SettingsController', 'showSettings', ['plugin' => 'boardcustomizer']), true);
+ }
+}
diff --git a/plugins/Boardcustomizer/Locale/de_DE/translations.php b/plugins/Boardcustomizer/Locale/de_DE/translations.php
new file mode 100644
index 00000000..91587405
--- /dev/null
+++ b/plugins/Boardcustomizer/Locale/de_DE/translations.php
@@ -0,0 +1,21 @@
+<?php
+
+return array(
+ 'My display settings' => 'Meine Anzeigeeinstellungen',
+ 'Board: only show first column header' => 'Pinnwand: nur erste Spaltenüberschrift anzeigen',
+ 'Board: top selection without scollbar' => 'Pinnwand: Pinnwandauswahl in Kopfzeile ohne Scrollbar',
+ 'Card: material design' => 'Karte: Materialdesign',
+ 'Card: hide task priority' => 'Karte: Aufgabenpriorität ausblenden',
+ 'Card: hide task age' => 'Karte: Alter der Aufgabe ausblenden',
+ 'Card: white background' => 'Karte: weißer Hintergrund',
+ 'Card: hide group labels' => 'Karte: Gruppenbeschriftungen ausblenden',
+ 'Customize board and card style' => 'Anpassen von Pinnwand- und Kartenstilen',
+ 'Card: hide owner name' => 'Karte: Name Zuständiger ausblenden',
+ 'Card: hide category' => 'Karte: Kategorie ausblenden',
+ 'Card: hide tags' => 'Karte: Schlagworte ausblenden',
+ 'Card: hide all footer icons' => 'Karte: alle Icons ausblenden',
+ 'Card: hide reference' => 'Karte: Referenz ausblenden',
+ 'Card: hide score' => 'Karte: Komplexität ausblenden',
+ 'Card: hide time estimated' => 'Karte: geschätzte Zeit ausblenden',
+ 'Card: hide task date' => 'Karte: Datum ausblenden',
+);
diff --git a/plugins/Boardcustomizer/Makefile b/plugins/Boardcustomizer/Makefile
new file mode 100644
index 00000000..65801bdd
--- /dev/null
+++ b/plugins/Boardcustomizer/Makefile
@@ -0,0 +1,6 @@
+plugin=Boardcustomizer
+version=1.0.1
+
+all:
+ @ echo "Build archive for plugin ${plugin} version=${version}"
+ @ git archive HEAD --prefix=${plugin}/ --format=zip -o ${plugin}-${version}.zip \ No newline at end of file
diff --git a/plugins/Boardcustomizer/Plugin.php b/plugins/Boardcustomizer/Plugin.php
new file mode 100644
index 00000000..0cf8f990
--- /dev/null
+++ b/plugins/Boardcustomizer/Plugin.php
@@ -0,0 +1,44 @@
+<?php
+
+namespace Kanboard\Plugin\BoardCustomizer;
+
+use Kanboard\Core\Plugin\Base;
+use Kanboard\Core\Translator;
+
+class Plugin extends Base
+{
+ public function initialize()
+ {
+ $this->template->hook->attach('template:layout:head', 'boardcustomizer:layout/head');
+ $this->template->hook->attach('template:project:dropdown', 'boardcustomizer:project/dropdown');
+ $this->template->hook->attach('template:user:sidebar:information', 'boardcustomizer:user/sidebar');
+ }
+ public function onStartup()
+ {
+ Translator::load($this->languageModel->getCurrentLanguage(), __DIR__ . '/Locale');
+ }
+ public function getPluginName()
+ {
+ return 'Boardcustomizer';
+ }
+ public function getPluginDescription()
+ {
+ return t('Customize board and card style');
+ }
+ public function getPluginAuthor()
+ {
+ return 'BlueTeck';
+ }
+ public function getPluginVersion()
+ {
+ return '1.0.1';
+ }
+ public function getPluginHomepage()
+ {
+ return 'https://github.com/BlueTeck/kanboard_plugin_boardcustomizer';
+ }
+ public function getCompatibleVersion()
+ {
+ return '>=1.2.10';
+ }
+}
diff --git a/plugins/Boardcustomizer/README.md b/plugins/Boardcustomizer/README.md
new file mode 100644
index 00000000..ede7fec0
--- /dev/null
+++ b/plugins/Boardcustomizer/README.md
@@ -0,0 +1,51 @@
+# Kanboard Plugin BoardCustomizer
+
+Customize board and card style per user.
+
+Plugin for https://github.com/kanboard/kanboard
+
+
+## Options
+
+### Board
+- only show first column header
+- top selection without scollbar
+
+### Card
+- material design
+- hide task priority
+- hide task age
+- white background
+- hide owner name
+- hide category
+- hide tags
+- hide whole footer
+- hide reference
+- hide score
+- hide time estimated
+- hide task date
+- hide group labels (if [Group Assign](https://github.com/creecros/group_assign) Plugin is installed)
+
+Further options and pull requests are welcome.
+
+## Screenshots
+
+![Screenshot 1](https://user-images.githubusercontent.com/1961634/60758678-45135700-a01a-11e9-9c9d-23290daaddb7.png)
+
+![Screenshot 2](https://user-images.githubusercontent.com/1961634/60758686-6f651480-a01a-11e9-8bb0-0afb13ba9a6e.png)
+
+## Author
+
+- [BlueTeck](https://github.com/BlueTeck)
+- License MIT
+
+## Installation
+
+No additional tables are needed, metadata storage of the user is used.
+
+- Decompress the archive in the `plugins` folder
+
+or
+
+- Create a folder **plugins/Boardcustomizer**
+- Copy all files under this directory \ No newline at end of file
diff --git a/plugins/Boardcustomizer/Template/layout/head.php b/plugins/Boardcustomizer/Template/layout/head.php
new file mode 100644
index 00000000..fca861f9
--- /dev/null
+++ b/plugins/Boardcustomizer/Template/layout/head.php
@@ -0,0 +1,173 @@
+<?php
+if ($this->user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_materialcard")) {
+ /* change overall card layout and shadow */
+ ?>
+ <style>
+ .board-task-list>div.task-board {
+ font-size: 13px;
+ border-left-width: 2.5px !important;
+ border-radius: 3px;
+ padding-left: 6px;
+ padding-right: 4px;
+ padding-top: 6px;
+ padding-bottom: 6px;
+ margin-bottom: 8px;
+ margin-left: 8px;
+ margin-right: 8px;
+ box-shadow: 0 1px 2px rgba(62, 54, 54, 0.55);
+ border-right: none;
+ border-top: 1px solid #ececec;
+ border-bottom: none;
+ }
+ </style>
+<?php
+}
+if ($this->user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_onlyfirstcolumnheaders")) {
+ /* This will hide all column titles on swimlanes except for the first one */
+ ?>
+ <style>
+ tr[class*='board-swimlane-columns']:not(:first-child) {
+ display: none;
+ }
+
+ .board-column-header-task-count {
+ display: none;
+ }
+ </style>
+<?php
+}
+if ($this->user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_hidetaskage")) {
+ /* hide task age */
+ ?>
+ <style>
+ .task-icon-age {
+ display: none;
+ }
+ </style>
+<?php
+}
+if ($this->user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_hidetaskpriority")) {
+ /* hide task priority */
+ ?>
+ <style>
+ .task-priority {
+ display: none;
+ }
+ </style>
+<?php
+}
+if ($this->user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_whitebackground")) {
+ /* task white background */
+ ?>
+ <style>
+ .board-task-list>div {
+ background-color: white !important;
+ background: #fff;
+ }
+ </style>
+<?php
+}
+if ($this->user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_topnavhiddenscrollbar")) {
+ /* better nav bar */
+ ?>
+ <style>
+ #select-dropdown-menu {
+ overflow: auto !important;
+ }
+ </style>
+<?php
+}
+if ($this->user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_groupassign_hidecardlabels")) {
+ /* hide group assign labels */
+ ?>
+ <style>
+ .assigned-group-label {
+ display: none;
+ }
+
+ .assigned-other-label {
+ display: none;
+ }
+ </style>
+<?php
+}
+if ($this->user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_hideownername")) {
+ /* hide owner text */
+ ?>
+ <style>
+ div.task-board-header > .task-board-assignee {
+ display: none;
+ }
+ </style>
+<?php
+}
+if ($this->user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_hidecategory")) {
+ /* hide category */
+ ?>
+ <style>
+ .task-board-category-container {
+ display: none;
+ }
+ </style>
+<?php
+}
+if ($this->user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_hidetags")) {
+ /* hide tags */
+ ?>
+ <style>
+ .task-tags {
+ display: none;
+ }
+ </style>
+<?php
+}
+if ($this->user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_hidefooter")) {
+ /* hide whole footer */
+ ?>
+ <style>
+ .task-board-icons {
+ display: none;
+ }
+ </style>
+<?php
+}
+if ($this->user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_hidereference")) {
+ /* hide reference */
+ ?>
+ <style>
+ .task-board-reference {
+ display: none;
+ }
+ </style>
+<?php
+}
+if ($this->user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_hidescore")) {
+ /* hide score */
+ ?>
+ <style>
+ .task-score {
+ display: none;
+ }
+ </style>
+<?php
+}
+if ($this->user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_hidetimeestimated")) {
+ /* hide time estimated */
+ ?>
+ <style>
+ .task-time-estimated {
+ display: none;
+ }
+ </style>
+<?php
+}
+if ($this->user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_hidetaskdate")) {
+ /* hide task date */
+ ?>
+ <style>
+ .task-date {
+ display: none;
+ }
+ </style>
+<?php
+} \ No newline at end of file
diff --git a/plugins/Boardcustomizer/Template/project/dropdown.php b/plugins/Boardcustomizer/Template/project/dropdown.php
new file mode 100644
index 00000000..0d9f7e6a
--- /dev/null
+++ b/plugins/Boardcustomizer/Template/project/dropdown.php
@@ -0,0 +1,3 @@
+<li>
+ <?= $this->url->icon('cog', t('My display settings'), 'SettingsController', 'showSettings', array('plugin' => 'boardcustomizer')) ?>
+</li> \ No newline at end of file
diff --git a/plugins/Boardcustomizer/Template/user/settings.php b/plugins/Boardcustomizer/Template/user/settings.php
new file mode 100644
index 00000000..9a6e3124
--- /dev/null
+++ b/plugins/Boardcustomizer/Template/user/settings.php
@@ -0,0 +1,29 @@
+<div class="page-header">
+ <h2><?= t('My display settings') ?></h2>
+</div>
+
+
+<?php if (empty($options)) : ?>
+ <p class="alert"><?= t('No options') ?></p>
+<?php else : ?>
+ <table class="table-small table-fixed">
+ <tr>
+ <th class="column-40"><?= t('Option') ?></th>
+ <th class="column-20"><?= t('Status') ?></th>
+ </tr>
+ <?php foreach ($options as $option => $key) : ?>
+ <tr>
+ <td>
+ <?= $option ?>
+ </td>
+ <td>
+ <?php if ($this->user->userMetadataModel->exists($user['id'], $key)) : ?>
+ <?= $this->url->icon('toggle-off', t('Disable'), 'SettingsController', 'disable', array('plugin' => 'boardcustomizer', 'key' => $key), true) ?>
+ <?php else : ?>
+ <?= $this->url->icon('toggle-on', t('Enable'), 'SettingsController', 'enable', array('plugin' => 'boardcustomizer', 'key' => $key), true) ?>
+ <?php endif ?>
+ </td>
+ </tr>
+ <?php endforeach ?>
+ </table>
+<?php endif ?> \ No newline at end of file
diff --git a/plugins/Boardcustomizer/Template/user/sidebar.php b/plugins/Boardcustomizer/Template/user/sidebar.php
new file mode 100644
index 00000000..2d7a1582
--- /dev/null
+++ b/plugins/Boardcustomizer/Template/user/sidebar.php
@@ -0,0 +1,3 @@
+<li <?= $this->app->checkMenuSelection('SettingsController', 'showSettings') ?>>
+ <?= $this->url->link(t('My display settings'), 'SettingsController', 'showSettings', array('plugin' => 'boardcustomizer')) ?>
+</li> \ No newline at end of file