def show(self, id, *args, **kwargs): c.tasklist = safe_get(TaskList, id, check_live=True) self.preload_permission_cache(c.tasklist) c.task_listID = id c.tasks = c.tasklist.topLevelTasks() c.parentID = 0 c.depth = 0 from tasktracker.lib import helpers as h c.permalink = h._get_permalink(request.GET) c.contextual_wrapper_class = 'tt-context-tasklist-show' return render('task/list.myt')
def show(self, id, *args, **kwargs): version = request.params.get("version", None) if version: c.version = version c.task = Task.versions.versionClass.get(version) else: c.task = safe_get(Task, int(id), check_live=True) c.parentID = int(id) c.tasklist = c.task.task_list c.task_listID = c.tasklist.id c.depth = c.task.depth() c.permalink = h._get_permalink(request.GET) c.prev, c.next = c.task.adjacentTasks(options=h.permalink_to_sql(c.permalink), user=c.username, level=c.level) # if the task shown would not be shown under the current # filters, alter the permalink to remove the filters. if not h.is_task_allowed(c.task, c.permalink): c.permalink = h._get_permalink_without_filters(request.GET) c.contextual_wrapper_class = "tt-context-task-show" return render("task/show.myt")