{% extends 'base.html' %} {% load static %} {% block title %}{% if is_new %}New Project{% else %}Edit {{ project.name }}{% endif %} | Fox Fitt{% endblock %} {% block content %} {# === PROJECT EDIT/CREATE PAGE === Serves both /projects/new/ and /projects//edit/. Form sections: Project Basics · Timeline · Supervisors. #}
{# === PAGE HEADER === #}

{% if is_new %}New Project{% else %}Edit: {{ project.name }}{% endif %}

{% if not is_new %} Cancel {% else %} Cancel {% endif %}
{% csrf_token %} {% if form.non_field_errors %}
{{ form.non_field_errors }}
{% endif %}
{# === PROJECT BASICS === #}
Project Basics
{{ form.name }} {% if form.name.errors %}
{{ form.name.errors.0 }}
{% endif %}
{{ form.description }} {% if form.description.errors %}
{{ form.description.errors.0 }}
{% endif %}
{{ form.active }}
Inactive projects are hidden from attendance logging forms.
{# === TIMELINE === #}
Timeline

Optional. Used for reporting and filtering.

{{ form.start_date }} {% if form.start_date.errors %}
{{ form.start_date.errors.0 }}
{% endif %}
{{ form.end_date }} {% if form.end_date.errors %}
{{ form.end_date.errors.0 }}
{% endif %}
Leave blank for ongoing projects.
{# === SUPERVISORS PICKER === #}
Supervisors

Any number of supervisors may be assigned. Only admins and members of the "Work Logger" group are listed.

{% if form.supervisors.errors %}
{{ form.supervisors.errors.0 }}
{% endif %}
{% for choice in form.supervisors %}
{{ choice.tag }}
{% empty %}
No eligible supervisors. Add a user to the "Work Logger" group or grant them staff access first.
{% endfor %}
{# === SUBMIT ROW === #}
{% if not is_new %} Cancel {% else %} Cancel {% endif %}
{% endblock %}