.row
  .col-md-12
    = form_tag(project_monitor_path, project: project, method: :get) do
      = hidden_field_tag :defaults, 0
      %span.dropdown#project-monitor-status-dropdown
        %button.btn.btn-outline-secondary.dropdown-toggle{ data: { 'bs-toggle': :dropdown }, type: :button }
          %span.caret
          Status
        .dropdown-menu.keep-open
          .text-center
            %button.btn.btn-link.monitor-filter-link{ type: :button } All
            %button.btn.btn-link.monitor-no-filter-link{ type: :button } None
          - status.each do |status|
            .dropdown-item
              .form-check
                = check_box_tag valid_xml_id(status), 1, status_filter.include?(status), class: 'form-check-input'
                %label.form-check-label{ for: valid_xml_id(status) }
                  = status
      %span.dropdown#project-monitor-architectures-dropdown
        %button.btn.btn-outline-secondary.dropdown-toggle{ data: { 'bs-toggle': :dropdown }, type: :button }
          %span.caret
          Architecture
        .dropdown-menu.keep-open
          .text-center
            %button.btn.btn-link.monitor-filter-link{ type: :button } All
            %button.btn.btn-link.monitor-no-filter-link{ type: :button } None
          - architectures.each do |architecture|
            .dropdown-item
              .form-check
                = check_box_tag valid_xml_id("arch_#{architecture}"), 1, architecture_filter.include?(architecture), class: 'form-check-input'
                %label.form-check-label{ for: valid_xml_id("arch_#{architecture}") }
                  = architecture
      %span.dropdown#project-monitor-repositories-dropdown
        %button.btn.btn-outline-secondary.dropdown-toggle{ data: { 'bs-toggle': :dropdown }, type: :button }
          %span.caret
          Repository
        .dropdown-menu.keep-open
          .text-center
            %button.btn.btn-link.monitor-filter-link{ type: :button } All
            %button.btn.btn-link.monitor-no-filter-link{ type: :button } None
          - repositories.each do |repository|
            .dropdown-item
              .form-check
                = check_box_tag valid_xml_id("repo_#{repository}"), 1, repository_filter.include?(repository), class: 'form-check-input'
                %label.form-check-label{ for: valid_xml_id("repo_#{repository}") }
                  = repository
      %span#project-monitor-repositories-last-build
        = label_tag 'lastbuild', title: 'Include the results from the last build', class: 'btn btn-outline-secondary mb-0' do
          = check_box_tag 'lastbuild', 1, lastbuild_switch
          Last time results

      %button.btn.btn-primary#filter-button{ type: :submit }
        Apply Filter
      %i.fas.fa-lg.fa-sync-alt.fa-spin.ms-3#table-spinner

      = render partial: 'webui/shared/build_status_legend_modal', locals: { legend: legend }
