<commit_before>class CartLineItemView extends Backbone.View

  tagName: "tr"

  events:
    "change .epages-cart-overlay-line-item-quantity": "changeQuantity"
    "click .epages-cart-overlay-line-item-remove": "removeLineItem"

  template: _.template """
    <td class="epages-cart-overlay-image">
      <img src="<%= itemImage %>">
    </td>
    <td class="epages-cart-overlay-name"><%= name %></td>
    <td class="epages-cart-overlay-price"><span class="epages-cart-overlay-subhead-narrow" data-i18n='unit-price'></span><%= singleItemPrice %></td>
    <td class="epages-cart-overlay-quantity">
      <span class="epages-cart-overlay-subhead-narrow" data-i18n='quantity'></span><input type="number" class="epages-cart-overlay-line-item-quantity" value="<%= quantity %>">
      <%= unit %>
    </td>
    <td class="epages-cart-overlay-total"><span class="epages-cart-overlay-subhead-narrow" data-i18n='total-price'></span><%= lineItemPrice %></td>
    <td class="epages-cart-overlay-remove">
      <button class="epages-cart-overlay-line-item-remove"
              alt="Remove product">
      </button> <span data-i18n='remove-line-item'></span>
    </td>
  """

  render: ->
    @$el.html @template
      itemImage:       @model.get("variationImage") || @model.largeImage()
      name:            @model.name()
      quantity:        @model.quantity()
      unit:            @model.unit()
      singleItemPrice: @model.formattedPrice()
      lineItemPrice:   @model.get("lineItemPrice") || ''

    App.i18n(this)
    this

  changeQuantity: (event) ->
    quantity = parseInt(event.target.value)
    @model.set(quantity: quantity)

  removeLineItem: (event) ->
    event.preventDefault()<commit_msg>Changes for the WP plugin<commit_after>class CartLineItemView extends Backbone.View

  tagName: "tr"

  events:
    "change .epages-cart-overlay-line-item-quantity": "changeQuantity"
    "click .epages-cart-overlay-line-item-remove": "removeLineItem"
    "click .epages-cart-overlay-line-item-quantity-hidden": "changeQuantityH"

  template: _.template """
    <td class="epages-cart-overlay-image">
      <span class="epages-cart-overlay-line-item-quantity-hidden" style="visibility: hidden;" id="h-<%= productId %>"></span>
      <img src="<%= itemImage %>">
    </td>
    <td class="epages-cart-overlay-name"><%= name %></td>
    <td class="epages-cart-overlay-price"><span class="epages-cart-overlay-subhead-narrow" data-i18n='unit-price'></span><%= singleItemPrice %></td>
    <td class="epages-cart-overlay-quantity">
      <span class="epages-cart-overlay-subhead-narrow" data-i18n='quantity' id="s-<%= productId %>"></span><input type="number" class="epages-cart-overlay-line-item-quantity" value="<%= quantity %>">
      <%= unit %>
    </td>
    <td class="epages-cart-overlay-total"><span class="epages-cart-overlay-subhead-narrow" data-i18n='total-price'></span><%= lineItemPrice %></td>
    <td class="epages-cart-overlay-remove">
      <button class="epages-cart-overlay-line-item-remove"
              alt="Remove product"
              id="b-<%= productId %>">
      </button> <span data-i18n='remove-line-item'></span>
    </td>
  """

  render: ->
    @$el.html @template
      itemImage:       @model.get("variationImage") || @model.largeImage()
      name:            @model.name()
      quantity:        @model.quantity()
      unit:            @model.unit()
      singleItemPrice: @model.formattedPrice()
      lineItemPrice:   @model.get("lineItemPrice") || ''
      productId:       @model.get("productId")

    App.i18n(this)
    this

  changeQuantity: (event) ->
    quantity = parseInt(event.target.value)
    @model.set(quantity: quantity)

  changeQuantityH: (event) ->
    elementId = event.target.id.split("h-")[1]
    input = document.getElementById("s-" + elementId).nextSibling
    @model.set(quantity: input.value)

  removeLineItem: (event) ->
    event.preventDefault()
{'fraction_non_alphanumeric': 0.1827489122088559, 'fraction_numerical': 0.0053749680061428206, 'mean_word_length': 3.3470522803114573, 'pattern_counts': {'":': 5, '<': 68, '<?xml version=': 0, '>': 75, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '236926', 'n_tokens_mistral': 1337, 'n_tokens_neox': 1269, 'n_words': 199}