<?php $this->getContainer()->get('contao_bootstrap.templates.view.form_renderer')->prepare($this) ?>
<?php $this->extend('block_unsearchable'); ?>

<?php $this->block('content'); ?>
  <form<?php if ($this->action): ?> action="<?= $this->action ?>"<?php endif; ?> method="get">
    <div class="formbody">
        <div class="widget widget-text form-group">
        <label for="ctrl_keywords_<?= $this->uniqueId ?>" class="invisible"><?= $this->keywordLabel ?></label>
        <div class="input-group">
          <input type="search" name="keywords" id="ctrl_keywords_<?= $this->uniqueId ?>" class="form-control text" value="<?= $this->keyword ?>">
          <div class="input-group-append widget widget-submit">
            <button type="submit" id="ctrl_submit_<?= $this->uniqueId ?>" class="btn btn-success px-3 <?= $this->buttonClass ?>"><i class="fas fa-search"></i></button>
          </div>
        </div>
    </div>
      <?php if ($this->advanced): ?>
        <div class="widget widget-radio form-group">
          <fieldset class="radio_container">
            <legend class="invisible"><?= $this->optionsLabel ?></legend>
              <div class="custom-control custom-radio custom-control-inline">
                  <input type="radio" name="query_type" id="matchAll_<?= $this->uniqueId ?>" class="custom-control-input radio" value="and"<?php if ($this->queryType == 'and'): ?> checked="checked"<?php endif; ?>>
                  <label for="matchAll_<?= $this->uniqueId ?>" class="custom-control-label"><?= $this->matchAll ?></label>
              </div>
              <div class="custom-control custom-radio custom-control-inline">
                  <input type="radio" name="query_type" id="matchAny_<?= $this->uniqueId ?>" class="custom-control-input radio" value="or"<?php if ($this->queryType == 'or'): ?> checked="checked"<?php endif; ?>>
                  <label for="matchAny_<?= $this->uniqueId ?>" class="custom-control-label"><?= $this->matchAny ?></label>
              </div>
          </fieldset>
        </div>
      <?php endif; ?>
    </div>
  </form>

  <?php if ($this->header): ?>
    <p class="header"><?= $this->header ?> (<?= $this->duration ?>)</p>
  <?php endif; ?>

  <?= $this->results . $this->pagination ?>

<?php $this->endblock(); ?>
