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

Open in your IDE?
  1. {% if  type is not defined %}
  2.     {% set route_name = 'auction_item' %}
  3. {% elseif type == 'shop' %}
  4.     {% set route_name = 'shop_item' %}
  5. {% elseif type == 'fund-a-need' %}
  6.     {% set route_name = 'fund_a_need_item' %}
  7. {% else %}
  8.     {% set route_name = 'auction_item' %}
  9. {% endif %}
  10. {% set itemParams =  campaignParams|merge({ itemId: item.id }) %}
  11. <div class="auction-item-details d-flex align-items-start">
  12.     <div class="image">
  13.         {% if isPackagedItem is defined and isPackagedItem %}
  14.             <span class="image-container">
  15.                 {% if item.primaryImage and item.primaryImage.image %}
  16.                     <img src="{{ vich_uploader_asset(item.primaryImage.image, 'file') }}" />
  17.                 {% else %}
  18.                     <i class="far fa-image default-icon"></i>
  19.                 {% endif %}
  20.             </span>
  21.         {% else %}
  22.             <a href="{{ path(route_name, itemParams) }}" class="image-container">
  23.                 {% if item.primaryImage and item.primaryImage.image %}
  24.                     <img src="{{ vich_uploader_asset(item.primaryImage.image, 'file') }}" />
  25.                 {% else %}
  26.                     <i class="far fa-image default-icon"></i>
  27.                 {% endif %}
  28.             </a>
  29.         {% endif %}
  30.     </div>
  31.     <div class="info flex-grow-1">
  32.         {% if isPackagedItem is defined and isPackagedItem %}
  33.             <h6 class="my-1">{{ item.name }}</h6>
  34.         {% else %}
  35.             <a href="{{ path(route_name, itemParams) }}" class="name">
  36.                 {{ item.name }}
  37.             </a>
  38.         {% endif %}
  39.         {% if item.donation %}
  40.             <div class="tag d-flex align-items-center">
  41.                 {% include '@BidcozCore/Components/icon.html.twig' with { icon: 'tag-outline', size: 'small' } %}
  42.                 <span>Donation</span>
  43.             </div>
  44.         {% elseif item.fixedPrice %}
  45.             <div class="tag d-flex align-items-center">
  46.                 {% include '@BidcozCore/Components/icon.html.twig' with { icon: 'tag-outline', size: 'small' } %}
  47.                 <span>Fixed Price Item</span>
  48.             </div>
  49.             <div class="price">
  50.                 <strong>Price:</strong>
  51.                 {{ item.buyItNowPrice|money }}
  52.             </div>
  53.         {% else %}
  54.             {% if isPackagedItem is not defined or not isPackagedItem %}
  55.                 <div class="value">
  56.                     <strong>Value:</strong>
  57.                     {{ item.estimatedValueDisplay ? 'Priceless' : item.estimatedValue|money  }}
  58.                 </div>
  59.             {% endif %}
  60.         {% endif %}
  61.         {% if item.soldOut %}
  62.             <p class="text-danger">{{ item.auctionType ? 'Sold Out' : 'SOLD' }}</p>
  63.         {% endif %}
  64.         {% if item.auctionType and (isPackagedItem is not defined or not isPackagedItem) %}
  65.             <div class="bid-info">
  66.                 {% if item.winningBid %}
  67.                     {% if item.paidFor %}
  68.                         <strong>Sold At:</strong>
  69.                         {{ item.purchase.amount|money }}
  70.                     {% else %}
  71.                         <strong>Current Bid:</strong>
  72.                         {{ item.winningBid.amount|money }}
  73.                     {% endif %}
  74.                 {% else %}
  75.                     <strong>Starting Bid:</strong>
  76.                     {{ item.minBid|money }}
  77.                 {% endif %}
  78.             </div>
  79.         {% endif %}
  80.         {% if not item.auctionType and auction.showQtyRemaining %}
  81.             <div class="quantity">
  82.                 {{ item.currentQuantity }} Items Remaining
  83.             </div>
  84.         {% endif %}
  85.         {% if not item.donorAnonymous %}
  86.             <div class="value">
  87.                 <strong>Donor:</strong>
  88.                 {% include '@BidcozFrontend/Auction/Item/_donor.html.twig' with {display_initial:true} %}
  89.             </div>
  90.         {% endif %}
  91.         <div class="auction-item-messages pt-0">
  92.             {% if isPackagedItem is defined and isPackagedItem %}
  93.                 {{ item.description|raw }}
  94.             {% endif %}
  95.             {# if item.manualType %}
  96.                 <div class="auction-item-message">Bidding at Event</div>
  97.             {% endif #}
  98.             {# include '@BidcozFrontend/Auction/_item_time.html.twig' with { listView: true } #}
  99.         </div>
  100.     </div>
  101.     <div class="actions">
  102.         <div class="buttons d-flex flex-column justify-content-between h-100">
  103.             {% if isPackagedItem is not defined or not isPackagedItem %}
  104.                 <a href="{{ path(route_name, itemParams) }}" class="btn btn-sm full-width">
  105.                     {% if organization.slug == 'nvidia' %}
  106.                         Bid Now
  107.                     {% else %}
  108.                         View Details
  109.                     {% endif %}
  110.                 </a>
  111.             {% endif %}
  112.             {% if is_granted('AUCTION', campaign) %}
  113.                 <a href="{{ path('auction_manage_item_edit', campaignParams|merge({ id: item.id })) }}" class="edit-link d-flex justify-content-end align-items-center" data-title="Edit Item: {{ item.name }}" data-submit="{{ path('auction_manage_item_update', campaignParams|merge({ id: item.id})) }}">
  114.                     {% include '@BidcozCore/Components/icon.html.twig' with { icon: 'cog-outline', h: '1.5rem', w: '1.5rem' } %}
  115.                     <span>Edit</span>
  116.                 </a>
  117.             {% endif %}
  118.         </div>
  119.     </div>
  120.     {% if item.auctionType and (isPackagedItem is not defined or not isPackagedItem) %}
  121.         {% set totalBids = itemBidCount is defined ? itemBidCount : item.activeBids|length %}
  122.         <div class="badge {% if totalBids == 0 %}badge-default{% else %}badge-success{% endif %}">
  123.             {{ totalBids }} bid{{ totalBids == 1 ? '' : 's' }}
  124.         </div>
  125.     {% endif %}
  126.     {% if not item.auctionType and item.manualType %}
  127.         <div class="badge badge-success">
  128.             On-site
  129.         </div>
  130.     {% endif %}
  131. </div>