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 = { ...@@ -35,8 +35,8 @@ FIELDS = {
label='Completed', label='Completed',
), ),
'context': Field( 'context': Field(
sort=lambda t: sorted(c.lower() for c in t.contexts()), sort=lambda t: sorted(c.lower() for c in t.contexts()) or ['zz'],
group=lambda t: sorted(t.contexts()), group=lambda t: sorted(t.contexts()) or ['None'],
label='Context' label='Context'
), ),
'created': Field( 'created': Field(
...@@ -67,8 +67,8 @@ FIELDS = { ...@@ -67,8 +67,8 @@ FIELDS = {
label='Priority', label='Priority',
), ),
'project': Field( 'project': Field(
sort=lambda t: sorted(p.lower() for p in t.projects()), sort=lambda t: sorted(p.lower() for p in t.projects()) or ['zz'],
group=lambda t: sorted(t.projects()), group=lambda t: sorted(t.projects()) or ['None'],
label='Project', label='Project',
), ),
'text': Field( '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