{#
/**
 * @file
 * Default template for the 'plain' address formatter.
 *
 * Available variables:
 *   - given_name: Given name.
 *   - additional_name: Additional name.
 *   - family_name: Family name.
 *   - organization: Organization.
 *   - address_line1: First address line.
 *   - address_line2: Second address line.
 *   - postal_code: Postal code.
 *   - sorting_code: Sorting code.
 *   - dependent_locality: The dependent locality.
 *     - dependent_locality.code: Dependent locality code.
 *     - dependent_locality.name: Dependent locality name.
 *   - locality: The locality subdivision.
 *     - locality.code: Locality code.
 *     - locality.name: Locality name.
 *   - administrative_area: The administrative area subdivision.
 *     - administrative_area.code: Administrative area code.
 *     - administrative_area.name: Administrative area name.
 *   - country: The country.
 *     - country.code: Country code.
 *     - country.name: Country name.
 *
 * if a subdivision (dependent_locality, locality, administrative_area) was
 * entered, the array will always have a code. If it's a predefined subdivision,
 * it will also have a name. The code is always prefered.
 *
 * @ingroup themeable
 */
#}
<div class="address" translate="no">
  {% if given_name or family_name %}
    <div class="address__name">
      {% if given_name %}
        <span class="address__first-name">
        {{ given_name }}
      </span>
      {% endif %}
      {% if family_name %}
        <span class="address__last-name">
        {{ family_name }}
      </span>
      {% endif %}
    </div>
  {% endif %}

  {% if organization or address_line1 or address_line2 %}
    <div class="address__lines">
      {% if organization %}
        <div class="address__org">
          {{ organization }}
        </div>
      {% endif %}

      {% if address_line1 %}
        <div class="address__line1">
          {{ address_line1 }}
        </div>
      {% endif %}

      {% if address_line2 %}
        <div class="address__line2">
          {{ address_line2 }}
        </div>
      {% endif %}
    </div>
  {% endif %}

  {% if dependent_locality.code or locality.code or postal_code or administrative_area.code %}
    <div class="address__locality">
      {% if locality.code or postal_code or administrative_area.code %}
        <div class="address__locality-line1">
          {% if administrative_area.code %}
            <span class="address__locality__admin">{{ administrative_area.code }}</span>
          {% endif %}
          {% if postal_code %}
            <span class="address__locality__postal-code">{{ postal_code }}</span>
          {% endif %}
          {% if locality.code %}
            <span class="address__locality__locality">{{ locality.code }}</span>
          {% endif %}
        </div>
      {% endif %}

      {% if dependent_locality.code %}
        <div class="address__locality-line2">
          {{ dependent_locality.code }}
        </div>
      {% endif %}
    </div>
  {% endif %}

  {% if country.name %}
    <div class="address__country">
      {{ country.name }}
    </div>
  {% endif %}
</div>
