From: Christian Heller Date: Wed, 20 Dec 2023 01:39:59 +0000 (+0100) Subject: Improve todo accounting. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/%7B%7B%20web_path%20%7D%7D/static/do_tasks?a=commitdiff_plain;h=53b84307929582af2aaeac2247cc57db4a7bedf4;p=misc Improve todo accounting. --- diff --git a/ledger.py b/ledger.py index 22e36a3..36cca98 100755 --- a/ledger.py +++ b/ledger.py @@ -46,13 +46,13 @@ booking_html = """

""" add_form_header = """
- - + + """ add_form_footer = """ - +
""" add_free_html = """
@@ -62,27 +62,27 @@ add_free_html = """
""" add_structured_html = """ - - - - - - - + + + + + + +
- - - - + + + +
{% for line in booking_lines %} - - - - - - - + + + + + + +
{% endfor %} {% for name, items in datalist_sets.items() %} diff --git a/todo.py b/todo.py index 6cade91..46108a8 100644 --- a/todo.py +++ b/todo.py @@ -4,198 +4,21 @@ from uuid import uuid4 from datetime import datetime, timedelta from urllib.parse import parse_qs from jinja2 import Template +from jinja2 import Environment as JinjaEnv, FileSystemLoader as JinjaFSLoader from urllib.parse import urlparse db_path = '/home/plom/org/todo_new.json' -# db_path = '/home/plom/public_repos/misc/todo_new.json' server_port = 8082 DATE_FORMAT = '%Y-%m-%d' - -html_head = """ - - -tasks: list add | day: -choose tasks -do tasks -| calendar -| unset cookie -
-""" -form_footer = '\n' -form_header_tmpl = """ -
-""" -calendar_tmpl = """ -

-from: -to: - -

- -{% for date, day in days.items() | sort() %} -{% if day.weekday == "Mo" %}{% endif %} - -{% for task, todo in day.todos.items() | sort(attribute='1.title', reverse=True) %} -{% if todo.visible %} - -{% endif %} -{% endfor %} -{% endfor %} -
{{ day.weekday }} {{ date }} |{{ '%04.1f' % day.todos_sum|round(2) }}| {{ day.comment|e }}
{% if todo.done %}✓{% else %}  {% endif %}{%if "cancelled" in todo.tags%}{% endif %}{% if "deadline" in todo.tags %}DEADLINE: {% endif %}{{ todo.title|e }}{%if "cancelled" in todo.tags%}{% endif %}{{ todo.comment|e }}
-""" -todo_tmpl = """ -

todo

- - - - - - - - - - - - -
task{{ todo.task.title|e }}
default weight{{ todo.default_weight }}
day{{ todo.day.date }}
day weight
comment
done
day tags -{% for tag in db.t_tags | sort %} -{% if tag in todo.task.tags %} âœ“{% else %}{% endif %} {{ tag }}
-{% endfor %} -add: -
- -""" -task_tmpl = """ -

task

- - - - - - -
title
history
    {% for k,v in task.title_history.items() | sort(attribute='0', reverse=True) %}
  • {{ k }}: {{ v|e }}{% endfor %}
default weight
history
    {% for k,v in task.default_weight_history.items() | sort(attribute='0', reverse=True) %}
  • {{ k }}: {{ v|e }}{% endfor %}
tags -{% for tag in db.t_tags | sort %} - {{ tag }}
-{% endfor %} -add:
-
history
    {% for k,v in task.tags_history.items() | sort(attribute='0', reverse=True) %}
  • {{ k }}: {{ v|e }}{% endfor %}
-
- -""" -day_tmpl = """ -

- hide unchosen hide done | -prev next | - -date: | -{{ db.selected_day.todos_sum|round(2) }} ({{ db.selected_day.todos_sum2|round(2)}}) | -comment: -

