{% extends '@BidcozFrontend/campaign.html.twig' %}
{% block beforeContent %}
{{ parent() }}
<h1 class="text-center">Donate</h1>
{% endblock %}
{% block content %}
<div class="row justify-content-center">
{% if is_granted('DONATION', organization) and campaign.hasCashDonations and campaign.showCashDonations %}
<div class="col-12 col-md-6 col-xl-4 pb-4">
<div class="panel donate-content h-100" data-url="{{ path('campaign_donate_cash', campaignParams) }}">
<div class="panel-body center text-center">
<div class="d-flex justify-content-center mt-5">
{% include '@BidcozCore/Components/icon.html.twig' with { icon: 'currency-outline', h: '60px', w: '60px' } %}
</div>
<h2>Make a Cash Donation</h2>
</div>
</div>
</div>
{% endif %}
{% if is_granted('PROCUREMENT', organization) and campaign.hasItemDonations %}
<div class="col-12 col-md-6 col-xl-4 pb-4">
<div class="panel donate-content h-100" data-url="{{ path('campaign_donate_item', campaignParams) }}">
<div class="panel-body center text-center">
<div class="d-flex justify-content-center mt-5">
{% include '@BidcozCore/Components/icon.html.twig' with { icon: 'tag-outline', h: '60px', w: '60px' } %}
</div>
<h2>Make an Item Donation</h2>
</div>
</div>
</div>
{% endif %}
{% if is_granted('DONATION', organization) and is_granted('DONATION_CRYPTO', organization) and campaign.cryptoWallets | length %}
<div class="col-12 col-md-6 col-xl-4 pb-4">
<div class="panel donate-content h-100" data-url="{{ path('campaign_donate_crypto', campaignParams) }}">
<div class="panel-body center text-center">
<div class="d-flex justify-content-center mt-5">
<span class="icon">
<i class="fas fa-coins" style="height: 60px; width: 60px;"></i>
</span>
</div>
<h2>Make a Crypto Donation (Beta)</h2>
</div>
</div>
</div>
{% endif %}
</div>
{% endblock %}
{# block internal_sidebar %}
{% if is_logged_in() and campaign.hasCashDonations and campaign.hasCashDonations %}
<div class="sidebar-content donate-sidebar">
<div class="panel">
<div class="panel-body">
<h6>Select Donation Type</h6>
<p class="caption">
{% if campaign.donationText %}
{{ campaign.donationText }}
{% else %}
We accept and appreciate all donations. Thank you.
{% endif %}
</p>
<div class="row donation-types">
{% if campaign.hasCashDonations %}
<div class="col-xs-12 col-sm-6 col-lg-12">
<a
id="cash-donation"
href="{{ path('campaign_donate_cash', campaignParams) }}"
class="btn btn-secondary full-width"
>
Donate Cash
</a>
</div>
{% endif %}
{% if campaign.hasItemDonations %}
<div class="col-xs-12 col-sm-6 col-lg-12">
<a
id="item-donation"
href="{{ path('campaign_donate_item', campaignParams) }}"
class="btn btn-secondary full-width"
>
Donate Item
</a>
</div>
{% endif %}
</div>
</div>
</div>
</div>
{% endif %}
{% endblock #}
{% block javascripts %}
{{ parent() }}
<script type="text/javascript">
// $(function(){
// var donationTypes = $('.donation-types').children().length,
// urlParts = window.location.pathname.split('/'),
// path = urlParts[urlParts.length - 1];
//
// if ( path === 'money' || path === 'item' ) {
// if ( donationTypes === 1 ) {
// $('.sidebar').hide();
// $('.main-content').removeClass(function (index, className) {
// return (className.match(/(^|\s)col-\S+/g) || []).join(' ');
// }).addClass('col-12');
// }
// } else {
// if ( donationTypes === 1 ) {
// $('.donation-types>div>a')[0].click();
// $('.sidebar').hide();
// $('.main-content').removeClass(function (index, className) {
// return (className.match(/(^|\s)col-\S+/g) || []).join(' ');
// }).addClass('col-12');
// }
// }
//
// if ('money' === path) {
// $('.select-type-default').addClass('d-none');
// $('.donation-types>div>a').first().removeClass('btn-secondary');
// } else if ('item' === path) {
// $('.select-type-default').addClass('d-none');
// $('.donation-types>div>a').last().removeClass('btn-secondary');
// }
// });
$(document).ready(function() {
$('.donate-content').on('click', function() {
window.location.href = $(this).data('url');
});
});
</script>
{% endblock %}