Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Add Venmo button #2376

Merged
merged 5 commits into from
May 12, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions scss/modules.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,35 @@ a.mini-user:hover {
font-style: italic;
color: $gray;
}
.auth-button, .account-delete {
float: right;
margin-top: 8px;

.account-action {
padding-right: 8px;
vertical-align: middle;
text-align: right;

.account-delete {
display: inline-block;
}
}

tr.has-avatar > .account-details {
vertical-align: bottom;
}

.email {
position: relative;
}
.toggle-bitcoin, .toggle-email {
position: absolute;
right: 0;
}
.toggle-bitcoin {
margin-top: 8px;
right: 8px;
}
.account-type ~ .auth-button, .toggle-email {
margin-top: -1.25em;
}
td > div {
position: relative;
}
table {
width: 100%;
}
Expand Down Expand Up @@ -156,9 +168,6 @@ a.mini-user:hover {
}
}
}
tr.has-avatar > td {
vertical-align: bottom;
}
div.account-type {
font-size: 12px;
color: $gray;
Expand Down
19 changes: 11 additions & 8 deletions templates/account-row.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,30 @@
<td class="account-details">
{% if account == None %}
<span class="none">None</span>
{% if not user.ANON and user.participant == participant %}
{% call auth_button(platform.name, 'connect') %}
+ Add
{% endcall %}
{% endif %}
{% else %}
<a class="account-username" rel="me" href="{{ account.html_url|e }}"
>{{ account.user_name|e }}
{% if account.display_name and account.display_name != account.user_name %}
({{ account.display_name|e }})
{% endif %}
</a>
{% if user.participant == participant %}
{% endif %}

<div class="account-type">{{ platform.display_name }}</div>
</td>
<td class="account-action">
{% if user.participant == participant %}
{% if account == None %}
{% call auth_button(platform.name, 'connect') %}
+ Add
{% endcall %}
{% else %}
<div class="account-delete" title="Disconnect"
data-platform="{{ platform.name }}"
data-user_id="{{ account.user_id }}">
</div>
{% endif %}
{% endif %}

<div class="account-type">{{ platform.display_name }}</div>
</td>
</tr>
{% endmacro %}
4 changes: 2 additions & 2 deletions templates/connected-accounts.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h2>Other Giving Options</h2>
<td class="account-type">
<img src="{{ website.asset_url }}/bitcoin.png" />
</td>
<td class="account-details">
<td class="account-details" colspan="2">
{% if not user.ANON and own_account %}
<div class="bitcoin">
{% else %}
Expand Down Expand Up @@ -70,7 +70,7 @@ <h2>Other Giving Options</h2>
{% endif %}

{% if accounts[website.platforms.venmo.name] or own_account %}
{{ account_row(website.platforms.venmo, accounts, auth_button) }}
{% include "templates/venmo-account.html" %}
{% endif %}
</table>

Expand Down
49 changes: 49 additions & 0 deletions templates/venmo-account.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{% from 'templates/avatar-url.html' import avatar_url with context %}

{% set account = accounts.get('venmo', None) %}
<tr class="{{ 'has-avatar' if account }}">
<td class="account-type">
<div class="sanity-preserving-wrapper">
{% if account != None %}
<img class="avatar" src="{{ avatar_url(account) }}"/>
{% endif %}
<img class="platform" src="{{ website.asset_url }}/venmo.png" />
</div>
</td>
<td class="account-details">
{% if account == None %}
<span class="none">None</span>
{% else %}
<a class="account-username" rel="me" href="{{ account.html_url|e }}"
>{{ account.user_name|e }}
{% if account.display_name and account.display_name != account.user_name %}
({{ account.display_name|e }})
{% endif %}
</a>
{% endif %}

<div class="account-type">Venmo</div>
</td>
<td class="account-action">
{% if account == None %}
{% if not user.ANON and user.participant == participant %}
{% call auth_button('venmo', 'connect') %}
+ Add
{% endcall %}
{% endif %}
{% else %}
{% if user.participant == participant %}
<div class="account-delete" title="Disconnect"
data-platform="venmo"
data-user_id="{{ account.user_id }}">
</div>
{% else %}
<div class="venmo-button">
<a class="venmo-pay-button" data-recipient-id="{{account.user_id}}"></a>
</div>
{% endif %}
{% endif %}
</td>
</tr>

<script src="https://platform.venmo.com/sdk.js"></script>
14 changes: 12 additions & 2 deletions www/%username/account/index.html.spt
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,14 @@ locked = False
<div class="account-type">Credit card</div>
{% if participant.last_bill_result != "" %}
<span class="none">None</span>
<a class="button auth-button" href="/credit-card.html">+ Add</a>
{% else %}
<a class="account-username" href="/credit-card.html">Added</a>
{% endif %}
</td>
<td class="account-action">
{% if participant.last_bill_result != "" %}
<a class="button auth-button" href="/credit-card.html">+ Add</a>
{% else %}
<a class="button auth-button" href="/credit-card.html">Edit</a>
{% endif %}
</td>
Expand All @@ -100,9 +105,14 @@ locked = False
<div class="account-type">Bank account</div>
{% if participant.last_ach_result != "" %}
<span class="none">None</span>
<a class="button auth-button" href="/bank-account.html">+ Add</a>
{% else %}
<a class="account-username" href="/bank-account.html">Added</a>
{% endif %}
</td>
<td class="account-action">
{% if participant.last_ach_result != "" %}
<a class="button auth-button" href="/bank-account.html">+ Add</a>
{% else %}
<a class="button auth-button" href="/bank-account.html">Edit</a>
{% endif %}
</td>
Expand Down