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

Commit

Permalink
refactor team and community listings
Browse files Browse the repository at this point in the history
  • Loading branch information
Changaco committed Feb 9, 2015
1 parent de41fa2 commit 033188a
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 32 deletions.
28 changes: 19 additions & 9 deletions templates/community-listing.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
{% if communities %}
<h2>{{ _("Communities") }}</h2>
<ul class="community memberships">
{% for community in communities %}
<li>
<a href="/for/{{ community.slug }}/">{{ community.name }}</a>
<div class="fine">{{ with_others(community) }}</div>
</li>
{% endfor %}
</ul>
{% if user.participant == participant %}
<h2>{{ ngettext("You are in {n} community", "You are in {n} communities",
len(communities)) }}</h2>
{% else %}
<h2>{{ _("Communities") }}</h2>
{% endif %}
<ul class="community memberships">
{% for community in communities %}
<li>
<a href="/for/{{ community.slug }}/">{{ community.name }}</a>
<div class="fine">{{ with_others(community) }}</div>
</li>
{% endfor %}
</ul>
{% elif user.participant == participant %}
<h2>{{ _("You haven't joined any community") }}</h2>
{% endif %}
{% if user.participant == participant %}
<p><a href="/for/">{{ _("Join Communities") }}</a></p>
{% endif %}
8 changes: 0 additions & 8 deletions templates/profile-edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,6 @@ <h2>{{ _("Funding Goal") }}
<!-- Memberships -->
{% include "templates/team-listing.html" %}
{% include "templates/community-listing.html" %}
{% if not communities %}
{#
Still show the communities heading in this case. Otherwise it's set in
community-listing.html. See https://github.com/gratipay/gratipay.com/pull/1916.
#}
<h2>{{ _("Communities") }}</h2>
{% endif %}
<a href="/for/">{{ _("Join Communities") }}</a>

<!-- Connected Accounts -->
{% include "templates/connected-accounts.html" %}
Expand Down
29 changes: 20 additions & 9 deletions templates/team-listing.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
{% set teams = participant.get_teams() %}
{% if teams %}
<h2>{{ _('Teams') }}</h2>
<ul class="team memberships">
{% for team in teams %}
<li>
<a href="/{{ team.name }}/">{{ team.name }}</a>
<div class="fine">{{ with_others(team) }}</div>
</li>
{% endfor %}
</ul>
{% if user.participant == participant %}
<h2>{{ ngettext("You are in {n} team", "You are in {n} teams",
len(teams)) }}</h2>
{% else %}
<h2>{{ _("Teams") }}</h2>
{% endif %}
<ul class="team memberships">
{% for team in teams %}
<li>
<a href="/{{ team.name }}/">{{ team.name }}</a>
<div class="fine">{{ with_others(team) }}</div>
</li>
{% endfor %}
</ul>
{% if user.participant == participant %}
<p><a href="/about/teams/">{{ _("Learn more about how teams work") }}</a></p>
{% endif %}
{% elif user.participant == participant %}
<h2>{{ _('You are not in any team') }}</h2>
<p><a href="/about/teams/">{{ _('What are Teams?') }}</a></p>
{% endif %}
6 changes: 0 additions & 6 deletions www/index.html.spt
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,8 @@ friends_hack = website.db.all("""
href="">About Receiving</a> guide for more suggestions.</p>

{% include "templates/team-listing.html" %}

<p><a href="">Join Teams</a> | <a href="">What are Teams?</a></p>


{% include "templates/community-listing.html" %}

<p><a href="">Join Communities</a> | <a href="">What are Communities?</a></p>

</div>

{% endif %}
Expand Down

0 comments on commit 033188a

Please sign in to comment.