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.pyindex 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.htmlsimilarity index 100%rename from src/hi/apps/location/templates/location/location_drop_down.htmlrename to src/hi/apps/location/templates/location/panes/location_drop_down.htmldiff --git a/src/hi/apps/location/templates/location/location_view.html b/src/hi/apps/location/templates/location/panes/location_view.htmlsimilarity index 84%rename from src/hi/apps/location/templates/location/location_view.htmlrename to src/hi/apps/location/templates/location/panes/location_view.htmlindex 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.htmlsimilarity index 100%rename from src/hi/apps/location/templates/location/location_view_buttons.htmlrename to src/hi/apps/location/templates/location/panes/location_view_buttons.htmldiff --git a/src/hi/apps/location/templates/location/svg_icon_item.html b/src/hi/apps/location/templates/location/panes/svg_icon_item.htmlsimilarity index 100%rename from src/hi/apps/location/templates/location/svg_icon_item.htmlrename to src/hi/apps/location/templates/location/panes/svg_icon_item.htmldiff --git a/src/hi/apps/location/templates/location/svg_path_item.html b/src/hi/apps/location/templates/location/panes/svg_path_item.htmlsimilarity index 100%rename from src/hi/apps/location/templates/location/svg_path_item.htmlrename to src/hi/apps/location/templates/location/panes/svg_path_item.htmldiff --git a/src/hi/apps/location/view_mixin.py b/src/hi/apps/location/view_mixin.pyindex 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 DIVIDclass 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.pyindex 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_NAMEdef 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.htmlindex 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' %}"