Skip to content

Commit

Permalink
Prioritize active team in team list
Browse files Browse the repository at this point in the history
  • Loading branch information
dcramer committed May 26, 2013
1 parent 5becdfa commit 0213e49
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/sentry/templates/sentry/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
</a>
<nav class="dropdown-menu">
<input type="text" value="search by project name"> <a href="#" class="btn">New</a>
{% for t in TEAM_LIST %}
{% for t in TEAM_LIST|reorder_teams:team %}
<h6><a href="{% url 'sentry' t.slug %}">{{ t.name }}</a></h6>
<ul class="project-list">
{% for p in t.project_set.all %}
Expand Down
8 changes: 8 additions & 0 deletions src/sentry/templatetags/sentry_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,3 +420,11 @@ def recent_alerts(context, project, asvar):
context[asvar] = list(Alert.get_recent_for_project(project.id))

return ''


@register.filter
def reorder_teams(team_list, team):
yield team
for t in team_list:
if t != team:
yield t

0 comments on commit 0213e49

Please sign in to comment.