{% extends "base.html" %}

{% block content %}
<div class="container">
  <div class="row">
    <section class="col-md-6">
      <h3 id="create">Clone existing repository</h3>
      <form method="POST" action="/clone">
        {{csrf_token()}}
        <div class="form-group">
          <label for="cloneUrl">Clone URL</label>
          <input
            autofocus
            type="text"
            name="cloneUrl"
            id="cloneUrl"
            class="form-control {{valid.cls("cloneUrl")}}"
            value="{{ cloneUrl or "" }}" />
          {{valid.summary("cloneUrl")}}
        </div>
        <div class="form-group">
          <label for="name">Name</label>
          <input
            type="text"
            name="name"
            id="name"
            class="form-control {{valid.cls("name")}}"
            value="{{ name or "" }}" />
          {{valid.summary("name")}}
        </div>
        <div class="form-group">
          <label for="description">Description</label>
          <input
            type="text"
            name="description"
            id="description"
            class="form-control {{valid.cls("description")}}"
            value="{{ description or "" }}" />
          {{valid.summary("description")}}
        </div>
        <fieldset class="form-group">
          <legend>Visibility</legend>
          <div class="form-check form-check-inline">
            <label
              class="form-check-label"
              title="Publically visible and listed on your profile"
            >
              <input
                class="form-check-input"
                type="radio"
                name="visibility"
                value="PUBLIC"
                {{ "checked" if visibility == "PUBLIC" else "" }}
              > Public
            </label>
          </div>
          <div class="form-check form-check-inline">
            <label
                class="form-check-label"
                title="Visible to anyone with the link, but not shown on your profile"
            >
              <input
                class="form-check-input"
                type="radio"
                name="visibility"
                value="UNLISTED"
                {{ "checked" if visibility == "UNLISTED" else "" }}
              > Unlisted
            </label>
          </div>
          <div class="form-check form-check-inline">
            <label
              class="form-check-label"
              title="Only visible to you and your collaborators"
            >
              <input
                class="form-check-input"
                type="radio"
                name="visibility"
                value="PRIVATE"
                {{ "checked" if visibility == "PRIVATE" else "" }}
              > Private
            </label>
          </div>
        </fieldset>
        <button type="submit" class="btn btn-primary">
          Clone {{icon("caret-right")}}
        </button>
      </form>
      {{valid.summary()}}
    </section>
  </div>
</div>
{% endblock %}
