{% extends "pages/base.html" %}
{% load i18n %}

{% block title %}{% translate "Create logbook entry" %}{% endblock %}

{% block content %}
<div class="container py-4">
  <div class="row justify-content-center">
    <div class="col-lg-8">
      <h1 class="mb-3">{% translate "Logbook entry" %}</h1>
      <p class="text-muted">{% translate "Create an entry to report events across the constellation." %}</p>
      <form method="post" enctype="multipart/form-data" class="card card-body bg-dark border-secondary">
        {% csrf_token %}
        {{ form.non_field_errors }}
        {% for field in form.visible_fields %}
          <div class="mb-3">
            <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="text-danger">{{ error }}</div>{% endfor %}
          </div>
        {% endfor %}
        <div class="d-flex gap-2">
          <button type="submit" class="btn btn-primary">{% translate "Create entry" %}</button>
          <a href="{% url 'logbook:create' %}" class="btn btn-outline-secondary">{% translate "Reset" %}</a>
        </div>
      </form>
    </div>
  </div>
</div>
{% endblock %}
