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

Open in your IDE?
  1. {% extends '@BidcozFrontend/campaign.html.twig' %}
  2. {# PRIMARY COMPONENTS #}
  3. {% set hasTickets = campaign.hasTickets and is_granted('TICKET', organization) %}
  4. {% set hasRegistrations = campaign.hasRegistrations and is_granted('REGISTRATION', organization) %}
  5. {% set hasAuction = campaign.hasAuction and is_granted('AUCTION', organization) %}
  6. {% set hasFundDrive = campaign.fundDriveEnabled and is_granted('FUND_DRIVE', organization) %}
  7. {% set hasCashDonations = is_granted('DONATION', organization) and campaign.hasCashDonations and campaign.showCashDonations %}
  8. {% set hasItemDonations = is_granted('PROCUREMENT', organization) and campaign.hasItemDonations %}
  9. {% set hasDonation = hasCashDonations or hasItemDonations %}
  10. {% set hasFundANeed = campaign.hasFundANeed and is_granted('FUND_A_NEED', organization) %}
  11. {% set hasShop = campaign.hasShop and is_granted('SHOP', organization) %}
  12. {% set hasRaffle = campaign.raffleActive and is_granted('RAFFLE', organization) %}
  13. {% set hasPaddleRaise = campaign.hasPaddleRaise and is_granted('PADDLE_RISE', organization) and campaign.showPaddleRaiseMobileBtn %}
  14. {% set hasSponsorships = campaign.hasSponsorship and campaign.sponsorshipSignup and is_granted('SPONSORSHIP', organization) %}
  15. {% set hasMemberships = campaign.membershipEnabled and campaign.membershipLevels|length and is_granted('MEMBERSHIP', organization) %}
  16. {% set hasVolunteer = campaign.hasVolunteers and is_granted('VOLUNTEER', organization) %}
  17. {# COMPONENT HELPERS #}
  18. {% set hasFeaturedItems = hasAuction and featuredItems|length %}
  19. {% set hasShopItems = hasShop and shopItems|length %}
  20. {% set hasFundANeedItems = hasFundANeed and fundANeedItems|length %}
  21. {% block homepageClass %} is-homepage{% endblock %}
  22. {% block beforeContent '' %}
  23. {% block homepageIntro %}
  24.     <div class="campaign-navigation d-flex justify-content-end align-items-center home-intro-campaign-nav">
  25.         {% if campaign.logo %}
  26.             <div class="campaign-logo flex-grow-1 home-intro-logo">
  27.                 <img src="{{ vich_uploader_asset(campaign.logo, 'file') }}" class="logo" />
  28.             </div>
  29.         {% else %}
  30.             <div class="campaign-name-container flex-grow-1">
  31.                 <h4 class="campaign-name">{{ campaign.name }}</h4>
  32.             </div>
  33.         {% endif %}
  34.         <div class="campaign-navigation-links flex-shrink-0">
  35.             <a href="#" class="campaign-navigation-links-toggle d-lg-none">
  36.                 <i class="fas fa-bars icon-sm"></i>
  37.             </a>
  38.             <ul class="navigation-links align-items-center justify-content-end d-none d-lg-flex">
  39.                 {% if campaign is defined and campaign is not null %}
  40.                     {% include '@BidcozCore/Layout/Blocks/menu/auction.html.twig' %}
  41.                 {% endif %}
  42.             </ul>
  43.         </div>
  44.     </div>
  45.     {% if campaign.bannerImage or campaign.video.url is not null %}
  46.         {% if campaign.video.url is not null %}
  47.             <div class="campaign-banner row align-items-center justify-content-center">
  48.                 <div id="{{campaign.video.url}}" class="video" style="width:100%; height:100%;">
  49.                     <div id="video-cover"
  50.                         class="campaign-banner row align-items-center justify-content-center mx-0">
  51.                         {% if campaign.bannerImage is defined and campaign.bannerImage %}
  52.                             <img src="{{ vich_uploader_asset(campaign.bannerImage, 'file') }}" />
  53.                         {% endif %}
  54.                     </div>
  55.                     <div id="youtube-container" style="height:100%; display: none;">
  56.                         <div id="player"><!-- youtube video will replace this div --></div>
  57.                     </div>
  58.                     <h6 id="play" class="play-btn text-center align-items-center control-btn" disabled>
  59.                         <svg version="1.1" id="fi_375" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30.051 30.051" style="enable-background:new 0 0 30.051 30.051;" xml:space="preserve">
  60.                             <path d="M19.982,14.438l-6.24-4.536c-0.229-0.166-0.533-0.191-0.784-0.062c-0.253,0.128-0.411,0.388-0.411,0.669v9.069
  61.                                 c0,0.284,0.158,0.543,0.411,0.671c0.107,0.054,0.224,0.081,0.342,0.081c0.154,0,0.31-0.049,0.442-0.146l6.24-4.532
  62.                                 c0.197-0.145,0.312-0.369,0.312-0.607C20.295,14.803,20.177,14.58,19.982,14.438z"></path>
  63.                             <path d="M15.026,0.002C6.726,0.002,0,6.728,0,15.028c0,8.297,6.726,15.021,15.026,15.021c8.298,0,15.025-6.725,15.025-15.021
  64.                                 C30.052,6.728,23.324,0.002,15.026,0.002z M15.026,27.542c-6.912,0-12.516-5.601-12.516-12.514c0-6.91,5.604-12.518,12.516-12.518
  65.                                 c6.911,0,12.514,5.607,12.514,12.518C27.541,21.941,21.937,27.542,15.026,27.542z"></path>
  66.                         </svg>
  67.                     </h6>
  68.                     <div id="controls" class="d-flex ml-5" style="display: none !important;">
  69.                         <div class="d-flex">
  70.                             <h6 id="rewind" class="col control-btn p-1">
  71.                                 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256,512C114.61,512,0,397.38,0,256S114.61,0,256,0,512,114.61,512,256C511.83,397.32,397.32,511.83,256,512Zm1-467.88C139.43,44.12,44.12,139.43,44.12,257S139.43,469.87,257,469.87,469.87,374.57,469.87,257,374.51,44.25,257,44.12Z"/><path d="M256,352.8a13.81,13.81,0,0,1-9-3.33l-96.8-83a13.83,13.83,0,0,1-1.5-19.5,13.28,13.28,0,0,1,1.5-1.5l96.8-83A13.82,13.82,0,0,1,269.83,173V339A13.83,13.83,0,0,1,256,352.8ZM180.45,256l61.72,52.91V203.09Z"/><path d="M394.29,352.8a13.81,13.81,0,0,1-9-3.33l-96.8-83A13.83,13.83,0,0,1,287,247a13.28,13.28,0,0,1,1.5-1.5l96.8-83A13.82,13.82,0,0,1,408.12,173V339A13.83,13.83,0,0,1,394.29,352.8ZM318.74,256l61.72,52.91V203.09Z"/><path d="M117.71,352.8A13.83,13.83,0,0,1,103.88,339V173a13.83,13.83,0,0,1,27.66,0V339A13.83,13.83,0,0,1,117.71,352.8Z"/></svg>                            </h6>
  72.                             <h6 id="pause" class="col control-btn p-1">
  73.                                 <svg version="1.1" id="fi_16427" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 271.953 271.953" style="enable-background:new 0 0 271.953 271.953;" xml:space="preserve">
  74.                                     <path d="M135.977,271.953c75.097,0,135.977-60.879,135.977-135.977S211.074,0,135.977,0S0,60.879,0,135.977
  75.                                         S60.879,271.953,135.977,271.953z M135.977,21.756c62.979,0,114.22,51.241,114.22,114.22s-51.241,114.22-114.22,114.22
  76.                                         s-114.22-51.241-114.22-114.22S72.992,21.756,135.977,21.756z"></path>
  77.                                     <path d="M110.707,200.114c7.511,0,13.598-6.086,13.598-13.598V83.174c0-7.511-6.086-13.598-13.598-13.598
  78.                                         c-7.511,0-13.598,6.086-13.598,13.598v103.342C97.109,194.028,103.195,200.114,110.707,200.114z"></path>
  79.                                     <path d="M165.097,200.114c7.511,0,13.598-6.086,13.598-13.598V83.174c0-7.511-6.086-13.598-13.598-13.598
  80.                                         S151.5,75.663,151.5,83.174v103.342C151.5,194.028,157.586,200.114,165.097,200.114z"></path>
  81.                                 </svg>
  82.                             </h6>
  83.                             {# leaving these incase we want play and stop for some reason #}
  84.                             {# <h6 id="play" class="col control-btn p-1">
  85.                                 <svg version="1.1" id="fi_375" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30.051 30.051" style="enable-background:new 0 0 30.051 30.051;" xml:space="preserve">
  86.                                     <path d="M19.982,14.438l-6.24-4.536c-0.229-0.166-0.533-0.191-0.784-0.062c-0.253,0.128-0.411,0.388-0.411,0.669v9.069
  87.                                         c0,0.284,0.158,0.543,0.411,0.671c0.107,0.054,0.224,0.081,0.342,0.081c0.154,0,0.31-0.049,0.442-0.146l6.24-4.532
  88.                                         c0.197-0.145,0.312-0.369,0.312-0.607C20.295,14.803,20.177,14.58,19.982,14.438z"></path>
  89.                                     <path d="M15.026,0.002C6.726,0.002,0,6.728,0,15.028c0,8.297,6.726,15.021,15.026,15.021c8.298,0,15.025-6.725,15.025-15.021
  90.                                         C30.052,6.728,23.324,0.002,15.026,0.002z M15.026,27.542c-6.912,0-12.516-5.601-12.516-12.514c0-6.91,5.604-12.518,12.516-12.518
  91.                                         c6.911,0,12.514,5.607,12.514,12.518C27.541,21.941,21.937,27.542,15.026,27.542z"></path>
  92.                                 </svg>
  93.                             </h6> #}
  94.                             {# <h6 id="stop" class="col control-btn p-1">
  95.                                 <svg version="1.1" id="fi_2914" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30.05 30.05" style="enable-background:new 0 0 30.05 30.05;" xml:space="preserve">
  96.                                     <path d="M18.993,10.688h-7.936c-0.19,0-0.346,0.149-0.346,0.342v8.022c0,0.189,0.155,0.344,0.346,0.344
  97.                                         h7.936c0.19,0,0.344-0.154,0.344-0.344V11.03C19.336,10.838,19.183,10.688,18.993,10.688z"></path>
  98.                                     <path d="M15.026,0C6.729,0,0.001,6.726,0.001,15.025S6.729,30.05,15.026,30.05
  99.                                         c8.298,0,15.023-6.726,15.023-15.025S23.324,0,15.026,0z M15.026,27.54c-6.912,0-12.516-5.604-12.516-12.515
  100.                                         c0-6.914,5.604-12.517,12.516-12.517c6.913,0,12.514,5.603,12.514,12.517C27.54,21.936,21.939,27.54,15.026,27.54z"></path>
  101.                                 </svg>
  102.                             </h6> #}
  103.                         </div>
  104.                     </div>
  105.                 </div>
  106.         {% else %}
  107.             <div class="campaign-banner row align-items-center justify-content-center">
  108.                 <img src="{{ vich_uploader_asset(campaign.bannerImage, 'file') }}" />
  109.         {% endif %}
  110.             {% if theme.themeName == 'wide' %}
  111.                 <div class="banner-overlay-content pb-2">
  112.                     <h1>{{ campaign.name }}</h1>
  113.                     <h5 class="mb-4 mt-n3">{{ organization.name }}</h5>
  114.                     <div class="campaign-actions flex-wrap align-items-center justify-content-center d-none d-md-flex pb-4">
  115.                         {% if hasTickets and tickets_available(campaign) %}
  116.                             {# <div class="tooltip-container"> #}
  117.                                 <a id="buy-tickets" class="btn btn-ghost mx-2 my-1 tooltip-trigger{{ tickets_available(campaign) ? '' : ' disabled' }}" href="{{ path('campaign_tickets', campaignParams) }}">{{ campaign.ticketDisplayName }}s</a>
  118.                                 {# if not  %}
  119.                                     <div class="tooltip">
  120.                                         <strong>SOLD OUT</strong>
  121.                                         <br />
  122.                                         Please contact the organization for further assistance.
  123.                                     </div>
  124.                                 {% endif #}
  125.                             {# </div> #}
  126.                         {% endif %}
  127.                         {% if hasRegistrations %}
  128.                             <a href="{{ path('campaign_registrations', campaignParams) }}" class="btn btn-ghost mx-2 my-1">Register</a>
  129.                         {% endif %}
  130.                         {% if hasAuction and campaign.auctionAvailable %}
  131.                             <a id="view-auction" class="btn btn-ghost mx-2 my-1" href="{{ path('auction_catalog', campaignParams) }}">Auction</a>
  132.                         {% endif %}
  133.                         {% if hasFundDrive %}
  134.                             <a id="view-fund-drive" class="btn btn-ghost mx-2 my-1" href="{{ path('campaign_donate_levels', campaignParams) }}">Appeal</a>
  135.                         {% endif %}
  136.                         {% if hasCashDonations and hasItemDonations %}
  137.                             <a id="donate" class="btn btn-ghost mx-2 my-1" href="{{ path('campaign_donate', campaignParams) }}">Donate</a>
  138.                         {% elseif hasItemDonations %}
  139.                             <a id="donate" class="btn btn-ghost mx-2 my-1" href="{{ path('campaign_donate_item', campaignParams) }}">Donate</a>
  140.                         {% elseif hasCashDonations %}
  141.                             <a id="donate" class="btn btn-ghost mx-2 my-1" href="{{ path('campaign_donate_cash', campaignParams) }}">Donate</a>
  142.                         {% endif %}
  143.                         {% if hasFundANeed %}
  144.                             <a id="view-fund-a-need" class="btn btn-ghost mx-2 my-1" href="{{ path('fund_a_need_catalog', campaignParams) }}">{{ campaign.fundANeedDisplayName }}</a>
  145.                         {% endif %}
  146.                         {% if hasShop %}
  147.                             <a id="view-shop" class="btn btn-ghost mx-2 my-1" href="{{ path('shop_catalog', campaignParams) }}">{{ campaign.shopDisplayName }}</a>
  148.                         {% endif %}
  149.                         {% if hasRaffle %}
  150.                             <a id="view-raffle" class="btn btn-ghost mx-2 my-1" href="{{ path('campaign_raffle', campaignParams) }}">{{ campaign.raffleDisplayName }}</a>
  151.                         {% endif %}
  152.                         {% if hasPaddleRaise %}
  153.                             <a id="view-paddle-raise" class="btn btn-ghost mx-2 my-1" href="{{ path('campaign_paddle_raise', campaignParams) }}">Paddle Raise</a>
  154.                         {% endif %}
  155.                         {% if hasSponsorships %}
  156.                             <a id="view-sponsorships" class="btn btn-ghost mx-2 my-1" href="{{ path('campaign_sponsor', campaignParams) }}">Become a Sponsor</a>
  157.                         {% endif %}
  158.                         {% if hasMemberships %}
  159.                             <a id="view-memberships" class="btn btn-ghost mx-2 my-1" href="{{ path('campaign_membership_levels', campaignParams) }}">Become a Member</a>
  160.                         {% endif %}
  161.                         {% if hasMemberships %}
  162.                             <a id="view-volunteer" class="btn btn-ghost mx-2 my-1" href="{{ path('campaign_volunteer', campaignParams) }}">Volunteer</a>
  163.                         {% endif %}
  164.                     </div>
  165.                 </div>
  166.             {% endif %}
  167.         </div>
  168.     {% endif %}
  169.     <div class="campaign-info row">
  170.         {% if campaign.logo and theme.themeName != 'wide' %}
  171.             <div class="campaign-image d-none d-md-block col-md-3">
  172.                 <div id="campaign-logo" class="image-container" style="background-image: url('{{ vich_uploader_asset(campaign.logo, 'file') }}');"></div>
  173.             </div>
  174.         {% endif %}
  175.         {% if theme.themeName != 'wide' %}
  176.             <div class="campaign-title flex-grow-1 {% if campaign.logo %}col-md-6{% else %}col-md-9{% endif %}">
  177.                 <h3>{{ campaign.name }}</h3>
  178.                 <h6 class="mt-n3">{{ organization.name }}</h6>
  179.             </div>
  180.         {% endif %}
  181.         <div class="campaign-actions col-md-3{{ theme.themeName == 'wide' ? ' d-md-none' : '' }}">
  182.             {% if hasAuction and campaign.auctionAvailable %}
  183.                 <a id="view-auction" class="btn secondary full-width my-1" href="{{ path('auction_catalog', campaignParams) }}">Auction</a>
  184.             {% endif %}
  185.             {% if hasCashDonations and hasItemDonations %}
  186.                 <a id="donate" class="btn secondary full-width my-1" href="{{ path('campaign_donate', campaignParams) }}">Donate</a>
  187.             {% elseif hasItemDonations %}
  188.                 <a id="donate" class="btn secondary full-width my-1" href="{{ path('campaign_donate_item', campaignParams) }}">Donate</a>
  189.             {% elseif hasCashDonations %}
  190.                 <a id="donate" class="btn secondary full-width my-1" href="{{ path('campaign_donate_cash', campaignParams) }}">Donate</a>
  191.             {% endif %}
  192.             <!-- CrewUps Component -->
  193.             {% if hasVolunteer %}
  194.                 <a id="view-volunteer" class="btn secondary full-width my-1" href="{{ path('campaign_volunteer', campaignParams) }}">Crew Up</a>
  195.             {% endif %}
  196.             {% if hasFundANeed %}
  197.                 <a id="view-fund-a-need" class="btn secondary full-width my-1" href="{{ path('fund_a_need_catalog', campaignParams) }}">{{ campaign.fundANeedDisplayName }}</a>
  198.             {% endif %}
  199.             {% if hasFundDrive %}
  200.                 <a id="view-fund-drive" class="btn secondary full-width my-1" href="{{ path('campaign_donate_levels', campaignParams) }}">Appeal</a>
  201.             {% endif %}
  202.             {% if hasMemberships %}
  203.                 <a id="view-memberships" class="btn secondary full-width my-1" href="{{ path('campaign_membership_levels', campaignParams) }}">Memberships</a>
  204.             {% endif %}
  205.             {% if hasShop %}
  206.                 <a id="view-shop" class="btn secondary full-width my-1" href="{{ path('shop_catalog', campaignParams) }}">{{ campaign.shopDisplayName }}</a>
  207.             {% endif %}
  208.             {% if hasPaddleRaise %}
  209.                 <a id="view-paddle-raise" class="btn secondary full-width my-1" href="{{ path('campaign_paddle_raise', campaignParams) }}">Paddle Raise</a>
  210.             {% endif %}
  211.             {% if hasRaffle %}
  212.                 <a id="view-raffle" class="btn secondary full-width my-1" href="{{ path('campaign_raffle', campaignParams) }}">{{ campaign.raffleDisplayName }}</a>
  213.             {% endif %}
  214.             {% if hasRegistrations %}
  215.                 <a href="{{ path('campaign_registrations', campaignParams) }}" class="btn secondary full-width my-1">Register</a>
  216.             {% endif %}
  217.             {% if hasSponsorships %}
  218.                 <a id="view-sponsorships" class="btn secondary full-width my-1" href="{{ path('campaign_sponsor', campaignParams) }}">Sponsorships</a>
  219.             {% endif %}
  220.             {% if hasTickets and tickets_available(campaign) %}
  221.                 {# <div class="tooltip-container"> #}
  222.                     <a id="buy-tickets" class="btn secondary full-width my-1 tooltip-trigger{{ tickets_available(campaign) ? '' : ' disabled' }}" href="{{ path('campaign_tickets', campaignParams) }}">{{ campaign.ticketDisplayName }}s</a>
  223.                     {# if not tickets_available(campaign) %}
  224.                         <div class="tooltip">
  225.                             <strong>SOLD OUT</strong>
  226.                             <br />
  227.                             Please contact the organization for further assistance.
  228.                         </div>
  229.                     {% endif #}
  230.                 {# </div> #}
  231.             {% endif %}
  232.         </div>
  233.     </div>
  234. {% endblock %}
  235. {% block content %}
  236.     {# if campaign.hasRegistrations %}
  237.         <div class="buy-buttons-container panel">
  238.             <div class="panel-body">
  239.                 {% if campaign.hasRegistrations and is_granted('REGISTRATION', organization) %}
  240.                     {% if campaign is registrations_purchasable %}
  241.                         <div class="buy">
  242.                             <a href="{{ path('campaign_registrations', campaignParams) }}" class="btn btn-primary">Register</a>
  243.                         </div>
  244.                     {% else %}
  245.                         <p>Applications are no longer available.  Please <a href="{{ path('campaign_contact', campaignParams) }}">contact the organization</a> for further assistance.</p>
  246.                     {% endif %}
  247.                 {% endif %}
  248.             </div>
  249.         </div>
  250.     {% endif #}
  251.     {% if campaign.homepageContent %}
  252.         <div class="panel">
  253.             <div class="panel-body mb-5">
  254.                 {# <div class="d-flex justify-content-between align-items-center">
  255.                     <h4>Overview</h4>
  256.                 </div> #}
  257.                 <div class="caption {% if not campaign.detailsBody %}pb-0{% endif %}">{{ campaign.homepageContent|raw }}</div>
  258.                 {% if campaign.detailsBody %}
  259.                     <a href="{{ path('campaign_details', campaignParams) }}" class="btn btn-primary btn-sm col-2 text-nowrap ml-0 mb-4">
  260.                         <strong>Learn More</strong>
  261.                     </a>
  262.                 {% endif %}
  263.             </div>
  264.         </div>
  265.     {% endif %}
  266.     {% if campaign.feeType == 'user' %}
  267.         <div class="panel">
  268.             <div class="panel-body mb-2">
  269.                 <small><i>A {{ campaign.fees }}% fee will be added at checkout to help cover costs of this fundraiser.</i></small>
  270.             </div>
  271.         </div>
  272.     {% endif %}
  273.     {% if featuredItems|length or shopItems|length or fundANeedItems|length %}
  274.         <div class="panel">
  275.             <div class="panel-body">
  276.                 <h4 class="mt-4 mb-0 pt-4 pb-3 featured-items-title">Featured Items</h4>
  277.                 <!-- Featured Auction Items -->
  278.                 {% if hasFeaturedItems %}
  279.                     <div class="campaign-featured">
  280.                         {% set componentVisible = true %}
  281.                         <div class="d-flex justify-content-between align-items-center mt-4 mb-2">
  282.                             <h6>Auction</h6>
  283.                             <div class="d-flex align-items-center">
  284.                                 {% if is_logged_in() %}
  285.                                     {% set watchListItems = user_campaign_watchlist(app.user, campaign) %}
  286.                                     {% if watchListItems|length %}
  287.                                         <a href="{{ path('auction_watchlist', campaignParams) }}" class="catalog-link">
  288.                                             <strong>View Watchlist</strong>
  289.                                         </a>
  290.                                         {% if campaign.auctionAvailable %}
  291.                                             <span class="mx-2">|</span>
  292.                                         {% endif %}
  293.                                     {% endif %}
  294.                                 {% endif %}
  295.                                 {% if campaign.auctionAvailable %}
  296.                                     <a class="catalog-link" href="{{ path('auction_catalog', campaignParams) }}">
  297.                                         <strong>View Catalog</strong>
  298.                                     </a>
  299.                                 {% endif %}
  300.                             </div>
  301.                         </div>
  302.                         <ul class="auction-items row list-view">
  303.                             {% for data in featuredItems %}
  304.                                 {% set item = data[0] %}
  305.                                 {% set itemBidCount = data["bidCount"] %}
  306.                                 <li class="auction-item">
  307.                                     {% include '@BidcozFrontend/Auction/Item/_item_list.html.twig' %}
  308.                                 </li>
  309.                             {% endfor %}
  310.                         </ul>
  311.                     </div>
  312.                 {% endif %}
  313.                 <!-- Featured Shop Items -->
  314.                 {% if hasShopItems %}
  315.                     <div class="campaign-featured">
  316.                         <div class="d-flex justify-content-between align-items-center mt-4 mb-2">
  317.                             <h6>Shop</h6>
  318.                             <a class="catalog-link" href="{{ path('shop_catalog', campaignParams) }}">
  319.                                 <strong>View {{ campaign.shopDisplayName }}</strong>
  320.                             </a>
  321.                         </div>
  322.                         <ul class="auction-items row list-view">
  323.                             {% for data in shopItems %}
  324.                                 {% set item = data[0] %}
  325.                                 <li class="auction-item">
  326.                                     {% include '@BidcozFrontend/Auction/Item/_item_list.html.twig' with { type: 'shop' } %}
  327.                                 </li>
  328.                             {% endfor %}
  329.                         </ul>
  330.                     </div>
  331.                 {% endif %}
  332.                 <!-- Featured Fund A Need Items -->
  333.                 {% if hasFundANeedItems %}
  334.                     <div class="campaign-featured">
  335.                         <div class="d-flex justify-content-between align-items-center mt-4 mb-2">
  336.                             <h6>Fund A Need</h6>
  337.                             <a class="catalog-link" href="{{ path('fund_a_need_catalog', campaignParams) }}">
  338.                                 <strong>View Fund A Need</strong>
  339.                             </a>
  340.                         </div>
  341.                         <ul class="auction-items row list-view">
  342.                             {% for data in fundANeedItems %}
  343.                                 {% set item = data[0] %}
  344.                                 <li class="auction-item">
  345.                                     {% include '@BidcozFrontend/Auction/Item/_item_list.html.twig' with { type: 'fund-a-need' } %}
  346.                                 </li>
  347.                             {% endfor %}
  348.                         </ul>
  349.                     </div>
  350.                 {% endif %}
  351.             </div>
  352.         </div>
  353.     {% endif %}
  354.     {% set winningTicketsByType = campaign_raffle_winners(campaign) %}
  355.     {% if hasRaffle and winningTicketsByType and campaign.raffleShowWinnersOnHomepage %}
  356.         <div class="raffle-winners panel">
  357.             <div class="panel-body pb-3">
  358.                 <h4 class="mt-4 mb-0 pt-4 pb-3 featured-items-title">{{ campaign.raffleDisplayName }} Winners</h4>
  359.                 {% for raffleName, tickets in winningTicketsByType %}
  360.                     <div class="row">
  361.                         {% for ticket in tickets %}
  362.                             <div class="col-12 col-md-6 col-xl-4">
  363.                                 <div class="panel">
  364.                                     <div class="panel-body">
  365.                                         <h6 class="my-3">
  366.                                             <a href="{{ path('campaign_raffle', campaignParams) }}">{{ raffleName }}</a>
  367.                                         </h6>
  368.                                         <div class="d-flex align-items-center mb-2">
  369.                                             {% set splitName = ticket.user.name|split(' ') %}
  370.                                             <div class="user-image flex-shrink-0 mr-2">
  371.                                                 {{ splitName[0]|slice(0, 1) }}{{ splitName[1]|slice(0, 1) }}
  372.                                             </div>
  373.                                             <div class="user-info flex-grow-1">
  374.                                                 <div class="name"><strong>{{ ticket.user.name }}</strong></div>
  375.                                                 {# <div class="email">{{ ticket.user.email }}</div> #}
  376.                                             </div>
  377.                                         </div>
  378.                                         <div class="ticket-number">
  379.                                             <strong>{{ campaign.ticketDisplayName }} #{{ ticket.number }}</strong>
  380.                                         </div>
  381.                                         <div class="won-item">
  382.                                             <strong>Won Item:</strong>
  383.                                             {{ ticket.itemsWon|map(i => i.item.description)|join(', ') }}
  384.                                         </div>
  385.                                         {% if ticket.itemsWon|length %}
  386.                                             <div class="won-item">
  387.                                                 <strong>Donor:</strong>
  388.                                                 {{ ticket.itemsWon|map(i => i.item.donor)|join(', ') }}
  389.                                             </div>
  390.                                         {% endif %}
  391.                                     </div>
  392.                                 </div>
  393.                             </div>
  394.                         {% endfor %}
  395.                     </div>
  396.                 {% endfor %}
  397.             </div>
  398.         </div>
  399.     {% endif %}
  400.     <div class="row">
  401.         {# TODO: THIS MAY BE NEEDED -- I WASN'T SURE #}
  402.         {# set rowClass= campaign.fundDriveEnabled and campaign.membershipEnabled ? 'col-md-6' : 'col-md-12'%}
  403.         {% if campaign.fundDriveEnabled and campaign.donationLevels|length and is_granted('FUND_DRIVE', organization) %}
  404.             <div class="donation {{ rowClass }}">
  405.                 <a class="btn btn-info btn-lg" href="{{ path('campaign_donate_levels',campaignParams) }}">Make a Pledge</a>
  406.                 {% if has_donor_donations(campaign) %}
  407.                     <br/><br/>
  408.                     <div class="row">
  409.                     {% for level in campaign.donationLevels %}
  410.                         {% if level.displayDonors %}
  411.                             <div class="col-md-4 col-xs-6">
  412.                                 <h4>{{ level.name }}</h4>
  413.                                 <ul style="list-style-type: none; padding-left: 0px;">
  414.                                     {% for donation in level.donations  %}
  415.                                         {% if not donation.isAnonymous and not donation.canceled %}
  416.                                             <li>{{ donation.donorName }}</li>
  417.                                         {% endif %}
  418.                                     {% endfor  %}
  419.                                 </ul>
  420.                             </div>
  421.                         {% endif %}
  422.                     {% endfor  %}
  423.                     </div>
  424.                 {% endif %}
  425.             </div>
  426.         {% endif %}
  427.         {% if has_members(campaign) %}
  428.             <br/><br/>
  429.             <div class="row">
  430.                 {% for level in campaign.membershipLevels  %}
  431.                     {% if level.displayDonors %}
  432.                         <div class="col-md-4 col-xs-6">
  433.                             <h4>{{ level.name }}</h4>
  434.                             <ul style="list-style-type: none; padding-left: 0px;">
  435.                                 {% for donation in level.donations  %}
  436.                                     {% if not donation.isAnonymous and not donation.canceled %}
  437.                                         <li>{{ donation.donorName }}</li>
  438.                                     {% endif %}
  439.                                 {% endfor  %}
  440.                             </ul>
  441.                         </div>
  442.                     {% endif %}
  443.                 {% endfor  %}
  444.             </div>
  445.         {% endif #}
  446.     </div>
  447. {% endblock %}
  448. {% block sidebar %}
  449.     <div class="campaign-details">
  450.         <div class="row">
  451.             <!-- Appeal Component -->
  452.             {% if hasFundDrive %}
  453.                 {% if campaign.cashDonationGoal != 0 %}
  454.                     {% set total_donations = campaign_total_fund_drive_donations(campaign, true) %}
  455.                     {% set progress_percent = (total_donations / campaign.cashDonationGoal) * 100 %}
  456.                 {% endif %}
  457.                 <div class="col-xs-12 col-sm-12 col-md-6 col-lg-12">
  458.                     <div class="panel">
  459.                         <div class="panel-body">
  460.                             <div class="activity my-3">
  461.                                 <h6 class="my-3">Appeal</h6>
  462.                                 {% if campaign.displayCashDonationGoalProgress and total_donations is defined and progress_percent is defined %}
  463.                                     <div class="donations-total">{{ total_donations|money }}</div>
  464.                                     <div class="donations-goal">Raised of {{ campaign.cashDonationGoal|money }} goal</div>
  465.                                     <div class="progress-bar">
  466.                                         <div class="progress" style="width: {{ progress_percent }}%;"></div>
  467.                                     </div>
  468.                                 {% endif %}
  469.                                 <a href="{{ path('campaign_donate_levels', campaignParams) }}" class="btn btn-sm full-width">Give Now</a>
  470.                             </div>
  471.                         </div>
  472.                     </div>
  473.                 </div>
  474.             {% endif %}
  475.             <!-- Auction Component -->
  476.             {% if hasAuction and campaign.auctionAvailable %}
  477.                 <div class="col-xs-12 col-sm-12 col-md-6 col-lg-12">
  478.                     <div class="panel">
  479.                         <div class="panel-body">
  480.                             <div class="activity my-3">
  481.                                 <h6 class="my-3">Auction</h6>
  482.                                 {% if is_logged_in() %}
  483.                                     {% set bidNumber = user_campaign_bid_number(app.user, campaign) %}
  484.                                     {% if bidNumber and campaign.auctionAvailable %}
  485.                                         <p class="sidebar-bidder-number">
  486.                                             You are bidder <strong style="font-size: 1rem;">#{{ bidNumber.number }}</strong>.
  487.                                         </p>
  488.                                     {% endif %}
  489.                                 {% endif %}
  490.                                 {% if campaign.auctionAvailable and (campaign.auction.hasOnsite or campaign.auction.hasOnline) %}
  491.                                     {% set auction = campaign.auction %}
  492.                                     {% set hasOnSiteAuction = auction.hasOnsite and auction.onsiteBegin and auction.onsiteEnd and is_granted('AUCTION_ONSITE', organization) %}
  493.                                     {% set hasOnlineAuction = auction.hasOnline and auction.onlineBegin and auction.onlineEnd and is_granted('AUCTION_ONLINE', organization) %}
  494.                                     {% if hasOnSiteAuction %}
  495.                                         <div class="mb-3">
  496.                                             {% if auction.location %}
  497.                                                 <p class="location">
  498.                                                     <strong>Event Location:</strong><br />
  499.                                                     {% if auction.locationLink %}
  500.                                                         <a href="https://maps.google.com/maps?q={{ auction.location }}" target="_blank">
  501.                                                             {{ auction.location }}
  502.                                                         </a>
  503.                                                     {% else %}
  504.                                                         {{ auction.location }}
  505.                                                     {% endif %}
  506.                                                 </p>
  507.                                             {% endif %}
  508.                                             <p class="auction-date">
  509.                                                 <strong>Start Date:</strong><br />
  510.                                                 {{ auction.onsiteBegin|date_long(campaign) }}
  511.                                             </p>
  512.                                             <p class="auction-date">
  513.                                                 <strong>End Date:</strong><br />
  514.                                                 {{ auction.onsiteEnd|date_long(campaign) }}
  515.                                             </p>
  516.                                         </div>
  517.                                     {% endif %}
  518.                                     {% if hasOnlineAuction %}
  519.                                         <div class="mb-4">
  520.                                             {# If the auction hasn't started yet, count down to start. #}
  521.                                             {% if "now"|date('c') < auction.onlineBegin|date('c') %}
  522.                                                 <p class="auction-date">
  523.                                                     <strong>Online Auction Begins:</strong><br/>
  524.                                                     {{ auction.onlineBegin|date_long(campaign) }}
  525.                                                 </p>
  526.                                                 <div
  527.                                                     class="countdown"
  528.                                                     data-end="{{ auction.onlineBegin|date('c') }}"
  529.                                                     data-timezone="{{ user_timezone() }}"
  530.                                                 ></div>
  531.                                             {# Else, the auction has started, so count down to end. #}
  532.                                             {% else %}
  533.                                                 <p class="auction-date">
  534.                                                     <strong>Online Auction Ends:</strong><br/>
  535.                                                     {{ auction.onlineEnd|date_long(campaign) }}
  536.                                                 </p>
  537.                                                 <div
  538.                                                     class="countdown"
  539.                                                     data-end="{{ auction.onlineEnd|date('c') }}"
  540.                                                     data-timezone="{{ user_timezone() }}"
  541.                                                 ></div>
  542.                                             {% endif %}
  543.                                         </div>
  544.                                     {% endif %}
  545.                                 {% endif %}
  546.                                 <a id="view-auction" class="btn btn-sm full-width my-1" href="{{ path('auction_catalog', campaignParams) }}">Bid Now</a>
  547.                             </div>
  548.                         </div>
  549.                     </div>
  550.                 </div>
  551.             {% endif %}
  552.             <!-- CrewUps Component -->
  553.             {% if hasVolunteer %}
  554.                 <div class="col-xs-12 col-sm-12 col-md-6 col-lg-12">
  555.                     <div class="panel">
  556.                         <div class="panel-body">
  557.                             <div class="activity my-3">
  558.                                 <h6>{{ campaign.crewUpSetupDisplayName }}</h6>
  559.                                 {% if campaign.crewUpSetupTextDescription is not null %}
  560.                                     <p>{{ campaign.crewUpSetupTextDescription }}</p>
  561.                                 {% endif %}
  562.                                 <a href="{{ path('campaign_volunteer', campaignParams) }}" class="btn secondary btn-sm">
  563.                                     Crew Up
  564.                                 </a>
  565.                             </div>
  566.                         </div>
  567.                     </div>
  568.                 </div>
  569.             {% endif %}
  570.             <!-- Donations Component -->
  571.             {% if hasDonation %}
  572.                 <div class="col-xs-12 col-sm-12 col-md-6 col-lg-12">
  573.                     <div class="panel">
  574.                         <div class="panel-body">
  575.                             <div class="activity my-3">
  576.                                 <h6>Donations</h6>
  577.                                 <p>Are you unable to participate or would you like to give more?</p>
  578.                                 {% if hasCashDonations and hasItemDonations %}
  579.                                     <a class="btn btn-sm secondary full-width" href="{{ path('campaign_donate', campaignParams) }}">Donate</a>
  580.                                 {% elseif hasItemDonations %}
  581.                                     <a class="btn btn-sm secondary full-width" href="{{ path('campaign_donate_item', campaignParams) }}">Donate</a>
  582.                                 {% elseif hasCashDonations %}
  583.                                     <a class="btn btn-sm secondary full-width" href="{{ path('campaign_donate_cash', campaignParams) }}">Donate</a>
  584.                                 {% endif %}
  585.                             </div>
  586.                         </div>
  587.                     </div>
  588.                 </div>
  589.             {% endif %}
  590.             <!-- Fund a Need Component-->
  591.             {% if hasFundANeed %}
  592.                 <div class="col-xs-12 col-sm-12 col-md-6 col-lg-12">
  593.                     <div class="panel">
  594.                         <div class="panel-body">
  595.                             <div class="activity my-3">
  596.                                 <h6>{{ campaign.fundANeedDisplayName }}</h6>
  597.                                 <p>View specific needs and choose what you’d like to support.</p>
  598.                                 <a class="btn btn-sm secondary full-width" href="{{ path('fund_a_need_catalog', campaignParams) }}">{{ campaign.fundANeedDisplayName }}</a>
  599.                             </div>
  600.                         </div>
  601.                     </div>
  602.                 </div>
  603.             {% endif %}
  604.             <!-- Memberships Component -->
  605.             {% if hasMemberships %}
  606.                 <div class="col-xs-12 col-sm-12 col-md-6 col-lg-12">
  607.                     <div class="panel">
  608.                         <div class="panel-body">
  609.                             <div class="activity my-3">
  610.                                 <h6>Memberships</h6>
  611.                                 <p>Show your ongoing support and become a valued member of the {{ organization.name }} team.</p>
  612.                                 <a class="btn btn-sm secondary full-width" href="{{ path('campaign_membership_levels', campaignParams) }}">Become a Member</a>
  613.                             </div>
  614.                         </div>
  615.                     </div>
  616.                 </div>
  617.             {% endif %}
  618.             <!-- Paddle Raise Component -->
  619.             {% if hasPaddleRaise %}
  620.                 <div class="col-xs-12 col-sm-12 col-md-6 col-lg-12">
  621.                     <div class="panel">
  622.                         <div class="panel-body">
  623.                             <div class="activity my-3">
  624.                                 <h6>Paddle Raise</h6>
  625.                                 <p>When the time comes, raise it high!</p>
  626.                                 <a class="btn btn-sm secondary full-width" href="{{ path('campaign_paddle_raise', campaignParams) }}">Raise Your Paddle</a>
  627.                             </div>
  628.                         </div>
  629.                     </div>
  630.                 </div>
  631.             {% endif %}
  632.             <!-- Raffles Component -->
  633.             {% if hasRaffle %}
  634.                 <div class="col-xs-12 col-sm-12 col-md-6 col-lg-12">
  635.                     <div class="panel">
  636.                         <div class="panel-body">
  637.                             <div class="activity my-3">
  638.                                 <h6>{{ campaign.raffleDisplayName }}</h6>
  639.                                 <p>Get your chance to win and support {{ organization.name }} today!</p>
  640.                                 <a href="{{ path('campaign_raffle', campaignParams) }}" class="btn secondary full-width btn-sm">
  641.                                     Buy {{ campaign.raffleDisplayName }} Tickets
  642.                                 </a>
  643.                             </div>
  644.                         </div>
  645.                     </div>
  646.                 </div>
  647.             {% endif %}
  648.             <!-- Registrations Component -->
  649.             {% if hasRegistrations %}
  650.                 <div class="col-xs-12 col-sm-12 col-md-6 col-lg-12">
  651.                     <div class="panel">
  652.                         <div class="panel-body">
  653.                             <div class="activity my-3">
  654.                                 <h6>Registrations</h6>
  655.                                 <p><strong>Available Now!</strong><br />Register to participate in our event.</p>
  656.                                 <a class="btn btn-sm full-width" href="{{ path('campaign_registrations', campaignParams) }}">Register</a>
  657.                             </div>
  658.                         </div>
  659.                     </div>
  660.                 </div>
  661.             {% endif %}
  662.             <!-- Shop Component -->
  663.             {% if hasShop %}
  664.                 <div class="col-xs-12 col-sm-12 col-md-6 col-lg-12">
  665.                     <div class="panel">
  666.                         <div class="panel-body">
  667.                             <div class="activity my-3">
  668.                                 <h6>{{ campaign.shopDisplayName }}</h6>
  669.                                 <p>Checkout our catalog of great items available for purchase.</p>
  670.                                 <a href="{{ path('shop_catalog', campaignParams) }}" class="btn btn-sm secondary full-width">{{ campaign.shopDisplayName }}</a>
  671.                             </div>
  672.                         </div>
  673.                     </div>
  674.                 </div>
  675.             {% endif %}
  676.             <!-- Sponsorships Component -->
  677.             {% if hasSponsorships %}
  678.                 <div class="col-xs-12 col-sm-12 col-md-6 col-lg-12">
  679.                     <div class="panel">
  680.                         <div class="panel-body">
  681.                             <div class="activity my-3">
  682.                                 <h6>Sponsorship Opportunities</h6>
  683.                                 <p>Purchase a spot and display your brand logo proudly.</p>
  684.                                 <a href="{{ path('campaign_sponsor', campaignParams) }}" class="btn btn-sm secondary full-width">Become a Sponsor</a>
  685.                             </div>
  686.                         </div>
  687.                     </div>
  688.                 </div>
  689.             {% endif %}
  690.             <!-- Tickets Component -->
  691.             {% if hasTickets and organization.slug != 'chg' %}
  692.                 <div class="col-xs-12 col-sm-12 col-md-6 col-lg-12">
  693.                     <div class="panel">
  694.                         <div class="panel-body">
  695.                             <div class="activity my-3">
  696.                                 <h6 class="my-3">{{ campaign.ticketDisplayName }}</h6>
  697.                                 <p>
  698.                                     {% if tickets_available(campaign) %}
  699.                                         <strong>Available Now!</strong>
  700.                                     {% else %}
  701.                                         <strong>SOLD OUT!</strong>
  702.                                     {% endif %}
  703.                                     {% if is_logged_in() %}
  704.                                         {% set reservedSeats = user_campaign_reserved_seats(app.user, campaign) %}
  705.                                         {% if reservedSeats|length and is_granted('TICKET_SEATS_ASSIGN', organization) %}
  706.                                             {% set plural = reservedSeats|length == 1 ? 'Seat' : 'Seats' %}
  707.                                             <br />
  708.                                             <span class="sidebar-reserved-seat{% if reservedSeats|length %} multiple{% endif %}">
  709.                                                 Your {{ plural|capitalize }}
  710.                                                 <strong style="font-size: 1rem;" class="donations-total">{{ reservedSeats|join(', ') }}</strong>.
  711.                                             </span>
  712.                                         {% endif %}
  713.                                     {% endif %}
  714.                                 </p>
  715.                                 {% if tickets_available(campaign) %}
  716.                                     <a class="btn btn-sm full-width" href="{{ path('campaign_tickets', campaignParams) }}">Buy {{ campaign.ticketDisplayName }}s</a>
  717.                                 {% endif %}
  718.                             </div>
  719.                         </div>
  720.                     </div>
  721.                 </div>
  722.             {% endif %}
  723.             {#
  724.             <p style="margin-top: 20px;">
  725.                 <small><b>Server Time:</b> <span id="server-time" data-server-time="{{ now|date('r', 'America/Chicago') }}">{{ now|date('h:i a T') }}</span></small>
  726.             </p>
  727.             {% if is_logged_in() and campaign.hasAuction() %}
  728.                 <a href="{{ path('notification_preference', campaignParams) }}" class="btn btn-primary email-text-button">Email or Text?</a>
  729.             {% endif %}
  730.             #}
  731.         </div>
  732.     </div>
  733.     <script type="text/javascript"> var isCampaign = true; </script>
  734.     {% if campaign.video.url is not null %}
  735.         <script type="text/javascript">
  736.             var tag = document.createElement('script'),
  737.                 player,
  738.                 done = false,
  739.                 videoId = document.getElementsByClassName('video')[0].id,
  740.                 overlay = document.getElementsByClassName('banner-overlay-content'),
  741.                 campaignImage = document.getElementsByClassName('campaign-image');
  742.             tag.src = "https://www.youtube.com/iframe_api";
  743.             var firstScriptTag = document.getElementsByTagName('script')[0];
  744.             firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
  745.             if (videoId.includes("watch?v=")) { //if the url is pasted from the browser url
  746.                 videoId = videoId.split('?v=')[1];
  747.             } else if (videoId.includes("youtu.be/")) { // if the url is copied from the 'share' button on youtube
  748.                 videoId = videoId.split('/')[3];
  749.             }
  750.             function onYouTubeIframeAPIReady() {
  751.                 player = new YT.Player('player', {
  752.                     height: '100%',
  753.                     width: '100%',
  754.                     videoId: videoId,
  755.                     playerVars: { 'controls': 0 },
  756.                     events: {
  757.                         'onReady': onPlayerReady,
  758.                         'onStateChange': onPlayerStateChange
  759.                     }
  760.                 });
  761.             };
  762.             function onPlayerReady(event) {
  763.                 document.getElementById('play').disabled = false;
  764.             };
  765.             function onPlayerStateChange(event) {
  766.                 if (event.data == YT.PlayerState.ENDED) {
  767.                   videoStopped();
  768.                 }
  769.             };
  770.             function stopVideo() {
  771.                 player.stopVideo();
  772.             };
  773.             function playVideo() {
  774.                 player.playVideo();
  775.             };
  776.             function pauseVideo() {
  777.                 player.pauseVideo();
  778.             };
  779.             function rewindVideo() {
  780.                 player.seekTo({seconds:1, allowSeekAhead:false});
  781.             };
  782.             function videoStopped() {
  783.                 document.getElementById('youtube-container').style.display = "none";
  784.                 document.getElementById('video-cover').style.display = "";
  785.                 document.getElementById('play').style.display = "";
  786.                 if (campaignImage.length) {
  787.                     campaignImage[0].style.zIndex = "2";
  788.                 }
  789.                 if (overlay.length) {
  790.                     overlay[0].style.display = "";
  791.                 }
  792.                 document.getElementById('controls').setAttribute('style', 'display: none !important');
  793.             };
  794.             document.getElementById('play').addEventListener('click', function(e) {
  795.                 e.preventDefault();
  796.                 var bannerHeight = $('#video-cover').height();
  797.                 document.getElementById('youtube-container').style.display = "";
  798.                 document.getElementById('youtube-container').style.height = bannerHeight + 'px';
  799.                 document.getElementById('video-cover').style.display = "none";
  800.                 document.getElementById('play').style.display = "none";
  801.                 if (campaignImage.length) {
  802.                     campaignImage[0].style.zIndex = "0";
  803.                 }
  804.                 if (overlay.length) {
  805.                     overlay[0].style.display = "none";
  806.                 }
  807.                 document.getElementById('controls').style.display = "";
  808.                 player.playVideo();
  809.             });
  810.             document.getElementById('pause').addEventListener('click', function(e) {
  811.                 e.preventDefault();
  812.                 pauseVideo();
  813.                 videoStopped();
  814.             });
  815.             document.getElementById('rewind').addEventListener('click', function(e) {
  816.                 e.preventDefault();
  817.                 rewindVideo();
  818.             });
  819.         </script>
  820.     {% endif %}
  821. {% endblock %}