Files
www.gittip.com/templates/connected-accounts.html
Chad Whitacre 011b3a99bf Rationalize connected accounts
The "On whatever" text should only be shown when there is a connected
account, because otherwise the message says what platform it is. Also
the three conditionals weren't constructed to be parallel.
2013-03-22 15:44:27 -04:00

103 lines
4.4 KiB
HTML

<h2>Connected Accounts</h2>
<table id="accounts">
<tr>
<td class="account-type">
<img src="/assets/twitter.png" />
</td>
<td class="account-details">
{% if twitter_account is None %}
{% if not user.ANON and user.id == participant.id %}
Connect a <a href="{{ twitter.oauth_url(website, u'connect') }}">Twitter account</a>.
{% else %}
No Twitter account connected.
{% end %}
{% else %}
<a href="{{ twitter_account.user_info.get('html_url', '') }}"
><img class="avatar"
src="{{ twitter_account.user_info.get('profile_image_url_https', '/assets/%s/no-avatar.png' % __version__) }}"
/>{{ twitter_account.user_info.get('screen_name') }}
{% if twitter_account.user_info.get('name') %}({{ twitter_account.user_info.get('name') }}){% end %}
</a>
<div class="account-type">on Twitter</div>
{% end %}
</td>
</tr>
<tr>
<td class="account-type">
<img src="/assets/octocat.png" />
</td>
<td class="account-details">
{% if github_account is None %}
{% if not user.ANON and user.id == participant.id %}
Connect a <a href="{{ github.oauth_url(website, u'connect') }}">GitHub account</a>.
{% else %}
No GitHub account connected.
{% end %}
{% else %}
<a href="{{ github_account.user_info.get('html_url', '') }}"
><img class="avatar" src="{{ github_account.user_info.get('avatar_url', '/assets/%s/no-avatar.png' % __version__) }}"
/>{{ github_account.user_info.get('login') }}
{% if github_account.user_info.get('name') %}({{ github_account.user_info.get('name') }}){% end %}<br />
</a>
<div class="account-type">on GitHub</div>
{% end %}
</td>
</tr>
<tr>
<td class="account-type">
<img src="/assets/bitbucket.png" />
</td>
<td class="account-details">
{% if bitbucket_account is None %}
{% if not user.ANON and user.id == participant.id %}
Connect a <a href="{{ bitbucket.oauth_url(website, u'connect') }}">Bitbucket account</a>.
{% else %}
No Bitbucket account connected.
{% end %}
{% else %}
<a href="{{ bitbucket_account.user_info.get('html_url', '') }}"
><img class="avatar"
src="{{ bitbucket_account.user_info.get('avatar', '/assets/%s/no-avatar.png' % __version__) }}"
/>{{ bitbucket_account.user_info.get('username') }}
{% if bitbucket_account.user_info.get('display_name') %}({{ bitbucket_account.user_info.get('display_name') }}){% end %}
</a>
<div class="account-type">on Bitbucket</div>
{% end %}
</td>
</tr>
<tr>
<td class="account-type">
<img src="/assets/balanced-avatar.png" />
</td>
<td class="account-details">
{% if user.id == participant.id %}
<a href="/credit-card.html">Credit card</a>:
<!--
These spans are here because otherwise Chrome effs up the
unicode(?!)
-->
<span>{% if participant.last_bill_result != "" %}&#x2718;{% else %}&#x2714;{% end %}</span>
&nbsp; &nbsp; &nbsp;
<a href="/bank-account.html">Bank account</a>:
<span>{% if participant.last_ach_result != "" %}&#x2718;{% else %}&#x2714;{% end %}</span>
{% else %}
Credit card:
<span>{% if participant.last_bill_result != "" %}&#x2718;{% else %}&#x2714;{% end %}</span>
&nbsp; &nbsp; &nbsp;
Bank account:
<span>{% if participant.last_ach_result != "" %}&#x2718;{% else %}&#x2714;{% end %}</span>
{% end %}
<div class="account-type">{% if user.ADMIN and participant.balanced_account_uri %}
<a href="https://www.balancedpayments.com/{{ participant.balanced_account_uri[3:] }}"
>on Balanced Payments</a>{% else %}on Balanced Payments{% end %}</div>
</td>
</tr>
</table>