{# vim:set softtabstop=2: -#}
{% set title = 'Wizard' -%}
{#% set refresh = 15 %#}
{% include "_header.html" %}
{% set active="printer" %}

<div class="container">
  <div class="row">
      <div class="col-md-12">
          <h1>Printer Info</h1>

          <form method="post" id="form">
            <p>Please, fill in the name of the printer which will be used with PrusaLink, and its location.</p>

            {% set errors = wizard.errors.get('printer', {}) %}
            <div class="form-group row">
              <label for="name" class="col-sm-2 col-form-label">Name:</label>
              <div class="col-sm-10">
                <input type="text" class="form-control {{ 'is-invalid' if errors.get('name') else '' }}" id="name" name="name" value="{{ wizard.printer_name or '' }}" placeholder="Original Prusa i3 {{ wizard.daemon.prusa_link.printer.type_string }}">
                <div class="invalid-feedback">
                  Please provide a valid printer name.
                </div>
              </div>
            </div>

            <div class="form-group row">
              <label for="location" class="col-sm-2 col-form-label">Location:</label>
              <div class="col-sm-10">
                <input type="text" class="form-control {{ 'is-invalid' if errors.get('location') else '' }}" id="location" name="location" value="{{ wizard.printer_location or '' }}" placeholder="Warehouse top shelf">
                <div class="invalid-feedback">
                  Please provide a valid printer location.
                </div>
              </div>
            </div>

            <div class="container navigation">
              <div class="row">
                  <div class="col">
                    <a href={{ "/wizard/credentials" | prefixed }} class="btn btn-back btn-outline-light full-width"><img src="../img/arrow-left.svg" height="16" /> BACK | Setup credentials</a>
                  </div>
                  <div class="col-sm-auto">
                    <button onclick="document.getElementById('form').submit();" type="submit" class="btn btn-outline-light full-width">Recap and save | NEXT <img src="../img/arrow-right.svg" height="16" /></button>
                  </div>
              </div>
            </div>
          </form>

        </div>{# /col-md-9 so end of content  #}
      </div>{# /row #}
    </div>{# /container #}

    {% include "_wizard.html" %}
    {% include "_footer.html" %}