- - - -{% for uuid, t in db.tasks.items() | sort(attribute='1.title') %} -{% if t.visible and (uuid not in db.selected_day.todos.keys() or db.selected_day.todos[uuid].visible) %} - - - -{% if uuid in db.selected_day.todos.keys() %} - - - - - - -{% else %} - - - - - -{% endif %} - -{% endif %} -{% endfor %} -
taskchoose?done?weightedit?day tagscomment
] {{ t.current_title|e }}tags: {% for tag in t.tags | sort %}{{ tag }} {% endfor %}
edit{% for tag in db.selected_day.todos[uuid].day_tags | sort %}{{ tag }} {% endfor %}{{ db.selected_day.todos[uuid].comment|e }} -
- -""" -tag_filters_tmpl = """ -

- -

-

-mandatory tags: -{% for and_filter in db.t_filter_and %} - -{% endfor %} - -
-forbidden tags: -{% for not_filter in db.t_filter_not %} - -{% endfor %} - -

-""" -tasks_tmpl = """ - - -{% for uuid, t in db.tasks.items() | sort(attribute='1.title') %} -{% if t.visible %} - - - - -{% endif %} -{% endfor %} -
default
weight
tasktags
{{ t.default_weight }}{{ t.title|e }}{% for tag in t.tags | sort %}{{ tag }} {% endfor %}
-""" +j2env = JinjaEnv(loader=JinjaFSLoader('todo_templates')) class Task: - def __init__(self, db, title_history=None, tags_history=None, default_weight_history=None): + def __init__(self, db, title_history=None, tags_history=None, default_weight_history=None, links_history=None): self.db = db self.title_history = title_history if title_history else {} self.tags_history = tags_history if tags_history else {} self.default_weight_history = default_weight_history if default_weight_history else {} + self.links_history = links_history if links_history else {} self.visible = True def _set_with_history(self, history, value): @@ -209,11 +32,27 @@ class Task: @classmethod def from_dict(cls, db, d): - return cls( - db, - d['title_history'], - {k: set(v) for k, v in d['tags_history'].items()}, - d['default_weight_history']) + if 'links_history' in d.keys(): + return cls( + db, + d['title_history'], + {k: set(v) for k, v in d['tags_history'].items()}, + d['default_weight_history'], + {k: set(v) for k, v in d['links_history'].items()}) + else: + return cls( + db, + d['title_history'], + {k: set(v) for k, v in d['tags_history'].items()}, + d['default_weight_history']) + + def to_dict(self): + return { + 'title_history': self.title_history, + 'default_weight_history': self.default_weight_history, + 'tags_history': {k: list(v) for k,v in self.tags_history.items()}, + 'links_history': {k: list(v) for k,v in self.links_history.items()}, + } @property def default_weight(self): @@ -263,22 +102,13 @@ class Task: def tags(self, tags): self._set_with_history(self.tags_history, set(tags)) - # @property - # def tags_joined(self): - # return ';'.join(sorted(list(self.tags))) - - # @tags_joined.setter - # def tags_joined(self, tags_string): - # tags = set() - # for tag in [tag.strip() for tag in tags_string.split(';') if tag.strip() != '']: - # tags.add(tag) - # self.tags = tags + @property + def links(self): + return self._last_of_history(self.links_history, set()) - def to_dict(self): - return { - 'title_history': self.title_history, - 'tags_history': {k: list(v) for k,v in self.tags_history.items()}, - 'default_weight_history': self.default_weight_history} + @links.setter + def links(self, links): + self._set_with_history(self.links_history, set(links)) @property def id_(self): @@ -374,17 +204,6 @@ class Todo: def title(self): return self.task.title_at(self.day.date) - # @property - # def day_tags_joined(self): - # return ';'.join(sorted(list(self.day_tags))) - - # @day_tags_joined.setter - # def day_tags_joined(self, tags_string): - # tags = set() - # for tag in [tag.strip() for tag in tags_string.split(';') if tag.strip() != '']: - # tags.add(tag) - # self.day_tags = tags - @property def tags(self): return self.day_tags | self.task.tags @@ -431,8 +250,8 @@ class TodoDB(PlomDB): def to_dict(self): d = { - 't_filter_and': self.t_filter_and, - 't_filter_not': self.t_filter_not, + # 't_filter_and': self.t_filter_and, + # 't_filter_not': self.t_filter_not, 'tasks': {}, 'days': {} } @@ -483,7 +302,7 @@ class TodoDB(PlomDB): prev_date_str = prev_date.strftime(DATE_FORMAT) next_date = current_date + timedelta(days=1) next_date_str = next_date.strftime(DATE_FORMAT) - return Template(form_header_tmpl + tag_filters_tmpl + day_tmpl + form_footer).render(db=self, action=self.prefix+'/day', prev_date=prev_date_str, next_date=next_date_str) + return j2env.get_template('day.html').render(db=self, action=self.prefix+'/day', prev_date=prev_date_str, next_date=next_date_str) def show_calendar(self, start_date_str, end_date_str): self.t_filter_and = ['calendar'] @@ -505,11 +324,11 @@ class TodoDB(PlomDB): else: days_to_show[current_date] = self.days[current_date] days_to_show[current_date].weekday = datetime.strptime(current_date, DATE_FORMAT).strftime('%A')[:2] - return Template(form_header_tmpl + calendar_tmpl + form_footer).render(db=self, days=days_to_show, action=self.prefix+'/calendar', today=str(datetime.now())[:10], start_date=start_date_str, end_date=end_date_str) + return j2env.get_template('calendar.html').render(db=self, days=days_to_show, action=self.prefix+'/calendar', today=str(datetime.now())[:10], start_date=start_date_str, end_date=end_date_str) def show_todo(self, task_uuid, selected_date): todo = self.days[selected_date].todos[task_uuid] - return Template(form_header_tmpl + todo_tmpl + form_footer).render(db=self, todo=todo, action=self.prefix+'/todo') + return j2env.get_template('todo.html').render(db=self, todo=todo, action=self.prefix+'/todo') def update_todo_mini(self, task_uuid, date, day_weight, done): if task_uuid in self.days[date].todos.keys(): @@ -520,33 +339,39 @@ class TodoDB(PlomDB): todo.done = done return todo + def collect_tags(self, tags_joined, tags_checked): + tags = set() + for tag in [tag.strip() for tag in tags_joined.split(';') if tag.strip() != '']: + tags.add(tag) + for tag in tags_checked: + tags.add(tag) + return tags + def update_todo(self, task_uuid, date, day_weight, done, comment, day_tags_joined, day_tags_checked): todo = self.update_todo_mini(task_uuid, date, day_weight, done) todo.comment = comment - day_tags = set() - for tag in [tag.strip() for tag in day_tags_joined.split(';') if tag.strip() != '']: - day_tags.add(tag) - for tag in day_tags_checked: - day_tags.add(tag) - todo.day_tags = day_tags + todo.day_tags = self.collect_tags(day_tags_joined, day_tags_checked) def show_task(self, id_): task = self.tasks[id_] if id_ else self.add_task() - return Template(form_header_tmpl + task_tmpl + form_footer).render(db=self, task=task, action=self.prefix+'/task') + return j2env.get_template('task.html').render(db=self, task=task, action=self.prefix+'/task') - def update_task(self, id_, title, default_weight, tags_joined, tags_checked): + def update_task(self, id_, title, default_weight, tags_joined, tags_checked, links): task = self.tasks[id_] if id_ in self.tasks.keys() else self.add_task(id_) task.title = title task.default_weight = float(default_weight) if len(default_weight) > 0 else None - tags = set() - for tag in [tag.strip() for tag in tags_joined.split(';') if tag.strip() != '']: - tags.add(tag) - for tag in tags_checked: - tags.add(tag) - task.tags = tags + task.tags = self.collect_tags(tags_joined, tags_checked) + task.links = links + for link in links: + print("DEBUG DEBUG", links) + borrowed_links = self.tasks[link].links + print("DEBUG DEBUG brorowed1", borrowed_links) + borrowed_links.add(id_) + print("DEBUG DEBUG brorowed2", borrowed_links) + self.tasks[link].links = borrowed_links def show_tasks(self): - return Template(form_header_tmpl + tag_filters_tmpl + tasks_tmpl + form_footer).render(db=self, action=self.prefix+'/tasks') + return j2env.get_template('tasks.html').render(db=self, action=self.prefix+'/tasks') @@ -576,7 +401,28 @@ class TodoHandler(PlomHandler): postvars = parse_qs(self.rfile.read(length).decode(), keep_blank_values=1) parsed_url = urlparse(self.path) db = TodoDB(prefix=app_config['prefix']) + params_to_encode = [] + if 't_and' in postvars.keys(): + for target in postvars['t_and']: + if len(target) > 0 and not target in db.t_filter_and: + db.t_filter_and += [target] + if len(db.t_filter_and) == 0: + params_to_encode += [('t_and', '-')] + if 't_not' in postvars.keys(): + for target in postvars['t_not']: + if len(target) > 0 and not target in db.t_filter_not: + db.t_filter_not += [target] + if len(db.t_filter_not) == 0: + params_to_encode += [('t_not', '-')] + params_to_encode += [('t_and', f) for f in db.t_filter_and] + [('t_not', f) for f in db.t_filter_not] + def collect_checked(prefix, postvars): + tags_checked = [] + for k in postvars.keys(): + if k.startswith(prefix): + tags_checked += [k[len(prefix):]] + return tags_checked + if parsed_url.path == app_config['prefix'] + '/calendar': start = postvars['start'][0] if len(postvars['start'][0]) > 0 else '-' end = postvars['end'][0] if len(postvars['end'][0]) > 0 else '-' @@ -585,69 +431,40 @@ class TodoHandler(PlomHandler): elif parsed_url.path == app_config['prefix'] + '/todo': task_uuid = postvars['task_uuid'][0] date = postvars['date'][0] - tags_checked = [] - prefix = 'day_tag_' - for k in postvars.keys(): - if k.startswith(prefix): - tags_checked += [k[len(prefix):]] - db.update_todo(task_uuid, date, postvars['day_weight'][0], 'done' in postvars.keys(), postvars['comment'][0], postvars['day_tags_joined'][0], tags_checked) + db.update_todo(task_uuid, date, postvars['day_weight'][0], 'done' in postvars.keys(), postvars['comment'][0], postvars['joined_day_tags'][0], collect_checked('day_tag_', postvars)) homepage = f'{app_config["prefix"]}/todo?task={task_uuid}&date={date}' elif parsed_url.path == app_config['prefix'] + '/task': + encoded_params = urlencode(params_to_encode) id_ = postvars['id'][0] - tags_checked = [] - prefix = 'tag_' - for k in postvars.keys(): - if k.startswith(prefix): - tags_checked += [k[len(prefix):]] - db.update_task(id_, postvars['title'][0], postvars['default_weight'][0], postvars['tags_joined'][0], tags_checked) - homepage = f'{app_config["prefix"]}/task?id={id_}' + if 'title' in postvars.keys(): + db.update_task(id_, postvars['title'][0], postvars['default_weight'][0], postvars['joined_tags'][0], collect_checked('tag_', postvars), collect_checked('link_', postvars)) + homepage = f'{app_config["prefix"]}/task?id={id_}&{encoded_params}' - elif parsed_url.path in {app_config['prefix'] + '/tasks', app_config['prefix'] + '/day'}: - data = [] - for target in postvars['t_and']: - if len(target) > 0 and not target in db.t_filter_and: - db.t_filter_and += [target] - if len(db.t_filter_and) == 0: - data += [('t_and', '-')] - for target in postvars['t_not']: - if len(target) > 0 and not target in db.t_filter_not: - db.t_filter_not += [target] - if len(db.t_filter_not) == 0: - data += [('t_not', '-')] - data += [('t_and', f) for f in db.t_filter_and] + [('t_not', f) for f in db.t_filter_not] - if parsed_url.path == app_config['prefix'] + '/tasks': - encoded_params = urlencode(data) - homepage = f'{app_config["prefix"]}/tasks?{encoded_params}' - - elif parsed_url.path == app_config['prefix'] + '/day': - db.hide_unchosen = 'hide_unchosen' in postvars.keys() - db.hide_done = 'hide_done' in postvars.keys() - data += [('hide_unchosen', int(db.hide_unchosen))] + [('hide_done', int(db.hide_done))] - - db.selected_date = postvars['original_selected_date'][0] - new_selected_date = postvars['new_selected_date'][0] - try: - datetime.strptime(new_selected_date, DATE_FORMAT) - except ValueError: - raise PlomException(f'{app_config["prefix"]} bad date string: {new_selected_date}') - if new_selected_date != db.selected_date: - db.change_selected_days_date(new_selected_date) - if 't_uuid' in postvars.keys(): - for i, uuid in enumerate(postvars['t_uuid']): - t = db.tasks[uuid] - if uuid in db.selected_day.todos.keys() and ((not 'choose' in postvars) or uuid not in postvars['choose']): - del db.selected_day.todos[uuid] - if 'choose' in postvars.keys(): - for i, uuid in enumerate(postvars['t_uuid']): - if uuid in postvars['choose']: - done = 'done' in postvars and uuid in postvars['done'] - db.update_todo_mini(uuid, db.selected_date, postvars['day_weight'][i], done) - if 'day_comment' in postvars.keys(): - db.selected_day.comment = postvars['day_comment'][0] - data += [('selected_date', db.selected_date)] - encoded_params = urlencode(data) - homepage = f'{app_config["prefix"]}/day?{encoded_params}' + elif parsed_url.path == app_config['prefix'] + '/tasks': + encoded_params = urlencode(params_to_encode) + homepage = f'{app_config["prefix"]}/tasks?{encoded_params}' + + elif parsed_url.path == app_config['prefix'] + '/day': + if 'expect_unchosen_done' in postvars.keys(): + params_to_encode += [('hide_unchosen', int('hide_unchosen' in postvars.keys()))] + [('hide_done', int('hide_done' in postvars.keys()))] + if 'selected_date' in postvars.keys(): + db.selected_date = postvars['selected_date'][0] + if 't_uuid' in postvars.keys(): + for i, uuid in enumerate(postvars['t_uuid']): + t = db.tasks[uuid] + if uuid in db.selected_day.todos.keys() and ((not 'choose' in postvars) or uuid not in postvars['choose']): + del db.selected_day.todos[uuid] + if 'choose' in postvars.keys(): + for i, uuid in enumerate(postvars['t_uuid']): + if uuid in postvars['choose']: + done = 'done' in postvars and uuid in postvars['done'] + db.update_todo_mini(uuid, db.selected_date, postvars['day_weight'][i], done) + if 'day_comment' in postvars.keys(): + db.selected_day.comment = postvars['day_comment'][0] + params_to_encode += [('selected_date', db.selected_date)] + encoded_params = urlencode(params_to_encode) + homepage = f'{app_config["prefix"]}/day?{encoded_params}' db.write() self.redirect(homepage) @@ -671,6 +488,7 @@ class TodoHandler(PlomHandler): if selected_date is None and 'selected_date' in cookie_db.keys(): selected_date = cookie_db['selected_date'] cookie_db['selected_date'] = selected_date + if parsed_url.path in {app_config['prefix'] + '/day', app_config['prefix'] + '/tasks', app_config['prefix'] + '/task'}: t_filter_and = params.get('t_and', None) if t_filter_and is None and 't_and' in cookie_db.keys(): t_filter_and = cookie_db['t_and'] @@ -737,10 +555,9 @@ class TodoHandler(PlomHandler): end_date = None cookie_db['calendar_end'] = end_date page = db.show_calendar(start_date, end_date) - header = Template(html_head).render(db=db, prefix=app_config['prefix'], date=selected_date) if parsed_url.path != app_config['prefix'] + '/unset_cookie': self.set_cookie(app_config['cookie_name'], app_config['cookie_path'], cookie_db) - self.send_HTML(header + page) + self.send_HTML(page) if __name__ == "__main__": diff --git a/todo_templates/base.html b/todo_templates/base.html new file mode 100644 index 0000000..882c727 --- /dev/null +++ b/todo_templates/base.html @@ -0,0 +1,15 @@ + + +tasks: list add | day: +choose tasks +do tasks +| calendar +| unset cookie +
+{% block content %} +{% endblock %} diff --git a/todo_templates/calendar.html b/todo_templates/calendar.html new file mode 100644 index 0000000..8f0aa8e --- /dev/null +++ b/todo_templates/calendar.html @@ -0,0 +1,27 @@ +{% extends 'base.html' %} +{% block css %} +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; } +{% endblock %} +{% block content %} + +

+from: +to: + +

+ +{% for date, day in days.items() | sort() %} +{% if day.weekday == 'Mo' %}{% endif %} + +{% for task, todo in day.todos.items() | sort(attribute='1.title', reverse=True) %} +{% if todo.visible %} + +{% endif %} +{% endfor %} +{% endfor %} +
{{ day.weekday }} {{ date }} |{{ '%04.1f' % day.todos_sum|round(2) }}| {{ day.comment|e }}
{% if todo.done %}✓{% else %}  {% endif %}{%if "cancelled" in todo.tags%}{% endif %}{% if "deadline" in todo.tags %}DEADLINE: {% endif %}{{ todo.title|e }}{%if "cancelled" in todo.tags%}{% endif %}{{ todo.comment|e }}
+
+{% endblock %} + diff --git a/todo_templates/day.html b/todo_templates/day.html new file mode 100644 index 0000000..5c63670 --- /dev/null +++ b/todo_templates/day.html @@ -0,0 +1,80 @@ +{% extends 'base.html' %} +{% block css %} +table.alternating tr:nth-child(even) { + background-color: #f2f2f2; +} +table.alternating tr:nth-child(odd) { + background-color: #ffffff; +} +td.checkbox, td.number { height: 0.1em; padding: 0em; text-align: center; } +td.checkbox { width: 0.1em } +td button { height: 1.5em; padding: 0em; margin: 0em } +td details { display: inline } +input[type="number"] { text-align: right; } +{% endblock %} +{% block content %} +
+{% include 'tagfilters.html' %} +

+ + hide unchosen hide done +

+
+ +
+

edit day

+

+prev | {{db.selected_date}} | next | +{{ db.selected_day.todos_sum|round(2) }} ({{ db.selected_day.todos_sum2|round(2)}}) | +comment: + + +

+ + +{% for uuid, t in db.tasks.items() | sort(attribute='1.title') %} +{% if t.visible and (uuid not in db.selected_day.todos.keys() or db.selected_day.todos[uuid].visible) %} + + + +{% if uuid in db.selected_day.todos.keys() %} + + + + + + +{% else %} + + + + + +{% endif %} + +{% endif %} +{% endfor %} +
taskchoose?done?weightedit?day tagscomment
] {{ t.current_title|e }}tags: {% for tag in t.tags | sort %}{{ tag }} {% endfor %}
edit{% for tag in db.selected_day.todos[uuid].day_tags | sort %}{{ tag }} {% endfor %}{{ db.selected_day.todos[uuid].comment|e }} +
+ +
+ +{% include 'watch_form.html' %} +{% endblock %} diff --git a/todo_templates/tagfilters.html b/todo_templates/tagfilters.html new file mode 100644 index 0000000..3f784ea --- /dev/null +++ b/todo_templates/tagfilters.html @@ -0,0 +1,37 @@ +

+ +

+

+mandatory tags: +{% for and_filter in db.t_filter_and %} + +{% endfor %} + +
+forbidden tags: +{% for not_filter in db.t_filter_not %} + +{% endfor %} + +

+ diff --git a/todo_templates/task.html b/todo_templates/task.html new file mode 100644 index 0000000..56d0abe --- /dev/null +++ b/todo_templates/task.html @@ -0,0 +1,47 @@ +{% extends 'base.html' %} +{% block css %} +th, td { vertical-align: top; text-align: left} +td.input { width: 100%; } +td.checkbox { width: 0.1em; height: 0.1em; padding: 0em; text-align: center; } +input[type="number"] { text-align: right; } +input[type="text"] { width: 100% } +textarea { width: 100% }; +{% endblock %} +{% block content %} +
+

edit task

+ + + + + + + + + +
title
history
    {% for k,v in task.title_history.items() | sort(attribute='0', reverse=True) %}
  • {{ k }}: {{ v|e }}{% endfor %}
default weight
history
    {% for k,v in task.default_weight_history.items() | sort(attribute='0', reverse=True) %}
  • {{ k }}: {{ v|e }}{% endfor %}
tags +{% for tag in db.t_tags | sort %} + {{ tag }}
+{% endfor %} +add:
+
history
    {% for k,v in task.tags_history.items() | sort(attribute='0', reverse=True) %}
  • {{ k }}: {{ v|e }}{% endfor %}
+
links +{% for other_task_id, other_task in db.tasks.items() | sort(attribute='1.title') %} +{% if task.id_ != other_task_id and other_task.visible and other_task_id in task.links %} + {{ other_task.title|e }}
+{% endif %} +{% endfor %} +{% for other_task_id, other_task in db.tasks.items() | sort(attribute='1.title') %} +{% if task.id_ != other_task_id and other_task.visible and not other_task_id in task.links %} + {{ other_task.title|e }}
+{% endif %} +{% endfor %} +
+ +
+
+ +{% include 'tagfilters.html' %} +
+{% include 'watch_form.html' %} +{% endblock %} diff --git a/todo_templates/tasks.html b/todo_templates/tasks.html new file mode 100644 index 0000000..34976eb --- /dev/null +++ b/todo_templates/tasks.html @@ -0,0 +1,27 @@ +{% extends 'base.html' %} +{% block css %} +table.alternating tr:nth-child(even) { + background-color: #f2f2f2; +} +table.alternating tr:nth-child(odd) { + background-color: #ffffff; +} +td.number { text-align: right; } +{% endblock %} +{% block content %} +
+{% include 'tagfilters.html' %} +
+ + +{% for uuid, t in db.tasks.items() | sort(attribute='1.title') %} +{% if t.visible %} + + + + +{% endif %} +{% endfor %} +
default
weight
tasktags
{{ t.default_weight }}{{ t.title|e }}{% for tag in t.tags | sort %}{{ tag }} {% endfor %}
+{% endblock %} + diff --git a/todo_templates/todo.html b/todo_templates/todo.html new file mode 100644 index 0000000..b3926da --- /dev/null +++ b/todo_templates/todo.html @@ -0,0 +1,33 @@ +{% extends 'base.html' %} +{% block css %} +th, td { vertical-align: top; text-align: left} +td.input { width: 100%; } +td.checkbox { width: 0.1em; height: 0.1em; padding: 0em; text-align: center; } +input[type="number"] { text-align: right; } +input[type="text"] { width: 100% } +textarea { width: 100% }; +{% endblock %} +{% block content %} +
+

edit todo

+ + + + + + + + + + + + +
task{{ todo.task.title|e }}
default weight{{ todo.default_weight }}
day{{ todo.day.date }}
day weight
comment
done
day tags +{% for tag in db.t_tags | sort %} +{% if tag in todo.task.tags %} âœ“{% else %}{% endif %} {{ tag }}
+{% endfor %} +add: +
+ +
+{% endblock %} diff --git a/todo_templates/watch_form.html b/todo_templates/watch_form.html new file mode 100644 index 0000000..979c1da --- /dev/null +++ b/todo_templates/watch_form.html @@ -0,0 +1,19 @@ + +