src/Bidcoz/Bundle/FrontendBundle/Resources/views/Auction/_item_basic_info.html.twig line 1

Open in your IDE?
  1. {% import '@BidcozCore/_macro.html.twig' as macro %}
  2. {% set itemParams = campaignParams|merge({itemId: item.id}) %}
  3. {% set ticketRequired = campaign.hasTickets and (
  4.         (item.isOnline and auction.onlineTicketRequired)
  5.         or (item.isOnsite and auction.onsiteTicketRequired)
  6.         or (item.isOnlineAndOnsite and (auction.onlineTicketRequired or auction.onsiteTicketRequired)))
  7. %}
  8. {% set registrationRequired = campaign.hasRegistrations and (
  9.         (item.isOnline and auction.onlineRegistrationRequired)
  10.         or (item.isOnsite and auction.onsiteRegistrationRequired)
  11.         or (item.isOnlineAndOnsite and (auction.onlineRegistrationRequired or auction.onsiteRegistrationRequired)))
  12. %}
  13. <div id="item_basic_info_box" class="is-auction-item" data-delay="30">
  14.     <h1 class="d-flex align-items-center">
  15.         {{ item.name }}
  16.     </h1>
  17.     <div class="item-base-info d-flex flex-wrap align-items-center">
  18.         {% if type == 'auction' %}
  19.             <div class="item-venue-details d-flex align-items-center">
  20.                 {% if item.isFixedPrice() %}
  21.                     {% include '@BidcozCore/Components/icon.html.twig' with { icon: 'tag-outline', class: 'icon-sm' } %}
  22.                     <strong>Fixed Price Item</strong>
  23.                 {% elseif item.isOnline or item.isOnlineAndOnsite %}
  24.                     {% include '@BidcozCore/Components/icon.html.twig' with { icon: 'globe-outline', class: 'icon-sm' } %}
  25.                     <strong>Online Auction Item</strong>
  26.                 {% else %}
  27.                     {% include '@BidcozCore/Components/icon.html.twig' with { icon: 'location-outline', class: 'icon-sm' } %}
  28.                     <strong>Onsite Auction Item</strong>
  29.                 {% endif %}
  30.             </div>
  31.         {% endif %}
  32.         <div class="item-number">
  33.             <strong>Item #{{ item.number }}</strong>
  34.         </div>
  35.         {% if showBuyForm and auction.showQtyRemaining %}
  36.             <div class="quantity-remaining">
  37.                 <strong>{{ item.currentQuantity }} Item{{ item.currentQuantity == 1 ? '' : 's' }} Remaining</strong>
  38.             </div>
  39.         {% endif %}
  40.         <!-- edit -->
  41.         {% if is_granted('AUCTION', campaign) %}
  42.             <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">
  43.                 {% include '@BidcozCore/Components/icon.html.twig' with { icon: 'cog-outline', h: '1.25rem', w: '1.25rem' } %}
  44.                 <span class="edit-link-text ml-1"><strong>Edit</strong></span>
  45.             </a>
  46.         {% endif %}
  47.     </div>
  48.     {% if type == 'auction' %}
  49.         <div class="auction-item-rows pb-1 pt-2">
  50.             <div class="time-row d-flex flex-wrap align-items-center pb-1">
  51.                 {% if type == 'auction' and item is has_time_remaining and item is available(app.user) %}
  52.                     {% include '@BidcozCore/Components/icon.html.twig' with { icon: 'clock-outline', h: '1.25rem', w: '1.25rem' } %}
  53.                 {% endif %}
  54.                 {% include '@BidcozFrontend/Auction/_item_time.html.twig' %}
  55.             </div>
  56.             <!-- watch -->
  57.             <div class="watchlist-row pb-1">
  58.                 {% include '@BidcozFrontend/Auction/_item_watchlist_button.html.twig' %}
  59.             </div>
  60.         </div>
  61.     {% endif %}
  62.     <div class="row">
  63.         <div class="col-12">
  64.             {% if item.isFixedPrice() %}
  65.                 <h6 class="mt-n2 mb-2">Purchase Item</h6>
  66.             {% elseif item.donation %}
  67.                 <h6 class="mt-n2 mb-2">Enter Donation Amount</h6>
  68.             {% else %}
  69.                 <h6 class="mt-n2 mb-2">Place Your Bid</h6>
  70.             {% endif %}
  71.             {% if not item.isOnline and not item.isOnlineAndOnsite and item.manualType %}
  72.                 <div class="item-venue-details">
  73.                     <strong>Bidding will take place at the event only.</strong>
  74.                 </div>
  75.             {% endif %}
  76.             {% if type == 'auction' and (auction.isOvertimeBiddingSingleExtension() or auction.isOvertimeBiddingUnlimitedExtension()) %}
  77.                 <div class="overtime-bidding-message d-flex align-items-center">
  78.                     <div>This auction allows for overtime bidding.</div>
  79.                     <div class="tooltip-container">
  80.                         <div class="tooltip-trigger">
  81.                             {% include '@BidcozCore/Components/icon.html.twig' with { icon: 'question-outline' } %}
  82.                         </div>
  83.                         <div class="tooltip tooltip-center">
  84.                             {% if auction.isOvertimeBiddingSingleExtension() %}
  85.                                 This auction allows for a single overtime bidding extension of 10 minutes if a bid is placed within the final 5 minutes of bidding.
  86.                             {% elseif auction.isOvertimeBiddingUnlimitedExtension() %}
  87.                                 This auction allows for 10 minutes of overtime bidding if a bid is placed within the final 5 minutes of bidding.
  88.                             {% endif %}
  89.                         </div>
  90.                     </div>
  91.                 </div>
  92.             {% endif %}
  93.         </div>
  94.     </div>
  95.     <div class="bidding-container row">
  96.         {% if item.auctionType or item.manualType or not item.isFixedPrice() %}
  97.             <div class="col-12 {{ biddable ? 'col-sm-6' : 'col-sm-12' }}">
  98.                 {% if not item.isFixedPrice() %}
  99.                     <div class="quantity-remaining">
  100.                         <strong>Est. Value: {{ item.estimatedValueDisplay ? 'Priceless' : item.getEstimatedValue(true)|money }}</strong>
  101.                     </div>
  102.                 {% endif %}
  103.                 {% if item.auctionType or item.manualType %}
  104.                     <div class="bid-increment d-flex align-items-center">
  105.                         {% include '@BidcozCore/Components/icon.html.twig' with { icon: 'graph', class: 'icon-sm' } %}
  106.                         Bid Increment: {{ item.bidIncrement|money }}
  107.                     </div>
  108.                 {% endif %}
  109.             </div>
  110.         {% endif %}
  111.         {% if biddable %}
  112.             <div class="bidding-info col-12 {{ item.auctionType or item.manualType or not item.isFixedPrice() ? 'col-sm-6' : 'col-sm-12' }}">
  113.                 {% if item.winningBid %}
  114.                     <div class="minimum-bid">
  115.                         <strong>Current Bid: {{ item.winningBid.amount|money }}</strong>
  116.                     </div>
  117.                     {% set hasUserBid = is_logged_in() and item is biddable and item.hasUserBid(app.user) %}
  118.                     {% if hasUserBid %}
  119.                         <div class="bidder-notification d-flex">
  120.                             {% set currentWinningBidder = is_logged_in() and item is biddable and item.winningBid and item.winningBid.user == app.user %}
  121.                             {% if currentWinningBidder %}
  122.                                 {% include '@BidcozCore/Components/icon.html.twig' with { icon: 'smile-outline', class: 'icon-sm mr-1 text-success' } %}
  123.                                 <div class="high-bid-message text-success">
  124.                                     You have the highest bid.
  125.                                 </div>
  126.                             {% else %}
  127.                                 {% include '@BidcozCore/Components/icon.html.twig' with { icon: 'frown-outline', class: 'icon-sm mr-1 text-danger' } %}
  128.                                 <div class="high-bid-message text-danger d-flex align-items-center">
  129.                                     {% set maxBid = item_max_bid(item) %}
  130.                                     {% if maxBid and maxBid.active %}
  131.                                         There is a max bidder. You've raised their bid.
  132.                                        {{ 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.')}}
  133.                                     {% else %}
  134.                                         You've been outbid.
  135.                                     {% endif %}
  136.                                 </div>
  137.                             {% endif %}
  138.                         </div>
  139.                     {% endif %}
  140.                 {% else %}
  141.                     <div class="minimum-bid">
  142.                         <strong>Starting Bid: {{ item.minBid|money }}</strong>
  143.                     </div>
  144.                 {% endif %}
  145.             </div>
  146.         {% endif %}
  147.         <div class="bid-form col-12">
  148.             <div class="bid-form-content">
  149.                 {% set buyActionVisible = false %}
  150.                 {% if ticketRequired and (not is_logged_in() or user_campaign_tickets(app.user, campaign, true)|length == 0) %}
  151.                     <h6 class="lead">
  152.                         Purchase a {{ campaign.ticketDisplayName|lower }} to bid on this item.<br>
  153.                         <a href="{{ path('campaign_tickets', campaignParams) }}" class="btn btn-success">Buy {{ campaign.ticketDisplayName }}s</a>
  154.                     </h6>
  155.                 {% elseif registrationRequired and (not is_logged_in() or user_campaign_registrations(app.user, campaign, true)|length == 0) %}
  156.                     <h6 class="lead">
  157.                         Registration is required to bid on this item.<br>
  158.                         <a href="{{ path('campaign_registrations', campaignParams) }}" class="btn btn-success">Purchase Registration</a>
  159.                     </h6>
  160.                 {% elseif requireCC and is_logged_in() %}
  161.                     <h6 class="lead">
  162.                         Credit card is required to participate.<br>
  163.                         <a href="#" data-toggle="modal" data-target="#ccModal" class="btn btn-success">Add Credit Card</a>
  164.                     </h6>
  165.                 {% elseif not is_logged_in() %}
  166.                     <h6 class="lead">
  167.                         An account is required to participate.<br>
  168.                         <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>
  169.                     </h6>
  170.                 {% else %}
  171.                     {% if showBidForm %}
  172.                         {% set maxBid = item_max_bid(item) %}
  173.                         {% set userHasMaxBid = maxBid and maxBid.user == app.user %}
  174.                         {% set buyActionVisible = true %}
  175.                         <form method="post" action="{{ path('item_bid', itemParams) }}" class="form-inline" style="width: 100%;">
  176.                             <div class="form-group">
  177.                                 <label><strong>Bid Amount</strong></label>
  178.                                 {{ form_widget(bidForm.amount) }}
  179.                                 <div class="mt-1">
  180.                                     {% if userHasMaxBid %}
  181.                                         Your max bid is {{ maxBid.amount }}.
  182.                                         <a href="#" class="max-bid-trigger"><strong>Edit</strong></a>
  183.                                         or
  184.                                         <a href="#" class="cancel-max-bid-trigger"><strong>Cancel</strong></a>
  185.                                     {% else %}
  186.                                         <a href="#" class="max-bid-trigger"><strong>Set max bid amount</strong></a>
  187.                                     {% endif %}
  188.                                 </div>
  189.                                 <div class="bid-area">
  190.                                     <button class="btn btn-primary bid-btn w-100 mt-3
  191.                                         {% if auction.areYouSureModal %} are-you-sure{% endif %}
  192.                                         {% if item.winningBid and app.user and item.winningBid.user == app.user and not userHasMaxBid %} raise-your-bid{% endif %}"
  193.                                     >Place Bid</button>
  194.                                 </div>
  195.                             </div>
  196.                             {{ form_rest(bidForm) }}
  197.                         </form>
  198.                         {% if is_logged_in() %}
  199.                             <form id="max-bid-form" action="{{ path('item_max_bid', itemParams) }}" method="post" style="display: none;">
  200.                                 <div class="form-group">
  201.                                     <label class="d-flex align-items-center">
  202.                                         <strong class="mr-1">Max Bid</strong>
  203.                                         {{ 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') }}
  204.                                     </label>
  205.                                     <div class="input-group">
  206.                                         <span class="input-group-addon">$</span>
  207.                                         <input type="text" class="form-control" name="amount" value="{{ userHasMaxBid ? maxBid.amount : '' }}" />
  208.                                     </div>
  209.                                     <div class="bid-area">
  210.                                         <button class="btn btn-primary bid-btn w-100 mt-3">Set Max</button>
  211.                                         <div class="d-none">
  212.                                             <button class="btn btn-xs btn-primary cancel-max-button" name="_cancel" value="1">Cancel Max</button>
  213.                                         </div>
  214.                                     </div>
  215.                                 </div>
  216.                             </form>
  217.                         {% endif %}
  218.                     {% endif %}
  219.                     <div class="row">
  220.                         {% if showBuyForm %}
  221.                             {% set buyActionVisible = true %}
  222.                             <div class="col-12">
  223.                                 <form id="buy-it-now-form" method="post" action="{{ path(item_path(item, '', '_item_buy'), itemParams) }}" data-hold-in-cart="{{ campaign.holdItemsInCart ? 'true' : 'false'}}">
  224.                                     <div{% if not buyForm.vars.show_quantity %} class="d-none"{% endif %}>
  225.                                         {{ form_row(buyForm.quantity) }}
  226.                                     </div>
  227.                                     {% if buyForm.vars.collect_email %}
  228.                                         {{ form_row(buyForm.emails) }}
  229.                                         {% if organization.enableCustomizations or true %}
  230.                                             <button type="button" class="btn btn-secondary mt-1 w-100 text-nowrap text-center" data-toggle="modal" data-target="#internalUserModal">Select Recipients</button>
  231.                                         {% endif %}
  232.                                         <p>Note: One item will be purchased for each email address entered.</p>
  233.                                     {% endif %}
  234.                                     <button
  235.                                         class="btn btn-success mt-1 w-100 flex-wrap text-nowrap text-center"
  236.                                         name="buy-it-now"
  237.                                         value="1"
  238.                                         {% if campaign.holdItemsInCart %}
  239.                                             onclick="return confirm('Submitting this order is a commitment to buy and cannot be reversed.\nAre you sure?');"
  240.                                         {% endif %}
  241.                                     >
  242.                                         Buy
  243.                                             {% if type == 'auction'%} It Now{% endif %}
  244.                                             &nbsp;
  245.                                             <span id="item-quantity-price" data-value="{{ item.buyItNowPrice }}">{{ item.buyItNowPrice|money}}</span>
  246.                                             {% if buyForm.vars.collect_email %}&nbsp; each{% endif %}
  247.                                     </button>
  248.                                     {{ form_rest(buyForm) }}
  249.                                 </form>
  250.                                 {% if item.isFixedPrice() %}
  251.                                     <p class="mt-3">
  252.                                         {% if campaign.holdItemsInCart %}
  253.                                             <strong>Important:</strong> Submitting an order is a commitment to buy and cannot be reversed.
  254.                                         {% else %}
  255.                                             <strong>Important:</strong> Limited availability item.  Once ordered, complete purchase within 15 minutes or item will expire.
  256.                                         {% endif %}
  257.                                     </p>
  258.                                 {% elseif campaign.holdItemsInCart %}
  259.                                     <p class="mt-3">
  260.                                         <strong>Important:</strong> Choosing Buy it now is a commitment to buy and cannot be reversed.
  261.                                     </p>
  262.                                 {% endif %}
  263.                             </div>
  264.                         {% endif %}
  265.                         {% if showDonationForm %}
  266.                             <div class="col-12">
  267.                                 <form id="donation-form" method="post" action="{{ path(item_path(item, '', '_item_donation'), itemParams) }}" data-hold-in-cart="{{ campaign.holdItemsInCart ? 'true' : 'false'}}">
  268.                                     {{ form_row(donationForm.amount) }}
  269.                                     <button
  270.                                         class="btn btn-success mt-1 w-100 flex-wrap text-nowrap text-center"
  271.                                         name="donation"
  272.                                         value="1"
  273.                                         {% if campaign.holdItemsInCart %}
  274.                                             onclick="return confirm('Submitting this order is a commitment to buy and cannot be reversed.\nAre you sure?');"
  275.                                         {% endif %}
  276.                                     >
  277.                                         Make Donation</span>
  278.                                     </button>
  279.                                     {{ form_rest(donationForm) }}
  280.                                 </form>
  281.                             </div>
  282.                         {% endif %}
  283.                     </div>
  284.                 {% endif %}
  285.             </div>
  286.         </div>
  287.     </div>
  288. </div>