mirror of
https://github.com/kennethreitz-archive/www.gittip.com.git
synced 2026-06-21 15:50:59 +00:00
28cb48c72a
I sort of did this one with the blast shield down. I haven't even run
the tests yet. The sorts of things I changed:
- SQL {elsewhere,exchanges}.participant_id => .participant
- SQL participants.id => .username
- ORM {user,participant,self}.id => .username
177 lines
6.4 KiB
HTML
177 lines
6.4 KiB
HTML
{% extends base.html %}
|
|
|
|
{% block box %}
|
|
|
|
<table class="on-profile{% if participant.is_suspicious %} is-suspicious{% end %}">
|
|
<tr>
|
|
<td class="picture">
|
|
<a href="/{{ participant.username }}/"><img src="{{ participant.get_img_src(128) }}" /></a>
|
|
</td>
|
|
<td class="giving-receiving">
|
|
{% set g = giving = participant.get_dollars_giving() %}
|
|
{% set r = receiving = participant.get_dollars_receiving() %}
|
|
|
|
{% if g > r and not participant.anonymous %}
|
|
<h2 class="pad-sign">{{ participant.username }} gives</h2>
|
|
<div class="number">
|
|
{% if user == participant %}
|
|
$<span class="total-giving">{{ giving }}</span>
|
|
{% else %}
|
|
${{ giving }}
|
|
{% end %}
|
|
</div>
|
|
<div class="unit pad-sign">per
|
|
week{% if r > 0 %}, and receives ${{ receiving }}{% end %}
|
|
</div>
|
|
{% elif r > 0 %}
|
|
<h2 class="pad-sign">{{ participant.username }} receives</h2>
|
|
<div class="number">${{ receiving }}</div>
|
|
<div class="unit pad-sign">per
|
|
week{% if g > 0 %}, and gives
|
|
{% if participant.anonymous %}
|
|
anonymously
|
|
{% elif user == participant %}
|
|
$<span class="total-giving">{{ giving }}</span>
|
|
{% else %}
|
|
${{ giving }}
|
|
{% end %}
|
|
{% end %}
|
|
</div>
|
|
{% else %}
|
|
{% set age = participant.get_age_in_seconds() %}
|
|
<h2>{{ participant.username }}
|
|
{% if g > 0 %}
|
|
gives anonymously
|
|
{% elif age < 60 %}
|
|
just joined Gittip! :D
|
|
{% elif age < (60 * 60 * 24 * 7) %}
|
|
joined recently
|
|
{% else %}
|
|
is lurking
|
|
{% end %}
|
|
</h2>
|
|
{% end %}
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
{% if participant != user %}
|
|
<div class="nav level-1">
|
|
{% if locked %}
|
|
|
|
<div class="help with-padding">
|
|
This account has been locked by its owner.
|
|
</div>
|
|
|
|
{% elif user.ANON %}
|
|
|
|
<h2>Your Weekly Gift</h2>
|
|
{% for amount in AMOUNTS %}
|
|
<button class="tip-anon">${{ amount }}</button>
|
|
{% end %}
|
|
|
|
<div class="help with-padding">Sign in using
|
|
<a class="flash-me" href="{{ twitter.oauth_url(website, u'opt-in', path.decoded) }}">Twitter</a>,
|
|
<a href="{{ github.oauth_url(website, u'opt-in', path.decoded) }}">GitHub</a>, or
|
|
<a href="{{ bitbucket.oauth_url(website, u'opt-in', path.decoded) }}">Bitbucket</a>
|
|
to give to <b>{{ participant.username }}</b>.</div>
|
|
|
|
{% else %}
|
|
|
|
{% set my_tip = user.get_tip_to(participant.username) %}
|
|
<h2>Your Weekly Gift</h2>
|
|
{% for amount in AMOUNTS %}
|
|
<button amount="{{ amount }}" tippee="{{ participant.username }}"
|
|
class="tip{{ ' selected' if amount == my_tip else '' }}">${{ amount }}</button>
|
|
{% end %}
|
|
{% if my_tip not in AMOUNTS %}
|
|
<span class="old-amount">
|
|
<button class="tip disabled selected">{{ my_tip }}</button>
|
|
<span class="old-amount-link">—
|
|
<a href="http://blog.gittip.com/post/26505682007/is-personal-funding-viable" target="_blank">old amount</a>!</span>
|
|
</span>
|
|
{% end %}
|
|
|
|
{% if user.last_bill_result is None %}
|
|
|
|
<div id="payment-prompt" class="help{% if my_tip > 0 %} needed{% end %}">
|
|
Back your gift with a <a href="/credit-card.html"
|
|
class="highlight">credit card</a> to make sure it goes
|
|
through!</div>
|
|
{% elif user.last_bill_result %}
|
|
<div id="payment-prompt" class="help really-needed">Fix your <a
|
|
href="/credit-card.html" class="highlight">credit
|
|
card</a> to make sure your gifts go through!</div>
|
|
{% end %}
|
|
|
|
{% end %}
|
|
</div>
|
|
{% end %}
|
|
|
|
{% block nav %}{% end %}
|
|
|
|
{% if participant.username == 'aaronsw' %}
|
|
<div class="nav level-3">
|
|
<a href="http://news.ycombinator.com/item?id=5046845">RIP :`(</a>
|
|
</div>
|
|
<!--
|
|
|
|
After following Aaron's career for a decade, I interacted with him for the
|
|
first time three days before he committed suicide:
|
|
|
|
https://twitter.com/aaronsw/status/288664016723791873
|
|
|
|
:`(
|
|
|
|
-->
|
|
{% end %}
|
|
|
|
{% if user.ADMIN %}
|
|
<label class="is-suspicious-knob" data-username="{{ participant.username }}">
|
|
Suspicious
|
|
<input type="checkbox"
|
|
{% if participant.is_suspicious %}checked="true"{% end %} />
|
|
</label>
|
|
{% elif participant.is_suspicious %}
|
|
<div class="is-suspicious-indicator">Suspicious</div>
|
|
{% end %}
|
|
|
|
{% end %}
|
|
|
|
|
|
{% block body %}
|
|
|
|
<h2>Share</h2>
|
|
|
|
<!-- http://developers.facebook.com/docs/reference/plugins/like/ -->
|
|
<div id="fb-root"></div>
|
|
<script>(function(d, s, id) {
|
|
var js, fjs = d.getElementsByTagName(s)[0];
|
|
if (d.getElementById(id)) return;
|
|
js = d.createElement(s); js.id = id;
|
|
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
|
|
fjs.parentNode.insertBefore(js, fjs);
|
|
}(document, 'script', 'facebook-jssdk'));</script>
|
|
<div class="fb-like" data-send="false" data-width="120" data-show-faces="false"></div>
|
|
|
|
|
|
<!-- https://dev.twitter.com/docs/tweet-button -->
|
|
<a href="https://twitter.com/share"
|
|
class="twitter-share-button" data-lang="en"
|
|
data-text="I just tipped a hard-working genius with Gittip. You can too:"
|
|
data-url="https://www.gittip.com/">Tweet</a>
|
|
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
|
|
|
|
|
|
<!-- http://www.google.com/webmasters/+1/button/ -->
|
|
<g:plusone size="small" annotation="inline" width="120"></g:plusone>
|
|
<script type="text/javascript">
|
|
(function() {
|
|
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
|
|
po.src = 'https://apis.google.com/js/plusone.js';
|
|
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
|
|
})();
|
|
</script>
|
|
|
|
{% end %}
|