Skip to content

Commit

Permalink
Systematize names: some easy pickings
Browse files Browse the repository at this point in the history
* Rename directories:
  * Make "notificationprofiles" singular
  * Make "timeslots" singular
* Rename a subset of incident template names
  * Make "incidents" singular
  * Improve some template names to better understand their role
  • Loading branch information
hmpf authored Dec 10, 2024
1 parent 0e44800 commit bc31fca
Show file tree
Hide file tree
Showing 15 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions changelog.d/+singularize-easy-pickings.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
HTMx: Renamed some directories and templates to give them better, more consistent names.
2 changes: 1 addition & 1 deletion src/argus/htmx/incidents/customization.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class IncidentTableColumn:
"row_select",
"Selected",
"htmx/incidents/_incident_checkbox.html",
"htmx/incidents/_selected_incidents_header.html",
"htmx/incidents/_incident_list_select_all_checkbox.html",
),
IncidentTableColumn("id", "ID", "htmx/incidents/_incident_pk.html"),
IncidentTableColumn(
Expand Down
2 changes: 1 addition & 1 deletion src/argus/htmx/incidents/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def incident_list(request: HtmxHttpRequest) -> HttpResponse:
# requests, allowing us to skip rendering the unchanging parts of the
# template.
if request.htmx:
base_template = "htmx/incidents/responses/_incidents_table_refresh.html"
base_template = "htmx/incidents/responses/_incident_list_refresh.html"
else:
base_template = "htmx/incidents/_base.html"
context = {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
aria-label="Update Incidents" />
<div role="tabpanel"
class="tab-content border-primary [--tab-border:theme(borderWidth.DEFAULT)] rounded-box p-2">
{% include "htmx/incidents/_incidents_update_menu.html" %}
{% include "htmx/incidents/_incident_list_update_menu.html" %}
</div>
{% endblock menu_tabs %}
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<td colspan="{{ columns|length }}" class="border-t border-primary">
<div class="flex justify-between items-center">
{% block refresh_info %}
{% include "htmx/incidents/_incidents_refresh_info.html" %}
{% include "htmx/incidents/_incident_list_refresh_info.html" %}
{% endblock refresh_info %}
<!--
The htmx attributes set on the nav here are inherited by the child links.
Expand Down
4 changes: 2 additions & 2 deletions src/argus/htmx/templates/htmx/incidents/incident_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<section>
{% if incidents_extra_widget %}
<div class="flex">
<div class="w-2/3">{% include "htmx/incidents/_incidents_menubar.html" %}</div>
<div class="w-2/3">{% include "htmx/incidents/_incident_list_menubar.html" %}</div>
<div class="w-1/3 ml-2">{% include incidents_extra_widget %}</div>
</div>
{% else %}
{% include "htmx/incidents/_incidents_menubar.html" %}
{% include "htmx/incidents/_incident_list_menubar.html" %}
{% endif %}
</section>
<section id="incident-list" class="loading-box overflow-x-auto">
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/argus/htmx/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

from .auth import views as auth_views
from .incidents.urls import urlpatterns as incident_urls
from .timeslots.urls import urlpatterns as timeslot_urls
from .notificationprofiles.urls import urlpatterns as notificationprofile_urls
from .timeslot.urls import urlpatterns as timeslot_urls
from .notificationprofile.urls import urlpatterns as notificationprofile_urls
from .destination.urls import urlpatterns as destination_urls
from .themes.urls import urlpatterns as theme_urls
from .dateformat.urls import urlpatterns as dateformat_urls
Expand Down

0 comments on commit bc31fca

Please sign in to comment.