<div class="modal fade" tabindex="-1" role="dialog" id="distribute-rule-modal">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <h4 class="modal-title">Add Distribution Rule</h4>
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="<%= I18n.t(:close) %>"></button>
      </div>

      <form name="distribute_rules_form" method="post" action="/projects/<%= @project.id %>/distribution_rules" class="form-horizontal">

        <div class="modal-body  modal-body-tall">

          <div class="form-group form-group-sm row">
            <label class="col-sm-3 form-control-label" for="contact_header">Test files:</label>
            <div class="col-sm-9">
              <select name="test_file_names[]" multiple="true" class="form-control" style="width: 100%; height: 180px;">
                <% @project.recent_build_test_files.sort.each do |x| %>
                    <option class="<%= x %>"><%= x %></option>
                <% end %>
              </select>
            </div>
          </div>

          <div class="form-group form-group-sm row">
            <label class="col-sm-3 form-control-label" for="contact_header">Constraint:</label>
            <div class="col-sm-9">
              <select name="constraint" class="form-control" style="width: 100%;">
                <option value="only_on_agents">Only on these agents</option>
                <option value="on_same_agent">On the same agent</option>
              </select>
            </div>
          </div>

          <div class="form-group form-group-sm row">
            <label class="col-sm-3 form-control-label" for="contact_header">on Build Agents:</label>
            <div class="col-sm-9">
              <select name="build_agent_names[]" multiple="true" class="form-control" style="width: 100%">
                <% (@project_available_agents || @project.available_agents).sort.each do |x| %>
                    <option class="<%= x %>"><%= x %></option>
                <% end %>
              </select>
            </div>
          </div>


        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal" data-bs-dismiss="modal"><%= I18n.t(:close) %></button>
          <input type="submit" class="btn btn-primary" value="<%= I18n.t(:save) %>"/>
        </div>

      </form>


    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
