Skip to content

Home Information - Your home, your data, organized.

Python

Refactored location template locations.

Anthony Cassandra49f0fa85e6fc
diff --git a/src/hi/apps/location/edit/async_views.py b/src/hi/apps/location/edit/async_views.py
index 31491a1e..1f7711c7 100644
--- a/src/hi/apps/location/edit/async_views.py
+++ b/src/hi/apps/location/edit/async_views.py
@@ -236,7 +236,7 @@ class LocationViewEntityToggleView( View, LocationViewMixin ):
context = {
'location_view_data': location_view_data,
}
- template = get_template( 'location/location_view.html' )
+ template = get_template( self.LOCATION_VIEW_TEMPLATE_NAME )
location_view_content = template.render( context, request = request )
return antinode.response(
@@ -284,7 +284,7 @@ class LocationViewCollectionToggleView( View, LocationViewMixin ):
context = {
'location_view_data': location_view_data,
}
- template = get_template( 'location/location_view.html' )
+ template = get_template( self.LOCATION_VIEW_TEMPLATE_NAME )
location_view_content = template.render( context, request = request )
return antinode.response(
diff --git a/src/hi/apps/location/templates/location/location_drop_down.html b/src/hi/apps/location/templates/location/panes/location_drop_down.html
similarity index 100%
rename from src/hi/apps/location/templates/location/location_drop_down.html
rename to src/hi/apps/location/templates/location/panes/location_drop_down.html
diff --git a/src/hi/apps/location/templates/location/location_view.html b/src/hi/apps/location/templates/location/panes/location_view.html
similarity index 84%
rename from src/hi/apps/location/templates/location/location_view.html
rename to src/hi/apps/location/templates/location/panes/location_view.html
index 32fd3829..97255aba 100644
--- a/src/hi/apps/location/templates/location/location_view.html
+++ b/src/hi/apps/location/templates/location/panes/location_view.html
@@ -13,11 +13,11 @@
</g>
{% for svg_path_item in location_view_data.svg_path_items %}
- {% include "location/svg_path_item.html" with svg_path_item=svg_path_item %}
+ {% include "location/panes/svg_path_item.html" with svg_path_item=svg_path_item %}
{% endfor %}
{% for svg_icon_item in location_view_data.svg_icon_items %}
- {% include "location/svg_icon_item.html" with svg_icon_item=svg_icon_item %}
+ {% include "location/panes/svg_icon_item.html" with svg_icon_item=svg_icon_item %}
{% endfor %}
</svg>
diff --git a/src/hi/apps/location/templates/location/location_view_buttons.html b/src/hi/apps/location/templates/location/panes/location_view_buttons.html
similarity index 100%
rename from src/hi/apps/location/templates/location/location_view_buttons.html
rename to src/hi/apps/location/templates/location/panes/location_view_buttons.html
diff --git a/src/hi/apps/location/templates/location/svg_icon_item.html b/src/hi/apps/location/templates/location/panes/svg_icon_item.html
similarity index 100%
rename from src/hi/apps/location/templates/location/svg_icon_item.html
rename to src/hi/apps/location/templates/location/panes/svg_icon_item.html
diff --git a/src/hi/apps/location/templates/location/svg_path_item.html b/src/hi/apps/location/templates/location/panes/svg_path_item.html
similarity index 100%
rename from src/hi/apps/location/templates/location/svg_path_item.html
rename to src/hi/apps/location/templates/location/panes/svg_path_item.html
diff --git a/src/hi/apps/location/view_mixin.py b/src/hi/apps/location/view_mixin.py
index 265c1472..965558fc 100644
--- a/src/hi/apps/location/view_mixin.py
+++ b/src/hi/apps/location/view_mixin.py
@@ -12,6 +12,8 @@ from hi.constants import DIVID
class LocationViewMixin:
+ LOCATION_VIEW_TEMPLATE_NAME = 'location/panes/location_view.html'
+
def get_location( self, request, *args, **kwargs ) -> Location:
""" Assumes there is a required location_id in kwargs """
try:
diff --git a/src/hi/apps/location/views.py b/src/hi/apps/location/views.py
index a0e0949b..eb87d5bf 100644
--- a/src/hi/apps/location/views.py
+++ b/src/hi/apps/location/views.py
@@ -39,7 +39,7 @@ class LocationViewDefaultView( View ):
class LocationViewView( HiGridView, LocationViewMixin ):
def get_main_template_name( self ) -> str:
- return 'location/location_view.html'
+ return self.LOCATION_VIEW_TEMPLATE_NAME
def get_template_context( self, request, *args, **kwargs ):
location_view = self.get_location_view( request, *args, **kwargs )
diff --git a/src/hi/templates/panes/top_buttons.html b/src/hi/templates/panes/top_buttons.html
index 874a3930..f02eebb0 100644
--- a/src/hi/templates/panes/top_buttons.html
+++ b/src/hi/templates/panes/top_buttons.html
@@ -1,8 +1,8 @@
<div class="bg-white p-1">
<div class="d-flex justify-content-between">
- {% include "location/location_view_buttons.html" %}
+ {% include "location/panes/location_view_buttons.html" %}
<div class="d-flex justify-content-end">
- {% include "location/location_drop_down.html" %}
+ {% include "location/panes/location_drop_down.html" %}
<div>
{% if request.is_editing %}
<a href="{% url 'edit_end' %}"