}
);
+ foreach ($notes as &$note) {
+ $diffInDays = intval(
+ (time() - strtotime($note['last-change-date'])) / 86400
+ );
+ $value = 0 + $diffInDays;
+ if ($value > 160) {
+ $value = 160;
+ }
+ $note['dateColor'] = '#' . str_repeat(sprintf('%02X', $value), 3);
+ }
+
$res = new TemplateResponse('grauphel', 'tag');
$res->setParams(
array(
background-position: 8px center;
background-repeat: no-repeat;
}
+#headerTitle {
+ /* let it take all available space */
+ width: 9999px;
+}
a.action.delete, table.table form button.action.delete {
position: absolute;
<table class="table" id="grauphel-notes">
<thead>
<tr>
- <th>Title</th>
- <th>Last change</th>
+ <th id="headerTitle">Title</th>
+ <th>Modified</th>
</tr>
</thead>
<tbody>
<td>
<a class="cellclick" href="<?php p(OCP\Util::linkToRoute('grauphel.gui.note', array('guid' => $note['guid']))); ?>"><?php echo ($note['title']); ?></a>
</td>
- <td>
+ <td style="color: <?php echo p($note['dateColor']); ?>">
<?php p(\OCP\Util::formatDate(strtotime($note['last-change-date']))); ?>
</td>
</tr>