def get(self, slug, id): ctx = self.get_context(slug=slug, id=id) project = ctx['project'] # List view if id is None: issues = Issue.objects(project=project) return render_template('issue/list.html', issues=issues, project=project) # Detail view else: comment_form = model_form(Comment, exclude=['created_at', 'updated_at', 'author', 'mentions', 'attachments']) form = comment_form(request.form) issue = ctx['issue'] issue.sync() all_events = issue.all_events() return render_template('issue/detail.html', issue=issue, events=all_events, form=form, current_user=current_user(), project=project)
def get(self, slug): # List view if slug is None: projects = Project.objects.all() return render_template('project/list.html', projects=projects, current_user=current_user()) # Detail view else: ctx = self.get_context(slug=slug) project = ctx['project'] try: project.sync() except KeyError as e: if current_user().linked(): return redirect(url_for('github_login')) else: return redirect(url_for('github_info')) issues = Issue.objects(project=project, open=True) return render_template('issue/list.html', issues=issues, project=project)
def label_issues(slug, label): project = Project.objects.get_or_404(slug=slug) issues = Issue.objects(labels=label, project=project) return render_template('issue/list.html', issues=issues, project=project)
def open_issues(slug): project = Project.objects.get_or_404(slug=slug) issues = Issue.objects(open=True, project=project) return render_template('issue/list.html', issues=issues, project=project)