<commit_before>{% macro render_field(field, class_="form-control", show_label=True, input_prepend=None, label_text=None) %}
  <div class="form-group {% if field.errors %}has-error{% endif %}">
    {% if show_label %}
    <label for="{{ field.name }}">{{ label_text or field.label.text }}
      {% if field.flags.required %}<span>*</span>{% endif %}:
    </label>
    {% endif %}
      {% if input_prepend %}
      <div class="input-group">
        <span class="input-group-addon"><i class="{{ input_prepend }}"></i></span>
        {% endif %}
        {% if field.flags.required %}
          {% set class_ = class_ + " required" %}
        {% endif %}
        {% if field.flags.email %}
          {% set class_ = class_ + " email" %}
        {% endif %}
        {{ field(class_=class_, **kwargs) }}
        {% if input_prepend %}
        {# close the input-prepend div if one exists #}
      </div>
      {% endif %}
      {% if field.description %}
      <span class="help-block"><small>{{ field.description }}</small></span>
      {% endif %}
      {% for error in field.errors %}
      <span class="help-block"><small>{{ error|string }}</small></span>
      {% endfor %}
  </div>
{% endmacro %}

{% macro render_address(address, identifier, edit=True) -%}
<div class="pull-right">
  {% if edit %}
  <a href="{{ url_for('party.address.edit_address', address=address.id) }}" ><i class="fa fa-pencil"></i>{% trans %}Edit {% endtrans %}</a>&nbsp;&nbsp;/&nbsp;&nbsp;<span class="remove-address" data-url="{{ url_for('party.address.remove_address', active_id=address.id) }}"><i class="fa fa-trash-o"></i> {% trans %} Remove {% endtrans %}</a>
  {% endif %}
</div>
<address>
  {% for line in address.full_address.split('\n') %}
    {% if loop.first %}
      <strong>{{ line }}</strong><br/>
    {% else %}
      {{ line }}<br/>
    {% endif %}
  {% endfor %}
  {% if address.phone_number %}
    <abbr title="Phone"><i class="fa fa-phone"></i></abbr>: {{ address.phone_number.value }}<br/>
  {% endif %}
</address>
{%- endmacro %}

{% macro render_product(product) -%}
<div class="item">
  <a href="{{ url_for('product.product.render', uri=product.uri) }}">
    <img src="{{ CDN }}{{ product.default_image }}" alt="{{ product.name }}" title="{{ product.name }}"/>
    <h4> {{ product.name }}
      <span class="brand">Black Coffee</span>
    </h4>
    <span class="product-price">{{ product.sale_price()|currencyformat(request.nereid_currency.code) }}</span>
  </a>
</div>
{%- endmacro %}

{% macro render_product_list(product, node=None, name=None, description=None, product_list_name=None) -%}
{% set name = name or product.rec_name or product.name %}
{% set description = description or product.description %}
{% if product.__name__ == 'product.template' %}
  {% set product = product.products_displayed_on_eshop[0] %}
{% endif %}
{% set product_url = product.get_absolute_url(path=(node and node.slug or None), node=(node and node.id or None)) %}
<div class="thumbnail">
  <a href="{{ product_url }}" ga-product-link data-ga-product-list="{{ node and node.name or product_list_name }}">
    <img src="{{ CDN }}{{ product.default_image.transform_command().thumbnail(300, 300, 'a') }}"
          alt="{{ product.name }}"
          title="{{ product.name }}"
          class="img-responsive img-rounded">
  </a>
  <div class="caption">
    <h5 class="center">
      <a href="{{ product_url }}" ga-product-link data-ga-product-list="{{ node and node.name or product_list_name }}">{{ name|safe|truncate(50) }}</a>
    </h5><commit_msg>Modified render_product_list macro in _helpers.jinja. #6295 Product code removed from product name.<commit_after>{% macro render_field(field, class_="form-control", show_label=True, input_prepend=None, label_text=None) %}
  <div class="form-group {% if field.errors %}has-error{% endif %}">
    {% if show_label %}
    <label for="{{ field.name }}">{{ label_text or field.label.text }}
      {% if field.flags.required %}<span>*</span>{% endif %}:
    </label>
    {% endif %}
      {% if input_prepend %}
      <div class="input-group">
        <span class="input-group-addon"><i class="{{ input_prepend }}"></i></span>
        {% endif %}
        {% if field.flags.required %}
          {% set class_ = class_ + " required" %}
        {% endif %}
        {% if field.flags.email %}
          {% set class_ = class_ + " email" %}
        {% endif %}
        {{ field(class_=class_, **kwargs) }}
        {% if input_prepend %}
        {# close the input-prepend div if one exists #}
      </div>
      {% endif %}
      {% if field.description %}
      <span class="help-block"><small>{{ field.description }}</small></span>
      {% endif %}
      {% for error in field.errors %}
      <span class="help-block"><small>{{ error|string }}</small></span>
      {% endfor %}
  </div>
{% endmacro %}

{% macro render_address(address, identifier, edit=True) -%}
<div class="pull-right">
  {% if edit %}
  <a href="{{ url_for('party.address.edit_address', address=address.id) }}" ><i class="fa fa-pencil"></i>{% trans %}Edit {% endtrans %}</a>&nbsp;&nbsp;/&nbsp;&nbsp;<span class="remove-address" data-url="{{ url_for('party.address.remove_address', active_id=address.id) }}"><i class="fa fa-trash-o"></i> {% trans %} Remove {% endtrans %}</a>
  {% endif %}
</div>
<address>
  {% for line in address.full_address.split('\n') %}
    {% if loop.first %}
      <strong>{{ line }}</strong><br/>
    {% else %}
      {{ line }}<br/>
    {% endif %}
  {% endfor %}
  {% if address.phone_number %}
    <abbr title="Phone"><i class="fa fa-phone"></i></abbr>: {{ address.phone_number.value }}<br/>
  {% endif %}
</address>
{%- endmacro %}

{% macro render_product(product) -%}
<div class="item">
  <a href="{{ url_for('product.product.render', uri=product.uri) }}">
    <img src="{{ CDN }}{{ product.default_image }}" alt="{{ product.name }}" title="{{ product.name }}"/>
    <h4> {{ product.name }}
      <span class="brand">Black Coffee</span>
    </h4>
    <span class="product-price">{{ product.sale_price()|currencyformat(request.nereid_currency.code) }}</span>
  </a>
</div>
{%- endmacro %}

{% macro render_product_list(product, node=None, name=None, description=None, product_list_name=None) -%}
{% set description = description or product.description %}
{% if product.__name__ == 'product.template' %}
  {% set product = product.products_displayed_on_eshop[0] %}
  {% set name = name or product.name %}
{% elif product.__name__ == 'product.product' %}
  {% set name = name or product.template.name %}
{% endif %}
{% set product_url = product.get_absolute_url(path=(node and node.slug or None), node=(node and node.id or None)) %}
<div class="thumbnail">
  <a href="{{ product_url }}" ga-product-link data-ga-product-list="{{ node and node.name or product_list_name }}">
    <img src="{{ CDN }}{{ product.default_image.transform_command().thumbnail(300, 300, 'a') }}"
          alt="{{ product.name }}"
          title="{{ product.name }}"
          class="img-responsive img-rounded">
  </a>
  <div class="caption">
    <h5 class="center">
      <a href="{{ product_url }}" ga-product-link data-ga-product-list="{{ node and node.name or product_list_name }}">{{ name|safe|truncate(50) }}</a>
    </h5>
{'fraction_non_alphanumeric': 0.2107449459983384, 'fraction_numerical': 0.004153973968429798, 'mean_word_length': 3.486335403726708, 'pattern_counts': {'":': 0, '<': 125, '<?xml version=': 0, '>': 125, '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': '6179946', 'n_tokens_mistral': 2530, 'n_tokens_neox': 2303, 'n_words': 512}