home · contact · privacy
Improve todo accounting script.
[misc] / todo_templates / calendar.html
index 82a9ca2e487e16517ef127f7a41859aedede051f..bc77ccdb0669aed74dd67be1fa6ff7828301958a 100644 (file)
@@ -1,30 +1,70 @@
 {% extends 'base.html' %}
+
 {% block css %}
-tr td { background-color: white; }
+#filter { margin-bottom: 1em; }
+tr.month_row td { color: white; background-color: #555555; text-align: center; }
 tr.week_row td { height: 0.1em; background-color: black; }
-tr.day_row td { background-color: #cccccc }
-td.checkbox { width: 0.1em; height: 0.1em; padding: 0em; text-align: center; }
+tr.day_row td { background-color: #cccccc; }
+span.selected_date { font-weight: bold; }
 {% endblock %}
+
 {% block content %}
+<h3>calendar</h3>
 <form action="calendar" method="POST">
-<p>
+
+<div id="filter">
 from: <input name="start" {% if start_date %}value="{{ start_date }}"{% endif %} placeholder="yesterday" />
 to: <input name="end" {% if end_date %}value="{{ end_date }}"{% endif %} placeholder="2030-12-31" />
 <input type="submit" value="OK" />
-</p>
+</div>
+
 <table>
-{% for date, day in days.items() | sort() %}
-{% if day.weekday == 'Mo' %}<tr class="week_row"><td colspan=3></td></tr>{% endif %}
-<tr class="day_row"><td colspan=3><a href="do_tasks?date={{date}}&hide_unchosen=1">{{ day.weekday }} {{ date }}</a> |{{ "%5.1f" |format(day.todos_sum)}}| {{ day.comment|e }}</td></tr>
-{% for todo in day.linked_todos_as_list %}
+{% for date, day in days.items() %}
 
-{% if todo.visible %}
-<tr><td class="checkbox">{% if todo.done and not "cancelled" in todo.tags%}✓{% else %}&nbsp;&nbsp;{% endif %}</td><td><a href="todo?id={{todo.id_}}">{% if "cancelled" in todo.tags %}<s>{% endif %}{% if "deadline" in todo.tags %}DEADLINE: {% endif %}{{ todo.title|e }}{%if "cancelled" in todo.tags%}</s>{% endif %}</a></td><td>{{ todo.comment|e }}</td></tr>
+{% if day.month_title %}
+<tr class="month_row">
+<td colspan=3>{{ day.month_title }}</td>
+</tr>
+{% endif %}
+
+{% if day.weekday == 'Mo' %}
+<tr class="week_row">
+<td colspan=3></td>
+</tr>
 {% endif %}
 
+<tr class="day_row">
+<td colspan=3>
+<span {% if date == selected_date %}class="selected_date"{% endif %}>
+<a href="do_todos?date={{date}}&hide_unchosen=1">{{ day.weekday }} {{ date }}</a>
+</span>
+<span style="white-space: pre; ">|{{ '{:5.1f}'.format(day.todos_sum)}}|</span>
+{{ day.comment|e }}
+</td>
+</tr>
+
+{% for todo in day.linked_todos_as_list %}
+{% if todo.visible %}
+<tr>
+<td>
+{% if "cancelled" in todo.tags %}<s>{% endif %}
+[{% if todo.done and not "cancelled" in todo.tags %}✓{% else %} {% endif %}]
+<a href="todo?id={{todo.id_}}">
+{% if "deadline" in todo.tags %}DEADLINE: {% endif %}
+{{ todo.title|e }}
+</a>
+{%if "cancelled" in todo.tags%}</s>{% endif %}
+</td>
+<td>
+{{ todo.comment|e }}
+</td>
+</tr>
+{% endif %}
 {% endfor %}
+
 {% endfor %}
 </table>
+
 </form>
 {% endblock %}