summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--public/css/sublab.calendar.css3
-rw-r--r--scripts/calendar_plugin2.py2
-rw-r--r--template/tabcalendar.j22
3 files changed, 6 insertions, 1 deletions
diff --git a/public/css/sublab.calendar.css b/public/css/sublab.calendar.css
index 6393490..5dab3e7 100644
--- a/public/css/sublab.calendar.css
+++ b/public/css/sublab.calendar.css
@@ -60,3 +60,6 @@
padding-left: 10px;
margin-bottom: 0px;
}
+.tabcal-today {
+ background-color: rgb(46,100,20);
+}
diff --git a/scripts/calendar_plugin2.py b/scripts/calendar_plugin2.py
index ea44483..a7f752c 100644
--- a/scripts/calendar_plugin2.py
+++ b/scripts/calendar_plugin2.py
@@ -52,6 +52,7 @@ class TabularCalendarPlugin:
cur_day = calendar_start
active_month = None
active_week = None
+ today = date.today()
while cur_day <= calendar_end:
cur_month = cur_day.month
cur_week = cur_day.isocalendar()[1]
@@ -74,6 +75,7 @@ class TabularCalendarPlugin:
'year': cur_day.year,
'month': cur_day.month,
'day': cur_day.day,
+ 'today': cur_day == today,
'weekday': cur_day.weekday(),
'events': []
})
diff --git a/template/tabcalendar.j2 b/template/tabcalendar.j2
index ef84bfd..976aaa0 100644
--- a/template/tabcalendar.j2
+++ b/template/tabcalendar.j2
@@ -17,7 +17,7 @@
<td></td>
{%- endfor %}
{%- for day in week %}
-<td class="tabcal-cell">
+<td class="tabcal-cell {% if day.today %}tabcal-today{% endif %}">
<p class="tabcal-day">{{ day.day }}</span>
{%- if day.events %}
<ul>