Added observer tags.

This commit is contained in:
Michael Zhang 2016-03-03 18:39:09 -06:00
parent 7cc0b64d1e
commit 03e5dbc49e
3 changed files with 21 additions and 6 deletions

View file

@ -62,7 +62,9 @@ class Teams(db.Model):
"username": member.username,
"name": member.name,
"captain": member.uid == self.owner,
"type": member.utype
"type": member.utype,
"admin": member.admin == True,
"observer": member.utype == 3
})
return members
@ -124,9 +126,9 @@ class Teams(db.Model):
return result
def is_observer(self):
members = get_members()
members = self.get_members()
for member in members:
if member["observer"] == True:
if member["observer"] == True or member["admin"] == True:
return True
return False

View file

@ -300,6 +300,7 @@ def get_team_info(tid=None, teamname=None, teamname_lower=None, owner=None):
"points": team.points(),
"members": team.get_members(),
"captain": team.owner,
"observer": team.is_observer()
}
return result

View file

@ -22,14 +22,26 @@
<div ng-show="team['in_team']==true">
<h1><span data-toggle="tooltip" data-placement="top" title="Click to edit team name." id="teamname_edit" class="padded editable" contenteditable>{{ team['teamname'] }}</span></h1>
<h4><i class="fa fa-fw fa-university"></i> <span data-toggle="tooltip" data-placement="top" title="Click to edit school." id="school_edit" class="padded editable" contenteditable>{{ team['school'] || 'Add School' }}</span></h4>
<div class="badge">
<i class="fa fa-fw fa-flag"></i>
I'm in the team!
<div class="row">
<div class="label label-success">
<i class="fa fa-fw fa-flag"></i>
I'm in the team!
</div>
<div class="label label-warning">
<i class="fa fa-fw fa-globe"></i>
OBSERVER
</div>
</div>
</div>
<div ng-show="team['in_team']!=true">
<h1><span class="padded">{{ team['teamname'] }}</span></h1>
<h4><i class="fa fa-fw fa-university"></i> <span class="padded">{{ team['school'] || 'Unknown Affiliation' }}</span></h4>
<div class="row">
<div class="label label-warning">
<i class="fa fa-fw fa-globe"></i>
OBSERVER
</div>
</div>
</div>
</center>
</div>