Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Add team listing to sidebar
Browse files Browse the repository at this point in the history
Copied the team listing from team-listing.html to the user sidebar.
Added some comments as I figured out what was going on.  It might make
sense to make links yellow in the sidebar so they are more visible.
  • Loading branch information
mattbk authored and chadwhitacre committed Aug 22, 2015
1 parent ed5b69a commit 5d13f2e
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion templates/profile-sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,32 @@
{% set giving_str = '[' + _('hidden') + ']' if anon_giving else format_currency(g, "USD") %}
{% set receiving_str = '[' + _('hidden') + ']' if anon_receiving else format_currency(r, "USD") %}

<!-- Copied and modified from team-listing.html -->
{% set approved_teams = participant.get_teams(only_approved=True) %}

<!-- If viewer is admin or account owner, show team listing or team heading with no teams -->
{% if user.ADMIN or user.participant == participant %}
{{ _("Teams") }}
<ul class="team memberships">
{% for team in participant.get_teams() %}
<li><a href="/{{ team.slug }}/">{{ team.name }}</a></li>
{% endfor %}
</ul>
<!-- If viewer is account owner, give them some help -->
{% if user.participant == participant %}
<p><a href="/about/teams/">{{ _("Learn more about how teams work") }}</a></p>
{% endif %}
<!-- If viewer is not admin or account owner, only show team heading if there are teams to list -->
{% elif approved_teams %}
{{ _("Teams") }}
<ul class="team memberships">
{% for team in approved_teams %}
<li><a href="/{{ team.slug }}/">{{ team.name }}</a></li>
{% endfor %}
</ul>
{% endif %}
<!-- End copied section -->

<!--
<table>
<tr>
Expand All @@ -35,7 +61,7 @@
</td>
</tr>
</table>
-->
-->

{% if participant.claimed_time %}
<p>{{ _('Joined') }} {{ to_age(participant.claimed_time, add_direction=True) }}.</p>
Expand Down

0 comments on commit 5d13f2e

Please sign in to comment.