Get the main repo page design working

This commit is contained in:
Joseph Schorr 2015-03-10 17:22:46 -07:00
parent 3d3c8ca198
commit 002dc083f2
18 changed files with 299 additions and 18 deletions

View file

@ -1,6 +1,7 @@
import logging
import json
import datetime
from datetime import timedelta
from flask import request
@ -213,7 +214,17 @@ class Repository(RepositoryParamResource):
'is_building': len(list(active_builds)) > 0,
'is_organization': bool(organization),
'is_starred': is_starred,
'status_token': repo.badge_token if not is_public else ''
'status_token': repo.badge_token if not is_public else '',
'stats': {
'pulls': {
'today': model.get_repository_pulls(repo, timedelta(days=1)),
'thirty_day': model.get_repository_pulls(repo, timedelta(days=30))
},
'pushes': {
'today': model.get_repository_pushes(repo, timedelta(days=1)),
'thirty_day': model.get_repository_pushes(repo, timedelta(days=30))
}
}
}
raise NotFound()