Implement asset rules as Asset Group children objects
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{% load cache %}
|
||||
{% load cachalot cache %}
|
||||
{% get_last_invalidation 'core.AssetGroup' as last %}
|
||||
{% get_last_invalidation 'core.AssetGroup' 'core.AssetRule' as last %}
|
||||
{% include 'mixins/partials/notify.html' %}
|
||||
{% cache 600 objects_assetgroups request.user.id object_list last %}
|
||||
<table
|
||||
@@ -27,11 +27,7 @@
|
||||
<td>{{ item.description }}</td>
|
||||
<td>
|
||||
<a
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-get="{% url 'assetfilters' type=type group_id=item.id %}"
|
||||
hx-trigger="click"
|
||||
hx-target="#{{ type }}s-here"
|
||||
hx-swap="innerHTML">
|
||||
href="{% url 'assetrules' type='page' group=item.id %}">
|
||||
{{ item.matches }}
|
||||
</a>
|
||||
</td>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{% load cache %}
|
||||
{% load cachalot cache %}
|
||||
{% get_last_invalidation 'core.AssetRestriction' as last %}
|
||||
{% get_last_invalidation 'core.AssetRule' as last %}
|
||||
{% include 'mixins/partials/notify.html' %}
|
||||
{% cache 600 objects_assetrestrictions request.user.id object_list last %}
|
||||
{% cache 600 objects_assetrules request.user.id object_list last %}
|
||||
<table
|
||||
class="table is-fullwidth is-hoverable"
|
||||
hx-target="#{{ context_object_name }}-table"
|
||||
@@ -13,35 +13,37 @@
|
||||
<thead>
|
||||
<th>id</th>
|
||||
<th>user</th>
|
||||
<th>name</th>
|
||||
<th>description</th>
|
||||
<th>pairs</th>
|
||||
<th>asset</th>
|
||||
<th>group</th>
|
||||
<th>hook</th>
|
||||
<th>aggregation</th>
|
||||
<th>value</th>
|
||||
<th>original status</th>
|
||||
<th>status</th>
|
||||
<th>trigger above</th>
|
||||
<th>trigger below</th>
|
||||
<th>actions</th>
|
||||
</thead>
|
||||
{% for item in object_list %}
|
||||
<tr>
|
||||
<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 %}">
|
||||
<td>{{ item.id }}</td>
|
||||
<td>{{ item.user }}</td>
|
||||
<td>{{ item.name }}</td>
|
||||
<td>{{ item.description }}</td>
|
||||
<td>{{ item.pairs_parsed|length }}</td>
|
||||
<td>{{ item.asset }}</td>
|
||||
<td>{{ item.group }}</td>
|
||||
<td>
|
||||
<a
|
||||
class="has-text-grey"
|
||||
onclick="window.prompt('Copy to clipboard: Ctrl+C, Enter', '{{settings.URL}}/{{settings.ASSET_PATH}}/{{ item.webhook_id }}/');">
|
||||
<span class="icon" data-tooltip="Copy to clipboard">
|
||||
<i class="fa-solid fa-copy" aria-hidden="true"></i>
|
||||
</span>
|
||||
</a>
|
||||
</td>
|
||||
<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>
|
||||
<td>
|
||||
<div class="buttons">
|
||||
<button
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-get="{% url 'assetrestriction_update' type=type group=item.group.id pk=item.id %}"
|
||||
hx-get="{% url 'assetrule_update' type=type group=item.group.id pk=item.id %}"
|
||||
hx-trigger="click"
|
||||
hx-target="#{{ type }}s-here"
|
||||
hx-swap="innerHTML"
|
||||
@@ -54,7 +56,7 @@
|
||||
</button>
|
||||
<button
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-delete="{% url 'assetrestriction_delete' type=type group=item.group.id pk=item.id %}"
|
||||
hx-delete="{% url 'assetrule_delete' type=type group=item.group.id pk=item.id %}"
|
||||
hx-trigger="click"
|
||||
hx-target="#modals-here"
|
||||
hx-swap="innerHTML"
|
||||
Reference in New Issue
Block a user