<form method="post" class="container" id="tagList" hx-target="this" hx-swap="outerHTML show:window:top">
  <input type="hidden" name="{{ csrf.form_field_name }}" value="{{ csrf.request_token }}">
  <div class="row mwl-table-detail" id="tag_new"></div>
  {%- assign map_count = mappings | size -%}
  {% if map_count > 0 -%}
    {% for map in mappings -%}
      {%- assign map_id = mapping_ids | value: map.tag -%}
      <div class="row mwl-table-detail" id="tag_{{ map_id }}">
        <div class="col no-wrap">
          {{ map.tag }}<br>
          <small>
            {%- capture map_edit %}admin/settings/tag-mapping/{{ map_id }}/edit{% endcapture -%}
            <a href="{{ map_edit | relative_link }}" hx-target="#tag_{{ map_id }}"
               hx-swap="innerHTML show:#tag_{{ map_id }}:top">
              Edit
            </a>
            <span class="text-muted"> &bull; </span>
            {%- capture map_del %}admin/settings/tag-mapping/{{ map_id }}/delete{% endcapture -%}
            {%- capture map_del_link %}{{ map_del | relative_link }}{% endcapture -%}
            <a href="{{ map_del_link }}" hx-post="{{ map_del_link }}" class="text-danger"
               hx-confirm="Are you sure you want to delete the mapping for &ldquo;{{ map.tag }}&rdquo;? This action cannot be undone.">
              Delete
            </a>
          </small>
        </div>
        <div class="col">{{ map.url_value }}</div>
      </div>
    {%- endfor %}
  {%- else -%}
    <div class="row">
      <div class="col text-muted text-center fst-italic">This web log has no tag mappings</div>
    </div>
  {%- endif %}
</form>
