Skip to content

Home Information - Your home, your data, organized.

Python

Minor fixes after major refactor and refreshed migration.

Anthony Cassandrae137b1916ac1
diff --git a/src/hi/apps/config/urls.py b/src/hi/apps/config/urls.py
index 15c22b1a..205b0a0d 100644
--- a/src/hi/apps/config/urls.py
+++ b/src/hi/apps/config/urls.py
@@ -9,4 +9,8 @@ urlpatterns = [
views.ConfigHomePaneView.as_view(),
name='config_home_pane' ),
+ re_path( r'^tab$',
+ views.ConfigTabPaneView.as_view(),
+ name='config_tab_pane' ),
+
]
diff --git a/src/hi/apps/config/views.py b/src/hi/apps/config/views.py
index 63614cbf..92d0a39e 100644
--- a/src/hi/apps/config/views.py
+++ b/src/hi/apps/config/views.py
@@ -1,3 +1,4 @@
+from django.shortcuts import render
from django.urls import reverse
import hi.apps.common.antinode as antinode
@@ -29,3 +30,11 @@ class ConfigHomePaneView( HiGridView, IntegrationViewMixin ):
main_template_name = 'config/panes/home.html',
push_url_name = 'config_home_pane',
)
+
+
+class ConfigTabPaneView( HiGridView, IntegrationViewMixin ):
+
+ def get(self, request, *args, **kwargs):
+
+ context = self.get_integration_config_tab_context()
+ return render( request, 'core/panes/integration_config_tab.html', context )
diff --git a/src/hi/apps/location/edit/views.py b/src/hi/apps/location/edit/views.py
index 4d4191fc..b0966747 100644
--- a/src/hi/apps/location/edit/views.py
+++ b/src/hi/apps/location/edit/views.py
@@ -173,7 +173,7 @@ class LocationViewAddView( View ):
request.view_parameters.to_session( request )
redirect_url = reverse('home')
- return redirect( redirect_url )
+ return antinode.redirect_response( redirect_url )
class LocationViewGeometryView( View ):
diff --git a/src/hi/apps/location/templates/location/panes/location_details.html b/src/hi/apps/location/templates/location/panes/location_details.html
index 872bbba2..eb814471 100644
--- a/src/hi/apps/location/templates/location/panes/location_details.html
+++ b/src/hi/apps/location/templates/location/panes/location_details.html
@@ -6,3 +6,21 @@ TBD
<h5>Order Index</h5>
<div>{{ location_detail_data.location.order_id }}</div>
+
+<div>
+ <a href="{% url 'location_edit_location_view_delete' location_view_id=request.view_parameters.location_view_id %}"
+ id="hi-delete-location-view-link" class="btn btn-danger btn-control" role="button"
+ data-async="true">
+ DELETE THIS VIEW
+ </a>
+</div>
+
+
+<div>
+ <a href="{% url 'location_edit_location_delete' location_id=location_detail_data.location.id %}"
+ id="hi-delete-location-link" class="btn btn-danger btn-control" role="button"
+ data-async="true">
+ DELETE LOCATION AND ALL VIEWS
+ </a>
+</div>
+
diff --git a/src/hi/hi_grid_view.py b/src/hi/hi_grid_view.py
index eb4f4ffa..ac5ca4da 100644
--- a/src/hi/hi_grid_view.py
+++ b/src/hi/hi_grid_view.py
@@ -78,7 +78,7 @@ class HiGridView(View):
if ( 'location_view_list' not in context ):
location_view_list = list( current_location.views.order_by( 'order_id' ))
context['location_view_list'] = location_view_list
-
+
# This list of collections is needed for bottom buttons
if 'collection_list' not in context:
collection_list = list( Collection.objects.all().order_by( 'order_id' ))
diff --git a/src/hi/integrations/hass/templates/hass/panes/manage.html b/src/hi/integrations/hass/templates/hass/panes/manage.html
index bcc34204..b0a5ab92 100644
--- a/src/hi/integrations/hass/templates/hass/panes/manage.html
+++ b/src/hi/integrations/hass/templates/hass/panes/manage.html
@@ -1,4 +1,12 @@
-<h3>HAss Integration</h3>
+<div class="d-flex justify-content-between">
+ <div cLASS="h3">HAss Integration</div>
+ <div>
+ <a href="{% url 'config_tab_pane' %}"
+ class="btn btn-tertiary btn-control" role="button" data-async="#{{ DIVID.INTEGRATION_TAB }}">
+ BACK
+ </a>
+ </div>
+</div>
{% if processing_result %}
{% include "common/processing_result.html" with processing_result=processing_result %}
diff --git a/src/hi/integrations/zoneminder/templates/zoneminder/panes/manage.html b/src/hi/integrations/zoneminder/templates/zoneminder/panes/manage.html
index 28f4fd45..8a570f62 100644
--- a/src/hi/integrations/zoneminder/templates/zoneminder/panes/manage.html
+++ b/src/hi/integrations/zoneminder/templates/zoneminder/panes/manage.html
@@ -1,4 +1,12 @@
-<h3>ZoneMinder Integration</h3>
+<div class="d-flex justify-content-between">
+ <div cLASS="h3">ZoneMinder Integration</div>
+ <div>
+ <a href="{% url 'config_tab_pane' %}"
+ class="btn btn-tertiary btn-control" role="button" data-async="#{{ DIVID.INTEGRATION_TAB }}">
+ BACK
+ </a>
+ </div>
+</div>
{% if processing_result %}
{% include "common/processing_result.html" with processing_result=processing_result %}
@@ -8,7 +16,7 @@
<form action="{% url 'zm_sync' %}"
method="POST" role="form" data-async="#{{ DIVID.INTEGRATION_TAB }}">
{% csrf_token %}
- <button type="submit" class="btn btn-primary btn-control" role="button"
+ <button type="submit" class="btn btn-primary" role="button"
name="action" value="sync" >SYNC</button>
</form>
</div>