From e1e4c36180ecb8e7ba8368920260d19e5d8b2628 Mon Sep 17 00:00:00 2001 From: Ruben Carlo Benante Date: Sat, 11 Jul 2026 15:46:23 -0300 Subject: [PATCH] mastery badge + fix Integrations helper access (restores Reset button) (v0.5.0) --- Helper/QualKardHelper.php | 14 ++++++++++++++ Plugin.php | 9 ++++++++- Template/project/integration.php | 4 ++-- VERSION | 2 +- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/Helper/QualKardHelper.php b/Helper/QualKardHelper.php index beab78f..bdb7717 100644 --- a/Helper/QualKardHelper.php +++ b/Helper/QualKardHelper.php @@ -193,4 +193,18 @@ class QualKardHelper extends Base )); $this->db->table(TaskModel::TABLE)->eq('id', $task_id)->update(array('date_due' => $due)); } + + /** + * The mastery badge (label + CSS class) for a card, from its stored average. + * + * @param int $task_id + * @return array + */ + public function cardBadge($task_id) + { + $raw = $this->taskMetadataModel->get($task_id, 'qualkard_avg', ''); + $avg = ($raw === '' || $raw === null) ? null : (float) $raw; + + return self::badge($avg); + } } diff --git a/Plugin.php b/Plugin.php index 44b20dc..6d77412 100644 --- a/Plugin.php +++ b/Plugin.php @@ -48,6 +48,13 @@ class Plugin extends Base } } }); + + // Mastery badge under the card title on the board, plus its stylesheet. + $this->template->hook->attach('template:board:private:task:after-title', 'qualKard:board/badge'); + $this->template->hook->attach('template:board:public:task:after-title', 'qualKard:board/badge'); + $this->hook->on('template:layout:css', array( + 'template' => 'plugins/QualKard/Asset/css/qualkard.css', + )); } public function getHelpers() @@ -74,7 +81,7 @@ class Plugin extends Base public function getPluginVersion() { - return '0.4.0'; + return '0.5.0'; } public function getPluginHomepage() diff --git a/Template/project/integration.php b/Template/project/integration.php index fd45f3a..603c6fd 100644 --- a/Template/project/integration.php +++ b/Template/project/integration.php @@ -1,10 +1,10 @@

-helper->QualKardHelper->hasRecoReco()): ?> +QualKardHelper->hasRecoReco()): ?>

-helper->QualKardHelper->isEnabled($project['id'])): ?> +QualKardHelper->isEnabled($project['id'])): ?>

diff --git a/VERSION b/VERSION index d19cc72..ffa7f7a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -QualKard v0.4 +QualKard v0.5