fix Always-off (on/off/default safe values) + bump emphasis to 1.375em (v1.4.2)
This commit is contained in:
@@ -9,7 +9,11 @@ use Kanboard\Core\Base;
|
|||||||
*
|
*
|
||||||
* Resolves the 3-state "emphasize due date" setting for the CURRENT board (read from the route
|
* Resolves the 3-state "emphasize due date" setting for the CURRENT board (read from the route
|
||||||
* project_id, which the router populates for pretty URLs before the layout renders):
|
* project_id, which the router populates for pretty URLs before the layout renders):
|
||||||
* per-board '1' -> on, '0' -> off, 'default'/absent -> follow the LIVE global default.
|
* per-board 'on' -> on, 'off' -> off, 'default'/absent -> follow the LIVE global default.
|
||||||
|
*
|
||||||
|
* The stored values are the non-falsy strings 'on'/'off' (not '1'/'0'): Kanboard's
|
||||||
|
* MetadataModel::get() uses `?:`, and PHP treats the string "0" as falsy, so a stored "0" would
|
||||||
|
* come back as the 'default' fallback and "Always off" would never be honored.
|
||||||
*/
|
*/
|
||||||
class OrganonProjectHelper extends Base
|
class OrganonProjectHelper extends Base
|
||||||
{
|
{
|
||||||
@@ -31,11 +35,11 @@ class OrganonProjectHelper extends Base
|
|||||||
|
|
||||||
$value = $this->projectMetadataModel->get($project_id, self::EMPHASIZE_KEY, 'default');
|
$value = $this->projectMetadataModel->get($project_id, self::EMPHASIZE_KEY, 'default');
|
||||||
|
|
||||||
if ($value === '1') {
|
if ($value === 'on') {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($value === '0') {
|
if ($value === 'off') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ class Plugin extends Base
|
|||||||
|
|
||||||
public function getPluginVersion()
|
public function getPluginVersion()
|
||||||
{
|
{
|
||||||
return '1.4.1';
|
return '1.4.2';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPluginHomepage()
|
public function getPluginHomepage()
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
<?php if ($this->OrganonProjectHelper->isEmphasizeDueDate()): ?>
|
<?php if ($this->OrganonProjectHelper->isEmphasizeDueDate()): ?>
|
||||||
<style>.task-date { font-size: 1.25em; font-weight: bold; }</style>
|
<style>.task-date { font-size: 1.375em; font-weight: bold; }</style>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?php $choice = isset($values['organon_tweaks_emphasize_duedate']) && in_array($values['organon_tweaks_emphasize_duedate'], array('1', '0'), true) ? $values['organon_tweaks_emphasize_duedate'] : 'default' ?>
|
<?php $choice = isset($values['organon_tweaks_emphasize_duedate']) && in_array($values['organon_tweaks_emphasize_duedate'], array('on', 'off'), true) ? $values['organon_tweaks_emphasize_duedate'] : 'default' ?>
|
||||||
|
|
||||||
<h3><i class="fa fa-umbrella fa-fw" aria-hidden="true"></i> <?= t('OrganonTweaks') ?></h3>
|
<h3><i class="fa fa-umbrella fa-fw" aria-hidden="true"></i> <?= t('OrganonTweaks') ?></h3>
|
||||||
<div class="listing">
|
<div class="listing">
|
||||||
@@ -8,10 +8,10 @@
|
|||||||
<input type="radio" name="organon_tweaks_emphasize_duedate" value="default" <?= $choice === 'default' ? 'checked="checked"' : '' ?>> <?= t('Use default') ?>
|
<input type="radio" name="organon_tweaks_emphasize_duedate" value="default" <?= $choice === 'default' ? 'checked="checked"' : '' ?>> <?= t('Use default') ?>
|
||||||
</label>
|
</label>
|
||||||
<label style="display:inline-block; margin-right:16px;">
|
<label style="display:inline-block; margin-right:16px;">
|
||||||
<input type="radio" name="organon_tweaks_emphasize_duedate" value="1" <?= $choice === '1' ? 'checked="checked"' : '' ?>> <?= t('Always on') ?>
|
<input type="radio" name="organon_tweaks_emphasize_duedate" value="on" <?= $choice === 'on' ? 'checked="checked"' : '' ?>> <?= t('Always on') ?>
|
||||||
</label>
|
</label>
|
||||||
<label style="display:inline-block; margin-right:16px;">
|
<label style="display:inline-block; margin-right:16px;">
|
||||||
<input type="radio" name="organon_tweaks_emphasize_duedate" value="0" <?= $choice === '0' ? 'checked="checked"' : '' ?>> <?= t('Always off') ?>
|
<input type="radio" name="organon_tweaks_emphasize_duedate" value="off" <?= $choice === 'off' ? 'checked="checked"' : '' ?>> <?= t('Always off') ?>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<p class="form-help">
|
<p class="form-help">
|
||||||
|
|||||||
Reference in New Issue
Block a user