КОНТРОЛЫ/supplier.md


Исходный код

Twig код

{% set value = element.cf[cf.ID].VALUE[key].value %}

<div class="supplier js-control-supplier {{ class_name }}" data-search-in="{{ cf.SETTINGS.search_in|default('') }}">
  <div class="supplier__item supplier__item_name">
    {% include "interface/controls/suggest.twig" with {
      class_name: 'supplier__suggest supplier__suggest_name',
      additional_data: 'spellcheck="false" data-query-type="name"',
      input_class_name: 'linked-form__cf js-supplier-name' ~ ' ' ~ input_class_name,
      items: [],
      value: value.name|default(''),
      input_type: 'text',
      name: name ~ '[name]',
      ajax: {},
      placeholder: "...",
      disabled: disabled,
    } %}
  </div>

  <div class="supplier__item supplier__item_labeled {% if not value.vat_id %}hidden{% endif %}">
    <span class="supplier__item-label">{{ "ITIN"|i18n }}</span>
    <span class="supplier__item-value js-supplier-vat-id">{% if value.vat_id|length %}{{ value.vat_id }}{% else %}...{% endif %}</span>
  </div>

  <div class="supplier__item supplier__item_labeled {% if not value.kpp %}hidden{% endif %}">
    <span class="supplier__item-label">{{ "IEC"|i18n }}</span>
    <span class="supplier__item-value js-supplier-kpp">{% if value.kpp|length %}{{ value.kpp }}{% else %}...{% endif %}</span>
  </div>

  <div class="supplier__item supplier__item_labeled {% if not value.tax_registration_reason_code %}hidden{% endif %}">
    <span class="supplier__item-label">{{ "Registration #"|i18n }}</span>
    <span class="supplier__item-value js-supplier-tax-registration-reason-code">{% if value.tax_registration_reason_code|length %}{{ value.tax_registration_reason_code }}{% else %}...{% endif %}</span>
  </div>

  <div class="supplier__item supplier__item_labeled {% if not value.bank_code %}hidden{% endif %}">
    <span class="supplier__item-label">{{ "Bank code"|i18n }}</span>
    <span class="supplier__item-value js-supplier-bank-code">{% if value.bank_code|length %}{{ value.bank_code }}{% else %}...{% endif %}</span>
  </div>

  <div class="supplier__item supplier__item_labeled {% if not value.address %}hidden{% endif %}">
    <span class="supplier__item-label">{{ "CF_NAME_ADDRESS"|i18n }}</span>
    <span class="supplier__item-value js-supplier-address">{% if value.address|length %}{{ value.address }}{% else %}...{% endif %}</span>
  </div>

  <input type="hidden" class="js-linked-entity-id" name="{{ name ~ '[entity_id]' }}" value="{{ value.entity_id }}">
</div>

Ссылка на вики репозиторий