self._init_handling()
if self.site in {'calendar', 'day', 'process', 'process_titles',
'process_descriptions', 'process_efforts',
- 'processes', 'todo', 'condition', 'conditions'}:
+ 'processes', 'todo', 'condition',
+ 'condition_titles', 'condition_descriptions',
+ 'conditions'}:
template = f'{self.site}.html'
ctx = getattr(self, f'do_GET_{self.site}')()
html = self.server.jinja.get_template(template).render(**ctx)
id_ = self.params.get_int_or_none('id')
return {'condition': Condition.by_id(self.conn, id_, create=True)}
+ def do_GET_condition_titles(self) -> dict[str, object]:
+ """Show title history of Condition of ?id=."""
+ id_ = self.params.get_int_or_none('id')
+ condition = Condition.by_id(self.conn, id_)
+ return {'condition': condition}
+
+ def do_GET_condition_descriptions(self) -> dict[str, object]:
+ """Show description historys of Condition of ?id=."""
+ id_ = self.params.get_int_or_none('id')
+ condition = Condition.by_id(self.conn, id_)
+ return {'condition': condition}
+
def do_GET_process(self) -> dict[str, object]:
"""Show Process of ?id=."""
id_ = self.params.get_int_or_none('id')
<tr>
<th>title</th>
-<td><input name="title" value="{{condition.title.newest|e}}" /></td>
+<td><input name="title" value="{{condition.title.newest|e}}" />{% if condition.id_ %} [<a href="condition_titles?id={{condition.id_}}">history</a>]{% endif %}</td>
<tr/>
<tr>
<tr>
<th>description</th>
-<td><input name="description" value="{{condition.description.newest|e}}" /></td>
+<td><textarea name="description">{{condition.description.newest|e}}</textarea>{% if condition.id_ %} [<a href="condition_descriptions?id={{condition.id_}}">history</a>]{% endif %}</td>
<tr/>
</table>