-
-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
on the user's profile, make the tip button open the QR code for the B…
- Loading branch information
1 parent
d4210da
commit 84cad21
Showing
1 changed file
with
13 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -162,6 +162,7 @@ | |
.hide-issue-form { | ||
padding-top: 10px; | ||
} | ||
|
||
</style> | ||
{% endblock style %} | ||
{% block content %} | ||
|
@@ -214,21 +215,11 @@ <h1 class="page-header text-capitalize">{{ user.username }}</h1> | |
{% endif %} | ||
{% endif %} | ||
<div class="status"> | ||
<form name="_xclick" | ||
action="https://www.paypal.com/cgi-bin/webscr" | ||
method="post"> | ||
<input type="hidden" name="cmd" value="_xclick"> | ||
<input type="hidden" | ||
name="business" | ||
value="{{ project.paypal|default:" [email protected]" }}"> | ||
<input type="hidden" | ||
name="item_name" | ||
value="tip for {{ user.username }} on {% env 'DOMAIN_NAME' %}"> | ||
<input type="hidden" name="currency_code" value="USD"> | ||
<button type="submit" class="btn btn-danger text-black"> | ||
<i class="fa fa-money fa-lg"></i> {% trans "Send a tip" %} | ||
</button> | ||
</form> | ||
<button type="button" id="openModal" class="btn btn-danger">Send a Tip</button> | ||
<dialog id="dialog"> | ||
<img id="qr-image" alt="QR Code" width="400" height="400"> | ||
<p id="bch-address">BCH: {{ user.userprofile.crypto_address }}</p> | ||
</dialog> | ||
</div> | ||
</div> | ||
<div class="icon-block"> | ||
|
@@ -421,6 +412,13 @@ <h1 class="page-header text-capitalize">{{ user.username }}</h1> | |
</div> | ||
</div> | ||
<script type="text/javascript"> | ||
document.getElementById('openModal').addEventListener('click', function() { | ||
var address = "{{ user.userprofile.crypto_address }}"; | ||
var qrUrl = "https://api.qrserver.com/v1/create-qr-code/?data=bitcoincash:" + address + "&size=400x400"; | ||
document.getElementById('qr-image').src = qrUrl; | ||
document.getElementById('dialog').showModal(); | ||
}); | ||
|
||
$(function () { | ||
$('.img-thumbnail, .upload-btn').on('mouseenter', function () { | ||
$('.upload-btn').show(); | ||
|