From b8fa0246803dab40cf57d40b45984c53046f2d55 Mon Sep 17 00:00:00 2001 From: "Dzial Techniczny WMW Projekt s.c" Date: Tue, 10 Dec 2019 11:34:53 +0100 Subject: Plugins directory and local modifications --- .../Controller/SettingsController.php | 62 ++++++++ .../Boardcustomizer/Locale/de_DE/translations.php | 21 +++ plugins/Boardcustomizer/Makefile | 6 + plugins/Boardcustomizer/Plugin.php | 44 ++++++ plugins/Boardcustomizer/README.md | 51 ++++++ plugins/Boardcustomizer/Template/layout/head.php | 173 +++++++++++++++++++++ .../Boardcustomizer/Template/project/dropdown.php | 3 + plugins/Boardcustomizer/Template/user/settings.php | 29 ++++ plugins/Boardcustomizer/Template/user/sidebar.php | 3 + 9 files changed, 392 insertions(+) create mode 100644 plugins/Boardcustomizer/Controller/SettingsController.php create mode 100644 plugins/Boardcustomizer/Locale/de_DE/translations.php create mode 100644 plugins/Boardcustomizer/Makefile create mode 100644 plugins/Boardcustomizer/Plugin.php create mode 100644 plugins/Boardcustomizer/README.md create mode 100644 plugins/Boardcustomizer/Template/layout/head.php create mode 100644 plugins/Boardcustomizer/Template/project/dropdown.php create mode 100644 plugins/Boardcustomizer/Template/user/settings.php create mode 100644 plugins/Boardcustomizer/Template/user/sidebar.php (limited to 'plugins/Boardcustomizer') 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 @@ +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 @@ + '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 @@ +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 @@ +user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_materialcard")) { + /* change overall card layout and shadow */ + ?> + +user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_onlyfirstcolumnheaders")) { + /* This will hide all column titles on swimlanes except for the first one */ + ?> + +user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_hidetaskage")) { + /* hide task age */ + ?> + +user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_hidetaskpriority")) { + /* hide task priority */ + ?> + +user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_whitebackground")) { + /* task white background */ + ?> + +user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_topnavhiddenscrollbar")) { + /* better nav bar */ + ?> + +user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_groupassign_hidecardlabels")) { + /* hide group assign labels */ + ?> + +user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_hideownername")) { + /* hide owner text */ + ?> + +user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_hidecategory")) { + /* hide category */ + ?> + +user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_hidetags")) { + /* hide tags */ + ?> + +user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_hidefooter")) { + /* hide whole footer */ + ?> + +user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_hidereference")) { + /* hide reference */ + ?> + +user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_hidescore")) { + /* hide score */ + ?> + +user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_hidetimeestimated")) { + /* hide time estimated */ + ?> + +user->userMetadataModel->exists($this->user->getid(), "boardcustomizer_hidetaskdate")) { + /* hide task date */ + ?> + + + url->icon('cog', t('My display settings'), 'SettingsController', 'showSettings', array('plugin' => 'boardcustomizer')) ?> + \ 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 @@ + + + + +

+ + + + + + + $key) : ?> + + + + + +
+ + + user->userMetadataModel->exists($user['id'], $key)) : ?> + url->icon('toggle-off', t('Disable'), 'SettingsController', 'disable', array('plugin' => 'boardcustomizer', 'key' => $key), true) ?> + + url->icon('toggle-on', t('Enable'), 'SettingsController', 'enable', array('plugin' => 'boardcustomizer', 'key' => $key), true) ?> + +
+ \ 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 @@ +
  • app->checkMenuSelection('SettingsController', 'showSettings') ?>> + url->link(t('My display settings'), 'SettingsController', 'showSettings', array('plugin' => 'boardcustomizer')) ?> +
  • \ No newline at end of file -- cgit v1.2.3