Links for team management.

master
Nick Sergeant 2015-10-17 09:13:02 -04:00
parent 48ad4ade58
commit 1d2a85437d
6 changed files with 55 additions and 3 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1666,6 +1666,34 @@ div.profile {
text-decoration: none;
}
}
&.team-settings {
margin-top: -20px;
span.title {
color: #949494;
display: block;
font-size: 11px;
margin-bottom: 10px;
text-transform: uppercase;
}
a {
background: #dbdbdb;
box-sizing: border-box;
display: block;
margin-bottom: 5px;
padding: 5px 8px;
text-decoration: none;
width: 100%;
@include border-radius(3px);
&:hover {
background: #c8c8c8;
}
&:last-child {
margin-bottom: 0;
}
}
}
}
div.empty-snipts {
background: rgba(128, 128, 128, .08);

View File

@ -37,6 +37,10 @@ class Team(models.Model):
def __unicode__(self):
return self.name
@property
def member_count(self):
return self.members.all().count() + 1
@property
def member_limit(self):
plan_map = {

View File

@ -80,6 +80,9 @@
<option value="snipt-teams-250-yearly">250 users - $3,588/year</option>
<option value="snipt-teams-unlimited-yearly">Unlimited users - $5,988/year</option>
</select>
<p class="sub" style="margin-top: 3px; color: #999999;">
Free 14-day trial (your card won't be charged until then, and you can cancel at any time).
</p>
</div>
</div>
<div class="control-group">

View File

@ -20,9 +20,26 @@
</a>
</div>
{% endif %}
<div class="member-since">{{ user.team.members.all|length }} member{{ user.team.members.all|pluralize }}</div>
<div class="member-since">
{% if user.team.owner == request.user %}
<a href="/{{ user.username }}/members/">
{{ user.team.member_count }} member{{ user.team.member_count|pluralize }}
</a>
{% else %}
{{ user.team.member_count }} member{{ user.team.member_count|pluralize }}
{% endif %}
</div>
</div>
</div>
{% if user.team.owner == request.user %}
<div class="profile team-settings group">
<div class="meta">
<span class="title">Team settings</span>
<a href="/{{ user.username }}/billing/">Billing &raquo;</a>
<a href="/{{ user.username }}/members/">Members &raquo;</a>
</div>
</div>
{% endif %}
{% else %}
<div class="profile group">
<a href="/{{ user.username }}/">