forked from enviPath/enviPy
148 lines
4.7 KiB
HTML
148 lines
4.7 KiB
HTML
{% load static %}
|
|
<!-- Edit Package Permissions -->
|
|
<dialog
|
|
id="view_package_permissions_modal"
|
|
class="modal"
|
|
x-data="{}"
|
|
>
|
|
<div class="modal-box max-w-2xl">
|
|
<!-- Header -->
|
|
<h3 class="text-lg font-bold">Current Permissions</h3>
|
|
|
|
<!-- Close button (X) -->
|
|
<form method="dialog">
|
|
<button class="btn btn-sm btn-circle btn-ghost absolute top-2 right-2">
|
|
✕
|
|
</button>
|
|
</form>
|
|
|
|
<!-- Body -->
|
|
<div class="py-4">
|
|
<p class="mb-4">
|
|
Current permissions for this package.
|
|
</p>
|
|
|
|
<!-- User Permissions -->
|
|
{% if user_permissions %}
|
|
<div class="divider">User Permissions</div>
|
|
<div class="space-y-2">
|
|
<div class="grid grid-cols-12 gap-2 items-center">
|
|
<div class="col-span-5 truncate"></div>
|
|
<div class="col-span-2 text-center">Read</div>
|
|
<div class="col-span-2 text-center">Write</div>
|
|
<div class="col-span-2 text-center">Owner</div>
|
|
<div class="col-span-1"></div>
|
|
</div>
|
|
{% for up in user_permissions %}
|
|
<div class="grid grid-cols-12 gap-2 items-center">
|
|
<div class="col-span-5 truncate">
|
|
{{ up.user.username }}
|
|
{% if not up.user.is_active %}<i>(inactive)</i>{% endif %}
|
|
</div>
|
|
<div class="col-span-2 text-center">
|
|
<input
|
|
type="checkbox"
|
|
name="read"
|
|
id="read_{{ up.user.uuid }}"
|
|
class="checkbox"
|
|
{% if up.has_read %}checked{% endif %}
|
|
onclick="return false;"
|
|
/>
|
|
</div>
|
|
<div class="col-span-2 text-center">
|
|
<input
|
|
type="checkbox"
|
|
name="write"
|
|
id="write_{{ up.user.uuid }}"
|
|
class="checkbox"
|
|
{% if up.has_write %}checked{% endif %}
|
|
onclick="return false;"
|
|
/>
|
|
</div>
|
|
<div class="col-span-2 text-center">
|
|
<input
|
|
type="checkbox"
|
|
name="owner"
|
|
id="owner_{{ up.user.uuid }}"
|
|
class="checkbox"
|
|
{% if up.has_all %}checked{% endif %}
|
|
onclick="return false;"
|
|
/>
|
|
</div>
|
|
</div>
|
|
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
|
|
<!-- Group Permissions -->
|
|
{% if group_permissions %}
|
|
<div class="divider">Group Permissions</div>
|
|
<div class="space-y-2">
|
|
<div class="grid grid-cols-12 gap-2 items-center">
|
|
<div class="col-span-5 truncate"></div>
|
|
<div class="col-span-2 text-center">Read</div>
|
|
<div class="col-span-2 text-center">Write</div>
|
|
<div class="col-span-2 text-center">Owner</div>
|
|
<div class="col-span-1"></div>
|
|
</div>
|
|
{% for gp in group_permissions %}
|
|
|
|
<div class="grid grid-cols-12 gap-2 items-center">
|
|
<div class="col-span-5 truncate">
|
|
{{ gp.group.name|safe }}
|
|
</div>
|
|
<div class="col-span-2 text-center">
|
|
<input
|
|
type="checkbox"
|
|
name="read"
|
|
id="read_{{ gp.group.uuid }}"
|
|
class="checkbox"
|
|
{% if gp.has_read %}checked{% endif %}
|
|
onclick="return false;"
|
|
/>
|
|
</div>
|
|
<div class="col-span-2 text-center">
|
|
<input
|
|
type="checkbox"
|
|
name="write"
|
|
id="write_{{ gp.group.uuid }}"
|
|
class="checkbox"
|
|
{% if gp.has_write %}checked{% endif %}
|
|
onclick="return false;"
|
|
/>
|
|
</div>
|
|
<div class="col-span-2 text-center">
|
|
<input
|
|
type="checkbox"
|
|
name="owner"
|
|
id="owner_{{ gp.group.uuid }}"
|
|
class="checkbox"
|
|
{% if gp.has_all %}checked{% endif %}
|
|
onclick="return false;"
|
|
/>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<!-- Footer -->
|
|
<div class="modal-action">
|
|
<button
|
|
type="button"
|
|
class="btn"
|
|
onclick="this.closest('dialog').close()"
|
|
>
|
|
Close
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Backdrop -->
|
|
<form method="dialog" class="modal-backdrop">
|
|
<button>close</button>
|
|
</form>
|
|
</dialog>
|