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

Open in your IDE?
  1. {% extends '@BidcozFrontend/campaign.html.twig' %}
  2. {% set biddable = item is biddable %}
  3. {% block title %}
  4. {% apply spaceless %}
  5.     {{ item.name }} - {{ campaign.name }}
  6. {% endapply %}
  7. {% endblock %}
  8. {% block beforeAlerts %}
  9. {% apply spaceless %}
  10.     {% if ccRequiredWarning is defined and ccRequiredWarning %}
  11.         <div class="alert alert-danger">
  12.             <div class="message flex-grow-1">
  13.                 Credit card required to participate! <a class="btn btn-info" href="#" data-toggle="modal" data-target="#ccModal">Add Credit Card</a>
  14.             </div>
  15.             <a href="#" class="close">
  16.                 {% include '@BidcozCore/Components/icon.html.twig' with { icon: 'close', class: 'icon-sm' } %}
  17.             </a>
  18.         </div>
  19.     {% endif %}
  20. {% endapply %}
  21. {% endblock %}
  22. {% block toast %}
  23. {% apply spaceless %}
  24.     <div class="bidder-notifications">
  25.         {% if item is biddable %}
  26.             <div id="bid-alert-refresh" class="alert alert-warning d-none" role="alert">
  27.                 <div class="message flex-grow-1">
  28.                     Warning, you've been on the page for 20 seconds, please <a href="javascript:history.go(0);" style="color:#fff !important; text-decoration: underline !important;">refresh</a> to see the latest information
  29.                 </div>
  30.                 <a href="#" class="close">
  31.                     {% include '@BidcozCore/Components/icon.html.twig' with { icon: 'close', class: 'icon-sm' } %}
  32.                 </a>
  33.             </div>
  34.         {% endif %}
  35.     </div>
  36.     <div class="toast-container">
  37.         {% include '@BidcozCore/Layout/Blocks/alerts.html.twig' %}
  38.         {% set hasUserBid = is_logged_in() and item is biddable and item.hasUserBid(app.user) %}
  39.         {% if hasUserBid %}
  40.             {% set currentWinningBidder = is_logged_in() and item is biddable and item.winningBid and item.winningBid.user == app.user %}
  41.             {% if currentWinningBidder %}
  42.                 <div class="alert alert-success d-flex" role="alert">
  43.                     <div class="message flex-grow-1">
  44.                         {% if item.winningBid %}
  45.                             You have the high bid at {{ item.winningBid.amount|money }}!
  46.                         {% else %}
  47.                             You have the high bid!
  48.                         {% endif %}
  49.                     </div>
  50.                     <a href="#" class="close">
  51.                         {% include '@BidcozCore/Components/icon.html.twig' with { icon: 'close', class: 'icon-sm' } %}
  52.                     </a>
  53.                 </div>
  54.             {% else %}
  55.                 <div class="alert alert-danger d-flex" role="alert">
  56.                     <div class="message flex-grow-1">
  57.                         {% if item.winningBid %}
  58.                             You have been outbid. Place a bid of {{ (item.winningBid.amount + item.bidIncrement)|money }} or higher!
  59.                         {% else %}
  60.                             You have been outbid.
  61.                         {% endif %}
  62.                     </div>
  63.                     <a href="#" class="close">
  64.                         {% include '@BidcozCore/Components/icon.html.twig' with { icon: 'close', class: 'icon-sm' } %}
  65.                     </a>
  66.                 </div>
  67.             {% endif %}
  68.         {% endif %}
  69.     </div>
  70. {% endapply %}
  71. {% endblock %}
  72. {% block beforeContent %}
  73.     <div class="breadcrumbs item-page-breadcrumbs">
  74.         <a href="{{ path(type == 'shop'? 'shop_catalog' : (type == 'fund-a-need'? 'fund_a_need_catalog' : 'auction_catalog'), campaignParams) }}" class="d-flex align-items-center">
  75.             {% include '@BidcozCore/Components/icon.html.twig' with { icon: 'arrow-left', class: 'icon-md' } %}
  76.             Back to Catalog
  77.         </a>
  78.     </div>
  79. {% endblock %}
  80. {% block content %}
  81.     <div class="item-details-row row">
  82.         <div class="item-details-left col-lg-8">
  83.             <div class="panel h-100">
  84.                 <div class="panel-body">
  85.                     <div class="row">
  86.                         <div class="item-gallery-column col-md-6">
  87.                             {% include '@BidcozFrontend/Auction/_item_photo_box.html.twig' %}
  88.                         </div>
  89.                         <div class="item-info-column col-md-6">
  90.                             {% include '@BidcozFrontend/Auction/_item_basic_info.html.twig' %}
  91.                         </div>
  92.                     </div>
  93.                     {% if item.hasPackagedItems %}
  94.                         <div class="packaged-items mb-n4">
  95.                             <h6 class="mt-5 mb-4">The following items are included in the package:</h6>
  96.                             <ul class="auction-items row list-view">
  97.                                 {% for packagedItem in item.packagedItems %}
  98.                                     {% set pId = 'package' ~ packagedItem.id %}
  99.                                     <li class="auction-item w-100">
  100.                                         {% include '@BidcozFrontend/Auction/Item/_item_list.html.twig' with { item: packagedItem, isPackagedItem: true } %}
  101.                                     </li>
  102.                                 {% endfor %}
  103.                             </ul>
  104.                         </div>
  105.                     {% endif %}
  106.                 </div>
  107.             </div>
  108.         </div>
  109.         <div class="item-details-right col-lg-4">
  110.             <div class="panel h-100">
  111.                 <div class="panel-body">
  112.                     <h6 class="no-margin-top">Item Description</h6>
  113.                     <div class="tabs-container">
  114.                         <ul class="tabs">
  115.                             <li class="tab active">Item Details</li>
  116.                             {% if biddable %}
  117.                                 <li class="tab">Bidding Activity</li>
  118.                             {% elseif item.saleType.id == 'fixed-price' and item.showPurchasers %}
  119.                                 <li class="tab">Purchasers</li>
  120.                             {% endif %}
  121.                         </ul>
  122.                         <div class="tabs-content">
  123.                             <div class="tab-content active">
  124.                                 {% include '@BidcozFrontend/Auction/_item_details.html.twig' %}
  125.                                 <div class="caption">{{ item.description|raw }}</div>
  126.                                 <div class="share-buttons">
  127.                                     <div class="share-title">
  128.                                         <strong>Share With Friends</strong>
  129.                                     </div>
  130.                                     <!-- AddToAny BEGIN -->
  131.                                     <div class="a2a_kit a2a_kit_size_32 a2a_default_style"
  132.                                          data-a2a-title="Check out what’s new at {{ item.name }}!">
  133.                                         <a class="a2a_button_facebook"></a>
  134.                                         <a class="a2a_button_pinterest"></a>
  135.                                         <a class="a2a_button_x"></a>
  136.                                         <a class="a2a_button_linkedin"></a>
  137.                                         <a class="a2a_button_sms"></a>
  138.                                         <a class="a2a_button_facebook_messenger"></a>
  139.                                         <a class="a2a_button_email"></a>
  140.                                         <a class="a2a_button_google_gmail"></a>
  141.                                         <a class="a2a_button_copy_link"></a>
  142.                                         <a class="a2a_button_print"></a>
  143.                                         <a class="a2a_dd" href="https://www.addtoany.com/share"></a>
  144.                                     </div>
  145.                                     <!-- AddToAny END -->
  146.                                 </div>
  147.                             </div>
  148.                             {% if biddable %}
  149.                                 <div class="tab-content">
  150.                                     {% include '@BidcozFrontend/Auction/_bid_activity.html.twig' %}
  151.                                 </div>
  152.                             {% elseif item.saleType.id == 'fixed-price' and item.showPurchasers %}
  153.                                 <div class="tab-content">
  154.                                     {% include '@BidcozFrontend/Auction/_purchase_activity.html.twig' %}
  155.                                 </div>
  156.                             {% endif %}
  157.                         </div>
  158.                     </div>
  159.                 </div>
  160.             </div>
  161.         </div>
  162.     </div>
  163.     {% if auctionItems is defined %}
  164.         <div class="panel carousel-items">
  165.             <div class="panel-body">
  166.                 <h6 class="mt-n3 pt-2 mb-4">More Items</h6>
  167.                 <div class="auction-items slick-carousel row grid-view">
  168.                     {% for auctionItem in auctionItems %}
  169.                         {% if item.id != auctionItem[0].id %}
  170.                             <div class="auction-item">
  171.                                 {% include '@BidcozFrontend/Auction/Item/_item_list.html.twig' with { item: auctionItem[0], itemBidCount: auctionItem["bidCount"] } %}
  172.                             </div>
  173.                         {% endif %}
  174.                     {% endfor %}
  175.                 </div>
  176.             </div>
  177.         </div>
  178.     {% endif %}
  179.     {% if is_logged_in() %}
  180.         {% if (ccRequiredWarning is defined and ccRequiredWarning) or requireCC %}
  181.             {% include '_credit_card_modal.html.twig' with {formUrl: path('user_update_cc', {orgSlug: organization.slug, campaignSlug: campaign.slug})} %}
  182.         {% endif %}
  183.     {% endif %}
  184.     {% if internalUsers is defined and internalUsers %}
  185.         {% include '@BidcozFrontend/Auction/Item/_internal_user_modal.html.twig' %}
  186.     {% endif %}
  187. {% endblock %}
  188. {% block donor %}
  189.     {% include '@BidcozFrontend/Auction/Item/_donor.html.twig' %}
  190. {% endblock %}
  191. {% block stylesheets %}
  192.     {{ parent() }}
  193.     <link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.css"/>
  194.     <link rel="stylesheet" href="/components/bootstrap-sweetalert/dist/sweetalert.css" />
  195. {% endblock %}
  196. {% block javascripts %}
  197.     {{ parent() }}
  198.     <script src="/components/bootstrap-sweetalert/dist/sweetalert.min.js" type="text/javascript"></script>
  199.     {% if is_logged_in() %}
  200.         {% if (ccRequiredWarning is defined and ccRequiredWarning) or requireCC %}
  201.             {%  include '_credit_card_js.html.twig' %}
  202.             <script type="text/javascript">initCard();</script>
  203.         {% endif %}
  204.     {% endif %}
  205.     <script type="text/javascript" src="//cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.min.js"></script>
  206.     <script type="text/javascript">
  207.         $(document).ready(function() {
  208.             $('.slick-carousel').slick({
  209.                 arrows: true,
  210.                 infinite: true,
  211.                 prevArrow: '<div class="slick-prev"><i class="fas fa-arrow-left"></i></div>',
  212.                 nextArrow: '<div class="slick-next"><i class="fas fa-arrow-right"></i></div>',
  213.                 slidesToShow: 4,
  214.                 slidesToScroll: 4,
  215.                 responsive: [
  216.                     {
  217.                         breakpoint: 1024,
  218.                         settings: {
  219.                             slidesToShow: 3,
  220.                             slidesToScroll: 3
  221.                         }
  222.                     },
  223.                     {
  224.                         breakpoint: 600,
  225.                         settings: {
  226.                             slidesToShow: 2,
  227.                             slidesToScroll: 2
  228.                         }
  229.                     },
  230.                     {
  231.                         breakpoint: 480,
  232.                         settings: {
  233.                             slidesToShow: 1,
  234.                             slidesToScroll: 1
  235.                         }
  236.                     }
  237.                 ]
  238.             });
  239.             $('#internalUserModal').on('click', '.add-internal-email', function() {
  240.                 var email = $(this).data('email');
  241.                 var input = $('#item_buy_emails');
  242.                 var currentEmails = input.val();
  243.                 if (currentEmails) {
  244.                     input.val(currentEmails + ', ' + email);
  245.                 } else {
  246.                     input.val(email);
  247.                 }
  248.                 $(this).attr('disabled', 'disabled').text('Added');
  249.             });
  250.         });
  251.     </script>
  252. {% endblock %}