{% extends base.html %}
{% block title %}config{% end block %}

{% block body %}
<form method="POST" role="form">
  <div class="form-group">
    <label class="control-label" for="repo">Repository</label>
    <input type="text" name="repo" value="{{ config['repo'] }}" placeholder="/path/to/repo/" tabindex="1" class="form-control" />
  </div>
  <div class="form-group">
    <label class="control-label" for="port">Port</label>
    <input type="text" name="port" value=" {{ config['port'] or "8080" }}" placeholder="Port" tabindex="2" class="form-control" />
  </div>
  <div class="form-group">
    <label class="control-label" for="username">Username</label>
    <input type="text" name="username" value="{{ config['username'] }}" placeholder="Username" tabindex="3" class="form-control" />
  </div>
  <div class="form-group">
    <label class="control-label" for="pwdhash">Password</label>
    <input type="password" name="pwdhash" placeholder="Password" tabindex="4" class="form-control" />
  </div>
  <div class="form-group">
    <label>
      <input type="checkbox" name="autosave"{% if config.get('autosave', 'False') == 'True' %} checked="on"{% end if %} /> Autosave Notes
    </label>
    <span class=help-block>Saves notes every 5 seconds in edit mode.</span>
  </div>
  <input type="hidden" name="save" value="Save" />
  <button type="submit" class="btn btn-primary" tabindex="6">Save</button>
  <hr>
  <div class=lead>Advanced Settings</div>
  <div class="form-group">
    <label class=control-label for=address>Listen Address</label>
      <input type="text" class=form-control name="address" value="{{ config['address'] }}" placeholder="Listen Address"/> 
      <span class=help-block>Set to "0.0.0.0" to listen on all addresses</span>
  </div>
  <div class="form-group">
    <label>
      <input type="checkbox" name="testing"{% if config.get('testing', 'False') == 'True' %} checked="on"{% end if %} /> Test Mode
    </label>
    <span class="help-block">Enables logging, you probably want to leave this off.</span>
  </div>
</form>
{% end block %}
