+ # def show_pick_tasks(self, search, hide_chosen_tasks, sort_order=None):
+ # prev_date_str, next_date_str = self.neighbor_dates()
+
+ # chosen_todos = self.selected_day.linked_todos_as_list
+
+ # relevant_todos = []
+ # for todo in self.todos.values():
+ # if todo.done\
+ # or (not todo.visible)\
+ # or (not todo.matches(search))\
+ # or todo.earliest_date >= self.selected_date:
+ # continue
+ # relevant_todos += [todo]
+
+ # filtered_tasks = []
+ # chosen_tasks = [todo.task for todo in self.selected_day.linked_todos_as_list]
+ # for uuid, task in self.tasks.items():
+ # if (not task.visible)\
+ # or (not task.matches(search))\
+ # or (hide_chosen_tasks and task in chosen_tasks):
+ # continue
+ # filtered_tasks += [task]
+
+ # if sort_order == 'title':
+ # chosen_todos.sort(key=lambda t: t.title)
+ # relevant_todos.sort(key=lambda t: t.dated_title)
+ # tasks.sort(key=lambda t: t.title.then)
+ # elif sort_order == 'effort':
+ # chosen_todos.sort(key=lambda t:
+ # t.day_effort if t.day_effort else (t.default_effort if t.done else 0),
+ # reverse=True)
+ # relevant_todos.sort(key=lambda t: t.all_days_effort, reverse=True)
+ # filtered_tasks.sort(key=lambda t: t.default_effort.then, reverse=True)
+
+ # return j2env.get_template('pick_tasks.html').render(
+ # sort=sort_order,
+ # tags=self.t_tags,
+ # chosen_todos=chosen_todos,
+ # filter_and=self.tag_filter_and,
+ # filter_not=self.tag_filter_not,
+ # day=self.selected_day,
+ # prev_date=prev_date_str,
+ # next_date=next_date_str,
+ # all_tasks=[t for t in self.tasks.values()],
+ # filtered_tasks=filtered_tasks,
+ # hide_chosen_tasks=hide_chosen_tasks,
+ # relevant_todos=relevant_todos,
+ # search=search)
+