mirror of
https://github.com/kennethreitz-archive/www.gittip.com.git
synced 2026-06-21 15:50:59 +00:00
2c509a8d23
Trusted users can answer the question "Who is Gittip?" and we compute a percentage split for the pot based on those answers. The rest is details. Or faucets and fixtures. ;-)
93 lines
3.1 KiB
HTML
93 lines
3.1 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 = "making the world better by"
|
|
LONG_STATEMENT = 256
|
|
|
|
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.username # used in the title tag
|
|
username = participant.username # used in footer shared with on/$platform/
|
|
# pages
|
|
github_account, twitter_account, bitbucket_account = participant.get_accounts_elsewhere()
|
|
long_statement = len(participant.statement) > LONG_STATEMENT
|
|
if participant.type == 'individual':
|
|
MAKING = "I am " + MAKING
|
|
else:
|
|
MAKING = "We are " + MAKING
|
|
|
|
# ========================================================================== ^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() }}" />
|
|
{% if participant.statement %}
|
|
<meta name="og:description" content="{{ _clip(MAKING + " " + escape(participant.statement), 200) }}" />
|
|
{% else %}
|
|
<meta name="og:description" content="Gittip is a weekly gift exchange." />
|
|
{% end %}
|
|
<meta name="og:image" content="{{ participant.get_img_src() }}" />
|
|
{% end %}
|
|
{% block page %}
|
|
|
|
{% if user == participant %}
|
|
<div id="profile-edit">
|
|
{% include "templates/profile-edit.html" %}
|
|
</div>
|
|
{% else %}
|
|
<div class="group">
|
|
{% if participant.statement %}
|
|
<div class="{% if long_statement %}col1{% else %}col0{% end %}">
|
|
<h2>Statement</h2>
|
|
<div class="statement">
|
|
{{ MAKING }} {{ wrap(participant.statement) }}
|
|
</div>
|
|
</div>
|
|
<div class="{% if long_statement %}col2{% else %}col0{% end %}">
|
|
{% else %}
|
|
<div class="col0">
|
|
{% end %}
|
|
|
|
{% if participant.type == 'open group' %}
|
|
{% include "templates/open-group-members.html %}
|
|
{% end %}
|
|
|
|
<h2>Funding Goal</h2>
|
|
<div class="goal">
|
|
{% if participant.goal is None %}
|
|
I'm grateful for gifts, but I don't have a specific
|
|
funding goal.
|
|
{% elif participant.goal == 0 %}
|
|
I'm here as a patron.
|
|
{% 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 %}
|