Skip to content

Commit

Permalink
standardize on singular in view names and url names
Browse files Browse the repository at this point in the history
  • Loading branch information
hmpf committed Dec 18, 2024
1 parent 5c8202a commit e9e3766
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/argus/htmx/incident/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
urlpatterns = [
path("", views.incident_list, name="incident-list"),
path("<int:pk>/", views.incident_detail, name="incident-detail"),
path("update/<str:action>/", views.incidents_update, name="incidents-update"),
path("filter/", views.filter_form, name="incidents-filter"),
path("update/<str:action>/", views.incident_update, name="incident-update"),
path("filter/", views.filter_form, name="incident-filter"),
]
2 changes: 1 addition & 1 deletion src/argus/htmx/incident/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def get_form_data(request, formclass: forms.Form):


@require_POST
def incidents_update(request: HtmxHttpRequest, action: str):
def incident_update(request: HtmxHttpRequest, action: str):
try:
formclass, callback_func = INCIDENT_UPDATE_ACTIONS[action]
except KeyError:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "htmx/_base_form_modal.html" %}
{% block form_control %}
hx-post="{% url endpoint|default:'htmx:incidents-update' action=action %}"
hx-post="{% url endpoint|default:'htmx:incident-update' action=action %}"
hx-indicator="#{{ dialog_id }} .htmx-indicator"
{% if action_type == "bulk-update" %}
hx-include="[name='incident_ids']"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="menu menu-horizontal gap-2">
{% block update_menu_content %}
{% with action_type="bulk-update" endpoint="htmx:incidents-update" %}
{% with action_type="bulk-update" endpoint="htmx:incident-update" %}
{% include "htmx/incident/_incident_ticket_edit_modal.html" with action="update-ticket" dialog_id="add-ticket-dialog" button_class="btn-accent" button_title="Change ticket" header="Update ticket URL" explanation="Write an URL of an existing ticket, or nothing to remove existing ticket URLs" cancel_text="Cancel" submit_text="Submit" %}
{% include "htmx/incident/_incident_acknowledge_modal.html" with action="ack" dialog_id="create-acknowledgment-dialog" button_class="btn-accent" button_title="Acknowledge" header="Submit acknowledgment" explanation="Write a message describing why these incidents were acknowledged" cancel_text="Cancel" submit_text="Submit" %}
{% include "htmx/incident/_incident_close_modal.html" with action="close" dialog_id="close_incident-dialog" button_class="btn-accent" button_title="Close" header="Manually close incidents" explanation="Write a message describing why these incidents were manually closed" cancel_text="Cancel" submit_text="Close now" %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends "htmx/forms/dropdown_select_multiple.html" %}
{% block field_control %}
{{ block.super }}
hx-get="{% url 'htmx:incidents-filter' %}"
hx-get="{% url 'htmx:incident-filter' %}"
{% endblock field_control %}
{% block show_selected %}
<span class="badge badge-primary">{{ option.label }}</span>
Expand Down

0 comments on commit e9e3766

Please sign in to comment.