home · contact · privacy
Add foreign key restraints, expand and fix tests, add deletion and forking.
[misc] / todo_templates / calendar.html
index 8f0aa8e52bb598cfcdeb20bb41593feda30503a4..59dd5c57bf58654d9f7f4ce9410fa5b8ee0c518f 100644 (file)
@@ -1,27 +1,79 @@
 {% extends 'base.html' %}
+
+
+
 {% block css %}
+#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: #f2f2f2 }
-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; }
+span.todos_sum { white-space: pre; }
 {% endblock %}
+
+
+
 {% block content %}
-<form action="{{action|e}}" method="POST">
-<p>
-from: <input name="start" {% if start_date %}value="{{ start_date }}"{% endif %} placeholder="{{ today }}" />
+<h3>calendar</h3>
+<form action="calendar" method="POST">
+
+<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="{{db.prefix}}/day?selected_date={{date}}&hide_unchosen=1">{{ day.weekday }} {{ date }}</a> |{{ '%04.1f' % day.todos_sum|round(2) }}| {{ day.comment|e }}</td></tr>
-{% for task, todo in day.todos.items() | sort(attribute='1.title', reverse=True)  %}
+{% for date, day in days.items() %}
+
+{% 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="day_todos?date={{date}}">{{ day.weekday }} {{ date }}</a>
+</span>
+<span class="todos_sum">|{{ '{: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 class="checkbox">{% if todo.done %}✓{% else %}&nbsp;&nbsp;{% endif %}</td><td><a href="{{db.prefix}}/todo?task={{ todo.task.id_ }}&date={{ date }}">{%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>
+<tr>
+<td>
+{% if "cancelled" in todo.tags %}<s>{% endif %}
+{{ macros.doneness_string(todo, true) }}
+<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>
+
+<p>
+<a href="calendar_export?{% if start_date %}start={{start_date}}&{% endif %}{% if end_date %}end={{end_date}}{% endif %}">exportable</a>
+</p>
+
 </form>
 {% endblock %}