{% extends "pos/base.html" %} {% load static %} {% block title %}{% if is_edit %}Edit Master{% else %}Add Master{% endif %}{% endblock %} {% block stylesheets %} {{ block.super }} {% endblock %} {% block content %}

{% if is_edit %}Edit Master{% else %}Add Master{% endif %}

{% if form.errors %}
{% endif %} {% if is_edit %} {# Edit existing master: branches + expiry/status #}
{% csrf_token %}
{{ form.branches.label_tag }}{{ form.branches }} {% if form.branches.help_text %} {{ form.branches.help_text }} {% endif %} {{ form.branches.errors }}
{{ form.password1.label_tag }}{{ form.password1 }} {{ form.password1.help_text }} {{ form.password1.errors }}
{{ form.password2.label_tag }}{{ form.password2 }} {{ form.password2.errors }}
{{ form.expiry_date.label_tag }}{{ form.expiry_date }} {{ form.expiry_date.errors }}
{{ form.status.label_tag }}{{ form.status }} {{ form.status.errors }}
Cancel
{% else %} {# Full create form (as before) #}
{% csrf_token %}
{{ form.username.label_tag }}{{ form.username }}
{{ form.email.label_tag }}{{ form.email }}
{{ form.password1.label_tag }}{{ form.password1 }}
{{ form.password2.label_tag }}{{ form.password2 }}
{{ form.branches.label_tag }}{{ form.branches }} {% if form.branches.help_text %} {{ form.branches.help_text }} {% endif %}
{{ form.expiry_date.label_tag }}{{ form.expiry_date }}
{{ form.status.label_tag }}{{ form.status }}
Cancel
{% endif %}
{% endblock %} {% block javascripts %} {{ block.super }} {% endblock %}