
{% load widget_tweaks %}


<div class="inline-flex rounded-md shadow-xs">
  <button
    method="get" formtarget="_blank" type="submit"
    form="main-filter" formaction="{{default_format.url}}"
    class="btn btn-primary gap-2 rounded-r-none btn-md border-r-primary-focus border-r-2"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-5 h-5">
      <path fill-rule="evenodd" d="M4.5 2A1.5 1.5 0 003 3.5v13A1.5 1.5 0 004.5 18h11a1.5 1.5 0 001.5-1.5V7.621a1.5 1.5 0 00-.44-1.06l-4.12-4.122A1.5 1.5 0 0011.378 2H4.5zm4.75 6.75a.75.75 0 011.5 0v2.546l.943-1.048a.75.75 0 011.114 1.004l-2.25 2.5a.75.75 0 01-1.114 0l-2.25-2.5a.75.75 0 111.114-1.004l.943 1.048V8.75z" clip-rule="evenodd" />
    </svg>
    {{default_format.label}}</button>
  <div class="relative -ml-px block dropdown dropdown-bottom dropdown-end dropdown-hover">
    <button type="button" tabindex="0" class="focus:z-10 btn btn-primary rounded-l-none" id="option-menu-button" aria-expanded="true" aria-haspopup="true">
      <span class="sr-only">Open options</span>
      <!-- Heroicon name: mini/chevron-down -->
      <svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
        <path fill-rule="evenodd" d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z" clip-rule="evenodd" />
      </svg>
    </button>


    <ul class="dropdown-content menu bg-base-200 p-2 shadow rounded-box w-52 " role="menu" aria-orientation="vertical" aria-labelledby="option-menu-button" tabindex="0">
      {% for format in formats %}
        <li>
          <button method="get" formtarget="_blank" type="submit"
                  name="fields" value="{{format.fields}}"
                  form="main-filter" formaction="{{format.url}}" class="" role="menuitem" tabindex="-1">{{format.label}}</button>
        </li>
      {% endfor %}
    </ul>
  </div>
</div>
