This repository has been archived by the owner on Feb 11, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge bulk and singular incident update logic
* Make update endpoint work for singular incident as well and change detail view to use it * Remove now obsolete ack incident view * Include single incident pk using hx-vals
- Loading branch information
1 parent
0fdde37
commit 092d9e6
Showing
9 changed files
with
19 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
src/argus_htmx/templates/htmx/incidents/_base_incident_update_modal.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{% extends "htmx/_base_form_modal.html" %} | ||
{% block form_control %} | ||
hx-post="{% url endpoint|default:'htmx:incidents-update' action=action %}" | ||
{% if action_type == "bulk-update" %} | ||
hx-post="{% url endpoint|default:'htmx:incident-list' action=action %}" | ||
hx-include="[name='selected_incidents']" | ||
hx-include="[name='incident_ids']" | ||
{% else %} | ||
{{ block.super }} | ||
hx-vals='{"incident_ids": [{{ incident.pk }}] }' | ||
{% endif %} | ||
{% endblock form_control %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
<a class="link" href="{% url 'htmx:incident-add-ack' pk=incident.pk %}"> | ||
{% if incident.acked %} | ||
<span class="badge badge-primary">Acked</span> | ||
{% else %} | ||
<span class="badge badge-accent">Unacked</span> | ||
{% endif %} | ||
</a> | ||
{% if incident.acked %} | ||
<span class="badge badge-primary">Acked</span> | ||
{% else %} | ||
<span class="badge badge-accent">Unacked</span> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 2 additions & 12 deletions
14
src/argus_htmx/templates/htmx/incidents/_incident_combined_status.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,2 @@ | ||
{% if incident.open %} | ||
<span class="badge badge-primary">Open</span> | ||
{% else %} | ||
<span class="badge badge-accent">Closed</span> | ||
{% endif %} | ||
<a class="link" href="{% url 'htmx:incident-add-ack' pk=incident.pk %}"> | ||
{% if incident.acked %} | ||
<span class="badge badge-primary">Acked</span> | ||
{% else %} | ||
<span class="badge badge-accent">Unacked</span> | ||
{% endif %} | ||
</a> | ||
{% include "htmx/incidents/_incident_status.html" %} | ||
{% include "htmx/incidents/_incident_ack.html" %} |
46 changes: 0 additions & 46 deletions
46
src/argus_htmx/templates/htmx/incidents/incident_add_ack.html
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters