f2 comment icon always on, v0.3

This commit is contained in:
2026-07-05 10:20:45 -03:00
parent d47809c713
commit 230982dd4c
7 changed files with 104 additions and 3 deletions

View File

@@ -0,0 +1,14 @@
<?php /*
* Rendered by the template:board:task:icons hook, inside the card icons row. When a card
* has no comments yet, Kanboard shows no comment icon at all -- so adding the first comment
* means opening the card and finding the sidebar link. This adds a comment bubble with a
* "+" that opens the same comment modal (CommentListController::show) the native count icon
* uses, so the first comment can be added straight from the board. Cards that already have
* comments render nothing here (the native count icon already shows).
*
* Only shown to users who may create a comment (CommentController::save is PROJECT_MEMBER),
* so it does not appear for read-only viewers.
*/ ?>
<?php if (empty($task['nb_comments']) && $this->user->hasProjectAccess('CommentController', 'save', $task['project_id'])): ?>
<?= $this->modal->medium('comments-o', '+', 'CommentListController', 'show', array('task_id' => $task['id']), t('Add a comment')) ?>
<?php endif ?>

18
Template/config/show.php Normal file
View File

@@ -0,0 +1,18 @@
<div class="page-header">
<h2><?= t('Organon Tweaks') ?></h2>
</div>
<form method="post" action="<?= $this->url->href('ConfigController', 'save', array('plugin' => 'OrganonTweaks')) ?>" autocomplete="off">
<?= $this->form->csrf() ?>
<fieldset>
<?= $this->form->checkbox('organon_tweaks_always_comment_icon', t('Always show the comment icon on board cards'), 1, isset($values['organon_tweaks_always_comment_icon']) && $values['organon_tweaks_always_comment_icon'] == 1) ?>
<p class="form-help">
<?= t('Show a comment bubble with a "+" on cards that have no comments yet, so you can add the first comment straight from the board. Cards that already have comments keep showing the count as usual.') ?>
</p>
</fieldset>
<div class="form-actions">
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
</div>
</form>

View File

@@ -0,0 +1,3 @@
<li <?= $this->app->checkMenuSelection('ConfigController', 'show', 'OrganonTweaks') ?>>
<?= $this->url->link(t('Organon Tweaks'), 'ConfigController', 'show', array('plugin' => 'OrganonTweaks')) ?>
</li>