Redesign the teams page to use a table
Allows for faster loading and easier viewing of important information about teams
This commit is contained in:
parent
98206310bd
commit
6ebb417923
11 changed files with 194 additions and 168 deletions
|
@ -8,13 +8,12 @@ import features
|
|||
|
||||
from app import billing as stripe, avatar
|
||||
from endpoints.api import (resource, nickname, ApiResource, validate_json_request, request_error,
|
||||
related_user_resource, internal_only, require_user_admin, log_action,
|
||||
related_user_resource, internal_only, require_user_admin, log_action,
|
||||
show_if, path_param, require_scope)
|
||||
from endpoints.exception import Unauthorized, NotFound
|
||||
from endpoints.api.team import team_view
|
||||
from endpoints.api.user import User, PrivateRepositories
|
||||
from auth.permissions import (AdministerOrganizationPermission, OrganizationMemberPermission,
|
||||
CreateRepositoryPermission)
|
||||
CreateRepositoryPermission, ViewTeamPermission)
|
||||
from auth.auth_context import get_authenticated_user
|
||||
from auth import scopes
|
||||
from data import model
|
||||
|
@ -24,6 +23,18 @@ from data.billing import get_plan
|
|||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def team_view(orgname, team):
|
||||
return {
|
||||
'name': team.name,
|
||||
'description': team.description,
|
||||
'role': team.role_name,
|
||||
'avatar': avatar.get_data_for_team(team),
|
||||
'can_view': ViewTeamPermission(orgname, team.name).can(),
|
||||
|
||||
'repo_count': team.repo_count,
|
||||
'member_count': team.member_count,
|
||||
}
|
||||
|
||||
|
||||
def org_view(o, teams):
|
||||
is_admin = AdministerOrganizationPermission(o.username).can()
|
||||
|
|
Reference in a new issue