{% extends 'base.html' %} {% load static %} {% block title %}{% if is_new %}New Team{% else %}Edit {{ team.name }}{% endif %} | Fox Fitt{% endblock %} {% block content %} {# === TEAM EDIT/CREATE PAGE === Serves both /teams/new/ and /teams//edit/. Form sections: Team Basics · Pay Schedule · Workers. #}
{# === PAGE HEADER === #}

{% if is_new %}New Team{% else %}Edit: {{ team.name }}{% endif %}

{% if not is_new %} Cancel {% else %} Cancel {% endif %}
{% csrf_token %} {# === FORM-LEVEL ERRORS === #} {% if form.non_field_errors %}
{{ form.non_field_errors }}
{% endif %}
{# === TEAM BASICS === #}
Team Basics
{{ form.name }} {% if form.name.errors %}
{{ form.name.errors.0 }}
{% endif %}
{{ form.supervisor }} {% if form.supervisor.errors %}
{{ form.supervisor.errors.0 }}
{% endif %}
The user who manages this team — admin or member of the Work Logger group.
{{ form.active }}
Inactive teams are hidden from attendance logging forms.
{# === PAY SCHEDULE === #}
Pay Schedule

Optional. If set, the app can calculate pay periods automatically. Both fields must be filled together (or both left blank).

{{ form.pay_frequency }} {% if form.pay_frequency.errors %}
{{ form.pay_frequency.errors.0 }}
{% endif %}
{{ form.pay_start_date }} {% if form.pay_start_date.errors %}
{{ form.pay_start_date.errors.0 }}
{% endif %}
Anchor date — the first day of the very first pay period. Never needs updating.
{# === WORKERS PICKER === #}
Workers
Inactive workers appear with a grey badge and are still selectable.
{% if form.workers.errors %}
{{ form.workers.errors.0 }}
{% endif %}
{% for choice in form.workers %}
{{ choice.tag }}
{% empty %}
No workers exist yet.
{% endfor %}
{# === SUBMIT ROW === #}
{% if not is_new %} Cancel {% else %} Cancel {% endif %}
{% endblock %}