def stats_json(owner, repo): stargazers, open_issues, open_pulls, by_label = ( db.get_stats_series(owner, repo, include_labels=request.args.get('include_labels'))) stargazers = format_date_column(stargazers) open_issues = format_date_column(open_issues) open_pulls = format_date_column(open_pulls) by_label = [by_label[0]] + format_date_column(by_label[1:]) return jsonify({ 'owner': owner, 'repo': repo, 'stargazers': stargazers, 'open_issues': open_issues, 'open_pulls': open_pulls, 'by_label': by_label })
def stats(owner, repo): login = g.user.login if g.user else None if not db.is_repo_tracked(owner, repo): return render_template('new_repo.html', login=login, owner=owner, repo=repo) stargazers, open_issues, open_pulls, by_label = db.get_stats_series(owner, repo, include_labels=False) stargazers = format_date_column(stargazers) open_issues = format_date_column(open_issues) open_pulls = format_date_column(open_pulls) return render_template('index.html', login=login, owner=owner, repo=repo, stargazers=stargazers, open_issues=open_issues, open_pulls=open_pulls)