2023-07-21 03:22:08 +07:00
|
|
|
{% extends 'generic/object.html' %}
|
|
|
|
{% load i18n %}
|
|
|
|
{% load helpers %}
|
|
|
|
{% load render_table from django_tables2 %}
|
|
|
|
|
|
|
|
{% block title %}{% trans "Permission" %} {{ object.name }}{% endblock %}
|
|
|
|
|
|
|
|
{% block subtitle %}{% endblock %}
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
<div class="row mb-3">
|
|
|
|
<div class="col-md-6">
|
|
|
|
<div class="card">
|
|
|
|
<h5 class="card-header">{% trans "Permission" %}</h5>
|
2024-01-17 16:25:42 -05:00
|
|
|
<table class="table table-hover attr-table">
|
|
|
|
<tr>
|
|
|
|
<th scope="row">{% trans "Name" %}</th>
|
|
|
|
<td>{{ object.name }}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th scope="row">{% trans "Description" %}</th>
|
|
|
|
<td>{{ object.description|placeholder }}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th scope="row">{% trans "Enabled" %}</th>
|
|
|
|
<td>{% checkmark object.enabled %}</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2023-07-21 03:22:08 +07:00
|
|
|
</div>
|
|
|
|
<div class="card">
|
|
|
|
<h5 class="card-header">{% trans "Actions" %}</h5>
|
2024-01-17 16:25:42 -05:00
|
|
|
<table class="table table-hover attr-table">
|
|
|
|
<tr>
|
|
|
|
<th scope="row">{% trans "View" %}</th>
|
|
|
|
<td>{% checkmark object.can_view %}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th scope="row">{% trans "Add" %}</th>
|
|
|
|
<td>{% checkmark object.can_add %}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th scope="row">{% trans "Change" %}</th>
|
|
|
|
<td>{% checkmark object.can_change %}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th scope="row">{% trans "Delete" %}</th>
|
|
|
|
<td>{% checkmark object.can_delete %}</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2023-07-21 03:22:08 +07:00
|
|
|
</div>
|
|
|
|
<div class="card">
|
|
|
|
<h5 class="card-header">{% trans "Constraints" %}</h5>
|
|
|
|
<div class="card-body">
|
|
|
|
{% if object.constraints %}
|
|
|
|
<pre>{{ object.constraints|json }}</pre>
|
|
|
|
{% else %}
|
|
|
|
<span class="text-muted">None</span>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-6">
|
|
|
|
<div class="card">
|
|
|
|
<h5 class="card-header">{% trans "Object Types" %}</h5>
|
|
|
|
<ul class="list-group list-group-flush">
|
|
|
|
{% for user in object.object_types.all %}
|
|
|
|
<li class="list-group-item">{{ user }}</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div class="card">
|
|
|
|
<h5 class="card-header">{% trans "Assigned Users" %}</h5>
|
|
|
|
<div class="list-group list-group-flush">
|
|
|
|
{% for user in object.users.all %}
|
2024-02-05 10:24:03 -08:00
|
|
|
<a href="{% url 'users:user' pk=user.pk %}" class="list-group-item list-group-item-action">{{ user }}</a>
|
2023-07-21 03:22:08 +07:00
|
|
|
{% empty %}
|
|
|
|
<div class="list-group-item text-muted">{% trans "None" %}</div>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="card">
|
|
|
|
<h5 class="card-header">{% trans "Assigned Groups" %}</h5>
|
|
|
|
<div class="list-group list-group-flush">
|
|
|
|
{% for group in object.groups.all %}
|
2024-03-04 08:29:53 -05:00
|
|
|
<a href="{% url 'users:group' pk=group.pk %}" class="list-group-item list-group-item-action">{{ group }}</a>
|
2023-07-21 03:22:08 +07:00
|
|
|
{% empty %}
|
|
|
|
<div class="list-group-item text-muted">{% trans "None" %}</div>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|