{% extends "base.html" %} {% block title %}Roster{% endblock %} {% block content %}

Roster

Add a locomotive

{# ----- Decoder picker (OUTSIDE the form) ----- The picker is UI-only: its selects use ``name="mfg"`` / ``name="family"`` / ``name="model"`` so the htmx ``hx-include`` forwards the RIGHT query-param names to ``/programmer/decoders``. If it were inside the form, ``name="mfg"`` would collide with the loco-manufacturer text field on submit. When the user picks a model (via manual selection or the Identify flow), the JS at the bottom of this page mirrors the values into hidden ``decoderFamily`` / ``decoderModel`` inputs inside the form so the real submission carries them. Identify's returned fragment seeds the same #mfg-select / #families / #models IDs — this section is deliberately shaped to look like the Programmer page's picker for that reason. #} {% if catalog_loaded %}
Decoder manufacturer
No decoder picked yet.
{% else %}

Load the decoder catalog on the Programmer page (or set JMRI_DECODER_XML_ROOT for auto-load at startup) to enable the manufacturer / family / model picker + Identify. Free-text fields below still work if you know the family / model names.

{% endif %}
{# Decoder family / model — hidden when the catalog is loaded (the picker above populates them via JS). Visible free-text fallback when there's no catalog so users can still hand-enter values. #} {% if catalog_loaded %}
{% else %}
{% endif %}
{% include "_roster_table.html" %}
{# Mirror the picker selections into the hidden decoder inputs so a Save submits the family + model the user actually picked. Also updates a small status line so the user has feedback that the picker has taken effect. #} {% endblock %}