Skip to content

Commit

Permalink
Show team name instead of portal title on team overview
Browse files Browse the repository at this point in the history
  • Loading branch information
buchi committed Jun 9, 2016
1 parent c69e95e commit ffd9b92
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ftw/footballchallenge/browser/team_overview.pt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
metal:use-macro="context/main_template/macros/master"
i18n:domain="ftw.footballchallenge">

<metal:content-title fill-slot="content-title">
<h1 class="documentFirstHeading" tal:content="view/team_name"></h1>
</metal:content-title>

<metal:content-core fill-slot="content-core">
<div tal:define="nations view/calculate_nations">
<table class="listing">
Expand Down
3 changes: 3 additions & 0 deletions ftw/footballchallenge/browser/team_overview.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class TeamOverview(BrowserView):
def __init__(self, context, request):
super(TeamOverview, self).__init__(context, request)
self.team_id = None
self.team_name = ''


def __call__(self):
Expand All @@ -38,12 +39,14 @@ def __call__(self):
if not self.team_id:
if myteam:
self.team_id = myteam.id_
self.team_name = myteam.name
else:
return self.request.RESPONSE.redirect(self.context.absolute_url() + '/edit_team')
else:
team = session.query(Team).filter(Team.id_ == self.team_id).first()
if not team:
raise NotFound
self.team_name = team.name

# Don't show other teams if event hasn't started yet
if open_events and self.team_id != myteam.id_:
Expand Down

0 comments on commit ffd9b92

Please sign in to comment.