{% import '@BidcozCore/_macro.html.twig' as macro %}
{% set itemParams = campaignParams|merge({itemId: item.id}) %}
{% set ticketRequired = campaign.hasTickets and (
(item.isOnline and auction.onlineTicketRequired)
or (item.isOnsite and auction.onsiteTicketRequired)
or (item.isOnlineAndOnsite and (auction.onlineTicketRequired or auction.onsiteTicketRequired)))
%}
{% set registrationRequired = campaign.hasRegistrations and (
(item.isOnline and auction.onlineRegistrationRequired)
or (item.isOnsite and auction.onsiteRegistrationRequired)
or (item.isOnlineAndOnsite and (auction.onlineRegistrationRequired or auction.onsiteRegistrationRequired)))
%}
<div id="item_basic_info_box" class="is-auction-item" data-delay="30">
<h1 class="d-flex align-items-center">
{{ item.name }}
</h1>
<div class="item-base-info d-flex flex-wrap align-items-center">
{% if type == 'auction' %}
<div class="item-venue-details d-flex align-items-center">
{% if item.isFixedPrice() %}
{% include '@BidcozCore/Components/icon.html.twig' with { icon: 'tag-outline', class: 'icon-sm' } %}
<strong>Fixed Price Item</strong>
{% elseif item.isOnline or item.isOnlineAndOnsite %}
{% include '@BidcozCore/Components/icon.html.twig' with { icon: 'globe-outline', class: 'icon-sm' } %}
<strong>Online Auction Item</strong>
{% else %}
{% include '@BidcozCore/Components/icon.html.twig' with { icon: 'location-outline', class: 'icon-sm' } %}
<strong>Onsite Auction Item</strong>
{% endif %}
</div>
{% endif %}
<div class="item-number">
<strong>Item #{{ item.number }}</strong>
</div>
{% if showBuyForm and auction.showQtyRemaining %}
<div class="quantity-remaining">
<strong>{{ item.currentQuantity }} Item{{ item.currentQuantity == 1 ? '' : 's' }} Remaining</strong>
</div>
{% endif %}
<!-- edit -->
{% if is_granted('AUCTION', campaign) %}
<a href="{{ path(item_path(item, '', '_manage_item_edit'), campaignParams|merge({ id: item.id })) }}" class="edit-item-link d-flex align-items-center pl-4" data-title="Edit Item: {{ item.name }}" target="_blank">
{% include '@BidcozCore/Components/icon.html.twig' with { icon: 'cog-outline', h: '1.25rem', w: '1.25rem' } %}
<span class="edit-link-text ml-1"><strong>Edit</strong></span>
</a>
{% endif %}
</div>
{% if type == 'auction' %}
<div class="auction-item-rows pb-1 pt-2">
<div class="time-row d-flex flex-wrap align-items-center pb-1">
{% if type == 'auction' and item is has_time_remaining and item is available(app.user) %}
{% include '@BidcozCore/Components/icon.html.twig' with { icon: 'clock-outline', h: '1.25rem', w: '1.25rem' } %}
{% endif %}
{% include '@BidcozFrontend/Auction/_item_time.html.twig' %}
</div>
<!-- watch -->
<div class="watchlist-row pb-1">
{% include '@BidcozFrontend/Auction/_item_watchlist_button.html.twig' %}
</div>
</div>
{% endif %}
<div class="row">
<div class="col-12">
{% if item.isFixedPrice() %}
<h6 class="mt-n2 mb-2">Purchase Item</h6>
{% elseif item.donation %}
<h6 class="mt-n2 mb-2">Enter Donation Amount</h6>
{% else %}
<h6 class="mt-n2 mb-2">Place Your Bid</h6>
{% endif %}
{% if not item.isOnline and not item.isOnlineAndOnsite and item.manualType %}
<div class="item-venue-details">
<strong>Bidding will take place at the event only.</strong>
</div>
{% endif %}
{% if type == 'auction' and (auction.isOvertimeBiddingSingleExtension() or auction.isOvertimeBiddingUnlimitedExtension()) %}
<div class="overtime-bidding-message d-flex align-items-center">
<div>This auction allows for overtime bidding.</div>
<div class="tooltip-container">
<div class="tooltip-trigger">
{% include '@BidcozCore/Components/icon.html.twig' with { icon: 'question-outline' } %}
</div>
<div class="tooltip tooltip-center">
{% if auction.isOvertimeBiddingSingleExtension() %}
This auction allows for a single overtime bidding extension of 10 minutes if a bid is placed within the final 5 minutes of bidding.
{% elseif auction.isOvertimeBiddingUnlimitedExtension() %}
This auction allows for 10 minutes of overtime bidding if a bid is placed within the final 5 minutes of bidding.
{% endif %}
</div>
</div>
</div>
{% endif %}
</div>
</div>
<div class="bidding-container row">
{% if item.auctionType or item.manualType or not item.isFixedPrice() %}
<div class="col-12 {{ biddable ? 'col-sm-6' : 'col-sm-12' }}">
{% if not item.isFixedPrice() %}
<div class="quantity-remaining">
<strong>Est. Value: {{ item.estimatedValueDisplay ? 'Priceless' : item.getEstimatedValue(true)|money }}</strong>
</div>
{% endif %}
{% if item.auctionType or item.manualType %}
<div class="bid-increment d-flex align-items-center">
{% include '@BidcozCore/Components/icon.html.twig' with { icon: 'graph', class: 'icon-sm' } %}
Bid Increment: {{ item.bidIncrement|money }}
</div>
{% endif %}
</div>
{% endif %}
{% if biddable %}
<div class="bidding-info col-12 {{ item.auctionType or item.manualType or not item.isFixedPrice() ? 'col-sm-6' : 'col-sm-12' }}">
{% if item.winningBid %}
<div class="minimum-bid">
<strong>Current Bid: {{ item.winningBid.amount|money }}</strong>
</div>
{% set hasUserBid = is_logged_in() and item is biddable and item.hasUserBid(app.user) %}
{% if hasUserBid %}
<div class="bidder-notification d-flex">
{% set currentWinningBidder = is_logged_in() and item is biddable and item.winningBid and item.winningBid.user == app.user %}
{% if currentWinningBidder %}
{% include '@BidcozCore/Components/icon.html.twig' with { icon: 'smile-outline', class: 'icon-sm mr-1 text-success' } %}
<div class="high-bid-message text-success">
You have the highest bid.
</div>
{% else %}
{% include '@BidcozCore/Components/icon.html.twig' with { icon: 'frown-outline', class: 'icon-sm mr-1 text-danger' } %}
<div class="high-bid-message text-danger d-flex align-items-center">
{% set maxBid = item_max_bid(item) %}
{% if maxBid and maxBid.active %}
There is a max bidder. You've raised their bid.
{{ macro.popover('Why you\'re not the high bidder:','Another user has set a max bid on this item. Your bid raised the price, but didn\'t exceed their max bid. Try bidding higher or set your own max bid.')}}
{% else %}
You've been outbid.
{% endif %}
</div>
{% endif %}
</div>
{% endif %}
{% else %}
<div class="minimum-bid">
<strong>Starting Bid: {{ item.minBid|money }}</strong>
</div>
{% endif %}
</div>
{% endif %}
<div class="bid-form col-12">
<div class="bid-form-content">
{% set buyActionVisible = false %}
{% if ticketRequired and (not is_logged_in() or user_campaign_tickets(app.user, campaign, true)|length == 0) %}
<h6 class="lead">
Purchase a {{ campaign.ticketDisplayName|lower }} to bid on this item.<br>
<a href="{{ path('campaign_tickets', campaignParams) }}" class="btn btn-success">Buy {{ campaign.ticketDisplayName }}s</a>
</h6>
{% elseif registrationRequired and (not is_logged_in() or user_campaign_registrations(app.user, campaign, true)|length == 0) %}
<h6 class="lead">
Registration is required to bid on this item.<br>
<a href="{{ path('campaign_registrations', campaignParams) }}" class="btn btn-success">Purchase Registration</a>
</h6>
{% elseif requireCC and is_logged_in() %}
<h6 class="lead">
Credit card is required to participate.<br>
<a href="#" data-toggle="modal" data-target="#ccModal" class="btn btn-success">Add Credit Card</a>
</h6>
{% elseif not is_logged_in() %}
<h6 class="lead">
An account is required to participate.<br>
<a href="{{ path('campaign_login_user', campaignParams)}}" data-toggle="modal" data-target="#loginModal" class="btn btn-success trigger-login">Sign In or Create Account</a>
</h6>
{% else %}
{% if showBidForm %}
{% set maxBid = item_max_bid(item) %}
{% set userHasMaxBid = maxBid and maxBid.user == app.user %}
{% set buyActionVisible = true %}
<form method="post" action="{{ path('item_bid', itemParams) }}" class="form-inline" style="width: 100%;">
<div class="form-group">
<label><strong>Bid Amount</strong></label>
{{ form_widget(bidForm.amount) }}
<div class="mt-1">
{% if userHasMaxBid %}
Your max bid is {{ maxBid.amount }}.
<a href="#" class="max-bid-trigger"><strong>Edit</strong></a>
or
<a href="#" class="cancel-max-bid-trigger"><strong>Cancel</strong></a>
{% else %}
<a href="#" class="max-bid-trigger"><strong>Set max bid amount</strong></a>
{% endif %}
</div>
<div class="bid-area">
<button class="btn btn-primary bid-btn w-100 mt-3
{% if auction.areYouSureModal %} are-you-sure{% endif %}
{% if item.winningBid and app.user and item.winningBid.user == app.user and not userHasMaxBid %} raise-your-bid{% endif %}"
>Place Bid</button>
</div>
</div>
{{ form_rest(bidForm) }}
</form>
{% if is_logged_in() %}
<form id="max-bid-form" action="{{ path('item_max_bid', itemParams) }}" method="post" style="display: none;">
<div class="form-group">
<label class="d-flex align-items-center">
<strong class="mr-1">Max Bid</strong>
{{ macro.popover('Maximum Bid', 'Enter a dollar amount and the system will bid for you, as other bids are received, only up to that amount.', '', '', 'icon-sm') }}
</label>
<div class="input-group">
<span class="input-group-addon">$</span>
<input type="text" class="form-control" name="amount" value="{{ userHasMaxBid ? maxBid.amount : '' }}" />
</div>
<div class="bid-area">
<button class="btn btn-primary bid-btn w-100 mt-3">Set Max</button>
<div class="d-none">
<button class="btn btn-xs btn-primary cancel-max-button" name="_cancel" value="1">Cancel Max</button>
</div>
</div>
</div>
</form>
{% endif %}
{% endif %}
<div class="row">
{% if showBuyForm %}
{% set buyActionVisible = true %}
<div class="col-12">
<form id="buy-it-now-form" method="post" action="{{ path(item_path(item, '', '_item_buy'), itemParams) }}" data-hold-in-cart="{{ campaign.holdItemsInCart ? 'true' : 'false'}}">
<div{% if not buyForm.vars.show_quantity %} class="d-none"{% endif %}>
{{ form_row(buyForm.quantity) }}
</div>
{% if buyForm.vars.collect_email %}
{{ form_row(buyForm.emails) }}
{% if organization.enableCustomizations or true %}
<button type="button" class="btn btn-secondary mt-1 w-100 text-nowrap text-center" data-toggle="modal" data-target="#internalUserModal">Select Recipients</button>
{% endif %}
<p>Note: One item will be purchased for each email address entered.</p>
{% endif %}
<button
class="btn btn-success mt-1 w-100 flex-wrap text-nowrap text-center"
name="buy-it-now"
value="1"
{% if campaign.holdItemsInCart %}
onclick="return confirm('Submitting this order is a commitment to buy and cannot be reversed.\nAre you sure?');"
{% endif %}
>
Buy
{% if type == 'auction'%} It Now{% endif %}
<span id="item-quantity-price" data-value="{{ item.buyItNowPrice }}">{{ item.buyItNowPrice|money}}</span>
{% if buyForm.vars.collect_email %} each{% endif %}
</button>
{{ form_rest(buyForm) }}
</form>
{% if item.isFixedPrice() %}
<p class="mt-3">
{% if campaign.holdItemsInCart %}
<strong>Important:</strong> Submitting an order is a commitment to buy and cannot be reversed.
{% else %}
<strong>Important:</strong> Limited availability item. Once ordered, complete purchase within 15 minutes or item will expire.
{% endif %}
</p>
{% elseif campaign.holdItemsInCart %}
<p class="mt-3">
<strong>Important:</strong> Choosing Buy it now is a commitment to buy and cannot be reversed.
</p>
{% endif %}
</div>
{% endif %}
{% if showDonationForm %}
<div class="col-12">
<form id="donation-form" method="post" action="{{ path(item_path(item, '', '_item_donation'), itemParams) }}" data-hold-in-cart="{{ campaign.holdItemsInCart ? 'true' : 'false'}}">
{{ form_row(donationForm.amount) }}
<button
class="btn btn-success mt-1 w-100 flex-wrap text-nowrap text-center"
name="donation"
value="1"
{% if campaign.holdItemsInCart %}
onclick="return confirm('Submitting this order is a commitment to buy and cannot be reversed.\nAre you sure?');"
{% endif %}
>
Make Donation</span>
</button>
{{ form_rest(donationForm) }}
</form>
</div>
{% endif %}
</div>
{% endif %}
</div>
</div>
</div>
</div>