Commit 902ee572 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Return a group 'None' for todo items without group

When grouping by project, todo items without a project wouldn't be
listed (same for contexts).

Moreover, sort the projects such that the items without project are
shown at the bottom of the list.
parent 76d46255
......@@ -35,8 +35,8 @@ FIELDS = {
label='Completed',
),
'context': Field(
sort=lambda t: sorted(c.lower() for c in t.contexts()),
group=lambda t: sorted(t.contexts()),
sort=lambda t: sorted(c.lower() for c in t.contexts()) or ['zz'],
group=lambda t: sorted(t.contexts()) or ['None'],
label='Context'
),
'created': Field(
......@@ -67,8 +67,8 @@ FIELDS = {
label='Priority',
),
'project': Field(
sort=lambda t: sorted(p.lower() for p in t.projects()),
group=lambda t: sorted(t.projects()),
sort=lambda t: sorted(p.lower() for p in t.projects()) or ['zz'],
group=lambda t: sorted(t.projects()) or ['None'],
label='Project',
),
'text': Field(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment