home
·
contact
·
privacy
projects
/
plomtask
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Overhaul Todo view to underline difference to ProcessSteps.
[plomtask]
/
templates
/
_macros.html
diff --git
a/templates/_macros.html
b/templates/_macros.html
index b1f0104e134363bc9b8dcd24f6d6066d08996f00..55ab626b1fe6bbb7f49b3ab41c9dbb24bf56d792 100644
(file)
--- a/
templates/_macros.html
+++ b/
templates/_macros.html
@@
-1,16
+1,27
@@
{% macro edit_buttons() %}
{% macro edit_buttons() %}
+<div class="edit_buttons">
<input class="btn-harmless" type="submit" name="update" value="update" />
<div class="btn-to-right">
<input class="btn-dangerous" type="submit" name="delete" value="delete" />
</div>
<input class="btn-harmless" type="submit" name="update" value="update" />
<div class="btn-to-right">
<input class="btn-dangerous" type="submit" name="delete" value="delete" />
</div>
+</div>
{% endmacro %}
{% endmacro %}
-{% macro datalist_of_titles(title, candidates) %}
+{% macro datalist_of_titles(title, candidates
, historical=false, with_comments=false
) %}
<datalist id="{{title}}">
{% for candidate in candidates %}
<datalist id="{{title}}">
{% for candidate in candidates %}
-<option value="{{candidate.id_}}">{{candidate.title.newest|e}}</option>
+<option value="{{candidate.id_}}">
+{% if historical is true %}
+{{candidate.title_then|e}}
+{% else %}
+{{candidate.title.newest|e}}
+{% endif %}
+{% if with_comments and candidate.comment %}
+/ {{candidate.comment}}
+{% endif %}
+</option>
{% endfor %}
</datalist>
{% endmacro %}
{% endfor %}
</datalist>
{% endmacro %}
@@
-18,6
+29,7
@@
{% macro simple_checkbox_table(title, items, type_name, list_name, add_string="add", historical=false) %}
{% macro simple_checkbox_table(title, items, type_name, list_name, add_string="add", historical=false) %}
+{% if items|length > 0 %}
<table>
{% for item in items %}
<tr>
<table>
{% for item in items %}
<tr>
@@
-25,18
+37,20
@@
<input type="checkbox" name="{{title}}" value="{{item.id_}}" checked />
</td>
<td>
<input type="checkbox" name="{{title}}" value="{{item.id_}}" checked />
</td>
<td>
-<a href="{{type_name}}?id={{item.id_}}">{% if historical %}{{item.title_then}}{% else %}{{item.title.newest|e}}{% endif %}</a>
+<a href="{{type_name}}?id={{item.id_}}">{% if historical
is true
%}{{item.title_then}}{% else %}{{item.title.newest|e}}{% endif %}</a>
</td>
</tr>
{% endfor %}
</table>
</td>
</tr>
{% endfor %}
</table>
-{{add_string}}: <input name="{{title}}" list="{{list_name}}" autocomplete="off" />
+{% endif %}
+{{add_string}}: <input name="{{title}}" type="text" list="{{list_name}}" autocomplete="off" />
{% endmacro %}
{% macro history_page(item_name, item, attribute_name, attribute, as_pre=false) %}
<h3>{{item_name}} {{attribute_name}} history</h3>
{% endmacro %}
{% macro history_page(item_name, item, attribute_name, attribute, as_pre=false) %}
<h3>{{item_name}} {{attribute_name}} history</h3>
+<form action="{{item_name}}_{{attribute_name}}s?id={{item.id_}}" method="POST">
<table>
<tr>
<table>
<tr>
@@
-44,12
+58,15
@@
<td><a href="{{item_name}}?id={{item.id_}}">{{item.title.newest|e}}</a></td>
</tr>
<td><a href="{{item_name}}?id={{item.id_}}">{{item.title.newest|e}}</a></td>
</tr>
+
{% for date in attribute.history.keys() | sort(reverse=True) %}
<tr>
{% for date in attribute.history.keys() | sort(reverse=True) %}
<tr>
-<t
h>{{date | truncate(19, True, '') }}</th
>
+<t
d><input name="at:{{date}}" class="timestamp" value="{{date|truncate(19, True, '', 0)}}"></td
>
<td>{% if as_pre %}<pre>{% endif %}{{attribute.history[date]}}{% if as_pre %}</pre>{% endif %}</td>
</tr>
{% endfor %}
</table>
<td>{% if as_pre %}<pre>{% endif %}{{attribute.history[date]}}{% if as_pre %}</pre>{% endif %}</td>
</tr>
{% endfor %}
</table>
+<input class="btn-harmless" type="submit" name="update" value="update" />
+</form>
{% endmacro %}
{% endmacro %}