Files
Chad Whitacre b2da48d15d Refactor profile pages; #597
This rationalizes the navigation on profile pages, allowing users and
admins to view all pages under /profile/ and to take all appropriate
actions on each page.
2013-02-06 18:05:46 -05:00

22 lines
857 B
HTML

{% extends "participant.html" %}
{% block head2 %}
<script src="/assets/{{ __version__ }}/profile.js"></script>
{% if user.ADMIN %}<script src="/assets/{{ __version__ }}/admin.js"></script>{% end %}
<script>$(document).ready(Gittip.initTipButtons)</script>
{% end %}
{% block heading %}<h2 class="top"><span>{{ hero }}</span></h2>{% end %}
{% block nav %}
{% if participant.id == user.id or user.ADMIN %}
<div class="buttons nav">
<h2>Navigation</h2>
{% set current_page = path.raw.split('/')[2] %}
{% set pages = [('/', 'Profile'), ('/giving/', 'Giving'), ('/history/', 'History'), ('/widgets/', 'Widgets')] %}
{% for slug, name in pages %}
<a href="/{{ participant.id }}{{ slug }}"><button{% if slug.strip('/') == current_page %} class="selected"{% end %}>{{ name }}</button></a>
{% end %}
</div>
{% end %}
{% end %}