src/Bidcoz/Bundle/FrontendBundle/Resources/views/Campaign/Donate/index.html.twig line 1

Open in your IDE?
  1. {% extends '@BidcozFrontend/campaign.html.twig' %}
  2. {% block beforeContent %}
  3.     {{ parent() }}
  4.     <h1 class="text-center">Donate</h1>
  5. {% endblock %}
  6. {% block content %}
  7.     <div class="row justify-content-center">
  8.         {% if is_granted('DONATION', organization) and campaign.hasCashDonations and campaign.showCashDonations %}
  9.             <div class="col-12 col-md-6 col-xl-4 pb-4">
  10.                 <div class="panel donate-content h-100" data-url="{{ path('campaign_donate_cash', campaignParams) }}">
  11.                     <div class="panel-body center text-center">
  12.                         <div class="d-flex justify-content-center mt-5">
  13.                             {% include '@BidcozCore/Components/icon.html.twig' with { icon: 'currency-outline', h: '60px', w: '60px' } %}
  14.                         </div>
  15.                         <h2>Make a Cash Donation</h2>
  16.                     </div>
  17.                 </div>
  18.             </div>
  19.         {% endif %}
  20.         {% if is_granted('PROCUREMENT', organization) and campaign.hasItemDonations %}
  21.             <div class="col-12 col-md-6 col-xl-4 pb-4">
  22.                 <div class="panel donate-content h-100" data-url="{{ path('campaign_donate_item', campaignParams) }}">
  23.                     <div class="panel-body center text-center">
  24.                         <div class="d-flex justify-content-center mt-5">
  25.                             {% include '@BidcozCore/Components/icon.html.twig' with { icon: 'tag-outline', h: '60px', w: '60px' } %}
  26.                         </div>
  27.                         <h2>Make an Item Donation</h2>
  28.                     </div>
  29.                 </div>
  30.             </div>
  31.         {% endif %}
  32.         {% if is_granted('DONATION', organization) and is_granted('DONATION_CRYPTO', organization) and campaign.cryptoWallets | length %}
  33.             <div class="col-12 col-md-6 col-xl-4 pb-4">
  34.                 <div class="panel donate-content h-100" data-url="{{ path('campaign_donate_crypto', campaignParams) }}">
  35.                     <div class="panel-body center text-center">
  36.                         <div class="d-flex justify-content-center mt-5">
  37.                             <span class="icon">
  38.                                 <i class="fas fa-coins" style="height: 60px; width: 60px;"></i>
  39.                             </span>
  40.                         </div>
  41.                         <h2>Make a Crypto Donation (Beta)</h2>
  42.                     </div>
  43.                 </div>
  44.             </div>
  45.         {% endif %}
  46.     </div>
  47. {% endblock %}
  48. {# block internal_sidebar %}
  49.     {% if is_logged_in() and campaign.hasCashDonations and campaign.hasCashDonations %}
  50.         <div class="sidebar-content donate-sidebar">
  51.             <div class="panel">
  52.                 <div class="panel-body">
  53.                     <h6>Select Donation Type</h6>
  54.                     <p class="caption">
  55.                         {% if campaign.donationText %}
  56.                             {{ campaign.donationText }}
  57.                         {% else %}
  58.                             We accept and appreciate all donations. Thank you.
  59.                         {% endif %}
  60.                     </p>
  61.                     <div class="row donation-types">
  62.                         {% if campaign.hasCashDonations %}
  63.                             <div class="col-xs-12 col-sm-6 col-lg-12">
  64.                                 <a
  65.                                     id="cash-donation"
  66.                                     href="{{ path('campaign_donate_cash', campaignParams) }}"
  67.                                     class="btn btn-secondary full-width"
  68.                                 >
  69.                                     Donate Cash
  70.                                 </a>
  71.                             </div>
  72.                         {% endif %}
  73.                         {% if campaign.hasItemDonations %}
  74.                             <div class="col-xs-12 col-sm-6 col-lg-12">
  75.                                 <a
  76.                                     id="item-donation"
  77.                                     href="{{ path('campaign_donate_item', campaignParams) }}"
  78.                                     class="btn btn-secondary full-width"
  79.                                 >
  80.                                     Donate Item
  81.                                 </a>
  82.                             </div>
  83.                         {% endif %}
  84.                     </div>
  85.                 </div>
  86.             </div>
  87.         </div>
  88.     {% endif %}
  89. {% endblock #}
  90. {% block javascripts %}
  91.     {{ parent() }}
  92.     <script type="text/javascript">
  93.         // $(function(){
  94.         //     var donationTypes = $('.donation-types').children().length,
  95.         //         urlParts =  window.location.pathname.split('/'),
  96.         //         path = urlParts[urlParts.length - 1];
  97.         //
  98.         //     if ( path === 'money' || path === 'item' ) {
  99.         //         if ( donationTypes === 1 ) {
  100.         //             $('.sidebar').hide();
  101.         //             $('.main-content').removeClass(function (index, className) {
  102.         //                 return (className.match(/(^|\s)col-\S+/g) || []).join(' ');
  103.         //             }).addClass('col-12');
  104.         //         }
  105.         //     } else {
  106.         //         if ( donationTypes === 1 ) {
  107.         //             $('.donation-types>div>a')[0].click();
  108.         //             $('.sidebar').hide();
  109.         //             $('.main-content').removeClass(function (index, className) {
  110.         //                 return (className.match(/(^|\s)col-\S+/g) || []).join(' ');
  111.         //             }).addClass('col-12');
  112.         //         }
  113.         //     }
  114.         //
  115.         //     if ('money' === path) {
  116.         //         $('.select-type-default').addClass('d-none');
  117.         //         $('.donation-types>div>a').first().removeClass('btn-secondary');
  118.         //     } else if ('item' === path) {
  119.         //         $('.select-type-default').addClass('d-none');
  120.         //         $('.donation-types>div>a').last().removeClass('btn-secondary');
  121.         //     }
  122.         // });
  123.         $(document).ready(function() {
  124.             $('.donate-content').on('click', function() {
  125.                 window.location.href = $(this).data('url');
  126.             });
  127.         });
  128.     </script>
  129. {% endblock %}