{% extends '@BidcozFrontend/campaign.html.twig' %}
{# PRIMARY COMPONENTS #}
{% set hasTickets = campaign.hasTickets and is_granted('TICKET', organization) %}
{% set hasRegistrations = campaign.hasRegistrations and is_granted('REGISTRATION', organization) %}
{% set hasAuction = campaign.hasAuction and is_granted('AUCTION', organization) %}
{% set hasFundDrive = campaign.fundDriveEnabled and is_granted('FUND_DRIVE', organization) %}
{% set hasCashDonations = is_granted('DONATION', organization) and campaign.hasCashDonations and campaign.showCashDonations %}
{% set hasItemDonations = is_granted('PROCUREMENT', organization) and campaign.hasItemDonations %}
{% set hasDonation = hasCashDonations or hasItemDonations %}
{% set hasFundANeed = campaign.hasFundANeed and is_granted('FUND_A_NEED', organization) %}
{% set hasShop = campaign.hasShop and is_granted('SHOP', organization) %}
{% set hasRaffle = campaign.raffleActive and is_granted('RAFFLE', organization) %}
{% set hasPaddleRaise = campaign.hasPaddleRaise and is_granted('PADDLE_RISE', organization) and campaign.showPaddleRaiseMobileBtn %}
{% set hasSponsorships = campaign.hasSponsorship and campaign.sponsorshipSignup and is_granted('SPONSORSHIP', organization) %}
{% set hasMemberships = campaign.membershipEnabled and campaign.membershipLevels|length and is_granted('MEMBERSHIP', organization) %}
{% set hasVolunteer = campaign.hasVolunteers and is_granted('VOLUNTEER', organization) %}
{# COMPONENT HELPERS #}
{% set hasFeaturedItems = hasAuction and featuredItems|length %}
{% set hasShopItems = hasShop and shopItems|length %}
{% set hasFundANeedItems = hasFundANeed and fundANeedItems|length %}
{% block homepageClass %} is-homepage{% endblock %}
{% block beforeContent '' %}
{% block homepageIntro %}
<div class="campaign-navigation d-flex justify-content-end align-items-center home-intro-campaign-nav">
{% if campaign.logo %}
<div class="campaign-logo flex-grow-1 home-intro-logo">
<img src="{{ vich_uploader_asset(campaign.logo, 'file') }}" class="logo" />
</div>
{% else %}
<div class="campaign-name-container flex-grow-1">
<h4 class="campaign-name">{{ campaign.name }}</h4>
</div>
{% endif %}
<div class="campaign-navigation-links flex-shrink-0">
<a href="#" class="campaign-navigation-links-toggle d-lg-none">
<i class="fas fa-bars icon-sm"></i>
</a>
<ul class="navigation-links align-items-center justify-content-end d-none d-lg-flex">
{% if campaign is defined and campaign is not null %}
{% include '@BidcozCore/Layout/Blocks/menu/auction.html.twig' %}
{% endif %}
</ul>
</div>
</div>
{% if campaign.bannerImage or campaign.video.url is not null %}
{% if campaign.video.url is not null %}
<div class="campaign-banner row align-items-center justify-content-center">
<div id="{{campaign.video.url}}" class="video" style="width:100%; height:100%;">
<div id="video-cover"
class="campaign-banner row align-items-center justify-content-center mx-0">
{% if campaign.bannerImage is defined and campaign.bannerImage %}
<img src="{{ vich_uploader_asset(campaign.bannerImage, 'file') }}" />
{% endif %}
</div>
<div id="youtube-container" style="height:100%; display: none;">
<div id="player"><!-- youtube video will replace this div --></div>
</div>
<h6 id="play" class="play-btn text-center align-items-center control-btn" disabled>
<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">
<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
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
c0.197-0.145,0.312-0.369,0.312-0.607C20.295,14.803,20.177,14.58,19.982,14.438z"></path>
<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
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
c6.911,0,12.514,5.607,12.514,12.518C27.541,21.941,21.937,27.542,15.026,27.542z"></path>
</svg>
</h6>
<div id="controls" class="d-flex ml-5" style="display: none !important;">
<div class="d-flex">
<h6 id="rewind" class="col control-btn p-1">
<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>
<h6 id="pause" class="col control-btn p-1">
<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">
<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
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
s-114.22-51.241-114.22-114.22S72.992,21.756,135.977,21.756z"></path>
<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
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>
<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
S151.5,75.663,151.5,83.174v103.342C151.5,194.028,157.586,200.114,165.097,200.114z"></path>
</svg>
</h6>
{# leaving these incase we want play and stop for some reason #}
{# <h6 id="play" class="col control-btn p-1">
<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">
<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
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
c0.197-0.145,0.312-0.369,0.312-0.607C20.295,14.803,20.177,14.58,19.982,14.438z"></path>
<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
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
c6.911,0,12.514,5.607,12.514,12.518C27.541,21.941,21.937,27.542,15.026,27.542z"></path>
</svg>
</h6> #}
{# <h6 id="stop" class="col control-btn p-1">
<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">
<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
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>
<path d="M15.026,0C6.729,0,0.001,6.726,0.001,15.025S6.729,30.05,15.026,30.05
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
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>
</svg>
</h6> #}
</div>
</div>
</div>
{% else %}
<div class="campaign-banner row align-items-center justify-content-center">
<img src="{{ vich_uploader_asset(campaign.bannerImage, 'file') }}" />
{% endif %}
{% if theme.themeName == 'wide' %}
<div class="banner-overlay-content pb-2">
<h1>{{ campaign.name }}</h1>
<h5 class="mb-4 mt-n3">{{ organization.name }}</h5>
<div class="campaign-actions flex-wrap align-items-center justify-content-center d-none d-md-flex pb-4">
{% if hasTickets and tickets_available(campaign) %}
{# <div class="tooltip-container"> #}
<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>
{# if not %}
<div class="tooltip">
<strong>SOLD OUT</strong>
<br />
Please contact the organization for further assistance.
</div>
{% endif #}
{# </div> #}
{% endif %}
{% if hasRegistrations %}
<a href="{{ path('campaign_registrations', campaignParams) }}" class="btn btn-ghost mx-2 my-1">Register</a>
{% endif %}
{% if hasAuction and campaign.auctionAvailable %}
<a id="view-auction" class="btn btn-ghost mx-2 my-1" href="{{ path('auction_catalog', campaignParams) }}">Auction</a>
{% endif %}
{% if hasFundDrive %}
<a id="view-fund-drive" class="btn btn-ghost mx-2 my-1" href="{{ path('campaign_donate_levels', campaignParams) }}">Appeal</a>
{% endif %}
{% if hasCashDonations and hasItemDonations %}
<a id="donate" class="btn btn-ghost mx-2 my-1" href="{{ path('campaign_donate', campaignParams) }}">Donate</a>
{% elseif hasItemDonations %}
<a id="donate" class="btn btn-ghost mx-2 my-1" href="{{ path('campaign_donate_item', campaignParams) }}">Donate</a>
{% elseif hasCashDonations %}
<a id="donate" class="btn btn-ghost mx-2 my-1" href="{{ path('campaign_donate_cash', campaignParams) }}">Donate</a>
{% endif %}
{% if hasFundANeed %}
<a id="view-fund-a-need" class="btn btn-ghost mx-2 my-1" href="{{ path('fund_a_need_catalog', campaignParams) }}">{{ campaign.fundANeedDisplayName }}</a>
{% endif %}
{% if hasShop %}
<a id="view-shop" class="btn btn-ghost mx-2 my-1" href="{{ path('shop_catalog', campaignParams) }}">{{ campaign.shopDisplayName }}</a>
{% endif %}
{% if hasRaffle %}
<a id="view-raffle" class="btn btn-ghost mx-2 my-1" href="{{ path('campaign_raffle', campaignParams) }}">{{ campaign.raffleDisplayName }}</a>
{% endif %}
{% if hasPaddleRaise %}
<a id="view-paddle-raise" class="btn btn-ghost mx-2 my-1" href="{{ path('campaign_paddle_raise', campaignParams) }}">Paddle Raise</a>
{% endif %}
{% if hasSponsorships %}
<a id="view-sponsorships" class="btn btn-ghost mx-2 my-1" href="{{ path('campaign_sponsor', campaignParams) }}">Become a Sponsor</a>
{% endif %}
{% if hasMemberships %}
<a id="view-memberships" class="btn btn-ghost mx-2 my-1" href="{{ path('campaign_membership_levels', campaignParams) }}">Become a Member</a>
{% endif %}
{% if hasMemberships %}
<a id="view-volunteer" class="btn btn-ghost mx-2 my-1" href="{{ path('campaign_volunteer', campaignParams) }}">Volunteer</a>
{% endif %}
</div>
</div>
{% endif %}
</div>
{% endif %}
<div class="campaign-info row">
{% if campaign.logo and theme.themeName != 'wide' %}
<div class="campaign-image d-none d-md-block col-md-3">
<div id="campaign-logo" class="image-container" style="background-image: url('{{ vich_uploader_asset(campaign.logo, 'file') }}');"></div>
</div>
{% endif %}
{% if theme.themeName != 'wide' %}
<div class="campaign-title flex-grow-1 {% if campaign.logo %}col-md-6{% else %}col-md-9{% endif %}">
<h3>{{ campaign.name }}</h3>
<h6 class="mt-n3">{{ organization.name }}</h6>
</div>
{% endif %}
<div class="campaign-actions col-md-3{{ theme.themeName == 'wide' ? ' d-md-none' : '' }}">
{% if hasAuction and campaign.auctionAvailable %}
<a id="view-auction" class="btn secondary full-width my-1" href="{{ path('auction_catalog', campaignParams) }}">Auction</a>
{% endif %}
{% if hasCashDonations and hasItemDonations %}
<a id="donate" class="btn secondary full-width my-1" href="{{ path('campaign_donate', campaignParams) }}">Donate</a>
{% elseif hasItemDonations %}
<a id="donate" class="btn secondary full-width my-1" href="{{ path('campaign_donate_item', campaignParams) }}">Donate</a>
{% elseif hasCashDonations %}
<a id="donate" class="btn secondary full-width my-1" href="{{ path('campaign_donate_cash', campaignParams) }}">Donate</a>
{% endif %}
<!-- CrewUps Component -->
{% if hasVolunteer %}
<a id="view-volunteer" class="btn secondary full-width my-1" href="{{ path('campaign_volunteer', campaignParams) }}">Crew Up</a>
{% endif %}
{% if hasFundANeed %}
<a id="view-fund-a-need" class="btn secondary full-width my-1" href="{{ path('fund_a_need_catalog', campaignParams) }}">{{ campaign.fundANeedDisplayName }}</a>
{% endif %}
{% if hasFundDrive %}
<a id="view-fund-drive" class="btn secondary full-width my-1" href="{{ path('campaign_donate_levels', campaignParams) }}">Appeal</a>
{% endif %}
{% if hasMemberships %}
<a id="view-memberships" class="btn secondary full-width my-1" href="{{ path('campaign_membership_levels', campaignParams) }}">Memberships</a>
{% endif %}
{% if hasShop %}
<a id="view-shop" class="btn secondary full-width my-1" href="{{ path('shop_catalog', campaignParams) }}">{{ campaign.shopDisplayName }}</a>
{% endif %}
{% if hasPaddleRaise %}
<a id="view-paddle-raise" class="btn secondary full-width my-1" href="{{ path('campaign_paddle_raise', campaignParams) }}">Paddle Raise</a>
{% endif %}
{% if hasRaffle %}
<a id="view-raffle" class="btn secondary full-width my-1" href="{{ path('campaign_raffle', campaignParams) }}">{{ campaign.raffleDisplayName }}</a>
{% endif %}
{% if hasRegistrations %}
<a href="{{ path('campaign_registrations', campaignParams) }}" class="btn secondary full-width my-1">Register</a>
{% endif %}
{% if hasSponsorships %}
<a id="view-sponsorships" class="btn secondary full-width my-1" href="{{ path('campaign_sponsor', campaignParams) }}">Sponsorships</a>
{% endif %}
{% if hasTickets and tickets_available(campaign) %}
{# <div class="tooltip-container"> #}
<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>
{# if not tickets_available(campaign) %}
<div class="tooltip">
<strong>SOLD OUT</strong>
<br />
Please contact the organization for further assistance.
</div>
{% endif #}
{# </div> #}
{% endif %}
</div>
</div>
{% endblock %}
{% block content %}
{# if campaign.hasRegistrations %}
<div class="buy-buttons-container panel">
<div class="panel-body">
{% if campaign.hasRegistrations and is_granted('REGISTRATION', organization) %}
{% if campaign is registrations_purchasable %}
<div class="buy">
<a href="{{ path('campaign_registrations', campaignParams) }}" class="btn btn-primary">Register</a>
</div>
{% else %}
<p>Applications are no longer available. Please <a href="{{ path('campaign_contact', campaignParams) }}">contact the organization</a> for further assistance.</p>
{% endif %}
{% endif %}
</div>
</div>
{% endif #}
{% if campaign.homepageContent %}
<div class="panel">
<div class="panel-body mb-5">
{# <div class="d-flex justify-content-between align-items-center">
<h4>Overview</h4>
</div> #}
<div class="caption {% if not campaign.detailsBody %}pb-0{% endif %}">{{ campaign.homepageContent|raw }}</div>
{% if campaign.detailsBody %}
<a href="{{ path('campaign_details', campaignParams) }}" class="btn btn-primary btn-sm col-2 text-nowrap ml-0 mb-4">
<strong>Learn More</strong>
</a>
{% endif %}
</div>
</div>
{% endif %}
{% if campaign.feeType == 'user' %}
<div class="panel">
<div class="panel-body mb-2">
<small><i>A {{ campaign.fees }}% fee will be added at checkout to help cover costs of this fundraiser.</i></small>
</div>
</div>
{% endif %}
{% if featuredItems|length or shopItems|length or fundANeedItems|length %}
<div class="panel">
<div class="panel-body">
<h4 class="mt-4 mb-0 pt-4 pb-3 featured-items-title">Featured Items</h4>
<!-- Featured Auction Items -->
{% if hasFeaturedItems %}
<div class="campaign-featured">
{% set componentVisible = true %}
<div class="d-flex justify-content-between align-items-center mt-4 mb-2">
<h6>Auction</h6>
<div class="d-flex align-items-center">
{% if is_logged_in() %}
{% set watchListItems = user_campaign_watchlist(app.user, campaign) %}
{% if watchListItems|length %}
<a href="{{ path('auction_watchlist', campaignParams) }}" class="catalog-link">
<strong>View Watchlist</strong>
</a>
{% if campaign.auctionAvailable %}
<span class="mx-2">|</span>
{% endif %}
{% endif %}
{% endif %}
{% if campaign.auctionAvailable %}
<a class="catalog-link" href="{{ path('auction_catalog', campaignParams) }}">
<strong>View Catalog</strong>
</a>
{% endif %}
</div>
</div>
<ul class="auction-items row list-view">
{% for data in featuredItems %}
{% set item = data[0] %}
{% set itemBidCount = data["bidCount"] %}
<li class="auction-item">
{% include '@BidcozFrontend/Auction/Item/_item_list.html.twig' %}
</li>
{% endfor %}
</ul>
</div>
{% endif %}
<!-- Featured Shop Items -->
{% if hasShopItems %}
<div class="campaign-featured">
<div class="d-flex justify-content-between align-items-center mt-4 mb-2">
<h6>Shop</h6>
<a class="catalog-link" href="{{ path('shop_catalog', campaignParams) }}">
<strong>View {{ campaign.shopDisplayName }}</strong>
</a>
</div>
<ul class="auction-items row list-view">
{% for data in shopItems %}
{% set item = data[0] %}
<li class="auction-item">
{% include '@BidcozFrontend/Auction/Item/_item_list.html.twig' with { type: 'shop' } %}
</li>
{% endfor %}
</ul>
</div>
{% endif %}
<!-- Featured Fund A Need Items -->
{% if hasFundANeedItems %}
<div class="campaign-featured">
<div class="d-flex justify-content-between align-items-center mt-4 mb-2">
<h6>Fund A Need</h6>
<a class="catalog-link" href="{{ path('fund_a_need_catalog', campaignParams) }}">
<strong>View Fund A Need</strong>
</a>
</div>
<ul class="auction-items row list-view">
{% for data in fundANeedItems %}
{% set item = data[0] %}
<li class="auction-item">
{% include '@BidcozFrontend/Auction/Item/_item_list.html.twig' with { type: 'fund-a-need' } %}
</li>
{% endfor %}
</ul>
</div>
{% endif %}
</div>
</div>
{% endif %}
{% set winningTicketsByType = campaign_raffle_winners(campaign) %}
{% if hasRaffle and winningTicketsByType and campaign.raffleShowWinnersOnHomepage %}
<div class="raffle-winners panel">
<div class="panel-body pb-3">
<h4 class="mt-4 mb-0 pt-4 pb-3 featured-items-title">{{ campaign.raffleDisplayName }} Winners</h4>
{% for raffleName, tickets in winningTicketsByType %}
<div class="row">
{% for ticket in tickets %}
<div class="col-12 col-md-6 col-xl-4">
<div class="panel">
<div class="panel-body">
<h6 class="my-3">
<a href="{{ path('campaign_raffle', campaignParams) }}">{{ raffleName }}</a>
</h6>
<div class="d-flex align-items-center mb-2">
{% set splitName = ticket.user.name|split(' ') %}
<div class="user-image flex-shrink-0 mr-2">
{{ splitName[0]|slice(0, 1) }}{{ splitName[1]|slice(0, 1) }}
</div>
<div class="user-info flex-grow-1">
<div class="name"><strong>{{ ticket.user.name }}</strong></div>
{# <div class="email">{{ ticket.user.email }}</div> #}
</div>
</div>
<div class="ticket-number">
<strong>{{ campaign.ticketDisplayName }} #{{ ticket.number }}</strong>
</div>
<div class="won-item">
<strong>Won Item:</strong>
{{ ticket.itemsWon|map(i => i.item.description)|join(', ') }}
</div>
{% if ticket.itemsWon|length %}
<div class="won-item">
<strong>Donor:</strong>
{{ ticket.itemsWon|map(i => i.item.donor)|join(', ') }}
</div>
{% endif %}
</div>
</div>
</div>
{% endfor %}
</div>
{% endfor %}
</div>
</div>
{% endif %}
<div class="row">
{# TODO: THIS MAY BE NEEDED -- I WASN'T SURE #}
{# set rowClass= campaign.fundDriveEnabled and campaign.membershipEnabled ? 'col-md-6' : 'col-md-12'%}
{% if campaign.fundDriveEnabled and campaign.donationLevels|length and is_granted('FUND_DRIVE', organization) %}
<div class="donation {{ rowClass }}">
<a class="btn btn-info btn-lg" href="{{ path('campaign_donate_levels',campaignParams) }}">Make a Pledge</a>
{% if has_donor_donations(campaign) %}
<br/><br/>
<div class="row">
{% for level in campaign.donationLevels %}
{% if level.displayDonors %}
<div class="col-md-4 col-xs-6">
<h4>{{ level.name }}</h4>
<ul style="list-style-type: none; padding-left: 0px;">
{% for donation in level.donations %}
{% if not donation.isAnonymous and not donation.canceled %}
<li>{{ donation.donorName }}</li>
{% endif %}
{% endfor %}
</ul>
</div>
{% endif %}
{% endfor %}
</div>
{% endif %}
</div>
{% endif %}
{% if has_members(campaign) %}
<br/><br/>
<div class="row">
{% for level in campaign.membershipLevels %}
{% if level.displayDonors %}
<div class="col-md-4 col-xs-6">
<h4>{{ level.name }}</h4>
<ul style="list-style-type: none; padding-left: 0px;">
{% for donation in level.donations %}
{% if not donation.isAnonymous and not donation.canceled %}
<li>{{ donation.donorName }}</li>
{% endif %}
{% endfor %}
</ul>
</div>
{% endif %}
{% endfor %}
</div>
{% endif #}
</div>
{% endblock %}
{% block sidebar %}
<div class="campaign-details">
<div class="row">
<!-- Appeal Component -->
{% if hasFundDrive %}
{% if campaign.cashDonationGoal != 0 %}
{% set total_donations = campaign_total_fund_drive_donations(campaign, true) %}
{% set progress_percent = (total_donations / campaign.cashDonationGoal) * 100 %}
{% endif %}
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-12">
<div class="panel">
<div class="panel-body">
<div class="activity my-3">
<h6 class="my-3">Appeal</h6>
{% if campaign.displayCashDonationGoalProgress and total_donations is defined and progress_percent is defined %}
<div class="donations-total">{{ total_donations|money }}</div>
<div class="donations-goal">Raised of {{ campaign.cashDonationGoal|money }} goal</div>
<div class="progress-bar">
<div class="progress" style="width: {{ progress_percent }}%;"></div>
</div>
{% endif %}
<a href="{{ path('campaign_donate_levels', campaignParams) }}" class="btn btn-sm full-width">Give Now</a>
</div>
</div>
</div>
</div>
{% endif %}
<!-- Auction Component -->
{% if hasAuction and campaign.auctionAvailable %}
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-12">
<div class="panel">
<div class="panel-body">
<div class="activity my-3">
<h6 class="my-3">Auction</h6>
{% if is_logged_in() %}
{% set bidNumber = user_campaign_bid_number(app.user, campaign) %}
{% if bidNumber and campaign.auctionAvailable %}
<p class="sidebar-bidder-number">
You are bidder <strong style="font-size: 1rem;">#{{ bidNumber.number }}</strong>.
</p>
{% endif %}
{% endif %}
{% if campaign.auctionAvailable and (campaign.auction.hasOnsite or campaign.auction.hasOnline) %}
{% set auction = campaign.auction %}
{% set hasOnSiteAuction = auction.hasOnsite and auction.onsiteBegin and auction.onsiteEnd and is_granted('AUCTION_ONSITE', organization) %}
{% set hasOnlineAuction = auction.hasOnline and auction.onlineBegin and auction.onlineEnd and is_granted('AUCTION_ONLINE', organization) %}
{% if hasOnSiteAuction %}
<div class="mb-3">
{% if auction.location %}
<p class="location">
<strong>Event Location:</strong><br />
{% if auction.locationLink %}
<a href="https://maps.google.com/maps?q={{ auction.location }}" target="_blank">
{{ auction.location }}
</a>
{% else %}
{{ auction.location }}
{% endif %}
</p>
{% endif %}
<p class="auction-date">
<strong>Start Date:</strong><br />
{{ auction.onsiteBegin|date_long(campaign) }}
</p>
<p class="auction-date">
<strong>End Date:</strong><br />
{{ auction.onsiteEnd|date_long(campaign) }}
</p>
</div>
{% endif %}
{% if hasOnlineAuction %}
<div class="mb-4">
{# If the auction hasn't started yet, count down to start. #}
{% if "now"|date('c') < auction.onlineBegin|date('c') %}
<p class="auction-date">
<strong>Online Auction Begins:</strong><br/>
{{ auction.onlineBegin|date_long(campaign) }}
</p>
<div
class="countdown"
data-end="{{ auction.onlineBegin|date('c') }}"
data-timezone="{{ user_timezone() }}"
></div>
{# Else, the auction has started, so count down to end. #}
{% else %}
<p class="auction-date">
<strong>Online Auction Ends:</strong><br/>
{{ auction.onlineEnd|date_long(campaign) }}
</p>
<div
class="countdown"
data-end="{{ auction.onlineEnd|date('c') }}"
data-timezone="{{ user_timezone() }}"
></div>
{% endif %}
</div>
{% endif %}
{% endif %}
<a id="view-auction" class="btn btn-sm full-width my-1" href="{{ path('auction_catalog', campaignParams) }}">Bid Now</a>
</div>
</div>
</div>
</div>
{% endif %}
<!-- CrewUps Component -->
{% if hasVolunteer %}
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-12">
<div class="panel">
<div class="panel-body">
<div class="activity my-3">
<h6>{{ campaign.crewUpSetupDisplayName }}</h6>
{% if campaign.crewUpSetupTextDescription is not null %}
<p>{{ campaign.crewUpSetupTextDescription }}</p>
{% endif %}
<a href="{{ path('campaign_volunteer', campaignParams) }}" class="btn secondary btn-sm">
Crew Up
</a>
</div>
</div>
</div>
</div>
{% endif %}
<!-- Donations Component -->
{% if hasDonation %}
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-12">
<div class="panel">
<div class="panel-body">
<div class="activity my-3">
<h6>Donations</h6>
<p>Are you unable to participate or would you like to give more?</p>
{% if hasCashDonations and hasItemDonations %}
<a class="btn btn-sm secondary full-width" href="{{ path('campaign_donate', campaignParams) }}">Donate</a>
{% elseif hasItemDonations %}
<a class="btn btn-sm secondary full-width" href="{{ path('campaign_donate_item', campaignParams) }}">Donate</a>
{% elseif hasCashDonations %}
<a class="btn btn-sm secondary full-width" href="{{ path('campaign_donate_cash', campaignParams) }}">Donate</a>
{% endif %}
</div>
</div>
</div>
</div>
{% endif %}
<!-- Fund a Need Component-->
{% if hasFundANeed %}
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-12">
<div class="panel">
<div class="panel-body">
<div class="activity my-3">
<h6>{{ campaign.fundANeedDisplayName }}</h6>
<p>View specific needs and choose what you’d like to support.</p>
<a class="btn btn-sm secondary full-width" href="{{ path('fund_a_need_catalog', campaignParams) }}">{{ campaign.fundANeedDisplayName }}</a>
</div>
</div>
</div>
</div>
{% endif %}
<!-- Memberships Component -->
{% if hasMemberships %}
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-12">
<div class="panel">
<div class="panel-body">
<div class="activity my-3">
<h6>Memberships</h6>
<p>Show your ongoing support and become a valued member of the {{ organization.name }} team.</p>
<a class="btn btn-sm secondary full-width" href="{{ path('campaign_membership_levels', campaignParams) }}">Become a Member</a>
</div>
</div>
</div>
</div>
{% endif %}
<!-- Paddle Raise Component -->
{% if hasPaddleRaise %}
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-12">
<div class="panel">
<div class="panel-body">
<div class="activity my-3">
<h6>Paddle Raise</h6>
<p>When the time comes, raise it high!</p>
<a class="btn btn-sm secondary full-width" href="{{ path('campaign_paddle_raise', campaignParams) }}">Raise Your Paddle</a>
</div>
</div>
</div>
</div>
{% endif %}
<!-- Raffles Component -->
{% if hasRaffle %}
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-12">
<div class="panel">
<div class="panel-body">
<div class="activity my-3">
<h6>{{ campaign.raffleDisplayName }}</h6>
<p>Get your chance to win and support {{ organization.name }} today!</p>
<a href="{{ path('campaign_raffle', campaignParams) }}" class="btn secondary full-width btn-sm">
Buy {{ campaign.raffleDisplayName }} Tickets
</a>
</div>
</div>
</div>
</div>
{% endif %}
<!-- Registrations Component -->
{% if hasRegistrations %}
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-12">
<div class="panel">
<div class="panel-body">
<div class="activity my-3">
<h6>Registrations</h6>
<p><strong>Available Now!</strong><br />Register to participate in our event.</p>
<a class="btn btn-sm full-width" href="{{ path('campaign_registrations', campaignParams) }}">Register</a>
</div>
</div>
</div>
</div>
{% endif %}
<!-- Shop Component -->
{% if hasShop %}
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-12">
<div class="panel">
<div class="panel-body">
<div class="activity my-3">
<h6>{{ campaign.shopDisplayName }}</h6>
<p>Checkout our catalog of great items available for purchase.</p>
<a href="{{ path('shop_catalog', campaignParams) }}" class="btn btn-sm secondary full-width">{{ campaign.shopDisplayName }}</a>
</div>
</div>
</div>
</div>
{% endif %}
<!-- Sponsorships Component -->
{% if hasSponsorships %}
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-12">
<div class="panel">
<div class="panel-body">
<div class="activity my-3">
<h6>Sponsorship Opportunities</h6>
<p>Purchase a spot and display your brand logo proudly.</p>
<a href="{{ path('campaign_sponsor', campaignParams) }}" class="btn btn-sm secondary full-width">Become a Sponsor</a>
</div>
</div>
</div>
</div>
{% endif %}
<!-- Tickets Component -->
{% if hasTickets and organization.slug != 'chg' %}
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-12">
<div class="panel">
<div class="panel-body">
<div class="activity my-3">
<h6 class="my-3">{{ campaign.ticketDisplayName }}</h6>
<p>
{% if tickets_available(campaign) %}
<strong>Available Now!</strong>
{% else %}
<strong>SOLD OUT!</strong>
{% endif %}
{% if is_logged_in() %}
{% set reservedSeats = user_campaign_reserved_seats(app.user, campaign) %}
{% if reservedSeats|length and is_granted('TICKET_SEATS_ASSIGN', organization) %}
{% set plural = reservedSeats|length == 1 ? 'Seat' : 'Seats' %}
<br />
<span class="sidebar-reserved-seat{% if reservedSeats|length %} multiple{% endif %}">
Your {{ plural|capitalize }}
<strong style="font-size: 1rem;" class="donations-total">{{ reservedSeats|join(', ') }}</strong>.
</span>
{% endif %}
{% endif %}
</p>
{% if tickets_available(campaign) %}
<a class="btn btn-sm full-width" href="{{ path('campaign_tickets', campaignParams) }}">Buy {{ campaign.ticketDisplayName }}s</a>
{% endif %}
</div>
</div>
</div>
</div>
{% endif %}
{#
<p style="margin-top: 20px;">
<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>
</p>
{% if is_logged_in() and campaign.hasAuction() %}
<a href="{{ path('notification_preference', campaignParams) }}" class="btn btn-primary email-text-button">Email or Text?</a>
{% endif %}
#}
</div>
</div>
<script type="text/javascript"> var isCampaign = true; </script>
{% if campaign.video.url is not null %}
<script type="text/javascript">
var tag = document.createElement('script'),
player,
done = false,
videoId = document.getElementsByClassName('video')[0].id,
overlay = document.getElementsByClassName('banner-overlay-content'),
campaignImage = document.getElementsByClassName('campaign-image');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
if (videoId.includes("watch?v=")) { //if the url is pasted from the browser url
videoId = videoId.split('?v=')[1];
} else if (videoId.includes("youtu.be/")) { // if the url is copied from the 'share' button on youtube
videoId = videoId.split('/')[3];
}
function onYouTubeIframeAPIReady() {
player = new YT.Player('player', {
height: '100%',
width: '100%',
videoId: videoId,
playerVars: { 'controls': 0 },
events: {
'onReady': onPlayerReady,
'onStateChange': onPlayerStateChange
}
});
};
function onPlayerReady(event) {
document.getElementById('play').disabled = false;
};
function onPlayerStateChange(event) {
if (event.data == YT.PlayerState.ENDED) {
videoStopped();
}
};
function stopVideo() {
player.stopVideo();
};
function playVideo() {
player.playVideo();
};
function pauseVideo() {
player.pauseVideo();
};
function rewindVideo() {
player.seekTo({seconds:1, allowSeekAhead:false});
};
function videoStopped() {
document.getElementById('youtube-container').style.display = "none";
document.getElementById('video-cover').style.display = "";
document.getElementById('play').style.display = "";
if (campaignImage.length) {
campaignImage[0].style.zIndex = "2";
}
if (overlay.length) {
overlay[0].style.display = "";
}
document.getElementById('controls').setAttribute('style', 'display: none !important');
};
document.getElementById('play').addEventListener('click', function(e) {
e.preventDefault();
var bannerHeight = $('#video-cover').height();
document.getElementById('youtube-container').style.display = "";
document.getElementById('youtube-container').style.height = bannerHeight + 'px';
document.getElementById('video-cover').style.display = "none";
document.getElementById('play').style.display = "none";
if (campaignImage.length) {
campaignImage[0].style.zIndex = "0";
}
if (overlay.length) {
overlay[0].style.display = "none";
}
document.getElementById('controls').style.display = "";
player.playVideo();
});
document.getElementById('pause').addEventListener('click', function(e) {
e.preventDefault();
pauseVideo();
videoStopped();
});
document.getElementById('rewind').addEventListener('click', function(e) {
e.preventDefault();
rewindVideo();
});
</script>
{% endif %}
{% endblock %}