home · contact · privacy
Minor template improvements.
[plomtask] / templates / day.html
index ac0a64a704cce415cfdc4977597b9de21b2c5dc4..627923b2a2b34c75d57f204f97a2d5b86a729c33 100644 (file)
@@ -8,23 +8,48 @@ td, th, tr, table {
   padding: 0;
   margin: 0;
 }
+table {
+  border-collapse: collapse;
+}
 th {
   border: 1px solid black;
 }
-td.min_width {
-  min-width: 1em;
-}
 td.cond_line_0 {
-  background-color: #ffbbbb;
+  border-top: 1px solid white;
+  background-color: #dddddd;
 }
 td.cond_line_1 {
-  background-color: #bbffbb;
+  border-top: 1px solid white;
+  background-color: #efefef;
 }
 td.cond_line_2 {
-  background-color: #bbbbff;
+  border-top: 1px solid white;
+  background-color: #fffff;
+}
+td.cond_line_corner {
+  max-width: 0px;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: clip;
 }
 td.todo_line {
-  border-bottom: 1px solid #bbbbbb;
+  border-bottom: 1px solid #dddddd;
+  height: 1.7em;
+}
+tr.inactive td.todo_line {
+  background-color: #dddddd;
+}
+td.left_border {
+  border-left: 1px solid black;
+}
+td.right_border {
+  border-right: 1px solid black;
+}
+input[type="text"] {
+  width: 98%;
+}
+input[name="day_comment"] {
+  width: 100em;
 }
 {% endblock %}
 
