Skip to content

Commit

Permalink
[jan] Display task list background color in basic view.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Sep 26, 2014
1 parent 18930a3 commit 6dcb99e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions nag/docs/CHANGES
Expand Up @@ -2,6 +2,7 @@
v4.3.0-git
----------

[jan] Display task list background color in basic view.
[jan] Import snooze information from iCalendar alarms.
[jan] Import iCalendar 2.0 alarms.
[jan] Import and export recurrence rules to iCalendar.
Expand Down
2 changes: 2 additions & 0 deletions nag/package.xml
Expand Up @@ -33,6 +33,7 @@
</stability>
<license uri="http://www.horde.org/licenses/gpl">GPL-2.0</license>
<notes>
* [jan] Display task list background color in basic view.
* [jan] Import snooze information from iCalendar alarms.
* [jan] Import iCalendar 2.0 alarms.
* [jan] Import and export recurrence rules to iCalendar.
Expand Down Expand Up @@ -1605,6 +1606,7 @@
<date>2014-06-04</date>
<license uri="http://www.horde.org/licenses/gpl">GPL-2.0</license>
<notes>
* [jan] Display task list background color in basic view.
* [jan] Import snooze information from iCalendar alarms.
* [jan] Import iCalendar 2.0 alarms.
* [jan] Import and export recurrence rules to iCalendar.
Expand Down
9 changes: 8 additions & 1 deletion nag/templates/list.html.php
Expand Up @@ -54,8 +54,15 @@ function doPrefsUpdate(column, sortDown)
$owner = $task->tasklist;
}
}
$background = $share->get('color') ?: '#ddd';
$foreground = '#000';
if (Horde_Image::brightness($background) < 128) {
$foreground = '#fff';
}
$locals = array(
'style' => $style,
'background' => $background,
'foreground' => $foreground,
'have_read' => $share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ),
'have_edit' => $share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT),
'owner' => $owner,
Expand All @@ -75,4 +82,4 @@ function doPrefsUpdate(column, sortDown)
<div id="tasks_empty" style="display:none">
<?php echo _("No tasks match") ?>
</div>
</div>
</div>
4 changes: 2 additions & 2 deletions nag/templates/list/_task.html.php
@@ -1,4 +1,4 @@
<tr class="<?php echo $style ?>">
<tr class="<?php echo $style ?>" style="background-color:<?php echo $background ?>; color: <?php echo $foreground ?>">
<td>
<?php
if ($have_edit) {
Expand Down Expand Up @@ -54,7 +54,7 @@
if ($this->smartShare) {
$params['list'] = $this->smartShare->getName();
}
echo Horde::linkTooltip($task->view_link->add($params), '', '', '', '', $task->desc)
echo Horde::linkTooltip($task->view_link->add($params), '', '', '', '', $task->desc, '', array('style' => 'color:' . $foreground))
. $task_name . '</a>';
} else {
echo $task_name;
Expand Down

0 comments on commit 6dcb99e

Please sign in to comment.