{% extends ctx.module + "/base.j2" %}
{% set title = "Add" %}

{% block body -%}
<div class="container">
  <form method="post">
    <div class="columns is-desktop">
      <div class="column">
        <div class="field">
          <label class="label" for="path">Path</label>
          <div class="control">
            <input type="text" class="input" id="path" name="path" placeholder="module.FooPlug" required>
          </div>
          <p class="help">Full path to your plug or hook class.  External modules must be present on the system path, either installed to a default directory or one added to <code>sys.path</code>.</p>
        </div>
      </div>
      <div class="column">
        <div class="field">
          <label class="label" for="name">Name</label>
          <div class="control">
            <input type="text" class="input" id="name" name="name" placeholder="foo-test" required>
          </div>
          <p class="help">Identifier available to other hooks, in order to reference this instance in config.</p>
        </div>
      </div>
    </div>
    <div class="field">
      <label class="label" for="config">Config</label>
      <div class="control">
        <div id="config-editor"></div>
        <textarea id="config" name="config" class="textarea is-small json-editor" data-editor="config-editor" style="font-family: monospace">{}</textarea>
      </div>
    </div>
    <div class="field is-grouped">
      <div class="control">
        <button class="button is-success" type="submit"><i class="fas fa-fw fa-plus"></i> Add</button>
      </div>
    </div>
  </form>
</div>
{%- endblock %}
