mirror of
https://github.com/kennethreitz-archive/www.gittip.com.git
synced 2026-06-21 15:50:59 +00:00
28009b30b1
I have been misusing rsquo for apostrophes.
79 lines
2.5 KiB
HTML
79 lines
2.5 KiB
HTML
"""Show information about a single participant. It might be you!
|
|
"""
|
|
import locale
|
|
|
|
import requests
|
|
from aspen import json, Response
|
|
from aspen.utils import to_age
|
|
from gittip import AMOUNTS
|
|
from gittip.utils import get_participant, wrap
|
|
|
|
MAKING = "I am making the world better by"
|
|
|
|
def _clip(text, n):
|
|
text = text.replace('\n', ' ')
|
|
if len(text) > n:
|
|
text = text[:(n - 4)] + '...'
|
|
return text
|
|
|
|
# ========================================================================== ^L
|
|
|
|
participant = get_participant(request, restrict=False)
|
|
locked = False
|
|
tip_or_pledge = "tip"
|
|
hero = "Profile"
|
|
title = participant.id # used in the title tag
|
|
username = participant.id # used in footer shared with on/$platform/ pages
|
|
github_account, twitter_account = participant.get_accounts_elsewhere()
|
|
|
|
# ========================================================================== ^L
|
|
{% extends templates/profile.html %}
|
|
{% block head %}
|
|
<meta name="twitter:card" content="summary" />
|
|
<meta name="og:url" content="https://www.gittip.com/{{ username }}/" />
|
|
<meta name="og:type" content="website" />
|
|
<meta name="og:title" content="{{ participant.get_og_title() }}" />
|
|
<meta name="og:description" content="{{ _clip(MAKING + " " + participant.statement, 200) }}" />
|
|
<meta name="og:image" content="https://www.gittip.com/assets/gittip.opengraph.png" />
|
|
{% end %}
|
|
{% block page %}
|
|
|
|
{% if user == participant %}
|
|
<div id="profile-edit">
|
|
{% include "templates/profile-edit.html" %}
|
|
</div>
|
|
{% else %}
|
|
<div class="group">
|
|
<div class="col1">
|
|
<h2>Statement</h2>
|
|
<div class="statement">
|
|
{% if participant.statement %}
|
|
{{ MAKING }} {{ wrap(participant.statement) }}
|
|
{% else %}
|
|
[ unstated ]
|
|
{% end %}
|
|
</div>
|
|
</div>
|
|
<div class="col2">
|
|
|
|
<h2>Funding Goal</h2>
|
|
<div class="goal">
|
|
{% if participant.goal is None %}
|
|
I'm grateful for tips, but I don't have a specific
|
|
funding goal.
|
|
{% elif participant.goal == 0 %}
|
|
I'm not here to receive tips. I'll generally regift
|
|
them.
|
|
{% else %}
|
|
My goal is to receive
|
|
${{ locale.format("%.2f", participant.goal, grouping=True) }}
|
|
per week on Gittip.
|
|
{% end %}
|
|
</div>
|
|
|
|
{% include "templates/connected-accounts.html" %}
|
|
</div>
|
|
</div>
|
|
{% end %}
|
|
{% end %}
|