<%
var shipsToYou = false;
if(_.intersection(ob.userCountries, ob.ships_to).length > 0 || ob.ships_to == "ALL" || ob.ships_to.length == 0){
  shipsToYou = true;
}
%>


<div class="gridItem clearfix custCol-border <% if(ob.hidden){ %>div-fadeExtra<% } %>">

  <div class="itemImg row10 color-secondary custCol-secondary overflowHidden js-item" data-id="<%= ob.contract_hash %>">
    <div class="itemImg <% if(ob.cloak){ %> nsfw <% } %>" style="background-image: url(<%= ob.imageURL %>), url(imgs/defaultItem.png);"></div>
  </div>
  <div class="table">
    <div>
      <% if(ob.showAvatar) { %>
      <div class="thumbnail-small js-avatar tooltip" data-tooltip="<% if(ob.handle) { %><%= ob.handle %><% }else{ %><%= ob.guid %><% } %>" data-handle="<%= ob.handle %>"
        style="background-image: <% if(ob.avatar_hash && ob.avatarURL) { %> url(<%= ob.avatarURL %>), <% } %>url(imgs/defaultUser.png);"></div>
      <% } %>
      <div class="js-item pad8Left <% if(ob.title.length >= 30) { %>tooltip<% } %>"
      <% if(ob.title.length >= 30) { %>data-tooltip="<%= ob.title %>"<% } %> data-id="<%= ob.contract_hash %>">
        <div class="textSize14px noOverflow textOpacity1 js-searchTitle">
          <%= ob.title %>
        </div>
        <div class="textSize13px txt-fade textWeightNormal">
          <%= ob.formatBitcoin(ob.vendorBTCPrice, 4) %>
          <% if(ob.userCurrencyCode != 'BTC'){ %>
           (<%= ob.displayPrice %>)
          <% } %>
        </div>
      </div>
    </div>
  </div>
  <div class="gridItemControls custCol-border custCol-primary">
    <div class="table">
      <div>
        <% if(ob.discover) { %>
          <div class="btn-gridItemControl borderRight custCol-border js-about">
            <span class="ion-ios-book fontSize11 marginRight2 txt-fade"></span>
            <span class="txt-fade"><%= polyglot.t('About') %></span>
          </div>

          <% if(!ob.micro && !ob.hideFollow){ %>
            <div class="btn-gridItemControl borderRight custCol-border js-userShortUnfollow <% if(!ob.ownFollowing){ %> hide <% } %>">
              <span class="ion-eye-disabled fontSize11 marginRight2 txt-fade"></span>
              <%= polyglot.t('Unfollow') %>
            </div>
            <div class="btn-gridItemControl borderRight custCol-border js-userShortFollow <% if(ob.ownFollowing){ %> hide <% } %>">
              <span class="ion-person-add fontSize11 marginRight2 txt-fade"></span>
              <span class="txt-fade"><%= polyglot.t('Follow') %></span>
            </div>
          <% } %>

          <div class="btn-gridItemControl custCol-border <%= !ob.isBlocked ? 'js-blockUser' : 'js-unblockUser' %>">
            <span class="<%= !ob.isBlocked ? 'ion-sad' : 'ion-happy' %> fontSize11 marginRight2 txt-fade"></span>
            <span class="txt-fade"><%= !ob.isBlocked ? polyglot.t('Block') : polyglot.t('Unblock') %></span>
          </div>
        <% } %>

        <% if(ob.ownPage){ %>
          <div class="btn-gridItemControl borderRight custCol-border js-itemShortEdit">
            <span class="ion-compose fontSize11 marginRight2 txt-fade"></span>
            <span class="txt-fade"><%= polyglot.t('Edit') %></span>
          </div>
          <div class="btn-gridItemControl borderRight custCol-border js-itemShortClone">
            <span class="ion-ios-copy fontSize11 marginRight2 txt-fade"></span>
            <span class="txt-fade"><%= polyglot.t('Clone') %></span>
          </div>
          <div class="btn-gridItemControl custCol-border js-itemShortDelete">
            <span class="ion-trash-b fontSize11 marginRight2 txt-fade"></span>
            <span class="txt-fade"><%= polyglot.t('Delete') %></span>
            <div class="gridItemOverlay custCol-primary custCol-border fadeOut js-deleteOverlay">
              <span>Are you sure?</span>
              <div>
                <a class="btn btn-txt btn-txtOnly fontSize12 fontWeight400 textOpacity75 js-itemShortDeleteCancel"><%= polyglot.t('Cancel') %></a>
                <a class="btn btn-txt custCol-secondary marginLeft5 fontSize13 js-itemShortDeleteConfirm"><%= polyglot.t('YesDelete') %></a>
              </div>
            </div>
          </div>
        <% } %>

        <% if(!ob.ownPage && ob.discover === undefined){ %>
          <div class="btn-gridItemControl borderRight custCol-border js-item" data-id="<%= ob.contract_hash %>">
            <span class="ion-ios-pricetag fontSize10 marginRight2 txt-fade"></span>
            <span class="txt-fade"><%= polyglot.t('ViewListing') %></span>
          </div>
        <% } %>
      </div>
    </div>
  </div>

  <% if(ob.contract_type){ %><!-- type is not yet implemented -->
    <div class="listingType borderRadius3 js-item textOpacity90">
      <span class="<% print('listingType'+ob.contract_type) %>">
        <% if(ob.contract_type == "PHYSICAL_GOOD"){ %>
          <%= polyglot.t('Physical') %>
        <% }else if(ob.contract_type == "DIGITAL_GOOD"){  %>
          <%= polyglot.t('Digital') %>
        <% }else{ %>
          <%= polyglot.t('Service') %>
        <% } %>
      </span>
    </div>
  <% } %>

  <% if(!shipsToYou && ob.ships_to.length != 0 && !ob.ownPage){ %>
    <div class="listingDoesNotShipToYou cursorDefault tooltip" data-tooltip="<%= polyglot.t('DoesNotShip') %>">
      <span class="ion-cube fontSize14 marginLeft05 positionWrapper" style="color: #DCDCDC" ></span>
      <span class="listingsDoesNotShipToYouSlash">/</span>
    </div>
  <% } %>

</div>

<% if(ob.cloak){ %>
<div class="fullCentered txt-center padding10 custCol-secondary div-fade">
  <%= polyglot.t('NSFW') %>
</div>
<% } %>
