{% extends "partials/base.html" %} {% load static i18n %} {% block title %}{% trans "Edit User" %}{% endblock title %} {% block extra_css %} {% endblock extra_css %} {% block content %}

{% trans "Edit User" %}

{% trans "Edit User" %}

{% if messages %} {% for message in messages %} {% endfor %} {% endif %}
{% csrf_token %}
{{ form.username }} {% if form.username.errors %}
{{ form.username.errors|join:", " }}
{% endif %}
{{ form.name }} {% if form.name.errors %}
{{ form.name.errors|join:", " }}
{% endif %}
{{ form.email }} {% if form.email.errors %}
{{ form.email.errors|join:", " }}
{% endif %}
{{ form.role }} {% if not request.user.is_superuser %}
{% trans "Only superusers can change the role." %}
{% endif %} {% if form.role.errors %}
{{ form.role.errors|join:", " }}
{% endif %}
{{ form.status }} {% if form.status.errors %}
{{ form.status.errors|join:", " }}
{% endif %}
{% if user.role == 'client' %}
{{ form.manager_id }}
{{ form.manager_id.help_text }}
{% if form.manager_id.errors %}
{{ form.manager_id.errors|join:", " }}
{% endif %}
{% endif %}
{% trans "Cancel" %}
{% if user.role == 'sales' and clients %}

{% trans "Assigned Clients" %}

{% for client in clients %} {% empty %} {% endfor %}
{% trans "ID" %} {% trans "Username" %} {% trans "Name" %} {% trans "Email" %} {% trans "Created At" %} {% trans "Status" %}
{{ client.id }} {{ client.username }} {{ client.name }} {{ client.email }} {{ client.created_at|date:"Y-m-d H:i" }} {{ client.get_status_display }}
{% trans "No clients assigned." %}
{% endif %}
{% endblock content %} {% block extra_js %} {% if user.role == 'sales' and clients %} {% endif %} {% endblock extra_js %}