@@ -32,27 +57,44 @@ td.todo_line {
 
 {% macro show_node_undone(node, indent) %}
 {% if not node.todo.is_done %}
-<tr>
+<tr {% if node.seen or not node.todo.is_doable %}class="inactive"{% endif %}>
+{% if not node.seen %}
 <input type="hidden" name="todo_id" value="{{node.todo.id_}}" />
+{% endif %}
 
 {% for condition in conditions_present %}
-<td class="cond_line_{{loop.index0 % 3}} {% if not condition.is_active %}min_width{% endif %}">{% if condition in node.todo.conditions %}{% if not condition.is_active %}O{% endif %}{% endif %}</td>
+<td class="cond_line_{{loop.index0 % 3}}">
+{% if condition in node.todo.conditions and not condition.is_active %}
+O&nbsp;
+{% elif condition in node.todo.blockers and condition.is_active %}
+!&nbsp;
+{% endif %}
+</td>
 {% endfor %}
 
-<td class="todo_line">-&gt;</td>
-<td class="todo_line"><input name="done" type="checkbox" value="{{node.todo.id_}}" {% if node.todo.is_done %}checked disabled{% endif %} {% if not node.todo.is_doable %}disabled{% endif %}/></td>
-<td class="todo_line"><input name="effort" type="number" step=0.1 size=5 placeholder={{node.todo.process.effort.newest }} value={{node.todo.effort}} /></td>
-<td class="todo_line">
-{% for i in range(indent) %}&nbsp; {% endfor %} +
-{% if node.seen %}({% endif %}<a href="todo?id={{node.todo.id_}}">{{node.todo.process.title.newest|e}}</a>{% if node.seen %}){% endif %}
+{% if node.seen %}
+<td class="todo_line left_border"></td>
+<td class="todo_line">{% if node.todo.effort %}{{ node.todo.effort }}{% endif %}</td>
+{% else %}
+<td class="todo_line left_border"><input name="done" type="checkbox" value="{{node.todo.id_}}" {% if not node.todo.is_doable %}disabled{% endif %}/></td>
+<td class="todo_line"><input name="effort" type="number" step=0.1 size=5 placeholder={{node.todo.effort_then}} value={{node.todo.effort}} /></td>
+{% endif %}
+<td class="todo_line right_border">
+{% for i in range(indent) %}&nbsp; &nbsp; {% endfor %} +
+{% if node.seen %}({% endif %}<a href="todo?id={{node.todo.id_}}">{{node.todo.title_then|e}}</a>{% if node.seen %}){% endif %}
 </td>
-<td class="todo_line">-&gt;</td>
 
 {% for condition in conditions_present|reverse %}
-<td class="cond_line_{{(conditions_present|length - loop.index) % 3}} {% if condition in node.todo.enables or condition in node.todo.disables %}min_width{% endif %}">{% if condition in node.todo.enables %}+{% elif condition in node.todo.disables %}!{% endif %}</td>
+<td class="cond_line_{{(conditions_present|length - loop.index) % 3}}">{% if condition in node.todo.enables %}&nbsp;+{% elif condition in node.todo.disables %}&nbsp;!{% endif %}</td>
 {% endfor %}
 
-<td><input name="comment" value="{{node.todo.comment|e}}" /></td>
+<td colspan=2>
+{% if node.seen %}
+{{node.todo.comment|e}}
+{% else %}
+<input name="comment" type="text" value="{{node.todo.comment|e}}" />
+{% endif %}
+</td>
 
 </tr>
 {% endif %}
@@ -73,7 +115,7 @@ td.todo_line {
 <tr>
 {% if path|length > 0 and not path[-1].todo.is_done %}
 <td>
-({% for path_node in path %}<a href="todo?id={{path_node.todo.id_}}">{{path_node.todo.process.title.newest|e}}</a>  &lt;- {% endfor %})
+({% for path_node in path %}<a href="todo?id={{path_node.todo.id_}}">{{path_node.todo.title_then|e}}</a>  &lt;- {% endfor %})
 </td>
 </tr>
 
@@ -84,7 +126,7 @@ td.todo_line {
 <td>
 {% for i in range(indent) %}&nbsp; {% endfor %} +
 {% endif %}
-{% if node.seen %}({% endif %}<a href="todo?id={{node.todo.id_}}">{{node.todo.process.title.newest|e}}</a> {% if node.todo.comment|length > 0 %}[{{node.todo.comment|e}}]{% endif %}{% if node.seen %}){% endif %}
+{% if node.seen %}({% endif %}<a href="todo?id={{node.todo.id_}}">{{node.todo.title_then|e}}</a> {% if node.todo.comment|length > 0 %}[{{node.todo.comment|e}}]{% endif %}{% if node.seen %}){% endif %}
 </td>
 </tr>
 
@@ -105,19 +147,21 @@ td.todo_line {
 <a href="day?date={{day.prev_date}}">prev</a> | <a href="day?date={{day.next_date}}">next</a>
 </p>
 <form action="day?date={{day.date}}" method="POST">
-comment: <input name="day_comment" value="{{day.comment|e}}" />
-<input type="submit" value="OK" /><br />
-add todo: <input name="new_todo" list="processes" autocomplete="off" />
 
-<h4>todo</h4>
+<p>
+comment:
+<input name="day_comment" value="{{day.comment|e}}" />
+<input type="submit" value="OK" /></td>
+</p>
+
+<h4>to do</h4>
 
 <table>
 
 <tr>
-<th colspan={{ conditions_present|length}}>c</th>
-<th colspan=4>states</th>
-<th colspan={{ conditions_present|length}}>t</th>
+<th colspan={{ conditions_present|length + 3 + conditions_present|length }}>conditions</th>
 <th>add enabler</th>
+<th>add disabler</th>
 </tr>
 
 {% for condition in conditions_present %}
@@ -127,28 +171,35 @@ add todo: <input name="new_todo" list="processes" autocomplete="off" />
 {% for _ in conditions_present %}
 {% if outer_loop.index > loop.index %}
 <td class="cond_line_{{loop.index0 % 3}}">
-{% else %}
+{% elif outer_loop.index < loop.index %}
 <td class="cond_line_{{outer_loop.index0 % 3}}">
-{% endif %}
-{% if outer_loop.index == loop.index  %}
+{% else %}
+<td class="cond_line_{{outer_loop.index0 % 3}} cond_line_corner">×
 {% endif %}
 </td>
 {% endfor %}
 
-<td class="cond_line_{{loop.index0 % 3}}">[{% if condition.is_active %}X{% else %}&nbsp;{% endif %}]</td>
-<td colspan=3 class="cond_line_{{loop.index0 % 3}}"><a href="condition?id={{condition.id_}}">{{condition.title.newest|e}}</a></td>
+<td class="cond_line_{{loop.index0 % 3}}"><input type="checkbox" disabled{% if condition.is_active %} checked{% endif %}></td>
+<td colspan=2 class="cond_line_{{loop.index0 % 3}}"><a href="condition?id={{condition.id_}}">{{condition.title.at(day.date)|e}}</a></td>
 
 {% for _ in conditions_present %}
-{% if outer_loop.index0 + loop.index0 < conditions_present|length %}
+{% if outer_loop.index0 + loop.index < conditions_present|length %}
 <td class="cond_line_{{outer_loop.index0 % 3}}">
-{% else %}
+{% elif outer_loop.index0 + loop.index > conditions_present|length %}
 <td class="cond_line_{{(conditions_present|length - loop.index) % 3}}">
+{% else %}
+<td class="cond_line_{{outer_loop.index0 % 3}} cond_line_corner">&nbsp;×
 {% endif %}
 {% endfor %}
+
 {% set list_name = "todos_for_%s"|format(condition.id_) %}
 <td><input name="new_todo" list="{{list_name}}" autocomplete="off" /></td>
 {{ macros.datalist_of_titles(list_name, enablers_for[condition.id_]) }}
 </td>
+{% set list_name = "todos_against_%s"|format(condition.id_) %}
+<td><input name="new_todo" list="{{list_name}}" autocomplete="off" /></td>
+{{ macros.datalist_of_titles(list_name, disablers_for[condition.id_]) }}
+</td>
 </tr>
 {% endfor %}
 
@@ -156,11 +207,23 @@ add todo: <input name="new_todo" list="processes" autocomplete="off" />
 {% for condition in conditions_present %}
 <td class="cond_line_{{loop.index0 % 3}}"></td>
 {% endfor %}
-<th colspan={{ 4 }}>doables</th>
+<th colspan=3>doables</th>
+{% for condition in conditions_present %}
+<td class="cond_line_{{(conditions_present|length - loop.index) % 3}}"></td>
+{% endfor %}
+<td colspan=2></td>
+</tr>
+<tr>
+{% for condition in conditions_present %}
+<td class="cond_line_{{loop.index0 % 3}}"></td>
+{% endfor %}
+<td class="left_border"></td>
+<td>add:</td>
+<td class="right_border" ><input type="text" name="new_todo" list="processes"></td>
 {% for condition in conditions_present %}
 <td class="cond_line_{{(conditions_present|length - loop.index) % 3}}"></td>
 {% endfor %}
-<th>comments</th>
+<th colspan=2>comments</th>
 </tr>
 {% for node in top_nodes %}
 {{ show_node_undone(node, 0) }}