Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

on the user's profile, make the tip button open the QR code for the BCH address and remove the PayPal form. #1820 #1846

Merged
merged 11 commits into from
Feb 28, 2024
28 changes: 13 additions & 15 deletions website/templates/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@
.hide-issue-form {
padding-top: 10px;
}

</style>
{% endblock style %}
{% block content %}
Expand Down Expand Up @@ -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:" coderbounty@gmail.com" }}">
<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">
Expand Down Expand Up @@ -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();
Expand Down
Loading