Changement template caldav

This commit is contained in:
Ambulance Clerc
2022-06-20 00:55:41 +02:00
parent c6a3d4c589
commit 6a5bc4a280
2 changed files with 21 additions and 10 deletions

View File

@@ -46,7 +46,14 @@ class cls_caldav():
for event in recurring_ical_events.of(Calendar.from_ical(self.data)).at(today):
item = _caldav_item()
item.name = event["SUMMARY"]
if "/" in item.name:
arr = item.name.split("/")
item.key = arr[0]
item.name = arr[1]
item.desc = event["DESCRIPTION"]
if "*done*" in item.desc:
item.done = True
item.dtstart = event["DTSTART"].dt.strftime("%d.%m.%Y %H:%M")
item.dtend = event["DTEND"].dt.strftime("%d.%m.%Y %H:%M")
self.items.append(item)
@@ -69,11 +76,13 @@ class cls_caldav():
return self.data
class _caldav_item():
key = ""
name = ""
desc = ""
dtstart = None
dtend = None
dtstamp = None
done = False

View File

@@ -1,15 +1,17 @@
{% if latest_task_list %}
<ul>
{% for task in latest_task_list %}
<li><a "">{{ task.name }}</a></li>
{% endfor %}
</ul>
<table>
{% for task in latest_task_list %}
<tr><td style="font-weight: bold;" width="75" >{{task.key}}</td>&nbsp;&nbsp;&nbsp;&nbsp;<td style="{% if task.done %}text-decoration:line-through{% endif %}">{{ task.name }}</td></tr>
{% endfor %}
</table>
------------------------------------------------------
<ul>
{% for task in night_task_list %}
<li><a "">{{ task.name }}</a></li>
{% endfor %}
</ul>
<table>
{% for task in night_task_list %}
<tr><td style="font-weight: bold;" width="75" >{{task.key}}</td>&nbsp;&nbsp;&nbsp;&nbsp;<td style="{% if task.done %}text-decoration:line-through{% endif %}">{{ task.name }}</td></tr>
{% endfor %}
</table>
{% else %}
<p>No task are available.</p>
{% endif %}