{% extends "base.html" %}

{% block title %}{{ page_title }}{% endblock %}
{% block meta_description %}{{ meta_description }}{% endblock %}

{% block content %}
<section class="form-hero">
  <div class="container">
    <div class="row justify-content-center">
      <div class="col-lg-9">
        <span class="eyebrow">Connector registry</span>
        <h1>Register a new job source</h1>
        <p class="lead">Capture the minimum metadata needed to make a future connector discoverable, monitorable, and attachable to offers.</p>
      </div>
    </div>
  </div>
</section>
<section class="section-pad pt-0">
  <div class="container">
    <div class="row justify-content-center">
      <div class="col-lg-9">
        <form class="app-form glass-card" method="post" novalidate>
          {% csrf_token %}
          {% include "core/partials/form_errors.html" with form=form %}
          <div class="row g-4">
            {% for field in form %}
            <div class="col-md-{% if field.name == 'notes' %}12{% else %}6{% endif %}">
              <label class="form-label" for="{{ field.id_for_label }}">{{ field.label }}</label>
              {{ field }}
              {% if field.help_text %}<div class="form-text">{{ field.help_text }}</div>{% endif %}
              {% for error in field.errors %}<div class="invalid-feedback d-block">{{ error }}</div>{% endfor %}
            </div>
            {% endfor %}
          </div>
          <div class="d-flex flex-wrap gap-3 mt-4">
            <button class="btn btn-accent btn-lg rounded-pill px-4" type="submit">Save source</button>
            <a class="btn btn-outline-dark btn-lg rounded-pill px-4" href="{% url 'home' %}">Cancel</a>
          </div>
        </form>
      </div>
    </div>
  </div>
</section>
{% endblock %}
