{% extends 'layouts/base.html' %} {% load static %} {% block title %}Role Details - {{ object.name }}{% endblock title %} {% block extra_css %} {% endblock extra_css %} {% block breadcrumb %} {% endblock breadcrumb %} {% block content %}

{{ object.name }}

{{ object.description|default:'No description provided' }}

{{ user_count|default:0 }} Users {{ object.permissions.count }} Permissions {% if object.created_at %} Created {{ object.created_at|timesince }} ago {% else %} Created recently {% endif %}
{{ user_count|default:0 }}
Assigned Users
{{ object.permissions.count }}
Total Permissions
{{ child_role_count|default:0 }}
Child Roles
{{ active_user_count|default:0 }}
Active Users

Role Information

{{ object.name }}
The display name for this role
{{ object.code|default:'Not set' }}
Unique identifier for this role
{{ object.level|default:'1' }} {% if object.level == 1 %} (Highest) {% elif object.level == 5 %} (Lowest) {% endif %}
Role hierarchy level
{{ object.description|default:'No description provided' }}
Purpose and responsibilities of this role
{% if object.parent_role %} {{ object.parent_role.name }} {% else %} No parent role {% endif %}
Role hierarchy relationship
{{ object.get_role_type_display|default:'Standard' }}
Category of this role

Role Configuration

{% if object.is_default %}Default Role{% else %}Not Default{% endif %} {% if object.is_active %}Active{% else %}Inactive{% endif %} {% if object.is_system_role %}System Role{% else %}User Role{% endif %}
Current role configuration and status
{% if object.created_at %} {{ object.created_at|date:'M d, Y H:i' }} ({{ object.created_at|timesince }} ago) {% else %} Unknown {% endif %}
When this role was created
{% if object.created_by %} {{ object.created_by.get_full_name|default:object.created_by.username }} {% else %} System {% endif %}
Who created this role
Edit Role View Users

Permissions ({{ object.permissions.count }})

{% if object.permissions.count %}
{% for app_name, app_permissions in permission_groups.items %}
{{ app_name|title }}
{{ app_permissions|length }}
{% for permission in app_permissions %}
{{ permission.name }} {{ permission.content_type.app_label }}.{{ permission.codename }}
{% endfor %}
{% endfor %}
{% else %}
No permissions assigned

This role doesn't have any permissions yet.

Add Permissions
{% endif %}

Users with this Role ({{ user_count|default:0 }})

{% if assigned_users %} {% else %}
No users assigned

No users have been assigned to this role yet.

{% endif %}

Recent Activity

{% if object.created_at %}
{{ object.created_at|date:'M d, Y H:i' }}
Role Created
Role "{{ object.name }}" was created by {% if object.created_by %} {{ object.created_by.get_full_name|default:object.created_by.username }} {% else %} System {% endif %}
{% endif %} {% if object.updated_at and object.created_at and object.updated_at != object.created_at %}
{{ object.updated_at|date:'M d, Y H:i' }}
Role Updated
Role permissions or details were modified {% if object.updated_by %} by {{ object.updated_by.get_full_name|default:object.updated_by.username }} {% endif %}
{% endif %} {% if user_count %}
Recent
Users Assigned
{{ user_count }} user{{ user_count|pluralize }} currently have this role
{% endif %}
Back to Roles
Edit Role
{% endblock content %} {% block extra_js %} {% endblock extra_js %}