2023-02-11 14:52:00 +00:00
|
|
|
{% load cache %}
|
2023-02-11 17:22:25 +00:00
|
|
|
{% load cachalot cache %}
|
2023-02-13 20:45:23 +00:00
|
|
|
{% get_last_invalidation 'core.AssetRule' as last %}
|
2023-02-10 20:49:35 +00:00
|
|
|
{% include 'mixins/partials/notify.html' %}
|
2023-02-15 07:20:53 +00:00
|
|
|
{% cache 600 objects_assetrules request.user.id object_list type last %}
|
2023-02-11 14:52:00 +00:00
|
|
|
<table
|
|
|
|
class="table is-fullwidth is-hoverable"
|
|
|
|
hx-target="#{{ context_object_name }}-table"
|
|
|
|
id="{{ context_object_name }}-table"
|
|
|
|
hx-swap="outerHTML"
|
|
|
|
hx-trigger="{{ context_object_name_singular }}Event from:body"
|
|
|
|
hx-get="{{ list_url }}">
|
|
|
|
<thead>
|
|
|
|
<th>id</th>
|
|
|
|
<th>user</th>
|
2023-02-13 20:45:23 +00:00
|
|
|
<th>asset</th>
|
2023-02-11 14:52:00 +00:00
|
|
|
<th>group</th>
|
2023-02-13 20:45:23 +00:00
|
|
|
<th>aggregation</th>
|
|
|
|
<th>value</th>
|
|
|
|
<th>original status</th>
|
|
|
|
<th>status</th>
|
|
|
|
<th>trigger above</th>
|
|
|
|
<th>trigger below</th>
|
2023-02-11 14:52:00 +00:00
|
|
|
<th>actions</th>
|
|
|
|
</thead>
|
|
|
|
{% for item in object_list %}
|
2023-02-13 20:45:23 +00:00
|
|
|
<tr class="
|
|
|
|
{% if item.status == 2 %}has-background-success-light
|
|
|
|
{% elif item.status == 3 %}has-background-danger-light
|
|
|
|
{% elif item.status == 0 %}has-background-grey-light
|
|
|
|
{% endif %}">
|
2023-02-11 14:52:00 +00:00
|
|
|
<td>{{ item.id }}</td>
|
|
|
|
<td>{{ item.user }}</td>
|
2023-02-13 20:45:23 +00:00
|
|
|
<td>{{ item.asset }}</td>
|
2023-02-11 14:52:00 +00:00
|
|
|
<td>{{ item.group }}</td>
|
2023-02-13 20:45:23 +00:00
|
|
|
<td>{{ item.get_aggregation_display }}</td>
|
|
|
|
<td>{{ item.value }}</td>
|
|
|
|
<td>{{ item.get_original_status_display }}</td>
|
|
|
|
<td>{{ item.get_status_display }}</td>
|
|
|
|
<td>{{ item.trigger_above }}</td>
|
|
|
|
<td>{{ item.trigger_below }}</td>
|
2023-02-11 14:52:00 +00:00
|
|
|
<td>
|
|
|
|
<div class="buttons">
|
|
|
|
<button
|
|
|
|
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
2023-02-13 20:45:23 +00:00
|
|
|
hx-get="{% url 'assetrule_update' type=type group=item.group.id pk=item.id %}"
|
2023-02-11 14:52:00 +00:00
|
|
|
hx-trigger="click"
|
|
|
|
hx-target="#{{ type }}s-here"
|
|
|
|
hx-swap="innerHTML"
|
|
|
|
class="button">
|
|
|
|
<span class="icon-text">
|
|
|
|
<span class="icon">
|
|
|
|
<i class="fa-solid fa-pencil"></i>
|
|
|
|
</span>
|
2023-02-10 14:33:17 +00:00
|
|
|
</span>
|
2023-02-11 14:52:00 +00:00
|
|
|
</button>
|
|
|
|
<button
|
|
|
|
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
2023-02-13 20:45:23 +00:00
|
|
|
hx-delete="{% url 'assetrule_delete' type=type group=item.group.id pk=item.id %}"
|
2023-02-11 14:52:00 +00:00
|
|
|
hx-trigger="click"
|
|
|
|
hx-target="#modals-here"
|
|
|
|
hx-swap="innerHTML"
|
|
|
|
hx-confirm="Are you sure you wish to delete {{ item.name }}?"
|
|
|
|
class="button">
|
|
|
|
<span class="icon-text">
|
|
|
|
<span class="icon">
|
|
|
|
<i class="fa-solid fa-xmark"></i>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
2023-02-10 14:33:17 +00:00
|
|
|
|
2023-02-11 14:52:00 +00:00
|
|
|
</table>
|
|
|
|
{% endcache %}
|