Skip to content

Home Information - Your home, your data, organized.

Python

[Feature] Integration Settings Redesign Implementation (#144)

Tony C49331dbf8eec
diff --git a/docs/dev/frontend/icon-system.md b/docs/dev/frontend/icon-system.md
index 46e7ad7b..9cc87c10 100644
--- a/docs/dev/frontend/icon-system.md
+++ b/docs/dev/frontend/icon-system.md
@@ -165,6 +165,8 @@ Use for space-constrained areas with proper accessibility:
## Icon Parameters
+All icon CSS rules are defined in `src/hi/static/css/icons.css`.
+
### Size Options
- `xs` - Extra small (12px)
- `sm` - Small (16px) - **Most common**
@@ -265,4 +267,4 @@ Common icons available in the system (see `hi/apps/common/templatetags/icons.py`
## Related Documentation
- Frontend guidelines: [Frontend Guidelines](frontend-guidelines.md)
- Style guidelines: [Style Guidelines](style-guidelines.md)
-- Template conventions: [Template Conventions](template-conventions.md)
\ No newline at end of file
+- Template conventions: [Template Conventions](template-conventions.md)
diff --git a/src/custom/tests/test_models.py b/src/custom/tests/test_models.py
index f775996b..b0df4c6a 100644
--- a/src/custom/tests/test_models.py
+++ b/src/custom/tests/test_models.py
@@ -1,8 +1,12 @@
+import logging
+
from django.contrib.auth import get_user_model
from django.test import TestCase
from custom.models import CustomUser
+logging.disable(logging.CRITICAL)
+
class UsersManagersTests(TestCase):
diff --git a/src/hi/apps/attribute/edit_context.py b/src/hi/apps/attribute/edit_context.py
index 66f96d13..e2c65831 100644
--- a/src/hi/apps/attribute/edit_context.py
+++ b/src/hi/apps/attribute/edit_context.py
@@ -112,6 +112,10 @@ class AttributePageEditContext:
def update_button_html_id(self) -> str:
return f"{DIVID['ATTR_V2_UPDATE_BTN_ID']}{self.id_suffix}"
+ @property
+ def update_button_label(self) -> str:
+ return 'UPDATE'
+
def to_template_context(self) -> Dict[str, Any]:
return {
"attr_page_context": self,
diff --git a/src/hi/apps/attribute/forms.py b/src/hi/apps/attribute/forms.py
index 4c4b7788..62855e1c 100644
--- a/src/hi/apps/attribute/forms.py
+++ b/src/hi/apps/attribute/forms.py
@@ -8,6 +8,24 @@ from hi.apps.common.utils import is_blank, str_to_bool
from .enums import AttributeType, AttributeValueType
+class RegularAttributeBaseFormSet(forms.BaseInlineFormSet):
+ """Base formset that automatically excludes FILE attributes for regular attribute editing.
+
+ This formset is used across all attribute-enabled modules (Entity, Location, Config)
+ to ensure FILE type attributes are handled separately from regular attributes.
+ """
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ # Apply filtering after parent initialization
+ self.queryset = self.queryset.exclude(value_type_str=str(AttributeValueType.FILE))
+
+ def get_queryset(self):
+ """Override to automatically filter out FILE attributes"""
+ queryset = super().get_queryset()
+ return queryset.exclude(value_type_str=str(AttributeValueType.FILE))
+
+
class AttributeForm( forms.ModelForm ):
"""
Abstract mode form class the corresponds to the abstract model calss
@@ -42,10 +60,21 @@ class AttributeForm( forms.ModelForm ):
@property
def allow_reordering(self):
return self._allow_reordering
+
+ @property
+ def suppress_history(self):
+ return self._suppress_history
+
+ @property
+ def show_secrets(self):
+ return self._show_secrets
def __init__(self, *args, **kwargs):
self._show_as_editable = kwargs.pop( 'show_as_editable', True )
self._allow_reordering = kwargs.pop( 'allow_reordering', True )
+ self._suppress_history = kwargs.pop( 'suppress_history', False )
+ self._show_secrets = kwargs.pop( 'show_secrets', False )
+
instance = kwargs.get('instance')
super().__init__(*args, **kwargs)
diff --git a/src/hi/apps/attribute/response_constants.py b/src/hi/apps/attribute/response_constants.py
index 81d2a834..26089a16 100644
--- a/src/hi/apps/attribute/response_constants.py
+++ b/src/hi/apps/attribute/response_constants.py
@@ -29,7 +29,8 @@ class ResponseFields:
TARGET = "target"
HTML = "html"
MODE = "mode"
-
+ REDIRECT = "redirect"
+
# HTTP Headers
class HTTPHeaders:
diff --git a/src/hi/apps/attribute/response_helpers.py b/src/hi/apps/attribute/response_helpers.py
index 536f7963..f564547c 100644
--- a/src/hi/apps/attribute/response_helpers.py
+++ b/src/hi/apps/attribute/response_helpers.py
@@ -59,6 +59,19 @@ class AttributeResponse:
status=status_code,
)
+
+class AttributeRedirectResponse( HttpResponse ):
+
+ def __init__( self, url, *args, **kwargs ):
+ content = {
+ ResponseFields.REDIRECT: url,
+ }
+ super().__init__(
+ json.dumps( content ),
+ content_type = HTTPHeaders.APPLICATION_JSON,
+ status = 200, # Do not make this a 3xx, else jQuery will handle it
+ )
+
class AttributeResponseBuilder:
"""
diff --git a/src/hi/apps/attribute/templates/attribute/components/edit_content_body.html b/src/hi/apps/attribute/templates/attribute/components/edit_content_body.html
index fc2b4f1a..f107efdb 100644
--- a/src/hi/apps/attribute/templates/attribute/components/edit_content_body.html
+++ b/src/hi/apps/attribute/templates/attribute/components/edit_content_body.html
@@ -1,35 +1,45 @@
{% load icons %}
{% comment %}
Generic V2 Content Body Fragment
-Contains the main content area - used by both initial load and antinode updates
+Contains the main content area - used by both initial load and updates
Includes: owner info (when provided), action bar, and scrollable content
This template works generically for Entity, Location, and future attribute-owning models
by using the AttributeItemEditContext pattern.
{% endcomment %}
+
+<div class="d-flex mt-3">
+ <div class="flex-column">
+ {% block left_column %}
+ {% endblock %}
+ </div>
+ <div class="flex-column flex-grow-1">
+
+
<!-- Sticky Panel: Owner Info + Action Bar (always visible) -->
<div class="{{ DIVID.ATTR_V2_STICKY_PANEL_CLASS }}">
<!-- Basic Owner Information (minimal) - only if owner_form provided -->
- {% if owner_form %}
- {% if owner_form.non_field_errors %}
- <div class="attr-v2-non-field-errors">
- {% for err in owner_form.non_field_errors %}
- <div class="attr-v2-error-item">{{ err }}</div>
- {% endfor %}
- </div>
- {% endif %}
+
+ {% block basic_info %}
+ <div class="attr-v2-basic-info">
+ {% if owner_form %}
+ {% if owner_form.non_field_errors %}
+ <div class="attr-v2-non-field-errors">
+ {% for err in owner_form.non_field_errors %}
+ <div class="attr-v2-error-item">{{ err }}</div>
+ {% endfor %}
+ </div>
+ {% endif %}
- <div class="attr-v2-entity-info">
- {% block basic_info %}
- <div class="{{ DIVID.ATTR_V2_BASIC_INFO_CLASS }}">
+ <div class="attr-v2-owner-fields }}">
{% block owner_fields %}
<!-- Subclasses should override this block to provide owner-specific fields -->
{% endblock %}
</div>
- {% endblock %}
+ {% endif %}
</div>
- {% endif %}
+ {% endblock %}
<div class="{{ DIVID.ATTR_V2_ACTION_BAR_CLASS }}">
<div class="{{ DIVID.ATTR_V2_ACTION_BAR_CONTENT_CLASS }}">
@@ -40,7 +50,8 @@ by using the AttributeItemEditContext pattern.
class="btn btn-primary {{ DIVID.ATTR_V2_UPDATE_BTN_CLASS }}"
name="action"
value="update">
- {% icon "save" size="sm" css_class="hi-icon-left" %}UPDATE
+ {% icon "save" size="sm" css_class="hi-icon-left" %}
+ {{ attr_page_context.update_button_label }}
</button>
<!-- Vertically stacked message areas -->
<div class="attr-v2-message-stack">
@@ -79,14 +90,13 @@ by using the AttributeItemEditContext pattern.
</div>
</div>
</div>
-
<!-- Scrollable Content Area (below sticky panel) -->
<div id="{{ attr_page_context.scrollable_content_html_id }}"
class="{{ DIVID.ATTR_V2_SCROLLABLE_CONTENT_CLASS }}">
<!-- Files Section -->
{% block files_section %}
- {% include "attribute/components/file_grid.html" with file_attributes=file_attributes %}
+ {% include "attribute/components/file_grid.html" with file_attributes=file_attributes %}
{% endblock %}
<!-- Properties Section -->
@@ -99,3 +109,12 @@ by using the AttributeItemEditContext pattern.
{% endblock %}
</div>
+
+
+
+
+ </div>
+</div>
+
+
+
diff --git a/src/hi/apps/attribute/templates/attribute/components/regular_attribute_card.html b/src/hi/apps/attribute/templates/attribute/components/regular_attribute_card.html
index e89f24e6..7447e1e1 100644
--- a/src/hi/apps/attribute/templates/attribute/components/regular_attribute_card.html
+++ b/src/hi/apps/attribute/templates/attribute/components/regular_attribute_card.html
@@ -58,7 +58,7 @@ Individual attribute attribute card with value editing and actions
</button>
{% endif %}
- {% if attribute_form.instance.pk %}
+ {% if attribute_form.instance.pk and not attribute_form.suppress_history %}
<a href="{% attr_history_url attr_item_context attribute_form.instance.pk %}"
class="btn btn-sm btn-outline-secondary {{ DIVID.ATTR_V2_HISTORY_LINK_CLASS }}"
title="View history">
diff --git a/src/hi/apps/attribute/templates/attribute/components/value_types/attribute_value_secret.html b/src/hi/apps/attribute/templates/attribute/components/value_types/attribute_value_secret.html
index d5c2b4e1..85e260cc 100644
--- a/src/hi/apps/attribute/templates/attribute/components/value_types/attribute_value_secret.html
+++ b/src/hi/apps/attribute/templates/attribute/components/value_types/attribute_value_secret.html
@@ -19,6 +19,14 @@ is a secret: that only appears on the new attribute form.
<div class="attr-v2-secret-field">
<div class="{{ DIVID.ATTR_V2_SECRET_INPUT_WRAPPER_CLASS }}">
<!-- Secret field as password input -->
+ {% if attribute_form.show_secrets %}
+ <input type="text"
+ id="{{ attribute_form.value.id_for_label }}"
+ name="{{ attribute_form.value.html_name }}"
+ class="form-control {{ DIVID.ATTR_V2_SECRET_INPUT_CLASS }}"
+ value="{{ attribute_form.value.value|default_if_none:'' }}"
+ {% if attribute_form.instance and not attribute_form.instance.is_editable %}disabled="true"{% endif %} />
+ {% else %}
<input type="password"
id="{{ attribute_form.value.id_for_label }}"
name="{{ attribute_form.value.html_name }}"
@@ -33,6 +41,7 @@ is a secret: that only appears on the new attribute form.
<span class="{{ DIVID.ATTR_V2_ICON_SHOW_CLASS }}">{% icon "eye" size="sm" %}</span>
<span class="{{ DIVID.ATTR_V2_ICON_HIDE_CLASS }}" style="display: none;">{% icon "eye-off" size="sm" %}</span>
</button>
+ {% endif %}
</div>
{% if attribute_form.value.errors %}
<div class="attr-v2-field-errors">
@@ -40,5 +49,5 @@ is a secret: that only appears on the new attribute form.
<div class="attr-v2-error-text">{{ error }}</div>
{% endfor %}
</div>
- {% endif %}
+ {% endif %}
</div>
diff --git a/src/hi/apps/attribute/templates/attribute/modals/attribute_history.html b/src/hi/apps/attribute/templates/attribute/modals/attribute_history.html
deleted file mode 100644
index 63e849eb..00000000
--- a/src/hi/apps/attribute/templates/attribute/modals/attribute_history.html
+++ /dev/null
@@ -1,75 +0,0 @@
-{% extends "modals/action_ok.html" %}
-{% load humanize %}
-
-{% block title_text %}
-Attribute History: {{ attribute.name }}
-{% endblock %}
-
-{% block body %}
-<div class="container-fluid">
- <div class="row mb-3">
- <div class="col-12">
- <p class="text-muted mb-2">
- <strong>Current Value:</strong>
- <span class="badge badge-primary">{{ attribute.value|default:"(empty)" }}</span>
- </p>
- </div>
- </div>
-
- {% if history_records %}
- <div class="row">
- <div class="col-12">
- <div class="table-responsive">
- <table class="table table-sm table-striped">
- <thead class="thead-light">
- <tr>
- <th scope="col">When</th>
- <th scope="col">Value</th>
- <th scope="col">Action</th>
- </tr>
- </thead>
- <tbody>
- {% for record in history_records %}
- <tr>
- <td class="text-nowrap">
- <small>{{ record.changed_datetime|naturaltime }}</small>
- </td>
- <td>
- <span class="badge badge-light">{{ record.value|default:"(empty)" }}</span>
- </td>
- <td>
- {% if record.value != attribute.value %}
- {% if restore_url_name %}
- <form method="POST"
- action="{% url restore_url_name attribute.pk %}"
- data-async="true"
- style="display: inline;">
- {% csrf_token %}
- <input type="hidden" name="history_id" value="{{ record.pk }}">
- <button type="submit" class="btn btn-sm btn-outline-primary">
- Restore
- </button>
- </form>
- {% endif %}
- {% else %}
- <span class="text-muted">
- <small>Current</small>
- </span>
- {% endif %}
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- </div>
- </div>
- {% else %}
- <div class="row">
- <div class="col-12 text-center text-muted">
- <p>No history available for this attribute.</p>
- </div>
- </div>
- {% endif %}
-</div>
-{% endblock %}
\ No newline at end of file
diff --git a/src/hi/apps/attribute/templates/attribute/panes/attribute_form.html b/src/hi/apps/attribute/templates/attribute/panes/attribute_form.html
deleted file mode 100644
index 8fe4799c..00000000
--- a/src/hi/apps/attribute/templates/attribute/panes/attribute_form.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<div class="hi-attribute-list ">
- {{ attribute_formset.management_form }}
-
- {% for attribute_form in attribute_formset %}
- <div class="{{ DIVID.ATTRIBUTE_CONTAINER_CLASS }} my-2">
- {{ attribute_form.id }}
-
- {% if attribute_form.non_field_errors %}
- <div class="non-field-errors">
- {% for err in attribute_form.non_field_errors %}
- <p class="form-error">{{ err }}</p>
- {% endfor %}
- </div>
- {% endif %}
-
- {% if attribute_form.instance.pk %}
-
- {% if attribute_form.instance.value_type.is_file %}
- {% include "attribute/panes/attribute_form_file.html" %}
- {% elif attribute_form.instance.value_type.is_enum %}
- {% include "attribute/panes/attribute_form_enum.html" %}
- {% elif attribute_form.instance.value_type.is_boolean %}
- {% include "attribute/panes/attribute_form_boolean.html" %}
- {% else %}
- {% include "attribute/panes/attribute_form_text.html" %}
- {% endif %}
-
- {% else %}
- {% include "attribute/panes/attribute_form_new.html" %}
- {% endif %}
-
- {{ attribute_form.name.error }}
- {{ attribute_form.value.error }}
- </div>
- {% endfor %}
-</div>
diff --git a/src/hi/apps/attribute/templates/attribute/panes/attribute_form_boolean.html b/src/hi/apps/attribute/templates/attribute/panes/attribute_form_boolean.html
deleted file mode 100644
index bbf3f90c..00000000
--- a/src/hi/apps/attribute/templates/attribute/panes/attribute_form_boolean.html
+++ /dev/null
@@ -1,29 +0,0 @@
-{% load common_template_helpers %}
-{% load icons %}
-<input type="hidden" id="{{ attribute_form.name.id_for_label }}"
- name="{{ attribute_form.name.html_name }}"
- value="{{ attribute_form.instance.name }}" />
-<input type="hidden" name="{{ attribute_form.value.html_name }}" value="false" />
-<div class="input-group align-items-center" >
- <input type="checkbox" name="{{ attribute_form.value.html_name }}"
- id="{{ attribute_form.value.id_for_label }}"
- {% if attribute_form.value.value %}checked="on"{% endif %}
- data-original-value="{% if attribute_form.value.value %}true{% else %}false{% endif %}" >
- <label for="{{ attribute_form.value.id_for_label }}" class="pl-2 mb-0">{{ attribute_form.name.value }}</label>
- <div class="input-group-append ml-auto">
- {% if history_url_name %}
- <a href="{% url history_url_name attribute_form.instance.pk %}"
- class="btn btn-outline-secondary btn-sm attribute-history-btn"
- data-async="modal"
- title="View attribute history">
- {% icon "history" size="sm" aria_label="View history" %}
- </a>
- {% endif %}
- </div>
-</div>
-
-{% if attribute_form.show_as_editable and attribute_form.instance.is_editable and attribute_form.instance.attribute_type.can_delete %}
-<div class="">
- {{ attribute_form.DELETE }} Delete
-</div>
-{% endif %}
diff --git a/src/hi/apps/attribute/templates/attribute/panes/attribute_form_enum.html b/src/hi/apps/attribute/templates/attribute/panes/attribute_form_enum.html
deleted file mode 100644
index 31297748..00000000
--- a/src/hi/apps/attribute/templates/attribute/panes/attribute_form_enum.html
+++ /dev/null
@@ -1,39 +0,0 @@
-{% load common_template_helpers %}
-{% load icons %}
-<input type="hidden" id="{{ attribute_form.name.id_for_label }}"
- name="{{ attribute_form.name.html_name }}"
- value="{{ attribute_form.instance.name }}" />
-<div class="input-group" >
- <div class="input-group-prepend" >
- <span class="input-group-text" >{{ attribute_form.instance.name }}</span>
- </div>
- {% with attribute_form.instance.choices as choices_list %}
- <select
- id="{{ attribute_form.value.id_for_label }}"
- {% if attribute_form.instance and not attribute_form.instance.is_editable %}disabled="true"{% endif %}
- name="{{ attribute_form.value.html_name }}"
- data-original-value="{{ attribute_form.value.value|default_if_none:'' }}" >
- {% for value, label in choices_list %}
- <option value="{{ value }}" {% if attribute_form.value.value == value %}selected="true"{% endif %}>
- {{ label }}
- </option>
- {% endfor %}
- </select>
- {% endwith %}
- <div class="input-group-append">
- {% if history_url_name %}
- <a href="{% url history_url_name attribute_form.instance.pk %}"
- class="btn btn-outline-secondary btn-sm attribute-history-btn"
- data-async="modal"
- title="View attribute history">
- {% icon "history" size="sm" aria_label="View history" %}
- </a>
- {% endif %}
- </div>
-</div>
-
-{% if attribute_form.show_as_editable and attribute_form.instance.is_editable and attribute_form.instance.attribute_type.can_delete %}
-<div class="">
- {{ attribute_form.DELETE }} Delete
-</div>
-{% endif %}
diff --git a/src/hi/apps/attribute/templates/attribute/panes/attribute_form_field_value.html b/src/hi/apps/attribute/templates/attribute/panes/attribute_form_field_value.html
deleted file mode 100644
index ccb89732..00000000
--- a/src/hi/apps/attribute/templates/attribute/panes/attribute_form_field_value.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<div>
- <textarea rows="1" cols="40"
- id="{{ attribute_form.value.id_for_label }}"
- {% if attribute_form.instance and not attribute_form.instance.is_editable %}disabled="true"{% endif %}
- name="{{ attribute_form.value.html_name }}"
- data-original-value="{{ attribute_form.value.value|default_if_none:'' }}">{{ attribute_form.value.value|default_if_none:'' }}</textarea>
-</div>
-<div class="form-error text-danger" >{{ attribute_form.value.errors }}</div>
-<script type="text/javascript">
-(function() {
- let textareaSelector = '#{{ attribute_form.value.id_for_label }}';
- autosize($(textareaSelector));
-
- // In case this is in a modal, need to wait for autosize to work.
- $('.modal').on('shown.bs.modal', function () {
- autosize.update($(textareaSelector));
- });
- })();
-
-</script>
diff --git a/src/hi/apps/attribute/templates/attribute/panes/attribute_form_file.html b/src/hi/apps/attribute/templates/attribute/panes/attribute_form_file.html
deleted file mode 100644
index 486c58bd..00000000
--- a/src/hi/apps/attribute/templates/attribute/panes/attribute_form_file.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<input type="hidden" id="{{ attribute_form.name.id_for_label }}"
- name="{{ attribute_form.name.html_name }}"
- value="{{ attribute_form.instance.name }}" />
-
-<div class="input-group">
- <div class="input-group-prepend">
- <a href="{{ attribute_form.instance.file_value.url }}"
- class="btn btn-sm btn-primary"
- {% if attribute_form.instance.file_mime_type %}type="{{ attribute_form.instance.file_mime_type }}"{% endif %}
- target="_blank">
- VIEW
- </a>
- </div>
- {% include "attribute/panes/attribute_form_field_value.html" %}
- {% if attribute_form.show_as_editable and attribute_form.instance.is_editable and attribute_form.instance.attribute_type.can_delete %}
- <div class="input-group-append">
- <span class="pl-3" >{{ attribute_form.DELETE }} Delete</span>
- </div>
- {% endif %}
-</div>
diff --git a/src/hi/apps/attribute/templates/attribute/panes/attribute_form_new.html b/src/hi/apps/attribute/templates/attribute/panes/attribute_form_new.html
deleted file mode 100644
index 76c79322..00000000
--- a/src/hi/apps/attribute/templates/attribute/panes/attribute_form_new.html
+++ /dev/null
@@ -1,64 +0,0 @@
-{% load common_template_helpers %}
-{% load icons %}
-{% generate_uuid as unique_id %}
-<div class="my-2">
- <a class="" data-toggle="collapse" href="#hi-attribute-new-{{ unique_id }}"
- role="button" aria-expanded="false" aria-controls="hi-attribute-new-{{ unique_id }}">
- {% icon "plus" size="sm" css_class="hi-icon-left" %} Add New Attribute
- </a>
-</div>
-<div class="collapse my-2" id="hi-attribute-new-{{ unique_id }}">
-
- {% for hidden in attribute_form.hidden_fields %}
- {{ hidden }}
- {% endfor %}
-
- {% if attribute_form.non_field_errors %}
- <div class="non-field-errors">
- {% for err in attribute_form.non_field_errors %}
- <p class="form-error text-danger">ERROR: {{ err }}</p>
- {% endfor %}
- </div>
- {% endif %}
-
- <div class="form-group" >
- <label for="{{ attribute_form.name.id_for_label }}"><em>New {{ attribute_form.name.label }}</em></label>
- <input type="text"
- id="{{ attribute_form.name.id_for_label }}"
- class="form-control"
- name="{{ attribute_form.name.html_name }}"
- value="{{ attribute_form.name.value|default_if_none:'' }}">
- <div class="form-error text-danger" >{{ attribute_form.name.errors }}</div>
- </div>
- <div class="form-group">
- <label for="{{ attribute_form.value.id_for_label }}"><em>New {{ attribute_form.value.label }}</em></label>
- <textarea rows="2" cols="40"
- id="{{ attribute_form.value.id_for_label }}"
- class="form-control"
- name="{{ attribute_form.value.html_name }}"
- >{{ attribute_form.value.value|default_if_none:'' }}</textarea>
- <div class="form-error text-danger" >{{ attribute_form.value.errors }}</div>
-
- </div>
-
-<script type="text/javascript">
-(function() {
- let textareaSelector = '#{{ attribute_form.value.id_for_label }}';
- autosize($(textareaSelector));
-
- // In case this is in a modal, need to wait for autosize to work.
- $('.modal').on('shown.bs.modal', function () {
- autosize.update($(textareaSelector));
- });
- })();
-
-</script>
-
- <span>
- <input type="checkbox" name="{{ attribute_form.secret.html_name }}"
- id="{{ attribute_form.secret.id_for_label }}"
- {% if attribute_form.secret.value %}checked="on"{% endif %} >
- <label for="{{ attribute_form.secret.id_for_label }}">Mark as secret</label>
- </span>
- {{ attribute_form.secret.errors }}
-</div>
diff --git a/src/hi/apps/attribute/templates/attribute/panes/attribute_form_text.html b/src/hi/apps/attribute/templates/attribute/panes/attribute_form_text.html
deleted file mode 100644
index 3e076bc3..00000000
--- a/src/hi/apps/attribute/templates/attribute/panes/attribute_form_text.html
+++ /dev/null
@@ -1,41 +0,0 @@
-{% load icons %}
-<input type="hidden" id="{{ attribute_form.name.id_for_label }}"
- name="{{ attribute_form.name.html_name }}"
- value="{{ attribute_form.instance.name }}" />
-<div class="input-group" >
- <div class="input-group-prepend" >
- <span class="input-group-text" >{{ attribute_form.instance.name }}</span>
- </div>
- {% if attribute_form.instance.value_type.is_secret %}
- <input type="password"
- id="{{ attribute_form.value.id_for_label }}"
- {% if attribute_form.instance and not attribute_form.instance.is_editable %}disabled="true"{% endif %}
- name="{{ attribute_form.value.html_name }}"
- value="{{ attribute_form.value.value|default_if_none:'' }}"
- data-original-value="{{ attribute_form.value.value|default_if_none:'' }}">
- <span class="pl-2">
- <input type="checkbox" name="{{ attribute_form.value.html_name }}-show"
- id="{{ attribute_form.value.id_for_label }}-show"
- onclick="Hi.togglePasswordField( this );">
- <label for="{{ attribute_form.value.id_for_label }}-show">Show</label>
- </span>
- {% else %}
- {% include "attribute/panes/attribute_form_field_value.html" %}
- {% endif %}
- <div class="input-group-append">
- {% if history_url_name %}
- <a href="{% url history_url_name attribute_form.instance.pk %}"
- class="btn btn-outline-secondary btn-sm attribute-history-btn"
- data-async="modal"
- title="View attribute history">
- {% icon "history" size="sm" aria_label="View history" %}
- </a>
- {% endif %}
- </div>
-</div>
-
-{% if attribute_form.show_as_editable and attribute_form.instance.is_editable and attribute_form.instance.attribute_type.can_delete %}
-<div class="">
- {{ attribute_form.DELETE }} Delete
-</div>
-{% endif %}
diff --git a/src/hi/apps/attribute/templates/attribute/panes/attribute_upload_form.html b/src/hi/apps/attribute/templates/attribute/panes/attribute_upload_form.html
deleted file mode 100644
index 162f3a4a..00000000
--- a/src/hi/apps/attribute/templates/attribute/panes/attribute_upload_form.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{% load icons %}
-<label for="{{ attribute_upload_form.file_value.id_for_label }}"
- class="btn btn-primary btn-control">
- {% icon "upload" size="sm" css_class="hi-icon-left" %}UPLOAD FILE
-</label>
-<input type="file" name="{{ attribute_upload_form.file_value.html_name }}"
- id="{{ attribute_upload_form.file_value.id_for_label }}"
- style="display: none;"
- onchange="Hi.submitForm( this );">
-
diff --git a/src/hi/apps/attribute/view_mixins.py b/src/hi/apps/attribute/view_mixins.py
index b5866108..f5e145f0 100644
--- a/src/hi/apps/attribute/view_mixins.py
+++ b/src/hi/apps/attribute/view_mixins.py
@@ -119,6 +119,7 @@ class AttributeEditViewMixin( AttributeEditCommonMixin ):
edit_form_data = edit_form_data,
request = request,
)
+ return
def create_initial_template_context(
self,
diff --git a/src/hi/apps/attribute/views.py b/src/hi/apps/attribute/views.py
deleted file mode 100644
index c898fbaf..00000000
--- a/src/hi/apps/attribute/views.py
+++ /dev/null
@@ -1,114 +0,0 @@
-from django.views.generic import View
-
-import hi.apps.common.antinode as antinode
-from hi.views import page_not_found_response
-from hi.hi_async_view import HiModalView
-
-
-class BaseAttributeHistoryView(HiModalView):
- """
- Abstract base view for displaying attribute history in a modal.
- Subclasses must implement get_attribute_model_class(), get_history_url_name(), and get_restore_url_name().
- """
-
- def get_template_name(self):
- return 'attribute/modals/attribute_history.html'
-
- def get_attribute_model_class(self):
- """
- Return the concrete attribute model class for this view.
- Must be implemented by subclasses.
- """
- raise NotImplementedError(
- f"{self.__class__.__name__} must implement get_attribute_model_class()"
- )
-
- def get_history_url_name(self):
- """
- Return the URL name for the history view.
- Must be implemented by subclasses.
- """
- raise NotImplementedError(
- f"{self.__class__.__name__} must implement get_history_url_name()"
- )
-
- def get_restore_url_name(self):
- """
- Return the URL name for the restore view.
- Must be implemented by subclasses.
- """
- raise NotImplementedError(
- f"{self.__class__.__name__} must implement get_restore_url_name()"
- )
-
- def get(self, request, attribute_id, *args, **kwargs):
- model_class = self.get_attribute_model_class()
-
- try:
- # Get the specific attribute using the concrete model class
- attribute = model_class.objects.get(pk=attribute_id)
- except model_class.DoesNotExist:
- return page_not_found_response(request, "Attribute not found.")
-
- # Get history records for this attribute
- history_model_class = attribute._get_history_model_class()
- if history_model_class:
- history_records = history_model_class.objects.filter(
- attribute=attribute
- ).order_by('-changed_datetime')[:500] # High limit for safety, pagination TBD
- else:
- history_records = []
-
- context = {
- 'attribute': attribute,
- 'history_records': history_records,
- 'history_url_name': self.get_history_url_name(),
- 'restore_url_name': self.get_restore_url_name(),
- }
-
- return self.modal_response(request, context)
-
-
-class BaseAttributeRestoreView(View):
- """
- Abstract base view for restoring attribute values from history.
- Subclasses must implement get_attribute_model_class().
- """
-
- def get_attribute_model_class(self):
- """
- Return the concrete attribute model class for this view.
- Must be implemented by subclasses.
- """
- raise NotImplementedError(
- f"{self.__class__.__name__} must implement get_attribute_model_class()"
- )
-
- def post(self, request, attribute_id, *args, **kwargs):
- model_class = self.get_attribute_model_class()
-
- try:
- attribute = model_class.objects.get(pk=attribute_id)
- except model_class.DoesNotExist:
- return page_not_found_response(request, "Attribute not found.")
-
- history_id = request.POST.get('history_id')
- if not history_id:
- return page_not_found_response(request, "History record not specified.")
-
- # Get the history record to restore from
- history_model_class = attribute._get_history_model_class()
- if not history_model_class:
- return page_not_found_response(request, "No history available for this attribute type.")
-
- try:
- history_record = history_model_class.objects.get(pk=history_id, attribute=attribute)
- except history_model_class.DoesNotExist:
- return page_not_found_response(request, "History record not found.")
-
- # Restore the value from the history record
- attribute.value = history_record.value
- attribute.save() # This will create a new history record
-
- # Return success response that triggers page reload
- return antinode.refresh_response()
diff --git a/src/hi/apps/collection/templates/collection/edit/panes/collection_manage_items.html b/src/hi/apps/collection/templates/collection/edit/panes/collection_manage_items.html
index a1ea318c..c63f0c88 100644
--- a/src/hi/apps/collection/templates/collection/edit/panes/collection_manage_items.html
+++ b/src/hi/apps/collection/templates/collection/edit/panes/collection_manage_items.html
@@ -24,6 +24,6 @@
{% endfor %}
</div>
{% empty %}
- <div><em>No items defined.</em></div>
+ {% include "edit/panes/no_entities_message.html" %}
{% endfor %}
</div>
diff --git a/src/hi/apps/common/templates/common/modals/processing_result.html b/src/hi/apps/common/templates/common/modals/processing_result.html
index e0e0a448..d777ab51 100644
--- a/src/hi/apps/common/templates/common/modals/processing_result.html
+++ b/src/hi/apps/common/templates/common/modals/processing_result.html
@@ -1,4 +1,4 @@
-{% extends "modals/action_ok.html" %}
+{% extends "modals/action_refresh.html" %}
{% block title_text %}
{{ processing_result.title }}
diff --git a/src/hi/apps/common/templatetags/icons.py b/src/hi/apps/common/templatetags/icons.py
index f5e6f9bf..a8081572 100644
--- a/src/hi/apps/common/templatetags/icons.py
+++ b/src/hi/apps/common/templatetags/icons.py
@@ -42,7 +42,14 @@ AVAILABLE_ICONS = {
'close',
'upload',
'eye',
- 'eye-off'
+ 'eye-off',
+ 'move',
+ 'zoom',
+ 'rotate',
+ 'path',
+ 'info-circle',
+ 'rocket',
+ 'question-circle'
}
# Define available sizes
diff --git a/src/hi/apps/common/tests/test_model_fields.py b/src/hi/apps/common/tests/test_model_fields.py
index 4b1ee2d5..fc88bb06 100644
--- a/src/hi/apps/common/tests/test_model_fields.py
+++ b/src/hi/apps/common/tests/test_model_fields.py
@@ -1,6 +1,7 @@
"""
Tests for custom Django model fields.
"""
+import logging
from django.core.exceptions import ValidationError
from django.db import models
from django.test import TestCase
@@ -8,6 +9,8 @@ from django.test import TestCase
from hi.apps.common.enums import LabeledEnum
from hi.apps.common.model_fields import LabeledEnumField, NullableLabeledEnumField
+logging.disable(logging.CRITICAL)
+
class TestEnum(LabeledEnum):
"""Test enum for field testing."""
diff --git a/src/hi/apps/config/forms.py b/src/hi/apps/config/forms.py
index 9c0bbfb9..369a941f 100644
--- a/src/hi/apps/config/forms.py
+++ b/src/hi/apps/config/forms.py
@@ -1,6 +1,6 @@
from django import forms
-from hi.apps.attribute.forms import AttributeForm
+from hi.apps.attribute.forms import AttributeForm, RegularAttributeBaseFormSet
from .models import Subsystem, SubsystemAttribute
@@ -10,10 +10,11 @@ class SubsystemAttributeForm( AttributeForm ):
model = SubsystemAttribute
-SubsystemAttributeFormSet = forms.inlineformset_factory(
+SubsystemAttributeRegularFormSet = forms.inlineformset_factory(
Subsystem,
SubsystemAttribute,
form = SubsystemAttributeForm,
+ formset = RegularAttributeBaseFormSet,
extra = 0,
max_num = 100,
absolute_max = 100,
diff --git a/src/hi/apps/config/subsystem_attribute_edit_context.py b/src/hi/apps/config/subsystem_attribute_edit_context.py
index a08f2d6f..d425b416 100644
--- a/src/hi/apps/config/subsystem_attribute_edit_context.py
+++ b/src/hi/apps/config/subsystem_attribute_edit_context.py
@@ -9,7 +9,7 @@ from hi.apps.attribute.edit_context import AttributeItemEditContext, AttributePa
from hi.apps.attribute.forms import AttributeUploadForm
from hi.apps.attribute.models import AttributeModel
-from .forms import SubsystemAttributeFormSet
+from .forms import SubsystemAttributeRegularFormSet
from .models import Subsystem, SubsystemAttribute
@@ -57,7 +57,7 @@ class SubsystemAttributeItemEditContext(AttributeItemEditContext):
return SubsystemAttribute
def create_owner_form( self, form_data : Optional[ Dict[str, Any] ] = None ) -> ModelForm:
- # No viewable/editable Subsystem properties.
+ # No viewable/editable Subsystem model properties.
return None
def create_attribute_model( self ) -> AttributeModel:
@@ -65,7 +65,7 @@ class SubsystemAttributeItemEditContext(AttributeItemEditContext):
def create_regular_attributes_formset(
self, form_data : Optional[ Dict[str, Any] ] = None ) -> BaseInlineFormSet:
- return SubsystemAttributeFormSet(
+ return SubsystemAttributeRegularFormSet(
form_data,
instance = self.subsystem,
prefix = self.formset_prefix,
diff --git a/src/hi/apps/config/templates/config/panes/subsystem_edit_content_body.html b/src/hi/apps/config/templates/config/panes/subsystem_edit_content_body.html
index ce452d40..6eaffc81 100644
--- a/src/hi/apps/config/templates/config/panes/subsystem_edit_content_body.html
+++ b/src/hi/apps/config/templates/config/panes/subsystem_edit_content_body.html
@@ -3,10 +3,12 @@
{% load attribute_extras %}
{% comment %}
Config Settings Content Body Fragment
-Contains the main content area - used by both initial load and antinode updates
+Contains the main content area - used by both initial load and updates
This is what gets replaced on form submission
{% endcomment %}
+{% block basic_info %}{% endblock %}
+
{% block additional_actions %}
<h4 class="mb-0 text-muted">System Settings</h4>
{% endblock %}
@@ -17,50 +19,45 @@ This is what gets replaced on form submission
{% block files_section %}{% endblock %}
+{% block left_column %}
+<nav class="nav flex-column hi-vertical-nav mr-3" id="subsystemTabs" role="tablist">
+ {% for multi_edit_form_data in multi_edit_form_data_list %}
+ <a class="nav-link hi-vertical-nav-link {% if selected_subsystem_id == multi_edit_form_data.owner.id|stringformat:'s' %}active{% endif %}"
+ id="subsystem-{{ multi_edit_form_data.owner.id }}-tab"
+ data-toggle="tab"
+ data-subsystem-id="{{ multi_edit_form_data.owner.id }}"
+ data-config-settings-url="{% url 'config_settings' %}"
+ href="#subsystem-{{ multi_edit_form_data.owner.id }}-panel"
+ role="tab"
+ aria-controls="subsystem-{{ multi_edit_form_data.owner.id }}-panel"
+ aria-selected="{% if selected_subsystem_id == multi_edit_form_data.owner.id|stringformat:'s' %}true{% else %}false{% endif %}"
+ onclick="window.Hi.attr.updateFormAction('{% url 'config_settings' subsystem_id=multi_edit_form_data.owner.id %}', '{{ attr_page_context.container_html_id }}')">
+ {{ multi_edit_form_data.owner.name }}
+ {% if multi_edit_form_data.error_count > 0 %}
+ <span class="badge badge-danger ml-1">{{ multi_edit_form_data.error_count }}</span>
+ {% endif %}
+ </a>
+ {% endfor %}
+</nav>
+{% endblock %}
+
{% block properties_section %}
<!-- Vertical Tabbed Subsystem Interface -->
-<div class="d-flex mt-3">
- <!-- Left Column: Vertical Navigation -->
- <div class="flex-column">
- <nav class="nav flex-column" id="subsystemTabs" role="tablist">
- {% for multi_edit_form_data in multi_edit_form_data_list %}
- <a class="nav-link {% if selected_subsystem_id == multi_edit_form_data.owner.id|stringformat:'s' %}active{% endif %}"
- id="subsystem-{{ multi_edit_form_data.owner.id }}-tab"
- data-toggle="tab"
- data-subsystem-id="{{ multi_edit_form_data.owner.id }}"
- data-config-settings-url="{% url 'config_settings' %}"
- href="#subsystem-{{ multi_edit_form_data.owner.id }}-panel"
- role="tab"
- aria-controls="subsystem-{{ multi_edit_form_data.owner.id }}-panel"
- aria-selected="{% if selected_subsystem_id == multi_edit_form_data.owner.id|stringformat:'s' %}true{% else %}false{% endif %}"
- onclick="window.Hi.attr.updateFormAction('{% url 'config_settings' subsystem_id=multi_edit_form_data.owner.id %}', '{{ attr_page_context.container_html_id }}')">
- {{ multi_edit_form_data.owner.name }}
- {% if multi_edit_form_data.error_count > 0 %}
- <span class="badge badge-danger ml-1">{{ multi_edit_form_data.error_count }}</span>
- {% endif %}
- </a>
- {% endfor %}
- </nav>
- </div>
-
- <!-- Right Column: Tab Content -->
- <div class="flex-column flex-grow-1">
- <div class="tab-content" id="subsystemTabContent">
- {% for multi_edit_form_data in multi_edit_form_data_list %}
- <div class="tab-pane fade {% if selected_subsystem_id == multi_edit_form_data.owner.id|stringformat:'s' %}show active{% endif %}"
- id="subsystem-{{ multi_edit_form_data.owner.id }}-panel"
- role="tabpanel"
- aria-labelledby="subsystem-{{ multi_edit_form_data.owner.id }}-tab">
-
- <!-- Subsystem content using existing attribute editing components -->
- <div class="py-3">
- {% include "attribute/components/regular_attribute_list.html" with regular_attributes_formset=multi_edit_form_data.formset attr_item_context=multi_edit_form_data.context title=multi_edit_form_data.owner.name%}
- </div>
-
- </div>
- {% endfor %}
+<div class="tab-content" id="subsystemTabContent">
+
+ {% for multi_edit_form_data in multi_edit_form_data_list %}
+ <div class="tab-pane fade {% if selected_subsystem_id == multi_edit_form_data.owner.id|stringformat:'s' %}show active{% endif %}"
+ id="subsystem-{{ multi_edit_form_data.owner.id }}-panel"
+ role="tabpanel"
+ aria-labelledby="subsystem-{{ multi_edit_form_data.owner.id }}-tab">
+
+ <!-- Subsystem content using existing attribute editing components -->
+ <div class="py-3">
+ {% include "attribute/components/regular_attribute_list.html" with regular_attributes_formset=multi_edit_form_data.formset attr_item_context=multi_edit_form_data.context %}
</div>
+
</div>
-</div>
+ {% endfor %}
+</div>
{% endblock %}
diff --git a/src/hi/apps/config/templates/config/panes/system_settings.html b/src/hi/apps/config/templates/config/panes/system_settings.html
index 8e8b986f..12232af3 100644
--- a/src/hi/apps/config/templates/config/panes/system_settings.html
+++ b/src/hi/apps/config/templates/config/panes/system_settings.html
@@ -14,7 +14,7 @@ Uses existing attr-v2-* components for consistency with Entity/Location editing.
class="{{ DIVID.ATTR_V2_FORM_CLASS }} form">
{% csrf_token %}
- <!-- Main content wrapper for antinode updates -->
+ <!-- Main content wrapper for updates -->
<div id="{{ attr_page_context.content_html_id }}"
class="{{ DIVID.ATTR_V2_CONTENT_CLASS }}">
{% include "config/panes/subsystem_edit_content_body.html" %}
diff --git a/src/hi/apps/config/tests/test_config_multi_attribute_framework.py b/src/hi/apps/config/tests/test_config_multi_attribute_framework.py
index 67adf4b6..8ac368a7 100644
--- a/src/hi/apps/config/tests/test_config_multi_attribute_framework.py
+++ b/src/hi/apps/config/tests/test_config_multi_attribute_framework.py
@@ -4,6 +4,7 @@ Multi-instance attribute editing framework tests for config module.
These tests are specifically designed for the config module's multi-edit architecture,
where multiple subsystems are edited simultaneously.
"""
+import logging
from typing import List, Dict, Any
from hi.testing.base_test_case import MockRequest, MockSession
@@ -31,6 +32,8 @@ from hi.apps.config.subsystem_attribute_edit_context import (
)
from hi.apps.config.tests.synthetic_data import SubsystemAttributeSyntheticData
+logging.disable(logging.CRITICAL)
+
class SubsystemMultiAttributeEditFormHandlerTest(AttributeMultiEditFormHandlerTestMixin, BaseTestCase):
"""Test AttributeEditFormHandler with Subsystem-specific multi-edit implementations."""
diff --git a/src/hi/apps/config/views.py b/src/hi/apps/config/views.py
index ce2f5f1d..04717114 100644
--- a/src/hi/apps/config/views.py
+++ b/src/hi/apps/config/views.py
@@ -165,7 +165,7 @@ class ConfigSettingsView( ConfigPageView,
class SubsystemAttributeHistoryInlineView( View, AttributeMultiEditViewMixin ):
def get(self, request, subsystem_id, attribute_id, *args, **kwargs):
- # Validate that the attribute belongs to this entity for security
+ # Validate that the attribute belongs to this subsystem for security
try:
attribute = SubsystemAttribute.objects.select_related('subsystem').get(
pk = attribute_id, subsystem_id = subsystem_id )
@@ -188,6 +188,7 @@ class SubsystemAttributeRestoreInlineView( View,
"""View for restoring SubsystemAttribute values from history inline."""
def get(self, request, subsystem_id, attribute_id, history_id, *args, **kwargs):
+ """ Need to do restore in a GET since nested in main form and cannot have a form in a form """
try:
attribute = SubsystemAttribute.objects.select_related('subsystem').get(
pk = attribute_id, subsystem_id = subsystem_id
diff --git a/src/hi/apps/edit/templates/edit/modals/help.html b/src/hi/apps/edit/templates/edit/modals/help.html
index 69ffd9ec..8c8e2397 100644
--- a/src/hi/apps/edit/templates/edit/modals/help.html
+++ b/src/hi/apps/edit/templates/edit/modals/help.html
@@ -1,4 +1,7 @@
{% extends "modals/action_ok.html" %}
+{% load icons %}
+
+{% block modal_dialog_class %}hi-modal-dialog-700{% endblock %}
{% block title_text %}
Editing Help
@@ -6,54 +9,143 @@ Editing Help
{% block body %}
-<div class="h3">Moving</div>
-<p>
- <ul>
- <li>Left mouse click and drag</li>
- <li>One finger drag</li>
- </ul>
-</p>
-
-<div class="h3">Scaling</div>
-<p>
- <ul>
- <li>Mouse wheel</li>
- <li>"+" key (zoom in)</li>
- <li>"-" key (zoom out)</li>
- <li>"s" key and drag</li>
- <li>Two finger pinch/spread</li>
- <li>"ESC" key to end</li>
- </ul>
-</p>
-
-<div class="h3">Rotating</div>
-<p>
- <ul>
- <li>"r" key and drag</li>
- <li>"r" key and mouse wheel</li>
- <li>"r" then "+" key (rotate right)</li>
- <li>"r" then "-" key (rotate left)</li>
- <li>Two finger rotate</li>
- <li>"ESC" key to end</li>
- </ul>
-</p>
-
-<div class="h3">Path Editing</div>
-<p>
- <ul>
- <li>Click to select (area, node or edge)</li>
- <li>"i" or "INSERT" key to insert path node </li>
- <li>"x", "DEL" or "BACKSPACE" key to delete path node</li>
- <li>"a" or "+" key - add new path node or path segment</li>
- <li>"ESC" key to end path editing</li>
- </ul>
-</p>
-
-<div class="h3">Notes</div>
-<p>
- <ul>
- <li>Background edits of view only saved when the "View" editing pane is showing.</li>
- </ul>
-</p>
+<div class="editing-help-guide">
+ <div class="guide-header">
+ {% icon "edit" size="lg" color="primary" %}
+ <h5>Quick Reference Guide</h5>
+ </div>
+
+ <div class="editing-help-categories">
+ <!-- Moving -->
+ <div class="help-category">
+ <div class="category-header">
+ <div class="category-icon">
+ {% icon "move" size="sm" color="primary" %}
+ </div>
+ <h6 class="category-title">Moving</h6>
+ </div>
+ <ul class="help-actions">
+ <li>
+ <span class="action-method">Click & Drag</span>
+ <span class="action-description">Left mouse button</span>
+ </li>
+ <li>
+ <span class="action-method">Touch Drag</span>
+ <span class="action-description">One finger drag</span>
+ </li>
+ </ul>
+ </div>
+
+ <!-- Scaling -->
+ <div class="help-category">
+ <div class="category-header">
+ <div class="category-icon">
+ {% icon "zoom" size="sm" color="primary" %}
+ </div>
+ <h6 class="category-title">Scaling</h6>
+ </div>
+ <ul class="help-actions">
+ <li>
+ <span class="action-method">Mouse Wheel</span>
+ <span class="action-description">Scroll to zoom</span>
+ </li>
+ <li>
+ <span class="action-method">+ / -</span>
+ <span class="action-description">Zoom in/out</span>
+ </li>
+ <li>
+ <span class="action-method">S + Drag</span>
+ <span class="action-description">Scale mode</span>
+ </li>
+ <li>
+ <span class="action-method">Pinch</span>
+ <span class="action-description">Two finger gesture</span>
+ </li>
+ <li>
+ <span class="action-method">ESC</span>
+ <span class="action-description">End scale mode</span>
+ </li>
+ </ul>
+ </div>
+
+ <!-- Rotating -->
+ <div class="help-category">
+ <div class="category-header">
+ <div class="category-icon">
+ {% icon "rotate" size="sm" color="primary" %}
+ </div>
+ <h6 class="category-title">Rotating</h6>
+ </div>
+ <ul class="help-actions">
+ <li>
+ <span class="action-method">R + Drag</span>
+ <span class="action-description">Rotate mode</span>
+ </li>
+ <li>
+ <span class="action-method">R + Wheel</span>
+ <span class="action-description">Rotate with mouse</span>
+ </li>
+ <li>
+ <span class="action-method">R + +/-</span>
+ <span class="action-description">Rotate right/left</span>
+ </li>
+ <li>
+ <span class="action-method">Two Finger</span>
+ <span class="action-description">Touch rotate</span>
+ </li>
+ <li>
+ <span class="action-method">ESC</span>
+ <span class="action-description">End rotate mode</span>
+ </li>
+ </ul>
+ </div>
+
+ <!-- Path Editing -->
+ <div class="help-category">
+ <div class="category-header">
+ <div class="category-icon">
+ {% icon "path" size="sm" color="primary" %}
+ </div>
+ <h6 class="category-title">Path Editing</h6>
+ </div>
+ <ul class="help-actions">
+ <li>
+ <span class="action-method">Click</span>
+ <span class="action-description">Select area</span>
+ </li>
+ <li>
+ <span class="action-method">Drag Points</span>
+ <span class="action-description">Change shape</span>
+ </li>
+ <li>
+ <span class="action-method">I/INSERT</span>
+ <span class="action-description">Insert path node</span>
+ </li>
+ <li>
+ <span class="action-method">X/DEL</span>
+ <span class="action-description">Delete path node</span>
+ </li>
+ <li>
+ <span class="action-method">A/+</span>
+ <span class="action-description">Add new segment</span>
+ </li>
+ <li>
+ <span class="action-method">ESC</span>
+ <span class="action-description">End path editing</span>
+ </li>
+ </ul>
+ </div>
+ </div>
+
+ <div class="help-note">
+ <div class="note-header">
+ {% icon "info-circle" size="sm" color="secondary" %}
+ <h6 class="note-title">Important Note</h6>
+ </div>
+ <p class="note-content">
+ Background edits are only saved when the "View" editing pane is showing.
+ </p>
+ </div>
+</div>
{% endblock %}
diff --git a/src/hi/apps/edit/templates/edit/panes/no_entities_message.html b/src/hi/apps/edit/templates/edit/panes/no_entities_message.html
new file mode 100644
index 00000000..38ef5134
--- /dev/null
+++ b/src/hi/apps/edit/templates/edit/panes/no_entities_message.html
@@ -0,0 +1,39 @@
+{% load icons %}
+<div class="getting-started-guide">
+ <div class="guide-header">
+ {% icon "rocket" size="lg" color="primary" %}
+ <h5>Getting Started</h5>
+ </div>
+
+ <div class="guide-content">
+ <div class="mode-explanation">
+ <span class="badge badge-info">Edit Mode</span>
+ <p class="small mb-0">You're in editing mode to set up your home layout.</p>
+ </div>
+
+ <div class="steps">
+ <div class="step">
+ <div class="step-number">1</div>
+ <div class="step-content">
+ <div><strong>Add Your First Item</strong></div>
+ <p class="small mb-0">Click "Add New Item" above to create your first home item.</p>
+ </div>
+ </div>
+
+ <div class="step">
+ <div class="step-number">2</div>
+ <div class="step-content">
+ <div><strong>Switch to View Mode</strong></div>
+ <p class="small mb-0">Click "Exit Edit" above when done to start managing your home's information.</p>
+ </div>
+ </div>
+ </div>
+
+ <div class="help-hint">
+ {% icon "question-circle" size="sm" color="muted" %}
+ <small>Use "Editing Help" below for layout tips</small>
+ </div>
+ </div>
+</div>
+
+
diff --git a/src/hi/apps/entity/edit/tests/test_entity_type_transitions.py b/src/hi/apps/entity/edit/tests/test_entity_type_transitions.py
index a2d51519..f606ddd9 100644
--- a/src/hi/apps/entity/edit/tests/test_entity_type_transitions.py
+++ b/src/hi/apps/entity/edit/tests/test_entity_type_transitions.py
@@ -2,6 +2,7 @@
Tests for EntityType transition handling functionality.
Focus on actual behavior and database state changes per testing guidelines.
"""
+import logging
from decimal import Decimal
from django.db import transaction
@@ -12,6 +13,8 @@ from hi.apps.entity.enums import EntityType, EntityTransitionType
from hi.apps.entity.models import Entity, EntityPath, EntityPosition
from hi.apps.location.models import Location, LocationView
+logging.disable(logging.CRITICAL)
+
class TestEntityTypeTransitions(TransactionTestCase):
"""Test EntityType transition handling with preservation strategy"""
diff --git a/src/hi/apps/entity/forms.py b/src/hi/apps/entity/forms.py
index 82e81cdf..ba428873 100644
--- a/src/hi/apps/entity/forms.py
+++ b/src/hi/apps/entity/forms.py
@@ -1,7 +1,6 @@
from django import forms
-from hi.apps.attribute.forms import AttributeForm, AttributeUploadForm
-from hi.apps.attribute.enums import AttributeValueType
+from hi.apps.attribute.forms import AttributeForm, AttributeUploadForm, RegularAttributeBaseFormSet
from hi.apps.entity.enums import EntityType
from hi.apps.entity.models import Entity, EntityAttribute
@@ -29,20 +28,6 @@ class EntityAttributeForm( AttributeForm ):
model = EntityAttribute
-class RegularAttributeBaseFormSet(forms.BaseInlineFormSet):
- """Base formset that automatically excludes FILE attributes for regular attribute editing"""
-
- def __init__(self, *args, **kwargs):
- super().__init__(*args, **kwargs)
- # Apply filtering after parent initialization
- self.queryset = self.queryset.exclude(value_type_str=str(AttributeValueType.FILE))
-
- def get_queryset(self):
- """Override to automatically filter out FILE attributes"""
- queryset = super().get_queryset()
- return queryset.exclude(value_type_str=str(AttributeValueType.FILE))
-
-
EntityAttributeRegularFormSet = forms.inlineformset_factory(
Entity,
EntityAttribute,
diff --git a/src/hi/apps/entity/templates/entity/modals/entity_edit.html b/src/hi/apps/entity/templates/entity/modals/entity_edit.html
index 5e90316c..8cacbc81 100644
--- a/src/hi/apps/entity/templates/entity/modals/entity_edit.html
+++ b/src/hi/apps/entity/templates/entity/modals/entity_edit.html
@@ -17,7 +17,7 @@
enctype="multipart/form-data">
{% csrf_token %}
- <!-- Main content wrapper for antinode updates -->
+ <!-- Main content wrapper for updates -->
<div id="{{ attr_page_context.content_html_id }}"
class="{{ DIVID.ATTR_V2_CONTENT_CLASS }}">
{% include "entity/panes/entity_edit_content_body.html" %}
@@ -45,9 +45,6 @@
</div>
{% endif %}
</div>
-
-<!-- JavaScript for V2 functionality loaded via Django Pipeline js_before_content bundle -->
-
{% endblock %}
{% block footer %}
diff --git a/src/hi/apps/location/forms.py b/src/hi/apps/location/forms.py
index caaa1288..7682d586 100644
--- a/src/hi/apps/location/forms.py
+++ b/src/hi/apps/location/forms.py
@@ -1,7 +1,6 @@
from django import forms
-from hi.apps.attribute.forms import AttributeForm, AttributeUploadForm
-from hi.apps.attribute.enums import AttributeValueType
+from hi.apps.attribute.forms import AttributeForm, AttributeUploadForm, RegularAttributeBaseFormSet
from hi.apps.location.models import Location, LocationAttribute
@@ -11,20 +10,6 @@ class LocationAttributeForm( AttributeForm ):
model = LocationAttribute
-class RegularAttributeBaseFormSet(forms.BaseInlineFormSet):
- """Base formset that automatically excludes FILE attributes for regular attribute editing"""
-
- def __init__(self, *args, **kwargs):
- super().__init__(*args, **kwargs)
- # Apply filtering after parent initialization
- self.queryset = self.queryset.exclude(value_type_str=str(AttributeValueType.FILE))
-
- def get_queryset(self):
- """Override to automatically filter out FILE attributes"""
- queryset = super().get_queryset()
- return queryset.exclude(value_type_str=str(AttributeValueType.FILE))
-
-
LocationAttributeRegularFormSet = forms.inlineformset_factory(
Location,
LocationAttribute,
diff --git a/src/hi/apps/location/templates/location/edit/modals/location_add_first.html b/src/hi/apps/location/templates/location/edit/modals/location_add_first.html
index 74fc0bbf..e14500f8 100644
--- a/src/hi/apps/location/templates/location/edit/modals/location_add_first.html
+++ b/src/hi/apps/location/templates/location/edit/modals/location_add_first.html
@@ -19,7 +19,7 @@ Create Your Location
{% block action_right %}
<button id="hi-add-location-button" type="submit" class="btn btn-lg btn-success"
- name="action" value="add">
+ name="action" value="add">
{% icon "plus" size="sm" css_class="hi-icon-left" %}CREATE
</button>
{% endblock %}
diff --git a/src/hi/apps/location/templates/location/edit/panes/location_view_manage_items.html b/src/hi/apps/location/templates/location/edit/panes/location_view_manage_items.html
index 239d13e5..d7ca9884 100644
--- a/src/hi/apps/location/templates/location/edit/panes/location_view_manage_items.html
+++ b/src/hi/apps/location/templates/location/edit/panes/location_view_manage_items.html
@@ -23,7 +23,7 @@
{% endfor %}
</div>
{% empty %}
- <div class="mt-3"><em>No items defined.</em></div>
+ {% include "edit/panes/no_entities_message.html" %}
{% endfor %}
{% if collection_view_group.item_list %}
diff --git a/src/hi/apps/location/templates/location/modals/location_edit.html b/src/hi/apps/location/templates/location/modals/location_edit.html
index c3cb3add..bd2d2284 100644
--- a/src/hi/apps/location/templates/location/modals/location_edit.html
+++ b/src/hi/apps/location/templates/location/modals/location_edit.html
@@ -17,7 +17,7 @@
enctype="multipart/form-data">
{% csrf_token %}
- <!-- Main content wrapper for antinode updates -->
+ <!-- Main content wrapper for updates -->
<div id="{{ attr_page_context.content_html_id }}"
class="{{ DIVID.ATTR_V2_CONTENT_CLASS }}">
{% include "location/panes/location_edit_content_body.html" %}
diff --git a/src/hi/apps/location/tests/test_path_geometry.py b/src/hi/apps/location/tests/test_path_geometry.py
index d0ec0cb2..8edbba82 100644
--- a/src/hi/apps/location/tests/test_path_geometry.py
+++ b/src/hi/apps/location/tests/test_path_geometry.py
@@ -1,3 +1,4 @@
+import logging
from django.test import TestCase
from hi.apps.entity.enums import EntityType
@@ -5,6 +6,8 @@ from hi.apps.collection.enums import CollectionType
from hi.apps.location.models import Location, LocationView
from hi.apps.location.path_geometry import PathGeometry
+logging.disable(logging.CRITICAL)
+
class TestPathGeometry(TestCase):
"""Test the PathGeometry utility class for generating default SVG paths."""
diff --git a/src/hi/apps/sense/tests/test_sensor_history_manager.py b/src/hi/apps/sense/tests/test_sensor_history_manager.py
index b570c8bb..113c61ce 100644
--- a/src/hi/apps/sense/tests/test_sensor_history_manager.py
+++ b/src/hi/apps/sense/tests/test_sensor_history_manager.py
@@ -1,4 +1,5 @@
import asyncio
+import logging
from datetime import datetime
from unittest.mock import patch
@@ -12,6 +13,8 @@ from hi.apps.sense.sensor_history_manager import SensorHistoryManager
from hi.apps.sense.transient_models import SensorResponse
from hi.integrations.transient_models import IntegrationKey
+logging.disable(logging.CRITICAL)
+
class AsyncSensorHistoryManagerTestCase(AsyncTaskTestCase):
"""Test SensorHistoryManager with proper async infrastructure."""
diff --git a/src/hi/apps/sense/tests/test_sensor_response.py b/src/hi/apps/sense/tests/test_sensor_response.py
index 3ecaf5b7..6d42b074 100644
--- a/src/hi/apps/sense/tests/test_sensor_response.py
+++ b/src/hi/apps/sense/tests/test_sensor_response.py
@@ -1,4 +1,5 @@
import json
+import logging
from datetime import datetime
from django.utils import timezone
@@ -10,6 +11,8 @@ from hi.apps.sense.transient_models import SensorResponse
from hi.integrations.transient_models import IntegrationKey
from hi.testing.base_test_case import BaseTestCase
+logging.disable(logging.CRITICAL)
+
class TestSensorResponse(BaseTestCase):
"""Test SensorResponse transient model functionality."""
diff --git a/src/hi/apps/sense/tests/test_sensor_response_manager.py b/src/hi/apps/sense/tests/test_sensor_response_manager.py
index 1de2511f..0de4dc82 100644
--- a/src/hi/apps/sense/tests/test_sensor_response_manager.py
+++ b/src/hi/apps/sense/tests/test_sensor_response_manager.py
@@ -1,3 +1,4 @@
+import logging
from datetime import datetime
from unittest.mock import Mock, patch
from django.utils import timezone
@@ -9,6 +10,8 @@ from hi.apps.sense.sensor_response_manager import SensorResponseManager
from hi.apps.sense.transient_models import SensorResponse
from hi.integrations.transient_models import IntegrationKey
+logging.disable(logging.CRITICAL)
+
class AsyncSensorResponseManagerTestCase(AsyncTaskTestCase):
"""Test SensorResponseManager with proper async infrastructure."""
diff --git a/src/hi/apps/weather/tests/test_daily_weather_tracker.py b/src/hi/apps/weather/tests/test_daily_weather_tracker.py
index 7b67b87d..ed259bbf 100644
--- a/src/hi/apps/weather/tests/test_daily_weather_tracker.py
+++ b/src/hi/apps/weather/tests/test_daily_weather_tracker.py
@@ -2,6 +2,7 @@
Unit tests for DailyWeatherTracker - daily weather statistics tracking.
"""
import json
+import logging
import unittest
from datetime import datetime, timedelta
from unittest.mock import patch
@@ -14,6 +15,8 @@ from hi.apps.weather.daily_weather_tracker import DailyWeatherTracker
from hi.apps.weather.transient_models import WeatherConditionsData, NumericDataPoint, DataPointSource, Station
from hi.units import UnitQuantity
+logging.disable(logging.CRITICAL)
+
class TestDailyWeatherTracker(unittest.TestCase):
"""Test daily weather statistics tracking functionality."""
diff --git a/src/hi/apps/weather/tests/test_interval_updating.py b/src/hi/apps/weather/tests/test_interval_updating.py
index 39f50ac7..f19e39f4 100644
--- a/src/hi/apps/weather/tests/test_interval_updating.py
+++ b/src/hi/apps/weather/tests/test_interval_updating.py
@@ -1,3 +1,4 @@
+import logging
from django.test import TestCase
from unittest.mock import patch
from datetime import datetime
@@ -8,6 +9,8 @@ from hi.apps.weather.transient_models import (
WeatherForecastData, DataPointSource, IntervalEnvironmentalData, TimeInterval
)
+logging.disable(logging.CRITICAL)
+
class IntervalUpdatingTest(TestCase):
"""Test that intervals are properly updated as time passes."""
diff --git a/src/hi/apps/weather/tests/test_timezone_intervals.py b/src/hi/apps/weather/tests/test_timezone_intervals.py
index c41105e9..8de9a0ae 100644
--- a/src/hi/apps/weather/tests/test_timezone_intervals.py
+++ b/src/hi/apps/weather/tests/test_timezone_intervals.py
@@ -1,3 +1,4 @@
+import logging
from django.test import TestCase
from unittest.mock import patch
from datetime import datetime
@@ -6,6 +7,8 @@ import pytz
from hi.apps.weather.interval_data_manager import IntervalDataManager
from hi.apps.weather.transient_models import WeatherForecastData, WeatherHistoryData
+logging.disable(logging.CRITICAL)
+
class TimezoneIntervalTest(TestCase):
"""Test that daily intervals use local timezone boundaries."""
diff --git a/src/hi/apps/weather/tests/test_weather_alert_alarm_mapper.py b/src/hi/apps/weather/tests/test_weather_alert_alarm_mapper.py
index 799a64a0..783a1d9c 100644
--- a/src/hi/apps/weather/tests/test_weather_alert_alarm_mapper.py
+++ b/src/hi/apps/weather/tests/test_weather_alert_alarm_mapper.py
@@ -1,6 +1,7 @@
"""
Tests for WeatherAlertAlarmMapper - converting weather alerts to system alarms.
"""
+import logging
from unittest.mock import patch
from datetime import datetime, timedelta
@@ -20,6 +21,8 @@ from hi.apps.weather.transient_models import WeatherAlert
from hi.apps.weather.weather_alert_alarm_mapper import WeatherAlertAlarmMapper
from hi.testing.base_test_case import BaseTestCase
+logging.disable(logging.CRITICAL)
+
class TestWeatherAlertAlarmMapper(BaseTestCase):
"""Test weather alert to system alarm conversion logic."""
diff --git a/src/hi/apps/weather/tests/test_weather_alert_integration.py b/src/hi/apps/weather/tests/test_weather_alert_integration.py
index 2ed17c75..ac04035e 100644
--- a/src/hi/apps/weather/tests/test_weather_alert_integration.py
+++ b/src/hi/apps/weather/tests/test_weather_alert_integration.py
@@ -3,6 +3,7 @@ Integration tests for weather alert to system alarm conversion.
Tests the complete flow from NWS data parsing to alarm creation.
"""
import asyncio
+import logging
from unittest.mock import Mock, AsyncMock
from hi.apps.weather.enums import WeatherEventType, AlertSeverity
@@ -12,6 +13,8 @@ from hi.transient_models import GeographicLocation
from hi.units import UnitQuantity
from hi.testing.base_test_case import BaseTestCase
+logging.disable(logging.CRITICAL)
+
class TestWeatherAlertIntegration(BaseTestCase):
"""Test end-to-end weather alert to alarm integration."""
diff --git a/src/hi/apps/weather/tests/test_weather_manager_daily_tracker_integration.py b/src/hi/apps/weather/tests/test_weather_manager_daily_tracker_integration.py
index 1b6c6bf8..b9e074b0 100644
--- a/src/hi/apps/weather/tests/test_weather_manager_daily_tracker_integration.py
+++ b/src/hi/apps/weather/tests/test_weather_manager_daily_tracker_integration.py
@@ -2,10 +2,11 @@
Integration tests for WeatherManager and DailyWeatherTracker.
Tests the complete flow of temperature tracking and fallback value population.
"""
+import asyncio
+import logging
import unittest
from unittest.mock import patch
from datetime import datetime
-import asyncio
from django.core.cache import cache
from django.utils import timezone
@@ -17,6 +18,8 @@ from hi.apps.weather.weather_data_source import WeatherDataSource
from hi.transient_models import GeographicLocation
from hi.units import UnitQuantity
+logging.disable(logging.CRITICAL)
+
class MockWeatherDataSource(WeatherDataSource):
"""Mock weather data source for testing."""
diff --git a/src/hi/apps/weather/tests/test_weather_manager_defensive_handling.py b/src/hi/apps/weather/tests/test_weather_manager_defensive_handling.py
index 771247d9..42f94171 100644
--- a/src/hi/apps/weather/tests/test_weather_manager_defensive_handling.py
+++ b/src/hi/apps/weather/tests/test_weather_manager_defensive_handling.py
@@ -2,9 +2,10 @@
Test that WeatherManager gracefully handles errors in daily weather tracking
without breaking core weather API functionality.
"""
+import asyncio
+import logging
from unittest.mock import patch
from datetime import datetime
-import asyncio
from django.core.cache import cache
from django.utils import timezone
@@ -17,6 +18,8 @@ from hi.transient_models import GeographicLocation
from hi.units import UnitQuantity
from hi.testing.base_test_case import BaseTestCase
+logging.disable(logging.CRITICAL)
+
class MockWeatherDataSource(WeatherDataSource):
"""Mock weather data source for testing."""
diff --git a/src/hi/constants.py b/src/hi/constants.py
index 84bfab65..caa694ec 100644
--- a/src/hi/constants.py
+++ b/src/hi/constants.py
@@ -102,7 +102,6 @@ DIVID = {
'ATTR_V2_HISTORY_LINK_CLASS': 'attr-v2-history-link',
'ATTR_V2_RESTORE_LINK_CLASS': 'attr-v2-restore-link',
'ATTR_V2_STICKY_PANEL_CLASS': 'attr-v2-sticky-panel',
- 'ATTR_V2_BASIC_INFO_CLASS': 'attr-v2-basic-info',
'ATTR_V2_ACTION_BAR_CLASS': 'attr-v2-action-bar',
'ATTR_V2_ACTION_BAR_CONTENT_CLASS': 'attr-v2-action-bar-content',
'ATTR_V2_ACTION_BUTTONS_CLASS': 'attr-v2-action-buttons',
diff --git a/src/hi/integrations/forms.py b/src/hi/integrations/forms.py
index edcdcce3..ae6b3812 100644
--- a/src/hi/integrations/forms.py
+++ b/src/hi/integrations/forms.py
@@ -1,6 +1,6 @@
from django import forms
-from hi.apps.attribute.forms import AttributeForm
+from hi.apps.attribute.forms import AttributeForm, RegularAttributeBaseFormSet
from .models import Integration, IntegrationAttribute
@@ -10,10 +10,11 @@ class IntegrationAttributeForm( AttributeForm ):
model = IntegrationAttribute
-IntegrationAttributeFormSet = forms.inlineformset_factory(
+IntegrationAttributeRegularFormSet = forms.inlineformset_factory(
Integration,
IntegrationAttribute,
form = IntegrationAttributeForm,
+ formset = RegularAttributeBaseFormSet,
extra = 0,
max_num = 100,
absolute_max = 100,
diff --git a/src/hi/integrations/integration_attribute_edit_context.py b/src/hi/integrations/integration_attribute_edit_context.py
new file mode 100644
index 00000000..070dd105
--- /dev/null
+++ b/src/hi/integrations/integration_attribute_edit_context.py
@@ -0,0 +1,102 @@
+"""
+Integration Attribute Edit Context - Integration-specific context for attribute editing templates.
+
+This module contains Integration-specific implementations of the AttributeItemEditContext
+pattern, encapsulating integration-specific domain knowledge while maintaining
+the generic template interface.
+"""
+from typing import Any, Dict, Optional, Type
+
+from django.forms import ModelForm, BaseInlineFormSet
+
+from hi.apps.attribute.edit_context import AttributeItemEditContext
+from hi.apps.attribute.forms import AttributeUploadForm
+from hi.apps.attribute.models import AttributeModel
+
+from .forms import IntegrationAttributeRegularFormSet
+from .integration_data import IntegrationData
+from .models import Integration, IntegrationAttribute
+
+
+class IntegrationAttributeItemEditContext(AttributeItemEditContext):
+ """
+ Integration-specific context provider for attribute editing templates.
+
+ This class encapsulates Integration-specific knowledge while providing
+ the generic interface expected by attribute editing templates.
+ """
+
+ def __init__(self,
+ integration_data: IntegrationData,
+ update_button_label = 'UPDATE',
+ suppress_history = False,
+ show_secrets = False,
+ ) -> None:
+ """
+ Initialize context for Integration attribute editing.
+
+ Args:
+ integration: The Integration instance that owns the attributes
+ """
+ super().__init__( owner_type = 'integration', owner = integration_data.integration )
+ self.integration_data = integration_data
+ self._update_button_label = update_button_label
+ self._suppress_history = suppress_history
+ self._show_secrets = show_secrets
+
+ return
+
+ @property
+ def integration(self) -> Integration:
+ """Get the Integration instance (typed accessor)."""
+ return self.owner
+
+ @property
+ def content_body_template_name(self):
+ return 'integrations/panes/integration_edit_content_body.html'
+
+ @property
+ def update_button_label(self) -> str:
+ return self._update_button_label
+
+ @property
+ def attribute_model_subclass(self) -> Type[AttributeModel]:
+ return IntegrationAttribute
+
+ def create_owner_form( self, form_data : Optional[ Dict[str, Any] ] = None ) -> ModelForm:
+ # No viewable/editable Integration model properties.
+ return None
+
+ def create_attribute_model( self ) -> AttributeModel:
+ return IntegrationAttribute( integration = self.integration )
+
+ def create_regular_attributes_formset(
+ self, form_data : Optional[ Dict[str, Any] ] = None ) -> BaseInlineFormSet:
+ return IntegrationAttributeRegularFormSet(
+ form_data,
+ instance = self.integration,
+ prefix = self.formset_prefix,
+ form_kwargs={
+ 'show_as_editable': True,
+ 'allow_reordering': False, # Disable reordering for system-defined attributes
+ 'suppress_history': self._suppress_history, # While enabling, no history
+ 'show_secrets': self._show_secrets, # While enable, plain password view
+ }
+ )
+
+ @property
+ def attribute_upload_form_class(self) -> Type[AttributeUploadForm]:
+ # No file uploads for Integration attributes (as of yet)
+ return None
+
+ @property
+ def file_upload_url(self) -> str:
+ # No file uploads for Integration attributes (as of yet)
+ return None
+
+ def to_template_context(self) -> Dict[str, Any]:
+ template_context = super().to_template_context()
+ template_context.update({
+ 'integration_data': self.integration_data,
+ })
+ return template_context
diff --git a/src/hi/integrations/integration_manager.py b/src/hi/integrations/integration_manager.py
index 5721e267..a378eccb 100644
--- a/src/hi/integrations/integration_manager.py
+++ b/src/hi/integrations/integration_manager.py
@@ -14,7 +14,6 @@ from hi.apps.common.singleton import Singleton
from hi.apps.common.module_utils import import_module_safe
from .enums import IntegrationAttributeType
-from .forms import IntegrationAttributeFormSet
from .integration_data import IntegrationData
from .integration_gateway import IntegrationGateway
from .transient_models import IntegrationKey
@@ -280,7 +279,7 @@ class IntegrationManager( Singleton ):
integration_id = integration.integration_id,
integration_name = str(attribute_type),
)
- IntegrationAttribute.objects.create(
+ attribute = IntegrationAttribute(
integration = integration,
name = attribute_type.label,
value = attribute_type.initial_value,
@@ -291,18 +290,18 @@ class IntegrationManager( Singleton ):
is_editable = attribute_type.is_editable,
is_required = attribute_type.is_required,
)
+ attribute.save( track_history = False ) # Do not want this initial value in history
return
- def enable_integration( self,
- integration_data : IntegrationData,
- integration_attribute_formset : IntegrationAttributeFormSet ):
+ def enable_integration( self, integration_data : IntegrationData ):
with self._data_lock:
with transaction.atomic():
integration_data.integration.is_enabled = True
integration_data.integration.save()
- integration_attribute_formset.save()
self.refresh_integrations_from_db()
- self._launch_integration_monitor_task( integration_data = integration_data )
+ self._launch_integration_monitor_task(
+ integration_data = integration_data,
+ )
return
def disable_integration( self, integration_data : IntegrationData ):
diff --git a/src/hi/integrations/templates/integrations/modals/integration_enable.html b/src/hi/integrations/templates/integrations/modals/integration_enable.html
index 9338d93c..556d7895 100644
--- a/src/hi/integrations/templates/integrations/modals/integration_enable.html
+++ b/src/hi/integrations/templates/integrations/modals/integration_enable.html
@@ -1,30 +1,46 @@
-{% extends "modals/action_with_cancel.html" %}
+{% extends "modals/base.html" %}
+{% load icons %}
-{% block preamble %}
-<form action="{% url 'integrations_enable' integration_id=integration_data.integration_id %}" method="post" enctype="multipart/form-data"
- class="form" data-async="modal">
- {% csrf_token %}
- {% endblock %}
+{% block modal_dialog_class %}hi-modal-dialog-600{% endblock %}
+{% block title_text %}{{ integration_data.label }} Integration{% endblock %}
- {% block title_text %}
- {{ integration_data.label }}
- {% endblock %}
+{% block body %}
+<!-- Root container for this attribute editing context -->
+<div id="{{ attr_page_context.container_html_id }}"
+ class="{{ DIVID.ATTR_V2_CONTAINER_CLASS }}">
+
+ <div class="{{ DIVID.ATTR_V2_FORM_CLASS }}">
+ <form id="{{ attr_page_context.form_html_id }}"
+ action="{% url 'integrations_enable' integration_id=integration_data.integration_id %}"
+ method="post"
+ class="{{ DIVID.ATTR_V2_FORM_CLASS }} form"
+ enctype="multipart/form-data">
+ {% csrf_token %}
+
+ <!-- Main content wrapper for updates -->
+ <div id="{{ attr_page_context.content_html_id }}"
+ class="{{ DIVID.ATTR_V2_CONTENT_CLASS }}">
+ {% include "integrations/panes/integration_edit_content_body.html" with show_modal_cancel=True %}
+ </div>
+ </form>
+ </div>
- {% block body %}
- <h4>Enable {{ integration_data.label }} Integration?</h4>
+ <!-- Success/Error Messages -->
+ {% if messages %}
+ <div class="{{ DIVID.ATTR_V2_MESSAGES }}" id="{{ DIVID.ATTR_V2_MESSAGES }}">
+ {% for message in messages %}
+ <div class="alert alert-{{ message.tags }} alert-dismissible fade show" role="alert">
+ {{ message }}
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">
+ <span aria-hidden="true">&times;</span>
+ </button>
+ </div>
+ {% endfor %}
+ </div>
+ {% endif %}
+</div>
+{% endblock %}
- <div>
- {% include "attribute/panes/attribute_form.html" with attribute_formset=integration_attribute_formset %}
- </div>
- {% endblock %}
-
- {% block action_right %}
- <button id="hi-integration-enable" type="submit" class="btn btn-lg btn-success"
- name="action" value="enable">
- ENABLE
- </button>
- {% endblock %}
-
- {% block postamble %}
-</form>
+{% block footer %}
+<!-- No footer - sticky panel contains all actions -->
{% endblock %}
diff --git a/src/hi/integrations/templates/integrations/pages/integration_manage.html b/src/hi/integrations/templates/integrations/pages/integration_manage.html
index cd0c9499..0ce3910d 100644
--- a/src/hi/integrations/templates/integrations/pages/integration_manage.html
+++ b/src/hi/integrations/templates/integrations/pages/integration_manage.html
@@ -2,34 +2,74 @@
{% block config_content %}
<div id="hi-integration-settings" class="row">
- <nav class="nav flex-column">
+ <nav class="nav flex-column hi-vertical-nav">
+ <div class="hi-vertical-nav-header">
+ <h6 class="text-muted mb-2">INTEGRATIONS</h6>
+ <a class="btn btn-sm btn-outline-secondary w-100" role="button"
+ href="{% url 'integrations_select' %}"
+ data-async="modal">
+ <i class="fas fa-cog mr-1"></i>Manage
+ </a>
+ </div>
{% for integration_data in core.integration_data_list %}
- <a class="nav-link {% if core.integration_data.integration_id == integration_data.integration_id %}active{% endif %}"
+ <a class="nav-link hi-vertical-nav-link {% if core.integration_data.integration_id == integration_data.integration_id %}active{% endif %}"
href="{% url 'integrations_manage' integration_id=integration_data.integration_id %}"
data-async="true">
- <div class="bg-primary p-2 text-center">
- {{ integration_data.label }}
- </div>
+ {{ integration_data.label }}
</a>
{% endfor %}
</nav>
<div class="flex-colum flex-grow-1">
<div class="tab-content m-3">
- <div class="d-flex justify-content-between">
- <div class="h3">{{ core.integration_data.label }}</div>
- <div>
- <a class="btn btn-primary" role="button"
- href="{% url 'integrations_select' %}"
- data-async="modal">
- SELECT INTEGRATIONS
- </a>
- </div>
+
+ <!-- Root container for this attribute editing context -->
+ <div id="{{ attr_item_context.container_html_id }}"
+ class="{{ DIVID.ATTR_V2_CONTAINER_CLASS }}" >
+
+ <div class=" border-bottom mb-2 pb-2">
+ {% include core.manage_view_template_name %}
+ </div>
+
+ <div class="{{ DIVID.ATTR_V2_FORM_CLASS }}">
+ <form id="{{ attr_item_context.form_html_id }}"
+ action="{% url 'integrations_manage' integration_id=integration.integration_id %}"
+ method="post"
+ class="{{ DIVID.ATTR_V2_FORM_CLASS }} form"
+ enctype="multipart/form-data">
+ {% csrf_token %}
+
+ <!-- Main content wrapper for updates -->
+ <div id="{{ attr_item_context.content_html_id }}"
+ class="{{ DIVID.ATTR_V2_CONTENT_CLASS }}">
+ {% include "integrations/panes/integration_edit_content_body.html" %}
+ </div>
+ </form>
+ </div>
+
+ <!-- Success/Error Messages -->
+ {% if messages %}
+ <div class="{{ DIVID.ATTR_V2_MESSAGES }}" id="{{ DIVID.ATTR_V2_MESSAGES }}">
+ {% for message in messages %}
+ <div class="alert alert-{{ message.tags }} alert-dismissible fade show" role="alert">
+ {{ message }}
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">
+ <span aria-hidden="true">&times;</span>
+ </button>
+ </div>
+ {% endfor %}
+ </div>
+ {% endif %}
</div>
-
- {% block integration_content %}
- {% include core.manage_view_pane_template_name %}
- {% endblock %}
+
</div>
</div>
</div>
+
+<script>
+ // Initialize this specific container (for async-loaded content)
+ if (window.Hi && window.Hi.attr && window.Hi.attr.initializeContainer) {
+ window.Hi.attr.initializeContainer('#{{ attr_item_context.container_html_id }}');
+ }
+</script>
{% endblock %}
+
diff --git a/src/hi/integrations/templates/integrations/pages/no_integrations.html b/src/hi/integrations/templates/integrations/pages/no_integrations.html
index f2287120..b032fd9f 100644
--- a/src/hi/integrations/templates/integrations/pages/no_integrations.html
+++ b/src/hi/integrations/templates/integrations/pages/no_integrations.html
@@ -1,13 +1,13 @@
{% extends "config/pages/config_base.html" %}
{% block config_content %}
-<div class="alert alert-warning m-4">
- There are no integrations currently registered.
+<div class="alert alert-info text-center m-4">
+ There are no integrations currently enabled.
</div>
-<div class="m-4">
+<div class="text-center m-4 p-4">
<a class="btn btn-primary btn-lg" role="button"
href="{% url 'integrations_select' %}"
data-async="modal">
- ADD INTEGRATIONS
+ ENABLE INTEGRATIONS
</a>
</div>
{% endblock %}
diff --git a/src/hi/integrations/templates/integrations/panes/integration_edit_content_body.html b/src/hi/integrations/templates/integrations/panes/integration_edit_content_body.html
new file mode 100644
index 00000000..4da6fcf3
--- /dev/null
+++ b/src/hi/integrations/templates/integrations/panes/integration_edit_content_body.html
@@ -0,0 +1,20 @@
+{% extends "attribute/components/edit_content_body.html" %}
+{% load icons %}
+{% load attribute_extras %}
+
+{% block basic_info %}{% endblock %}
+
+{% block additional_actions %}
+{% if show_modal_cancel %}
+<a id="hi-modal-cancel" role="button" {% if autofocus %}autofocus="autofocus"{% endif %}
+ class="btn btn-tertiary" href="#" data-dismiss="modal">
+ {% icon "cancel" size="sm" css_class="hi-icon-left" %}CANCEL
+</a>
+{% endif %}
+{% endblock %}
+
+{% block file_upload_button %}{% endblock %}
+
+{% block add_attribute_button %}{% endblock %}
+
+{% block files_section %}{% endblock %}
diff --git a/src/hi/integrations/tests/test_integration_manager.py b/src/hi/integrations/tests/test_integration_manager.py
index 8e9abe73..dfec95e4 100644
--- a/src/hi/integrations/tests/test_integration_manager.py
+++ b/src/hi/integrations/tests/test_integration_manager.py
@@ -3,12 +3,13 @@ Unit tests for IntegrationManager.
"""
import asyncio
+import logging
import threading
from unittest.mock import Mock, AsyncMock, patch
+
from django.test import TestCase
from hi.apps.attribute.enums import AttributeType, AttributeValueType
-
from hi.integrations.integration_manager import IntegrationManager
from hi.integrations.integration_data import IntegrationData
from hi.integrations.integration_gateway import IntegrationGateway
@@ -16,6 +17,8 @@ from hi.integrations.models import Integration, IntegrationAttribute
from hi.integrations.transient_models import IntegrationMetaData, IntegrationKey
from hi.integrations.enums import IntegrationAttributeType
+logging.disable(logging.CRITICAL)
+
class MockIntegrationAttributeType(IntegrationAttributeType):
"""Mock integration attribute type for testing."""
@@ -560,73 +563,6 @@ class IntegrationManagerTestCase(TestCase):
self.assertEqual(attr.name, 'Existing Attribute')
self.assertEqual(attr.value, 'existing_value')
- def test_create_integration_attribute(self):
- """Test creation of individual integration attribute."""
- manager = IntegrationManager()
-
- integration = Integration.objects.create(
- integration_id='test_integration',
- is_enabled=True
- )
-
- # Call method
- manager._create_integration_attribute(
- integration=integration,
- attribute_type=MockIntegrationAttributeType.TEST_ATTR
- )
-
- # Verify attribute was created correctly
- self.assertEqual(integration.attributes.count(), 1)
-
- attr = integration.attributes.first()
- self.assertEqual(attr.integration, integration)
- self.assertEqual(attr.name, 'Test Attribute')
- self.assertEqual(attr.value, 'default')
- self.assertEqual(attr.value_type_str, str(AttributeValueType.TEXT))
- self.assertEqual(attr.attribute_type_str, str(AttributeType.PREDEFINED))
- self.assertTrue(attr.is_editable)
- self.assertTrue(attr.is_required)
-
- # Verify integration key format
- expected_key = f'test_integration.{str(MockIntegrationAttributeType.TEST_ATTR).lower()}'
- self.assertEqual(attr.integration_key_str, expected_key)
-
- # Verify value_range_str is JSON
- import json
- self.assertEqual(json.loads(attr.value_range_str), {})
-
- def test_enable_integration_database_transaction(self):
- """Test enable integration with database transaction and monitor launch."""
- manager = IntegrationManager()
-
- integration = Integration.objects.create(
- integration_id='test_integration',
- is_enabled=False
- )
-
- gateway = MockIntegrationGateway('test_integration')
- data = IntegrationData(
- integration_gateway=gateway,
- integration=integration
- )
-
- # Mock formset
- mock_formset = Mock()
-
- with patch.object(manager, '_launch_integration_monitor_task') as mock_launch:
- # Call enable
- manager.enable_integration(data, mock_formset)
-
- # Verify database changes
- integration.refresh_from_db()
- self.assertTrue(integration.is_enabled)
-
- # Verify formset was saved
- mock_formset.save.assert_called_once()
-
- # Verify monitor was launched
- mock_launch.assert_called_once_with(integration_data=data)
-
def test_disable_integration_database_transaction(self):
"""Test disable integration with database transaction and monitor stop."""
manager = IntegrationManager()
diff --git a/src/hi/integrations/tests/test_managers.py b/src/hi/integrations/tests/test_managers.py
index dff40351..9669913d 100644
--- a/src/hi/integrations/tests/test_managers.py
+++ b/src/hi/integrations/tests/test_managers.py
@@ -1,6 +1,7 @@
"""
Unit tests for IntegrationDetailsManager.
"""
+import logging
from django.test import TransactionTestCase
from django.db import models, connection
@@ -9,6 +10,8 @@ from hi.integrations.managers import IntegrationDetailsManager
from hi.integrations.models import IntegrationDetailsModel
from hi.integrations.transient_models import IntegrationKey
+logging.disable(logging.CRITICAL)
+
class ManagerTestModel(IntegrationDetailsModel):
"""Concrete test model for testing IntegrationDetailsManager."""
diff --git a/src/hi/integrations/tests/test_models.py b/src/hi/integrations/tests/test_models.py
index 8887d076..6ae33346 100644
--- a/src/hi/integrations/tests/test_models.py
+++ b/src/hi/integrations/tests/test_models.py
@@ -2,14 +2,17 @@
Unit tests for Integration models.
"""
+import logging
+
from django.test import TestCase, TransactionTestCase
from django.db import IntegrityError, transaction, models
from hi.apps.attribute.enums import AttributeType, AttributeValueType
-
from hi.integrations.models import Integration, IntegrationAttribute, IntegrationDetailsModel
from hi.integrations.transient_models import IntegrationKey, IntegrationDetails
+logging.disable(logging.CRITICAL)
+
class ConcreteIntegrationDetailsModel(IntegrationDetailsModel):
"""Concrete test class for testing abstract IntegrationDetailsModel."""
diff --git a/src/hi/integrations/tests/test_sync_mixins.py b/src/hi/integrations/tests/test_sync_mixins.py
index 42fffe6e..6744921a 100644
--- a/src/hi/integrations/tests/test_sync_mixins.py
+++ b/src/hi/integrations/tests/test_sync_mixins.py
@@ -2,15 +2,18 @@
Unit tests for IntegrationSyncMixin.
"""
+import logging
+
from django.test import TestCase, TransactionTestCase
from hi.apps.entity.models import Entity, EntityAttribute, EntityState
from hi.apps.sense.models import Sensor
from hi.apps.control.models import Controller
from hi.apps.common.processing_result import ProcessingResult
-
from hi.integrations.sync_mixins import IntegrationSyncMixin
+logging.disable(logging.CRITICAL)
+
class TestSynchronizer(IntegrationSyncMixin):
"""Test class that uses the IntegrationSyncMixin."""
diff --git a/src/hi/integrations/tests/test_transient_models.py b/src/hi/integrations/tests/test_transient_models.py
index 8aac9ccb..ff5a02ca 100644
--- a/src/hi/integrations/tests/test_transient_models.py
+++ b/src/hi/integrations/tests/test_transient_models.py
@@ -2,10 +2,11 @@
Unit tests for transient models (dataclasses and key parsing logic).
"""
+import logging
+
from django.test import TestCase
from hi.apps.attribute.enums import AttributeValueType
-
from hi.integrations.transient_models import (
IntegrationKey,
IntegrationDetails,
@@ -14,6 +15,8 @@ from hi.integrations.transient_models import (
)
from hi.integrations.enums import IntegrationAttributeType
+logging.disable(logging.CRITICAL)
+
class MockIntegrationAttributeType(IntegrationAttributeType):
"""Mock integration attribute type for testing."""
diff --git a/src/hi/integrations/tests/test_user_data_detector.py b/src/hi/integrations/tests/test_user_data_detector.py
index 83392355..b170e17c 100644
--- a/src/hi/integrations/tests/test_user_data_detector.py
+++ b/src/hi/integrations/tests/test_user_data_detector.py
@@ -2,14 +2,17 @@
Unit tests for EntityUserDataDetector utility.
"""
+import logging
+
from django.test import TestCase
+from django.db import IntegrityError
from hi.apps.entity.models import Entity, EntityAttribute, EntityState
from hi.apps.sense.models import Sensor
from hi.apps.control.models import Controller
-
from hi.integrations.user_data_detector import EntityUserDataDetector
-from django.db import IntegrityError
+
+logging.disable(logging.CRITICAL)
class EntityUserDataDetectorTestCase(TestCase):
diff --git a/src/hi/integrations/urls.py b/src/hi/integrations/urls.py
index 1f9d5ce8..67a873b7 100644
--- a/src/hi/integrations/urls.py
+++ b/src/hi/integrations/urls.py
@@ -27,13 +27,13 @@ urlpatterns = [
views.IntegrationManageView.as_view(),
name='integrations_manage' ),
- re_path( r'^attribute/history/(?P<attribute_id>\d+)$',
- views.IntegrationAttributeHistoryView.as_view(),
- name='integration_attribute_history'),
+ re_path( r'^attribute/history/(?P<integration_id>\d+)/(?P<attribute_id>\d+)/$',
+ views.IntegrationAttributeHistoryInlineView.as_view(),
+ name='integration_attribute_history_inline'),
- re_path( r'^attribute/restore/(?P<attribute_id>\d+)$',
- views.IntegrationAttributeRestoreView.as_view(),
- name='integration_attribute_restore'),
+ re_path( r'^attribute/restore/(?P<integration_id>\d+)/(?P<attribute_id>\d+)/(?P<history_id>\d+)/$',
+ views.IntegrationAttributeRestoreInlineView.as_view(),
+ name='integration_attribute_restore_inline'),
]
diff --git a/src/hi/integrations/view_mixins.py b/src/hi/integrations/view_mixins.py
new file mode 100644
index 00000000..32cb1862
--- /dev/null
+++ b/src/hi/integrations/view_mixins.py
@@ -0,0 +1,21 @@
+from django.http import Http404
+
+from .integration_manager import IntegrationManager
+
+
+class IntegrationViewMixin:
+
+ def get_integration_data( self, integration_id : str ):
+ try:
+ return IntegrationManager().get_integration_data(
+ integration_id = integration_id,
+ )
+ except KeyError:
+ raise Http404()
+ return
+
+ def get_integration_data_list( self, enabled_only = False ):
+ return IntegrationManager().get_integration_data_list(
+ enabled_only = enabled_only,
+ )
+
diff --git a/src/hi/integrations/views.py b/src/hi/integrations/views.py
index 194313fb..241302c9 100644
--- a/src/hi/integrations/views.py
+++ b/src/hi/integrations/views.py
@@ -2,17 +2,21 @@ import logging
from django.core.exceptions import BadRequest
from django.urls import reverse
-
-from hi.apps.config.enums import ConfigPageType
-from hi.apps.config.views import ConfigPageView
+from django.views.generic import View
from hi.exceptions import ForceRedirectException
from hi.hi_async_view import HiModalView
-from hi.apps.attribute.views import BaseAttributeHistoryView, BaseAttributeRestoreView
+from hi.views import page_not_found_response
-from .forms import IntegrationAttributeFormSet
+from hi.apps.attribute.response_helpers import AttributeRedirectResponse
+from hi.apps.attribute.view_mixins import AttributeEditViewMixin
+from hi.apps.config.enums import ConfigPageType
+from hi.apps.config.views import ConfigPageView
+
+from .integration_attribute_edit_context import IntegrationAttributeItemEditContext
from .integration_manager import IntegrationManager
from .models import IntegrationAttribute
+from .view_mixins import IntegrationViewMixin
logger = logging.getLogger(__name__)
@@ -43,12 +47,12 @@ class IntegrationSelectView( HiModalView ):
def get( self, request, *args, **kwargs ):
context = {
- 'integration_data_list': IntegrationManager().get_integration_data_list(),
+ 'integration_data_list': self.get_integration_data_list(),
}
return self.modal_response( request, context )
-class IntegrationEnableView( HiModalView ):
+class IntegrationEnableView( HiModalView, IntegrationViewMixin, AttributeEditViewMixin ):
def get_template_name( self ) -> str:
return 'integrations/modals/integration_enable.html'
@@ -57,9 +61,10 @@ class IntegrationEnableView( HiModalView ):
integration_manager = IntegrationManager()
integration_id = kwargs.get('integration_id')
- integration_data = integration_manager.get_integration_data(
+ integration_data = self.get_integration_data(
integration_id = integration_id,
)
+
if integration_data.integration.is_enabled:
raise BadRequest( f'{integration_data.label} is already enabled' )
@@ -67,59 +72,58 @@ class IntegrationEnableView( HiModalView ):
integration_metadata = integration_data.integration_metadata,
integration = integration_data.integration,
)
-
- integration_attribute_formset = IntegrationAttributeFormSet(
- instance = integration_data.integration,
- prefix = f'integration-{integration_id}',
- form_kwargs = {
- 'show_as_editable': True,
- },
+ attr_item_context = IntegrationAttributeItemEditContext(
+ integration_data = integration_data,
+ update_button_label = 'ENABLE',
+ suppress_history = True,
+ show_secrets = True,
+
)
- context = {
- 'integration_data': integration_data,
- 'integration_attribute_formset': integration_attribute_formset,
- }
- return self.modal_response( request, context )
+ template_context = self.create_initial_template_context(
+ attr_item_context= attr_item_context,
+ )
+ return self.modal_response( request, template_context )
def post(self, request, *args, **kwargs):
integration_manager = IntegrationManager()
integration_id = kwargs.get('integration_id')
- integration_data = integration_manager.get_integration_data(
+ integration_data = self.get_integration_data(
integration_id = integration_id,
)
if integration_data.integration.is_enabled:
raise BadRequest( f'{integration_data.label} is already enabled' )
-
- integration_attribute_formset = IntegrationAttributeFormSet(
- request.POST,
- request.FILES,
- instance = integration_data.integration,
- prefix = f'integration-{integration_id}',
- )
- if not integration_attribute_formset.is_valid():
- context = {
- 'integration_data': integration_data,
- 'integration_attribute_formset': integration_attribute_formset,
- }
- return self.modal_response( request, context, status_code = 400 )
-
+
+ attr_item_context = IntegrationAttributeItemEditContext(
+ integration_data = integration_data,
+ update_button_label = 'ENABLE',
+ suppress_history = True,
+ show_secrets = True,
+ )
+ response = self.post_attribute_form(
+ request = request,
+ attr_item_context = attr_item_context,
+ )
+
+ # Errors just dynamically populate modal content with form errors.
+ if response.status_code > 299:
+ return response
+
integration_manager.enable_integration(
integration_data = integration_data,
- integration_attribute_formset = integration_attribute_formset,
)
+ redirect_url = reverse( 'integrations_manage',
+ kwargs = { 'integration_id': integration_id } )
+ return AttributeRedirectResponse( url = redirect_url )
- redirect_url = reverse( 'integrations_home' )
- return self.redirect_response( request, redirect_url )
-
-class IntegrationDisableView( HiModalView ):
+class IntegrationDisableView( HiModalView, IntegrationViewMixin ):
def get_template_name( self ) -> str:
return 'integrations/modals/integration_disable.html'
def get(self, request, *args, **kwargs):
integration_id = kwargs.get('integration_id')
- integration_data = IntegrationManager().get_integration_data(
+ integration_data = self.get_integration_data(
integration_id = integration_id,
)
if not integration_data.integration.is_enabled:
@@ -133,7 +137,7 @@ class IntegrationDisableView( HiModalView ):
def post(self, request, *args, **kwargs):
integration_manager = IntegrationManager()
integration_id = kwargs.get('integration_id')
- integration_data = integration_manager.get_integration_data(
+ integration_data = self.get_integration_data(
integration_id = integration_id,
)
if not integration_data.integration.is_enabled:
@@ -144,9 +148,9 @@ class IntegrationDisableView( HiModalView ):
)
redirect_url = reverse( 'integrations_home' )
return self.redirect_response( request, redirect_url )
-
-class IntegrationManageView( ConfigPageView ):
+
+class IntegrationManageView( ConfigPageView, IntegrationViewMixin, AttributeEditViewMixin ):
def config_page_type(self) -> ConfigPageType:
return ConfigPageType.INTEGRATIONS
@@ -159,48 +163,115 @@ class IntegrationManageView( ConfigPageView ):
integration_id = kwargs.get('integration_id')
if integration_id:
- integration_data = integration_manager.get_integration_data(
+ integration_data = self.get_integration_data(
integration_id = integration_id,
)
else:
integration_data = integration_manager.get_default_integration_data()
-
+
if not integration_data.integration.is_enabled:
raise BadRequest( f'{integration_data.label} integration is not enabled' )
- integration_data_list = integration_manager.get_integration_data_list( enabled_only = True )
+ attr_item_context = IntegrationAttributeItemEditContext(
+ integration_data = integration_data,
+ )
+ integration_data_list = self.get_integration_data_list( enabled_only = True )
manage_view_pane = integration_data.integration_gateway.get_manage_view_pane()
- template_name = manage_view_pane.get_template_name()
+ manage_template_name = manage_view_pane.get_template_name()
template_context = manage_view_pane.get_template_context( integration_data = integration_data )
-
+
+ template_context.update(
+ self.create_initial_template_context(
+ attr_item_context= attr_item_context,
+ )
+ )
template_context.update({
+ # Extra needed on initial view only for tabbed navigation. Not
+ # needed for attribute edit operations.
+ #
# Nest this context to avoid collisions with integration
# context. Integrations should not need to know about these.
'core': {
'integration_data_list': integration_data_list,
'integration_data': integration_data,
- 'manage_view_pane_template_name': template_name,
+ 'manage_view_template_name': manage_template_name,
},
})
return template_context
+ def post( self, request,*args, **kwargs ):
+ integration_manager = IntegrationManager()
+
+ integration_id = kwargs.get('integration_id')
+ if integration_id:
+ integration_data = self.get_integration_data(
+ integration_id = integration_id,
+ )
+ else:
+ integration_data = integration_manager.get_default_integration_data()
-class IntegrationAttributeHistoryView(BaseAttributeHistoryView):
- """View for displaying IntegrationAttribute history in a modal."""
-
- def get_attribute_model_class(self):
- return IntegrationAttribute
-
- def get_history_url_name(self):
- return 'integration_attribute_history'
+ if not integration_data.integration.is_enabled:
+ raise BadRequest( f'{integration_data.label} integration is not enabled' )
+
+ attr_item_context = IntegrationAttributeItemEditContext(
+ integration_data = integration_data,
+ )
+ return self.post_attribute_form(
+ request = request,
+ attr_item_context = attr_item_context,
+ )
- def get_restore_url_name(self):
- return 'integration_attribute_restore'
+
+class IntegrationAttributeHistoryInlineView( View,
+ IntegrationViewMixin,
+ AttributeEditViewMixin ):
+
+ def get(self, request, integration_id, attribute_id, *args, **kwargs):
+ # Validate that the attribute belongs to this integration for security
+ try:
+ attribute = IntegrationAttribute.objects.select_related('integration').get(
+ pk = attribute_id, integration_id = integration_id )
+ except IntegrationAttribute.DoesNotExist:
+ return page_not_found_response(request, "Attribute not found.")
+
+ integration_data = self.get_integration_data(
+ integration_id = attribute.integration.integration_id,
+ )
+ attr_item_context = IntegrationAttributeItemEditContext(
+ integration_data = integration_data,
+ )
+ return self.get_history(
+ request = request,
+ attribute = attribute,
+ attr_item_context = attr_item_context,
+ )
-class IntegrationAttributeRestoreView(BaseAttributeRestoreView):
- """View for restoring IntegrationAttribute values from history."""
+class IntegrationAttributeRestoreInlineView( View,
+ IntegrationViewMixin,
+ AttributeEditViewMixin ):
+ """View for restoring IntegrationAttribute values from history inline."""
- def get_attribute_model_class(self):
- return IntegrationAttribute
+ def get(self, request, integration_id, attribute_id, history_id, *args, **kwargs):
+ """ Need to do restore in a GET since nested in main form and cannot have a form in a form """
+ try:
+ attribute = IntegrationAttribute.objects.select_related('integration').get(
+ pk = attribute_id, integration_id = integration_id
+ )
+ except IntegrationAttribute.DoesNotExist:
+ return page_not_found_response(request, "Attribute not found.")
+
+ integration_data = self.get_integration_data(
+ integration_id = attribute.integration.integration_id,
+ )
+
+ attr_item_context = IntegrationAttributeItemEditContext(
+ integration_data = integration_data,
+ )
+ return self.post_restore(
+ request = request,
+ attribute = attribute,
+ history_id = history_id,
+ attr_item_context = attr_item_context,
+ )
diff --git a/src/hi/middleware.py b/src/hi/middleware.py
index 0ceca396..c044827c 100644
--- a/src/hi/middleware.py
+++ b/src/hi/middleware.py
@@ -53,7 +53,7 @@ class ExceptionMiddleware(object):
def process_request( self, request ):
return None
-
+
def process_exception( self, request, exception ):
ip_address = request.META.get( 'HTTP_X_FORWARDED_FOR' ) # nginx forwarded
logger.warning( f'Exception caught in middleware [{ip_address}]: {exception}' )
diff --git a/src/hi/services/hass/hass_converter.py b/src/hi/services/hass/hass_converter.py
index ed270bc6..9f185368 100644
--- a/src/hi/services/hass/hass_converter.py
+++ b/src/hi/services/hass/hass_converter.py
@@ -718,15 +718,17 @@ class HassConverter:
if is_controllable:
# Create controller and store payload
- entity_state = cls._create_controller_from_entity_state_type(
+ controller = cls._create_controller_from_entity_state_type(
entity_state_type, entity, integration_key_for_storage, name, domain_payload
)
+ entity_state = controller.entity_state
else:
# Create sensor and store payload
- entity_state = cls._create_sensor_from_entity_state_type(
+ sensor = cls._create_sensor_from_entity_state_type(
entity_state_type, entity, integration_key_for_storage, name, domain_payload
)
-
+ entity_state = sensor.entity_state
+
return entity_state
@classmethod
@@ -777,12 +779,13 @@ class HassConverter:
return (domain, entity_state_type) in cls.CONTROL_SERVICE_MAPPING
@classmethod
- def _create_controller_from_entity_state_type( cls,
- entity_state_type : EntityStateType,
- entity : Entity,
- integration_key : IntegrationKey,
- name : str,
- domain_payload : dict ):
+ def _create_controller_from_entity_state_type(
+ cls,
+ entity_state_type : EntityStateType,
+ entity : Entity,
+ integration_key : IntegrationKey,
+ name : str,
+ domain_payload : dict ):
"""Create appropriate controller based on EntityStateType"""
if entity_state_type == EntityStateType.ON_OFF:
@@ -821,7 +824,7 @@ class HassConverter:
# Store domain payload
controller.integration_payload = domain_payload
controller.save()
- return controller.entity_state
+ return controller
@classmethod
def _create_sensor_from_entity_state_type( cls,
@@ -829,7 +832,7 @@ class HassConverter:
entity : Entity,
integration_key : IntegrationKey,
name : str,
- domain_payload : dict ):
+ domain_payload : dict ):
"""Create appropriate sensor based on EntityStateType"""
if entity_state_type == EntityStateType.MOVEMENT:
@@ -885,7 +888,7 @@ class HassConverter:
# Store domain payload for sensors too
sensor.integration_payload = domain_payload
sensor.save()
- return sensor.entity_state
+ return sensor
@classmethod
def _create_sensor_from_entity_state_type_with_params( cls,
diff --git a/src/hi/services/hass/hass_manage_view_pane.py b/src/hi/services/hass/hass_manage_view_pane.py
index b336ac3b..2bc17282 100644
--- a/src/hi/services/hass/hass_manage_view_pane.py
+++ b/src/hi/services/hass/hass_manage_view_pane.py
@@ -1,6 +1,6 @@
from typing import Dict
-from hi.integrations.forms import IntegrationAttributeFormSet
+from hi.apps.entity.models import Entity
from hi.integrations.integration_data import IntegrationData
from hi.integrations.integration_manage_view_pane import IntegrationManageViewPane
@@ -11,18 +11,9 @@ class HassManageViewPane( IntegrationManageViewPane ):
return 'hass/panes/hass_manage.html'
def get_template_context( self, integration_data : IntegrationData ) -> Dict[ str, object ]:
-
- integration_attribute_formset = IntegrationAttributeFormSet(
- instance = integration_data.integration,
- prefix = f'integration-{integration_data.integration_id}',
- form_kwargs = {
- 'show_as_editable': True,
- },
- )
+
+ has_entities = Entity.objects.filter( integration_id = integration_data.integration_id ).exists()
+
return {
- 'integration_attribute_formset': integration_attribute_formset,
- 'history_url_name': 'integration_attribute_history',
- 'restore_url_name': 'integration_attribute_restore',
+ 'has_entities': has_entities,
}
-
-
diff --git a/src/hi/services/hass/templates/hass/panes/hass_manage.html b/src/hi/services/hass/templates/hass/panes/hass_manage.html
index 82dbd023..c2cd8668 100644
--- a/src/hi/services/hass/templates/hass/panes/hass_manage.html
+++ b/src/hi/services/hass/templates/hass/panes/hass_manage.html
@@ -1,13 +1,28 @@
+{% load static %}
<div class="d-flex justify-content-between">
- <div>
- {% include "hass/panes/hass_settings.html" %}
- </div>
- <div class="my-4 py-4 mr-4 pr-4">
+ <div class="h3 integration-title">
+ <img class="img-fluid"
+ src="{% static 'img/integrations/home-assistant.png' %}"
+ alt="Home Assistant Logo" \>
+ Home Assistant
+ </div>
+ <div class="">
<form action="{% url 'hass_sync' %}"
- method="POST" role="form" data-async="true">
+ method="POST" role="form" data-async="true">
{% csrf_token %}
- <button type="submit" class="btn btn-lg btn-secondary" role="button"
- name="action" value="sync" >IMPORT ITEMS</button>
+ <button type="submit" class="btn btn-secondary" role="button"
+ name="action" value="sync" >
+ {% if has_entities %}
+ RE-SYNC
+ {% else %}
+ IMPORT
+ {% endif %}
+ </button>
</form>
</div>
</div>
+{% if not has_entities %}
+<div class="alert alert-warning text-center">
+ Use the "IMPORT" button to add items from Home Assistant.
+</div>
+{% endif %}
diff --git a/src/hi/services/hass/templates/hass/panes/hass_settings.html b/src/hi/services/hass/templates/hass/panes/hass_settings.html
deleted file mode 100644
index f7358d08..00000000
--- a/src/hi/services/hass/templates/hass/panes/hass_settings.html
+++ /dev/null
@@ -1,18 +0,0 @@
-{% load icons %}
-<div id="hi-hass-settings">
- <form action="{% url 'hass_settings' %}" method="post"
- class="form" data-async="#hi-hass-settings" data-mode="replace">
- {% csrf_token %}
-
- <div class="h4">Settings</div>
-
- <div>
- {% include "attribute/panes/attribute_form.html" with attribute_formset=integration_attribute_formset %}
- </div>
-
- <button id="hi-hass-setting-button" type="submit" class="btn btn-primary"
- name="action" value="update">
- {% icon "save" size="sm" css_class="hi-icon-left" %}UPDATE
- </button>
- </form>
-</div>
diff --git a/src/hi/services/hass/tests/test_hass_client.py b/src/hi/services/hass/tests/test_hass_client.py
index 2e55a46f..dfd59010 100644
--- a/src/hi/services/hass/tests/test_hass_client.py
+++ b/src/hi/services/hass/tests/test_hass_client.py
@@ -1,4 +1,5 @@
import json
+import logging
import os
from unittest.mock import Mock, patch
from django.test import TestCase
@@ -7,6 +8,8 @@ from requests.exceptions import ConnectionError
from hi.services.hass.hass_client import HassClient
from hi.services.hass.hass_models import HassState
+logging.disable(logging.CRITICAL)
+
class TestHassClientInitialization(TestCase):
"""Test HassClient initialization and configuration"""
diff --git a/src/hi/services/hass/tests/test_hass_controller.py b/src/hi/services/hass/tests/test_hass_controller.py
index 313e347a..514c84d8 100644
--- a/src/hi/services/hass/tests/test_hass_controller.py
+++ b/src/hi/services/hass/tests/test_hass_controller.py
@@ -1,3 +1,4 @@
+import logging
from unittest.mock import Mock, patch
from django.test import TestCase
@@ -5,6 +6,8 @@ from hi.integrations.transient_models import IntegrationDetails, IntegrationKey,
from hi.services.hass.hass_controller import HassController
+logging.disable(logging.CRITICAL)
+
class TestHassControllerBehaviorVerification(TestCase):
"""Test HassController focusing on behavior verification rather than mock validation"""
diff --git a/src/hi/services/hass/tests/test_hass_converter_mapping.py b/src/hi/services/hass/tests/test_hass_converter_mapping.py
index 7efe0c24..e36c2807 100644
--- a/src/hi/services/hass/tests/test_hass_converter_mapping.py
+++ b/src/hi/services/hass/tests/test_hass_converter_mapping.py
@@ -1,4 +1,5 @@
import json
+import logging
import os
from django.test import TestCase
from unittest.mock import Mock
@@ -11,6 +12,8 @@ from hi.integrations.transient_models import IntegrationKey
from hi.services.hass.hass_converter import HassConverter
from hi.services.hass.hass_models import HassApi, HassDevice
+logging.disable(logging.CRITICAL)
+
class TestHassConverterMapping(TestCase):
"""
diff --git a/src/hi/services/hass/tests/test_hass_manager.py b/src/hi/services/hass/tests/test_hass_manager.py
index feb66527..a00b33b6 100644
--- a/src/hi/services/hass/tests/test_hass_manager.py
+++ b/src/hi/services/hass/tests/test_hass_manager.py
@@ -1,3 +1,4 @@
+import logging
import threading
from unittest.mock import Mock, patch
from django.test import TestCase
@@ -11,6 +12,8 @@ from hi.services.hass.hass_client import HassClient
from hi.services.hass.hass_manager import HassManager
from hi.services.hass.hass_metadata import HassMetaData
+logging.disable(logging.CRITICAL)
+
class TestHassManagerSingleton(TestCase):
"""Test singleton behavior and thread safety"""
diff --git a/src/hi/services/hass/tests/test_hass_sync.py b/src/hi/services/hass/tests/test_hass_sync.py
index 59eadc29..f53bd39b 100644
--- a/src/hi/services/hass/tests/test_hass_sync.py
+++ b/src/hi/services/hass/tests/test_hass_sync.py
@@ -1,4 +1,5 @@
import json
+import logging
import os
from unittest.mock import Mock, patch
from django.test import TestCase
@@ -10,6 +11,8 @@ from hi.integrations.transient_models import IntegrationKey
from hi.services.hass.hass_sync import HassSynchronizer
from hi.services.hass.hass_models import HassDevice, HassState
+logging.disable(logging.CRITICAL)
+
class TestHassSynchronizerInitialization(TestCase):
"""Test HassSynchronizer initialization and basic setup"""
diff --git a/src/hi/services/hass/urls.py b/src/hi/services/hass/urls.py
index d9c12cb4..94673cd5 100644
--- a/src/hi/services/hass/urls.py
+++ b/src/hi/services/hass/urls.py
@@ -6,10 +6,6 @@ from . import views
urlpatterns = [
- re_path( r'^settings$',
- views.HassSettingsView.as_view(),
- name='hass_settings' ),
-
re_path( r'^sync$',
views.HassSyncView.as_view(),
name='hass_sync' ),
diff --git a/src/hi/services/hass/views.py b/src/hi/services/hass/views.py
index 4d59bf57..0ed711a3 100644
--- a/src/hi/services/hass/views.py
+++ b/src/hi/services/hass/views.py
@@ -1,48 +1,8 @@
-from django.core.exceptions import BadRequest
-from django.db import transaction
-
-from django.shortcuts import render
-from django.views.generic import View
-
-from hi.integrations.forms import IntegrationAttributeFormSet
-from hi.integrations.integration_manager import IntegrationManager
-
from hi.hi_async_view import HiModalView
-from .hass_metadata import HassMetaData
-from .hass_mixins import HassMixin
from .hass_sync import HassSynchronizer
-class HassSettingsView( View, HassMixin ):
-
- def post( self, request, *args, **kwargs ):
- integration_data = IntegrationManager().get_integration_data(
- integration_id = HassMetaData.integration_id,
- )
- if not integration_data.is_enabled:
- raise BadRequest( 'HAss is not enabled' )
-
- integration_attribute_formset = IntegrationAttributeFormSet(
- request.POST,
- request.FILES,
- instance = integration_data.integration,
- prefix = f'integration-{integration_data.integration_id}',
- )
- if integration_attribute_formset.is_valid():
- with transaction.atomic():
- integration_attribute_formset.save()
-
- self.hass_manager().notify_settings_changed()
-
- context = {
- 'integration_attribute_formset': integration_attribute_formset,
- 'history_url_name': 'integration_attribute_history',
- 'restore_url_name': 'integration_attribute_restore',
- }
- return render( request, 'hass/panes/hass_settings.html', context )
-
-
class HassSyncView( HiModalView ):
def get_template_name( self ) -> str:
diff --git a/src/hi/services/zoneminder/templates/zoneminder/panes/zm_manage.html b/src/hi/services/zoneminder/templates/zoneminder/panes/zm_manage.html
index 94555dca..43d98c57 100644
--- a/src/hi/services/zoneminder/templates/zoneminder/panes/zm_manage.html
+++ b/src/hi/services/zoneminder/templates/zoneminder/panes/zm_manage.html
@@ -1,13 +1,28 @@
+{% load static %}
<div class="d-flex justify-content-between">
- <div>
- {% include "zoneminder/panes/zm_settings.html" %}
+ <div class="h3 integration-title">
+ <img class="img-fluid"
+ src="{% static 'img/integrations/zoneminder.png' %}"
+ alt="ZoneMinder Logo" \>
+ ZoneMinder
</div>
- <div class="my-4 py-4 mr-4 pr-4">
+ <div class="">
<form action="{% url 'zm_sync' %}"
- method="POST" role="form" data-async="">
+ method="POST" role="form" data-async="">
{% csrf_token %}
- <button type="submit" class="btn btn-lg btn-secondary" role="button"
- name="action" value="sync" >IMPORT ITEMS</button>
+ <button type="submit" class="btn btn btn-secondary" role="button"
+ name="action" value="sync" >
+ {% if has_entities %}
+ RE-SYNC
+ {% else %}
+ IMPORT
+ {% endif %}
+ </button>
</form>
</div>
</div>
+{% if not has_entities %}
+<div class="alert alert-warning text-center">
+ Use the "IMPORT" button to add items from ZoneMinder.
+</div>
+{% endif %}
diff --git a/src/hi/services/zoneminder/templates/zoneminder/panes/zm_settings.html b/src/hi/services/zoneminder/templates/zoneminder/panes/zm_settings.html
deleted file mode 100644
index 6549f737..00000000
--- a/src/hi/services/zoneminder/templates/zoneminder/panes/zm_settings.html
+++ /dev/null
@@ -1,18 +0,0 @@
-{% load icons %}
-<div id="hi-zm-settings">
- <form action="{% url 'zm_settings' %}" method="post"
- class="form" data-async="#hi-zm-settings" data-mode="replace">
- {% csrf_token %}
-
- <div class="h4">Settings</div>
-
- <div>
- {% include "attribute/panes/attribute_form.html" with attribute_formset=integration_attribute_formset %}
- </div>
-
- <button id="hi-zm-setting-button" type="submit" class="btn btn-primary"
- name="action" value="update">
- {% icon "save" size="sm" css_class="hi-icon-left" %}UPDATE SETTINGS
- </button>
- </form>
-</div>
diff --git a/src/hi/services/zoneminder/tests/test_monitors.py b/src/hi/services/zoneminder/tests/test_monitors.py
index a556a081..2133d85e 100644
--- a/src/hi/services/zoneminder/tests/test_monitors.py
+++ b/src/hi/services/zoneminder/tests/test_monitors.py
@@ -1,3 +1,4 @@
+import logging
from datetime import datetime, timedelta
from unittest.mock import Mock, patch
from django.test import TestCase
@@ -8,6 +9,8 @@ from hi.apps.entity.enums import EntityStateValue
from hi.services.zoneminder.monitors import ZoneMinderMonitor
from hi.services.zoneminder.zm_models import ZmEvent, AggregatedMonitorState
+logging.disable(logging.CRITICAL)
+
class TestZoneMinderMonitorEventAggregation(TestCase):
"""
diff --git a/src/hi/services/zoneminder/tests/test_zm_controller.py b/src/hi/services/zoneminder/tests/test_zm_controller.py
index 314448ad..acd41d37 100644
--- a/src/hi/services/zoneminder/tests/test_zm_controller.py
+++ b/src/hi/services/zoneminder/tests/test_zm_controller.py
@@ -1,3 +1,4 @@
+import logging
from unittest.mock import Mock, patch
from django.test import TestCase
@@ -7,6 +8,8 @@ from hi.services.zoneminder.zm_controller import ZoneMinderController
from hi.services.zoneminder.zm_manager import ZoneMinderManager
from hi.services.zoneminder.zm_metadata import ZmMetaData
+logging.disable(logging.CRITICAL)
+
class TestZoneMinderControllerIntegrationKeyParsing(TestCase):
"""Test integration key parsing and end-to-end behavior with real manager"""
diff --git a/src/hi/services/zoneminder/tests/test_zm_manager.py b/src/hi/services/zoneminder/tests/test_zm_manager.py
index 3fd02579..f57f5d0b 100644
--- a/src/hi/services/zoneminder/tests/test_zm_manager.py
+++ b/src/hi/services/zoneminder/tests/test_zm_manager.py
@@ -1,3 +1,4 @@
+import logging
import threading
from datetime import timedelta
from unittest.mock import Mock, patch
@@ -13,6 +14,8 @@ from hi.services.zoneminder.enums import ZmAttributeType
from hi.services.zoneminder.zm_manager import ZoneMinderManager
from hi.services.zoneminder.zm_metadata import ZmMetaData
+logging.disable(logging.CRITICAL)
+
class TestZoneMinderManagerSingleton(TestCase):
"""Test singleton behavior and thread safety"""
diff --git a/src/hi/services/zoneminder/tests/test_zm_sync.py b/src/hi/services/zoneminder/tests/test_zm_sync.py
index 659b3560..8f1efa6f 100644
--- a/src/hi/services/zoneminder/tests/test_zm_sync.py
+++ b/src/hi/services/zoneminder/tests/test_zm_sync.py
@@ -1,4 +1,5 @@
import json
+import logging
import os
from unittest.mock import Mock, patch, call
from django.test import TestCase
@@ -12,6 +13,8 @@ from hi.integrations.transient_models import IntegrationKey
from hi.services.zoneminder.zm_sync import ZoneMinderSynchronizer
from hi.services.zoneminder.zm_metadata import ZmMetaData
+logging.disable(logging.CRITICAL)
+
class TestZoneMinderSynchronizerLockBehavior(TestCase):
"""Test database lock coordination with exception handling"""
diff --git a/src/hi/services/zoneminder/urls.py b/src/hi/services/zoneminder/urls.py
index 7f569ca7..3acc8bd3 100644
--- a/src/hi/services/zoneminder/urls.py
+++ b/src/hi/services/zoneminder/urls.py
@@ -6,10 +6,6 @@ from . import views
urlpatterns = [
- re_path( r'^settings$',
- views.ZmSettingsView.as_view(),
- name='zm_settings' ),
-
re_path( r'^sync$',
views.ZmSyncView.as_view(),
name='zm_sync' ),
diff --git a/src/hi/services/zoneminder/views.py b/src/hi/services/zoneminder/views.py
index 2654fe3e..1deffaf0 100644
--- a/src/hi/services/zoneminder/views.py
+++ b/src/hi/services/zoneminder/views.py
@@ -1,47 +1,8 @@
-from django.core.exceptions import BadRequest
-from django.db import transaction
-from django.shortcuts import render
-from django.views.generic import View
-
-from hi.integrations.forms import IntegrationAttributeFormSet
-from hi.integrations.integration_manager import IntegrationManager
-
from hi.hi_async_view import HiModalView
-from .zm_mixins import ZoneMinderMixin
-from .zm_metadata import ZmMetaData
from .zm_sync import ZoneMinderSynchronizer
-class ZmSettingsView( View, ZoneMinderMixin ):
-
- def post( self, request, *args, **kwargs ):
- integration_data = IntegrationManager().get_integration_data(
- integration_id = ZmMetaData.integration_id,
- )
- if not integration_data.is_enabled:
- raise BadRequest( 'ZoneMinder is not enabled' )
-
- integration_attribute_formset = IntegrationAttributeFormSet(
- request.POST,
- request.FILES,
- instance = integration_data.integration,
- prefix = f'integration-{integration_data.integration_id}',
- )
- if integration_attribute_formset.is_valid():
- with transaction.atomic():
- integration_attribute_formset.save()
-
- self.zm_manager().notify_settings_changed()
-
- context = {
- 'integration_attribute_formset': integration_attribute_formset,
- 'history_url_name': 'integration_attribute_history',
- 'restore_url_name': 'integration_attribute_restore',
- }
- return render( request, 'zoneminder/panes/zm_settings.html', context )
-
-
class ZmSyncView( HiModalView ):
def get_template_name( self ) -> str:
diff --git a/src/hi/services/zoneminder/zm_manage_view_pane.py b/src/hi/services/zoneminder/zm_manage_view_pane.py
index 41cb462e..3d3432e3 100644
--- a/src/hi/services/zoneminder/zm_manage_view_pane.py
+++ b/src/hi/services/zoneminder/zm_manage_view_pane.py
@@ -1,6 +1,6 @@
from typing import Dict
-from hi.integrations.forms import IntegrationAttributeFormSet
+from hi.apps.entity.models import Entity
from hi.integrations.integration_data import IntegrationData
from hi.integrations.integration_manage_view_pane import IntegrationManageViewPane
@@ -12,17 +12,8 @@ class ZmManageViewPane( IntegrationManageViewPane ):
def get_template_context( self, integration_data : IntegrationData ) -> Dict[ str, object ]:
- integration_attribute_formset = IntegrationAttributeFormSet(
- instance = integration_data.integration,
- prefix = f'integration-{integration_data.integration_id}',
- form_kwargs = {
- 'show_as_editable': True,
- },
- )
+ has_entities = Entity.objects.filter( integration_id = integration_data.integration_id ).exists()
+
return {
- 'integration_attribute_formset': integration_attribute_formset,
- 'history_url_name': 'integration_attribute_history',
- 'restore_url_name': 'integration_attribute_restore',
+ 'has_entities': has_entities,
}
-
-
diff --git a/src/hi/settings/base.py b/src/hi/settings/base.py
index cbe53b11..2c0dbc34 100644
--- a/src/hi/settings/base.py
+++ b/src/hi/settings/base.py
@@ -233,6 +233,9 @@ PIPELINE = {
'source_filenames': (
'bootstrap/css/bootstrap.css',
'css/main.css',
+ 'css/icons.css',
+ 'css/attribute.css',
+ 'css/stream-browser.css',
),
'output_filename': 'css/css_head.css',
},
@@ -245,14 +248,19 @@ PIPELINE = {
'js/antinode.js',
'js/autosize.min.js',
'js/main.js',
+ ),
+ 'output_filename': 'js/js_before_content.js',
+ },
+ 'js_hi_grid_header_content': {
+ 'source_filenames': (
+ 'js/watchdog.js',
'js/settings.js',
'js/audio.js',
- 'js/attribute-changes.js',
'js/video-timeline.js',
'js/attr.js',
'js/attr-dirty-tracking.js',
),
- 'output_filename': 'js/js_before_content.js',
+ 'output_filename': 'js/js_hi_grid_header_content.js',
},
'js_after_content': {
'source_filenames': (
@@ -264,7 +272,6 @@ PIPELINE = {
'js_hi_grid_content': {
'source_filenames': (
'js/svg-utils.js',
- 'js/watchdog.js',
'js/status.js',
'js/auto-view.js',
'js/edit.js',
diff --git a/src/hi/static/css/attribute.css b/src/hi/static/css/attribute.css
new file mode 100644
index 00000000..85c636fc
--- /dev/null
+++ b/src/hi/static/css/attribute.css
@@ -0,0 +1,1528 @@
+/* Attribute V2 System Styles - Fresh Start */
+
+/* Container Structure */
+.attr-v2-container {
+ /* Remove default form margins for better layout control */
+ margin: 0;
+}
+
+/* Sticky Panel (Entity Info + Action Bar - Always Visible) */
+.attr-v2-sticky-panel {
+ position: sticky;
+ top: 0;
+ z-index: 10;
+ background-color: var(--white);
+ border-bottom: 1px solid var(--line-color);
+ padding-bottom: 0.75rem;
+}
+
+/* Entity Info Section (Minimal - Name/Type) */
+.attr-v2-entity-info {
+ padding: 0.5rem 0 0.25rem 0;
+}
+
+/* Action Bar */
+.attr-v2-action-bar {
+ padding: 0.25rem 0;
+ background-color: var(--white);
+}
+
+.attr-v2-action-bar-content {
+ display: flex;
+ align-items: center;
+ gap: 1rem;
+}
+
+/* Left group: button and messages */
+.attr-v2-action-bar-left {
+ display: flex;
+ align-items: center;
+ gap: 1rem;
+ flex: 1; /* Take available space */
+}
+
+/* Message stack */
+.attr-v2-message-stack {
+ display: flex;
+ flex-direction: column;
+ gap: 0.25rem;
+}
+
+.attr-v2-update-btn {
+ min-height: 44px; /* Touch-friendly primary action */
+ min-width: 80px;
+ padding: 0.75rem 1.5rem;
+ flex-shrink: 0; /* Don't shrink button */
+}
+
+/* Right group: action buttons */
+.attr-v2-action-buttons {
+ display: flex;
+ gap: 0.5rem;
+ align-items: center;
+ flex-shrink: 0; /* Don't shrink buttons */
+ margin-left: auto; /* Push to right */
+}
+
+.attr-v2-action-buttons button {
+ min-height: 44px; /* Touch-friendly minimum */
+ padding: 0.375rem 0.75rem;
+ font-size: 0.875rem;
+ border-radius: 0.25rem;
+}
+
+.attr-v2-status-message {
+ font-size: 0.875rem;
+ color: var(--secondary-text-color);
+ font-style: italic;
+}
+
+/* Status message variants */
+.attr-v2-status-message.success {
+ color: var(--success-color, #28a745);
+ background-color: var(--success-bg-light);
+ padding: 0.25rem 0.5rem;
+ border-radius: 0.25rem;
+ font-style: normal;
+ font-weight: 500;
+ display: flex;
+ align-items: center;
+ gap: 0.25rem;
+}
+
+.attr-v2-status-message.success::before {
+ content: '✓';
+ font-weight: bold;
+ color: var(--success-color, #28a745);
+}
+
+/* Scrollable Content Area (Natural Scrolling) */
+.attr-v2-scrollable-content {
+ padding: 1rem 0;
+ /* Natural scrolling - no height restrictions or overflow settings */
+}
+
+/* Touch-friendly Form Controls - Consistent heights */
+.attr-v2-container input,
+.attr-v2-container select,
+.attr-v2-container textarea {
+ min-height: 44px; /* Touch-friendly minimum for form inputs */
+ padding: 0.75rem;
+ font-size: 0.875rem;
+ border-radius: 0.375rem;
+}
+
+.attr-v2-container input[type="text"],
+.attr-v2-container input[type="email"],
+.attr-v2-container input[type="url"],
+.attr-v2-container select {
+ height: 44px; /* Exact height for single-line inputs */
+}
+
+.attr-v2-container textarea {
+ min-height: 44px;
+ resize: vertical;
+}
+
+/* Section Titles - Reduced size to match mockup */
+.attr-v2-section-title {
+ font-size: 0.875rem;
+ font-weight: 600;
+ color: var(--secondary-text-color);
+ margin-bottom: 0.5rem;
+ padding-bottom: 0.25rem;
+ text-transform: uppercase;
+ letter-spacing: 0.025em;
+ border-bottom: 1px solid var(--line-color);
+}
+
+/* File Grid Layout */
+.attr-v2-file-section {
+ margin-bottom: 2rem;
+}
+
+.attr-v2-file-grid {
+ display: grid;
+ grid-template-columns: repeat(3, 1fr);
+ gap: 1rem;
+ margin-top: 0.75rem;
+}
+
+.attr-v2-file-card {
+ /* No border or padding on main card - components handle their own styling */
+ border-radius: 0.375rem;
+ background: transparent;
+ transition: all 0.2s ease;
+ display: flex;
+ flex-direction: column;
+ overflow: hidden; /* Maintain rounded corners */
+}
+
+.attr-v2-file-thumbnail {
+ position: relative;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ padding: 1rem;
+ /* Diagonal hatch pattern background */
+ background: repeating-linear-gradient(
+ 45deg,
+ #f8f9fa,
+ #f8f9fa 10px,
+ #e9ecef 10px,
+ #e9ecef 20px
+ );
+ border-radius: 0.375rem 0.375rem 0 0; /* Rounded top corners only */
+ cursor: pointer;
+}
+
+.attr-v2-file-type-label {
+ font-size: 0.8rem;
+ font-weight: 700;
+ color: var(--text-color);
+ margin-top: 0.5rem;
+ text-transform: uppercase;
+ letter-spacing: 0.05em;
+}
+
+.attr-v2-file-info {
+ flex-grow: 1;
+ background: var(--white);
+ border: 1px solid var(--line-color);
+ border-top: none; /* No border on top - seamless with thumbnail */
+ border-radius: 0 0 0.375rem 0.375rem; /* Rounded bottom corners only */
+ padding: 0.75rem;
+}
+
+.attr-v2-file-name {
+ font-size: 0.875rem;
+ font-weight: 500;
+ margin-bottom: 0.25rem;
+ word-break: break-word;
+}
+
+/* File title input - styled to appear like text initially */
+.attr-v2-file-title-input {
+ font-size: 0.875rem;
+ font-weight: 500;
+ margin-bottom: 0.25rem;
+ word-break: break-word;
+
+ /* Minimal styling - appears like text */
+ border: 1px solid transparent;
+ background: transparent;
+ padding: 2px 4px;
+ border-radius: 3px;
+ width: 100%;
+ transition: all 0.2s ease;
+
+ /* Inherit text color and font */
+ color: inherit;
+ font-family: inherit;
+ line-height: inherit;
+}
+
+/* Focused and activated state - stronger input appearance */
+.attr-v2-file-title-input:focus,
+.attr-v2-file-title-input.activated {
+ border-color: var(--primary-color, #007bff);
+ background: var(--white, #ffffff);
+ box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
+ outline: none;
+}
+
+/* Hover state - subtle indication it's interactive */
+.attr-v2-file-title-input:hover:not(:focus) {
+ border-color: var(--line-color, #dee2e6);
+ background: rgba(0, 0, 0, 0.02);
+}
+
+.attr-v2-file-filename {
+ font-size: 0.75rem;
+ color: var(--muted-color);
+ word-break: break-word;
+}
+
+.attr-v2-file-actions {
+ display: flex;
+ gap: 0.25rem;
+ justify-content: center;
+ margin-top: 0.75rem;
+ padding-top: 0.75rem;
+ border-top: 1px solid var(--line-color);
+}
+
+.attr-v2-file-actions button {
+ min-height: 44px; /* Touch-friendly minimum */
+ min-width: 44px;
+ padding: 0.375rem;
+ font-size: 0.875rem;
+ border-radius: 0.25rem;
+}
+
+/* Reorder Controls - Overlay in upper right of thumbnail */
+.attr-v2-reorder-controls {
+ position: absolute;
+ top: 4px;
+ right: 4px;
+ display: flex;
+ flex-direction: row;
+ gap: 1px;
+ background: rgba(255, 255, 255, 0.9);
+ border-radius: 0.25rem;
+ padding: 2px;
+ z-index: 1;
+}
+
+/* Disable thumbnail hover when hovering over reorder controls */
+.attr-v2-file-thumbnail:hover:has(.attr-v2-reorder-controls:hover) {
+ background-color: var(--background-color) !important;
+ transform: none !important;
+}
+
+/* Enhance reorder controls hover state */
+.attr-v2-reorder-controls:hover {
+ background: rgba(255, 255, 255, 1);
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
+}
+
+/* Ensure buttons within controls maintain their hover states */
+.attr-v2-reorder-controls button:hover {
+ background-color: var(--background-color);
+ border-color: var(--line-color);
+}
+
+/* JavaScript-based hover state override */
+.attr-v2-file-thumbnail.reorder-hover:hover {
+ background-color: var(--background-color) !important;
+ transform: none !important;
+}
+
+/* Fallback for browsers that don't support :has() - JavaScript handles it */
+@supports not selector(:has(*)) {
+ .attr-v2-file-thumbnail:hover:has(.attr-v2-reorder-controls:hover) {
+ /* This won't work in unsupported browsers, JS handles it instead */
+ }
+}
+
+.attr-v2-reorder-controls button {
+ /* Touch-friendly size with small visual appearance */
+ min-width: 24px;
+ min-height: 24px;
+ padding: 6px;
+ font-size: 10px;
+ line-height: 1;
+ border-radius: 0.25rem;
+ position: relative;
+ /* Center the small chevron icon within the larger touch area */
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.attr-v2-reorder-controls button:disabled {
+ opacity: 0.3;
+ cursor: not-allowed;
+ background-color: var(--background-color);
+ border-color: var(--line-color);
+ color: var(--muted-color);
+}
+
+.attr-v2-reorder-controls button:disabled:hover {
+ transform: none;
+ box-shadow: none;
+}
+
+/* Attribute List Layout */
+.attr-v2-attribute-section {
+ margin-bottom: 2rem;
+}
+
+.attr-v2-attribute-list {
+ display: flex;
+ flex-direction: column;
+ gap: 0.75rem;
+}
+
+.attr-v2-attribute-card {
+ border: 1px solid var(--line-color);
+ border-radius: 0.375rem;
+ padding: 0.75rem;
+ background: var(--white);
+ transition: all 0.2s ease;
+}
+
+.attr-v2-attribute-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: flex-start;
+ margin-bottom: 0.5rem;
+}
+
+.attr-v2-attribute-name {
+ font-size: 0.875rem;
+ font-weight: 500;
+ margin: 0;
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+}
+
+.attr-v2-attribute-actions {
+ display: flex;
+ gap: 0.25rem;
+}
+
+.attr-v2-attribute-actions button {
+ padding: 0.375rem;
+ min-width: 44px; /* Touch-friendly minimum */
+ min-height: 44px; /* Touch-friendly minimum */
+ border: none;
+ background: transparent;
+ color: var(--secondary-text-color);
+ border-radius: 0.25rem;
+ font-size: 0.875rem;
+}
+
+.attr-v2-attribute-actions button:hover {
+ background: var(--background-color);
+ color: var(--text-color);
+}
+
+.attr-v2-attribute-value {
+ margin-top: 0.5rem;
+}
+
+/* Comprehensive Visual State System */
+
+
+/* Error State (validation failures) */
+.attr-v2-file-card.error,
+.attr-v2-attribute-card.error {
+ border-left: 3px solid var(--danger-color);
+ background-color: rgba(220, 53, 69, 0.1);
+ box-shadow: 0 2px 4px rgba(220, 53, 69, 0.1);
+}
+
+.attr-v2-error-message {
+ color: var(--danger-color);
+ font-size: 0.875rem;
+ margin-top: 0.25rem;
+ display: flex;
+ align-items: center;
+ gap: 0.25rem;
+}
+
+/* Loading State (during operations) */
+.attr-v2-file-card.loading,
+.attr-v2-attribute-card.loading {
+ opacity: 0.7;
+ pointer-events: none;
+ position: relative;
+}
+
+.attr-v2-loading-overlay {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: rgba(255, 255, 255, 0.8);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border-radius: 0.25rem;
+}
+
+.attr-v2-loading-spinner {
+ width: 20px;
+ height: 20px;
+ border: 2px solid var(--line-color);
+ border-top: 2px solid var(--primary-color);
+ border-radius: 50%;
+ animation: spin 1s linear infinite;
+}
+
+/* Success State (after successful operations) */
+.attr-v2-file-card.success,
+.attr-v2-attribute-card.success {
+ border-left: 3px solid var(--success-color);
+ background-color: var(--success-bg-light);
+ transition: all 0.3s ease;
+}
+
+.attr-v2-success-message {
+ color: var(--success-color);
+ font-size: 0.875rem;
+ margin-top: 0.25rem;
+ display: flex;
+ align-items: center;
+ gap: 0.25rem;
+}
+
+
+.attr-v2-undo-delete {
+ margin-top: 0.5rem;
+ padding: 0.5rem;
+ background: rgba(255, 193, 7, 0.1);
+ border: 1px solid var(--warning-color);
+ border-radius: 0.25rem;
+}
+
+.attr-v2-undo-delete button {
+ min-height: 32px;
+ padding: 0.25rem 0.75rem;
+}
+
+/* Animation Keyframes */
+@keyframes pulse {
+ 0% { opacity: 1; }
+ 50% { opacity: 0.5; }
+ 100% { opacity: 1; }
+}
+
+@keyframes spin {
+ 0% { transform: rotate(0deg); }
+ 100% { transform: rotate(360deg); }
+}
+
+@keyframes fadeIn {
+ 0% { opacity: 0; transform: translateY(-10px); }
+ 100% { opacity: 1; transform: translateY(0); }
+}
+
+@keyframes slideUp {
+ 0% { opacity: 1; transform: translateY(0); }
+ 100% { opacity: 0; transform: translateY(-10px); }
+}
+
+/* Smooth Transitions for All Interactive Elements */
+
+/* Card State Transitions */
+.attr-v2-file-card,
+.attr-v2-attribute-card {
+ transition: all 0.2s ease-in-out;
+}
+
+.attr-v2-file-card:hover,
+.attr-v2-attribute-card:hover {
+ transform: translateY(-1px);
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
+}
+
+/* Button Transitions */
+.attr-v2-action-buttons button,
+.attr-v2-file-actions button,
+.attr-v2-attribute-actions button,
+.attr-v2-reorder-controls button,
+.attr-v2-update-btn {
+ transition: all 0.15s ease;
+}
+
+.attr-v2-action-buttons button:hover,
+.attr-v2-file-actions button:hover,
+.attr-v2-attribute-actions button:hover,
+.attr-v2-reorder-controls button:hover:not(:disabled),
+.attr-v2-update-btn:hover {
+ transform: translateY(-1px);
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
+}
+
+/* Form Element Transitions */
+.attr-v2-container input,
+.attr-v2-container select,
+.attr-v2-container textarea {
+ transition: border-color 0.15s ease, box-shadow 0.15s ease;
+}
+
+.attr-v2-container input:focus,
+.attr-v2-container select:focus,
+.attr-v2-container textarea:focus {
+ border-color: var(--primary-color);
+ box-shadow: 0 0 0 0.2rem rgba(23, 112, 114, 0.25);
+ outline: none;
+}
+
+/* Enhanced focus states for buttons and interactive elements */
+.attr-v2-action-buttons button:focus,
+.attr-v2-file-actions button:focus,
+.attr-v2-attribute-actions button:focus,
+.attr-v2-reorder-controls button:focus,
+.attr-v2-update-btn:focus {
+ outline: 2px solid var(--primary-color);
+ outline-offset: 2px;
+ box-shadow: 0 0 0 0.2rem rgba(23, 112, 114, 0.25);
+}
+
+.attr-v2-reorder-controls button:focus:disabled {
+ outline-color: var(--muted-color);
+ box-shadow: 0 0 0 0.2rem rgba(126, 126, 129, 0.25);
+}
+
+/* Card focus states for keyboard navigation */
+.attr-v2-file-card:focus-within,
+.attr-v2-attribute-card:focus-within {
+ outline: 2px solid var(--primary-color);
+ outline-offset: 2px;
+}
+
+/* Add form focus enhancement */
+.attr-v2-add-form:focus-within {
+ box-shadow: 0 4px 12px rgba(23, 112, 114, 0.15);
+}
+
+/* Add Form Animation */
+.attr-v2-add-form {
+ transition: all 0.3s ease;
+ animation: fadeIn 0.3s ease when visible;
+}
+
+.attr-v2-add-form.collapsed {
+ display: none;
+}
+
+.attr-v2-add-form:not(.collapsed) {
+ animation: fadeIn 0.3s ease;
+}
+
+/* Status Message Transitions */
+.attr-v2-status-message {
+ transition: opacity 0.25s ease, color 0.25s ease;
+}
+
+/* Thumbnail Hover Effect */
+.attr-v2-file-thumbnail {
+ transition: background-color 0.15s ease, transform 0.15s ease;
+}
+
+.attr-v2-file-thumbnail:hover {
+ background-color: var(--primary-color-light, #e7f3ff);
+ transform: scale(1.02);
+}
+
+/* Responsive Design - Mobile First with Tablet Primary */
+
+/* Small screens - 2 columns for very narrow widths */
+@media (max-width: 575px) {
+ /* Adjust modal for very small screens */
+ .hi-modal-dialog-700 {
+ max-width: 95%;
+ margin: 0.5rem;
+ }
+
+ /* File grid: 2 columns on very small screens */
+ .attr-v2-file-grid {
+ grid-template-columns: repeat(2, 1fr);
+ gap: 0.75rem;
+ }
+}
+
+/* Mobile Landscape (576px to 1023px) - Keep 3 columns */
+@media (min-width: 576px) and (max-width: 1023px) {
+ /* File grid maintains 3 columns */
+ .attr-v2-file-grid {
+ grid-template-columns: repeat(3, 1fr);
+ gap: 0.875rem;
+ }
+
+ /* Action bar may stack buttons vertically on very small landscape */
+ .attr-v2-action-bar-content {
+ flex-direction: column;
+ gap: 0.75rem;
+ align-items: stretch;
+ }
+
+ .attr-v2-action-buttons {
+ justify-content: center;
+ flex-wrap: wrap;
+ }
+
+ /* Attrribute actions stack vertically */
+ .attr-v2-attribute-actions {
+ flex-direction: column;
+ gap: 0.25rem;
+ align-items: flex-end;
+ }
+}
+
+/* Tablet Landscape (1024px+) - PRIMARY TARGET */
+@media (min-width: 1024px) {
+ /* Optimal layout - all features at full capacity */
+ .hi-modal-dialog-700 {
+ max-width: 700px;
+ }
+
+ /* File grid: 3 columns optimal */
+ .attr-v2-file-grid {
+ grid-template-columns: repeat(3, 1fr);
+ gap: 1rem;
+ }
+
+ /* Action bar horizontal layout */
+ .attr-v2-action-bar-content {
+ flex-direction: row;
+ justify-content: space-between;
+ align-items: center;
+ }
+
+ /* Enhanced hover effects for mouse/trackpad */
+ .attr-v2-file-card:hover,
+ .attr-v2-attribute-card:hover {
+ transform: translateY(-2px);
+ box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
+ }
+
+ /* Better button spacing */
+ .attr-v2-attribute-actions {
+ flex-direction: row;
+ gap: 0.25rem;
+ }
+}
+
+/* Desktop (1200px+) - SECONDARY TARGET */
+@media (min-width: 1200px) {
+ /* Enhanced layout with more space - maintain 3 columns */
+ .attr-v2-file-grid {
+ grid-template-columns: repeat(3, 1fr);
+ gap: 1.25rem;
+ }
+
+ /* More generous spacing */
+ .attr-v2-scrollable-content {
+ padding: 1.5rem 0;
+ }
+
+ .attr-v2-attribute-list {
+ gap: 1rem;
+ }
+
+ /* Enhanced hover effects */
+ .attr-v2-file-card:hover,
+ .attr-v2-attribute-card:hover {
+ transform: translateY(-3px);
+ box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
+ }
+
+ /* Larger touch targets can be more refined */
+ .attr-v2-reorder-controls button,
+ .attr-v2-attribute-actions button {
+ min-width: 32px;
+ min-height: 32px;
+ padding: 8px;
+ }
+}
+
+/* High DPI / Retina Displays */
+@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
+ /* Sharper borders and shadows */
+ .attr-v2-file-card,
+ .attr-v2-attribute-card {
+ border-width: 0.5px;
+ }
+
+ .attr-v2-sticky-panel {
+ border-bottom-width: 0.5px;
+ }
+}
+
+/* Touch Device Optimizations */
+@media (hover: none) and (pointer: coarse) {
+ /* Touch-only devices: remove hover effects, ensure touch targets */
+ .attr-v2-file-card:hover,
+ .attr-v2-attribute-card:hover,
+ .attr-v2-file-thumbnail:hover,
+ .attr-v2-action-buttons button:hover,
+ .attr-v2-file-actions button:hover,
+ .attr-v2-attribute-actions button:hover {
+ transform: none;
+ box-shadow: none;
+ background-color: initial;
+ }
+
+ /* Ensure all touch targets are adequate */
+ .attr-v2-attribute-actions button,
+ .attr-v2-file-actions button,
+ .attr-v2-reorder-controls button {
+ min-height: 44px; /* Touch-friendly standard */
+ min-width: 44px;
+ padding: 10px;
+ }
+}
+
+/* Reduced Motion Preference */
+@media (prefers-reduced-motion: reduce) {
+ /* Disable animations for users who prefer reduced motion */
+ .attr-v2-file-card,
+ .attr-v2-attribute-card,
+ .attr-v2-action-buttons button,
+ .attr-v2-file-actions button,
+ .attr-v2-attribute-actions button,
+ .attr-v2-reorder-controls button,
+ .attr-v2-container input,
+ .attr-v2-container select,
+ .attr-v2-container textarea,
+ .attr-v2-add-form,
+ .attr-v2-file-thumbnail {
+ animation: none;
+ transition: none;
+ }
+
+
+ .attr-v2-loading-spinner {
+ animation: spin 0.1s linear infinite;
+ }
+}
+
+/* Add Attrribute Form */
+.attr-v2-add-form {
+ border: 1px solid var(--line-color);
+ border-radius: 0.375rem;
+ background: var(--white);
+ margin-top: 1rem;
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
+ transition: all 0.3s ease;
+ overflow: hidden;
+}
+
+.attr-v2-add-form.collapsed {
+ display: none;
+}
+
+.attr-v2-add-form-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 0.75rem 1rem;
+ border-bottom: 1px solid var(--line-color);
+ background: var(--background-color);
+}
+
+.attr-v2-add-form-header h6 {
+ margin: 0;
+ font-size: 0.875rem;
+ font-weight: 600;
+ color: var(--text-color);
+}
+
+.attr-v2-add-form-content {
+ padding: 1rem;
+}
+
+.attr-v2-add-form-actions {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-top: 1rem;
+ padding-top: 1rem;
+ border-top: 1px solid var(--line-color);
+}
+
+/* Add form field layout improvements */
+.attr-v2-add-form-content .row {
+ align-items: end;
+}
+
+.attr-v2-add-form-content .custom-control {
+ padding-top: 0.5rem;
+}
+
+/* Enhanced icon alignment for V2 components */
+.attr-v2-action-buttons .hi-icon-left,
+.attr-v2-file-actions .hi-icon,
+.attr-v2-attribute-actions .hi-icon {
+ vertical-align: middle;
+}
+
+.attr-v2-action-buttons button .hi-icon-left {
+ margin-right: 0.5rem;
+}
+}
+/* ====================================================================== */
+/* SECRET FIELD STYLING */
+/* ====================================================================== */
+
+.attr-v2-secret-field {
+ position: relative;
+}
+
+.attr-v2-secret-input-wrapper {
+ position: relative;
+ display: flex;
+ align-items: stretch;
+}
+
+.attr-v2-secret-input-wrapper input,
+.attr-v2-secret-input-wrapper textarea {
+ flex: 1;
+ padding-right: 44px; /* Space for toggle button */
+}
+
+.attr-v2-secret-toggle {
+ position: absolute;
+ right: 4px;
+ top: 50%;
+ transform: translateY(-50%);
+ z-index: 1;
+ min-width: 36px;
+ height: 36px;
+ border: 1px solid #ced4da;
+ background: var(--background-color);
+ padding: 6px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.attr-v2-secret-toggle:hover {
+ background: var(--hover-background-color);
+ border-color: #adb5bd;
+}
+
+.attr-v2-secret-toggle:focus {
+ outline: 2px solid var(--primary-color);
+ outline-offset: 2px;
+ border-color: var(--primary-color);
+}
+
+/* Secret field in hidden state */
+.attr-v2-secret-field.hidden input,
+.attr-v2-secret-field.hidden textarea {
+ -webkit-text-security: disc;
+ font-family: 'Courier New', monospace;
+ letter-spacing: 0.1em;
+}
+
+/* Fallback for browsers that don't support text-security */
+.attr-v2-secret-field.hidden input:not([type="password"]),
+.attr-v2-secret-field.hidden textarea {
+ color: transparent;
+ text-shadow: 0 0 0 #495057;
+}
+
+/* Touch device optimizations */
+@media (max-width: 768px) {
+ .attr-v2-secret-toggle {
+ min-width: 44px;
+ height: 44px;
+ }
+}
+
+/* Secret field readonly visual indicators */
+.attr-v2-secret-input[readonly] {
+ background-color: #f8f9fa;
+ cursor: default;
+ border-color: #dee2e6;
+}
+
+.attr-v2-secret-input[readonly]:focus {
+ background-color: #f8f9fa;
+ border-color: #dee2e6;
+ box-shadow: none;
+}
+
+/* When secret field is editable (shown), give it normal input styling */
+.attr-v2-secret-input[type="text"]:not([readonly]) {
+ background-color: #ffffff;
+ cursor: text;
+}
+
+.attr-v2-secret-input[type="text"]:not([readonly]):focus {
+ border-color: var(--primary-color);
+ box-shadow: 0 0 0 0.2rem rgba(23, 112, 114, 0.25);
+}
+
+/* Secret checkbox positioning and alignment */
+.attr-v2-secret-checkbox {
+ margin-top: 0.75rem;
+ margin-bottom: 0.5rem;
+}
+
+.attr-v2-secret-checkbox .custom-control {
+ display: flex;
+ align-items: center;
+}
+
+.attr-v2-secret-checkbox .custom-control-label {
+ line-height: 1;
+ padding-top: 0;
+ margin-bottom: 0;
+ font-size: 0.875rem;
+}
+
+/* ====================================================================== */
+/* V2 DIRTY STATE TRACKING STYLING */
+/* ====================================================================== */
+
+/* Dirty message area in sticky panel */
+.attr-v2-dirty-message {
+ font-size: 0.875rem;
+ color: transparent;
+ transition: all 0.2s ease-in-out;
+ min-width: 120px;
+ padding: 0.25rem 0.5rem;
+ border-radius: 0.25rem;
+}
+
+.attr-v2-dirty-message.active {
+ color: #8B4513; /* Darker brown text for better contrast */
+ background-color: #FFF3CD; /* Light warning background */
+ border-left: 3px solid var(--warning-color);
+ font-weight: 500;
+}
+
+/* Field-level dirty indicators */
+.attr-v2-field-dirty {
+ border-left: 3px solid var(--warning-color) !important;
+ background-color: rgba(255, 193, 7, 0.05) !important;
+ transition: border-color 0.2s ease-in-out, background-color 0.2s ease-in-out;
+}
+
+.attr-v2-field-dirty:focus {
+ border-left-color: var(--primary-color) !important;
+ box-shadow: -3px 0 0 0 var(--primary-color), 0 0 0 0.2rem rgba(23, 112, 114, 0.25);
+}
+
+/* Dirty indicator dot */
+.attr-v2-dirty-indicator {
+ display: inline-block;
+ margin-left: 0.5rem;
+ color: var(--warning-color);
+ font-size: 0.75rem;
+ font-weight: bold;
+ opacity: 0.8;
+ animation: pulse 2s infinite;
+}
+
+/* Attrribute name dirty styling - fallback approach for broader browser support */
+.attr-v2-attribute-name.has-dirty-indicator {
+ font-weight: 600;
+ color: var(--warning-color);
+}
+
+/* Entity name dirty styling - fallback approach */
+.form-group.has-dirty-field small {
+ color: var(--warning-color);
+ font-weight: 500;
+}
+
+/* Modern browser support with :has() */
+@supports selector(:has(*)) {
+ .attr-v2-attribute-name:has(.attr-v2-dirty-indicator) {
+ font-weight: 600;
+ color: var(--warning-color);
+ }
+
+ .form-group:has(.attr-v2-field-dirty) small {
+ color: var(--warning-color);
+ font-weight: 500;
+ }
+
+ .attr-v2-new-attribute .attr-v2-attribute-name:has(.attr-v2-dirty-indicator) {
+ color: var(--primary-color);
+ }
+}
+
+/* New attribute form dirty state - different styling */
+.attr-v2-new-attribute .attr-v2-field-dirty {
+ border-left-color: var(--primary-color) !important;
+ background-color: rgba(23, 112, 114, 0.08) !important;
+}
+
+.attr-v2-new-attribute .attr-v2-dirty-indicator {
+ color: var(--primary-color);
+}
+
+.attr-v2-new-attribute .attr-v2-attribute-name.has-dirty-indicator {
+ color: var(--primary-color);
+}
+
+/* Reduce motion for accessibility */
+@media (prefers-reduced-motion: reduce) {
+ .attr-v2-dirty-indicator {
+ animation: none;
+ opacity: 1;
+ }
+
+ .attr-v2-field-dirty,
+ .attr-v2-dirty-message {
+ transition: none;
+ }
+}
+
+/* ====================================================================== */
+/* ADD ATTRIBUTE FORM STYLING */
+/* ====================================================================== */
+
+.attr-v2-add-form {
+ border: 1px solid #dee2e6;
+ border-radius: 0.375rem;
+ background: var(--background-color);
+ margin-bottom: 1rem;
+ overflow: hidden;
+ transition: all 0.3s ease;
+}
+
+.attr-v2-add-form.collapsed {
+ display: none;
+}
+
+.attr-v2-add-form-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 0.75rem 1rem;
+ background: var(--highlight-background-color);
+ border-bottom: 1px solid #dee2e6;
+}
+
+.attr-v2-add-form-header h6 {
+ margin: 0;
+ font-weight: 600;
+ color: var(--text-color);
+}
+
+.attr-v2-add-form-content {
+ padding: 1rem;
+}
+
+.attr-v2-add-form-actions {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-top: 1rem;
+ padding-top: 1rem;
+ border-top: 1px solid #dee2e6;
+}
+
+/* ====================================================================== */
+/* COMPACT BASIC INFO HEADER */
+/* ====================================================================== */
+
+.attr-v2-basic-info {
+ background: var(--white);
+ border: 1px solid var(--line-color);
+ border-radius: 0.375rem;
+ padding: 0.5rem 0.75rem;
+ margin-bottom: 0.5rem;
+}
+
+.attr-v2-basic-info .row {
+ margin-left: -0.375rem;
+ margin-right: -0.375rem;
+}
+
+.attr-v2-basic-info [class*="col-"] {
+ padding-left: 0.375rem;
+ padding-right: 0.375rem;
+}
+
+/* Force block layout for labels - very specific selector */
+.attr-v2-basic-info .form-group small,
+.attr-v2-basic-info .form-group .text-muted,
+.attr-v2-basic-info small,
+.attr-v2-basic-info .text-muted {
+ display: block !important;
+ font-size: 0.75rem !important;
+ color: var(--muted-color) !important;
+ margin-bottom: 0.25rem !important;
+ font-weight: 500 !important;
+ text-transform: uppercase !important;
+ letter-spacing: 0.5px !important;
+ width: 100% !important;
+ line-height: 1 !important;
+ clear: both !important;
+}
+
+.attr-v2-basic-info .form-control-sm {
+ font-size: 0.875rem;
+ padding: 0.375rem 0.5rem;
+ height: calc(1.5em + 0.75rem + 2px);
+ width: 100%; /* Ensure full width */
+}
+
+.attr-v2-basic-info .form-control {
+ width: 100%; /* Ensure full width for all form controls */
+}
+
+.attr-v2-basic-info select.form-control-sm {
+ padding-right: 1.75rem;
+ background-position: right 0.375rem center;
+ background-size: 16px 12px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+/* Ensure columns don't break layout */
+.attr-v2-basic-info .col-md-8,
+.attr-v2-basic-info .col-md-4,
+.attr-v2-basic-info .col-sm-6 {
+ min-width: 0; /* Allow flex shrinking */
+}
+
+/* Remove bottom margin from form groups in header */
+.attr-v2-basic-info .form-group {
+ margin-bottom: 0;
+}
+
+/* Error state styling */
+.attr-v2-basic-info .form-control.is-invalid,
+.attr-v2-basic-info .form-control:invalid {
+ border-color: var(--danger-color);
+}
+
+.attr-v2-basic-info .invalid-feedback {
+ font-size: 0.75rem;
+ margin-top: 0.25rem;
+}
+
+/* ====================================================================== */
+/* ERROR MESSAGE STYLING */
+/* ====================================================================== */
+
+/* Non-field errors container - page level (owner form) */
+.attr-v2-sticky-panel .attr-v2-non-field-errors {
+ border-left: 3px solid #dc2626;
+ padding-left: 1rem;
+ margin: 0.5rem 0;
+}
+
+.attr-v2-sticky-panel .attr-v2-non-field-errors .attr-v2-error-item {
+ color: #dc2626;
+ font-size: 0.875rem;
+ margin: 0.25rem 0;
+ display: flex;
+ align-items: flex-start;
+ gap: 0.5rem;
+}
+
+.attr-v2-sticky-panel .attr-v2-non-field-errors .attr-v2-error-item:before {
+ content: "•";
+ color: #dc2626;
+ font-weight: bold;
+ flex-shrink: 0;
+}
+
+/* Formset non-form errors (same style as owner non-field errors) */
+.attr-v2-formset-errors {
+ border-left: 3px solid #dc2626;
+ padding-left: 1rem;
+ margin: 0.5rem 0;
+}
+
+.attr-v2-formset-errors .attr-v2-error-item {
+ color: #dc2626;
+ font-size: 0.875rem;
+ margin: 0.25rem 0;
+ display: flex;
+ align-items: flex-start;
+ gap: 0.5rem;
+}
+
+.attr-v2-formset-errors .attr-v2-error-item:before {
+ content: "•";
+ color: #dc2626;
+ font-weight: bold;
+ flex-shrink: 0;
+}
+
+/* Non-field errors - individual attribute card level (most subtle) */
+.attr-v2-attribute-card .attr-v2-non-field-errors {
+ margin: 0.5rem 0 0 0;
+ padding: 0;
+}
+
+.attr-v2-attribute-card .attr-v2-non-field-errors .attr-v2-error-item {
+ color: #dc2626;
+ font-size: 0.8125rem;
+ margin: 0.25rem 0;
+ display: flex;
+ align-items: flex-start;
+ gap: 0.375rem;
+}
+
+.attr-v2-attribute-card .attr-v2-non-field-errors .attr-v2-error-item:before {
+ content: "•";
+ color: #dc2626;
+ font-weight: bold;
+ flex-shrink: 0;
+}
+
+/* Field-level errors */
+.attr-v2-field-errors {
+ color: #dc2626;
+ font-size: 0.8125rem;
+ margin-top: 0.25rem;
+ display: flex;
+ flex-direction: column;
+ gap: 0.125rem;
+}
+
+.attr-v2-field-errors .attr-v2-error-text {
+ display: flex;
+ align-items: flex-start;
+ gap: 0.375rem;
+}
+
+.attr-v2-field-errors .attr-v2-error-text:before {
+ content: "•";
+ color: #dc2626;
+ font-weight: bold;
+ flex-shrink: 0;
+}
+
+/* Invalid form controls */
+.attr-v2-attribute-card .form-control.is-invalid,
+.attr-v2-basic-info .form-control.is-invalid {
+ border-color: #dc2626;
+ background-image: none;
+}
+
+.attr-v2-attribute-card .form-control.is-invalid:focus,
+.attr-v2-basic-info .form-control.is-invalid:focus {
+ border-color: #dc2626;
+ box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.25);
+}
+
+/* ====================================================================== */
+/* INLINE HISTORY STYLING */
+/* ====================================================================== */
+
+.attr-v2-inline-history {
+ margin-top: 0.75rem;
+}
+
+.attr-v2-history-inline-content {
+ background: var(--highlight-background-color);
+ border: 1px solid var(--line-color);
+ border-radius: 0.375rem;
+ padding: 0.75rem;
+ font-size: 0.875rem;
+}
+
+.attr-v2-history-header {
+ margin-bottom: 0.5rem;
+ padding-bottom: 0.5rem;
+ border-bottom: 1px solid var(--line-color);
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+}
+
+.attr-v2-history-close {
+ color: var(--danger-color);
+ text-decoration: none;
+}
+
+.attr-v2-history-close:hover {
+ color: var(--danger-color);
+ text-decoration: none;
+}
+
+.attr-v2-history-current {
+ font-size: 0.8125rem;
+}
+
+.attr-v2-history-current .badge-primary {
+ background-color: var(--success-color);
+ border-color: var(--success-color);
+}
+
+.attr-v2-history-toggle .btn-link {
+ color: var(--text-color);
+ text-decoration: none;
+}
+
+.attr-v2-history-toggle .btn-link:hover {
+ color: var(--primary-color);
+ text-decoration: underline;
+}
+
+.attr-v2-history-record {
+ padding: 0.375rem 0;
+ border-bottom: 1px solid rgba(0,0,0,0.05);
+}
+
+.attr-v2-history-record:last-child {
+ border-bottom: none;
+}
+
+.attr-v2-history-record .badge {
+ font-size: 0.75rem;
+ max-width: 300px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ display: inline-block;
+ vertical-align: top;
+}
+
+.attr-v2-history-current .badge {
+ font-size: 0.75rem;
+ max-width: 300px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ display: inline-block;
+ vertical-align: top;
+}
+
+.attr-v2-history-record .btn-xs {
+ font-size: 0.75rem;
+ padding: 0.125rem 0.5rem;
+ line-height: 1.2;
+}
+
+.attr-v2-history-toggle {
+ padding-top: 0.5rem;
+ border-top: 1px solid rgba(0,0,0,0.05);
+}
+
+.attr-v2-history-empty {
+ text-align: center;
+ padding: 1rem 0;
+ color: var(--muted-color);
+}
+
+/* ====================================================================== */
+/* DELETION STATES WITH WATERMARKS */
+/* ====================================================================== */
+
+/* File Card Deletion Styling */
+.attr-v2-file-card.marked-for-deletion {
+ opacity: 0.9;
+ transition: all 0.3s ease;
+}
+
+.attr-v2-file-card.marked-for-deletion .attr-v2-file-thumbnail {
+ position: relative;
+ background: linear-gradient(rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.1)),
+ repeating-linear-gradient(45deg, #f8f9fa, #f8f9fa 10px, #e9ecef 10px, #e9ecef 20px);
+}
+
+.attr-v2-file-card.marked-for-deletion .attr-v2-file-thumbnail::after {
+ content: "PENDING DELETION";
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%) rotate(-15deg);
+ font-size: 0.875rem;
+ font-weight: 600;
+ color: var(--danger-color);
+ opacity: 0.3;
+ text-transform: uppercase;
+ letter-spacing: 2px;
+ pointer-events: none;
+ white-space: nowrap;
+ z-index: 10;
+}
+
+.attr-v2-file-card.marked-for-deletion .attr-v2-file-info {
+ border-color: var(--danger-color);
+ background: rgba(220, 53, 69, 0.05);
+}
+
+/* Attrribute Card Deletion Styling */
+.attr-v2-attribute-card.marked-for-deletion {
+ position: relative;
+ background: rgba(220, 53, 69, 0.05);
+ border-left: 4px solid var(--danger-color);
+ overflow: hidden;
+ opacity: 0.9;
+ transition: all 0.3s ease;
+}
+
+.attr-v2-attribute-card.marked-for-deletion::after {
+ content: "PENDING DELETION";
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ font-size: 1.5rem;
+ font-weight: 700;
+ color: var(--danger-color);
+ opacity: 0.1;
+ text-transform: uppercase;
+ letter-spacing: 2px;
+ pointer-events: none;
+ z-index: 10;
+ white-space: nowrap;
+}
+
+/* Keep inputs interactive but let watermark show through */
+.attr-v2-attribute-card.marked-for-deletion .form-control,
+.attr-v2-attribute-card.marked-for-deletion textarea,
+.attr-v2-attribute-card.marked-for-deletion input {
+ position: relative;
+ background-color: rgba(255, 255, 255, 0.9);
+}
+
+/* Undo button visibility when marked for deletion */
+.marked-for-deletion .attr-v2-delete-btn {
+ display: none !important;
+}
+
+.marked-for-deletion .attr-v2-undo-btn {
+ display: inline-flex !important;
+}
+
+/* ====================================================================== */
+/* ENTITY EDIT MODAL V2 STYLING IMPROVEMENTS */
+/* ====================================================================== */
+
+/* Task 1: Standardize delete icon colors to red */
+.attr-v2-attribute-actions .attr-v2-delete-btn {
+ color: #dc3545 !important;
+ border-color: #dc3545 !important;
+}
+
+.attr-v2-attribute-actions .attr-v2-delete-btn:hover {
+ background-color: #dc3545 !important;
+ color: white !important;
+}
+
+/* Task 2: Style "Add New Attrribute" form for visual distinction */
+.attr-v2-new-attribute {
+ background-color: rgba(23, 112, 114, 0.05) !important;
+ border: 2px dashed rgba(23, 112, 114, 0.3) !important;
+ border-radius: 8px;
+}
+
+.attr-v2-new-attribute .attr-v2-attribute-header h6 {
+ color: var(--primary-color);
+ font-weight: 600;
+ font-style: italic;
+}
+
+
+/* Task 3: Make Add File and Add Attrribute buttons consistent size */
+.attr-v2-action-buttons label.btn {
+ min-height: 44px;
+ padding: 0.375rem 0.75rem;
+ font-size: 0.875rem;
+ border-radius: 0.25rem;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ line-height: 1.5;
+ cursor: pointer;
+}
+
+/* Task 4: Make attribute name/labels more prominent than values */
+.attr-v2-attribute-name {
+ font-size: 0.9rem !important;
+ font-weight: 600 !important;
+ color: var(--primary-text-color) !important;
+ margin-bottom: 0.5rem;
+ letter-spacing: 0.5px;
+}
+
+/* Touch device optimizations */
+@media (max-width: 768px) {
+
+ .attr-v2-add-form-actions {
+ flex-direction: column;
+ gap: 0.75rem;
+ align-items: stretch;
+ }
+}
diff --git a/src/hi/static/css/icons.css b/src/hi/static/css/icons.css
new file mode 100644
index 00000000..6dbcd12e
--- /dev/null
+++ b/src/hi/static/css/icons.css
@@ -0,0 +1,116 @@
+
+/* ===== ICON SYSTEM ===== */
+
+/* Base icon class */
+.hi-icon {
+ display: inline-block;
+ vertical-align: middle;
+ fill: currentColor;
+ stroke: currentColor;
+ flex-shrink: 0;
+}
+
+/* Icon sizes */
+.hi-icon-sm {
+ width: 0.875rem;
+ height: 0.875rem;
+}
+
+.hi-icon-md {
+ width: 1rem;
+ height: 1rem;
+}
+
+.hi-icon-lg {
+ width: 1.25rem;
+ height: 1.25rem;
+}
+
+.hi-icon-xl {
+ width: 1.5rem;
+ height: 1.5rem;
+}
+
+/* Semantic icon colors using existing CSS variables */
+.hi-icon-primary {
+ color: var(--primary-color);
+}
+
+.hi-icon-secondary {
+ color: var(--secondary-color);
+}
+
+.hi-icon-success {
+ color: var(--success-color);
+}
+
+.hi-icon-warning {
+ color: var(--warning-color);
+}
+
+.hi-icon-error {
+ color: var(--error-color);
+}
+
+.hi-icon-muted {
+ color: var(--muted-color);
+}
+
+/* Icon spacing utilities */
+.hi-icon-left {
+ margin-right: 0.375rem;
+}
+
+.hi-icon-right {
+ margin-left: 0.375rem;
+}
+
+/* Icon button integration */
+.btn .hi-icon {
+ vertical-align: text-top;
+}
+
+
+/* Ensure icons work well in different contexts */
+.card-header .hi-icon,
+.card-title .hi-icon {
+ margin-right: 0.375rem;
+}
+
+.alert .hi-icon {
+ margin-right: 0.5rem;
+}
+
+/* Legacy icon class deprecation helpers */
+.plus-icon,
+.history-icon {
+ /* These classes are deprecated. Use {% icon %} template tag instead */
+ opacity: 0.7;
+}
+
+/* High contrast mode support */
+@media (prefers-contrast: high) {
+ .hi-icon {
+ stroke-width: 2;
+ }
+}
+
+/* Reduced motion support */
+@media (prefers-reduced-motion: reduce) {
+ .hi-icon {
+ transition: none;
+ }
+}
+
+/* History icon styling - matches plus-icon pattern */
+.history-icon {
+ font-size: 1rem;
+ color: var(--primary-color);
+ padding: 0 0.25rem;
+}
+.plus-icon {
+ font-size: 1.5rem;
+ color: var(--on-primary-color);
+ background-color: var(--primary-color);
+ padding: 0 0.25rem 0 0.25rem;
+}
diff --git a/src/hi/static/css/main.css b/src/hi/static/css/main.css
index 530b177f..90efa5f5 100644
--- a/src/hi/static/css/main.css
+++ b/src/hi/static/css/main.css
@@ -360,2721 +360,679 @@ a.clickable-card:active {
}
-/* Attribute V2 System Styles - Fresh Start */
-/* Container Structure */
-.attr-v2-container {
- /* Remove default form margins for better layout control */
- margin: 0;
+/* General Vertical Tab Styling */
+.hi-vertical-nav {
+ min-width: 200px;
+ border-right: 1px solid var(--line-color);
+ padding: 1rem 0;
}
-/* Sticky Panel (Entity Info + Action Bar - Always Visible) */
-.attr-v2-sticky-panel {
- position: sticky;
- top: 0;
- z-index: 10;
- background-color: var(--white);
+.hi-vertical-nav-header {
+ padding: 0 1rem 1rem 1rem;
border-bottom: 1px solid var(--line-color);
- padding-bottom: 0.75rem;
-}
-
-/* Entity Info Section (Minimal - Name/Type) */
-.attr-v2-entity-info {
- padding: 0.5rem 0 0.25rem 0;
-}
-
-/* Action Bar */
-.attr-v2-action-bar {
- padding: 0.25rem 0;
- background-color: var(--white);
-}
-
-.attr-v2-action-bar-content {
- display: flex;
- align-items: center;
- gap: 1rem;
+ margin-bottom: 0.5rem;
}
-/* Left group: button and messages */
-.attr-v2-action-bar-left {
+.hi-vertical-nav-link {
+ display: block;
+ padding: 0.75rem 1rem;
+ margin: 0.25rem 0;
+ border-radius: 0;
+ color: #495057;
+ text-decoration: none;
+ transition: all 0.2s ease;
+ min-height: 44px; /* Touch-friendly */
display: flex;
align-items: center;
- gap: 1rem;
- flex: 1; /* Take available space */
-}
-
-/* Message stack */
-.attr-v2-message-stack {
- display: flex;
- flex-direction: column;
- gap: 0.25rem;
}
-.attr-v2-update-btn {
- min-height: 44px; /* Touch-friendly primary action */
- min-width: 80px;
- padding: 0.75rem 1.5rem;
- flex-shrink: 0; /* Don't shrink button */
+.hi-vertical-nav-link:hover {
+ background-color: #f8f9fa;
+ color: var(--primary-color);
+ text-decoration: none;
}
-/* Right group: action buttons */
-.attr-v2-action-buttons {
- display: flex;
- gap: 0.5rem;
- align-items: center;
- flex-shrink: 0; /* Don't shrink buttons */
- margin-left: auto; /* Push to right */
+.hi-vertical-nav-link:focus {
+ color: var(--primary-color);
+ text-decoration: none;
}
-.attr-v2-action-buttons button {
- min-height: 44px; /* Touch-friendly minimum */
- padding: 0.375rem 0.75rem;
- font-size: 0.875rem;
- border-radius: 0.25rem;
+.hi-vertical-nav-link.active {
+ background-color: var(--primary-color);
+ color: var(--on-primary-color);
}
-.attr-v2-status-message {
- font-size: 0.875rem;
- color: var(--secondary-text-color);
- font-style: italic;
+.hi-vertical-nav-link.active:hover {
+ background-color: var(--primary-highlight-color);
+ color: var(--on-primary-color);
}
-/* Status message variants */
-.attr-v2-status-message.success {
- color: var(--success-color, #28a745);
- background-color: var(--success-bg-light);
- padding: 0.25rem 0.5rem;
- border-radius: 0.25rem;
- font-style: normal;
- font-weight: 500;
- display: flex;
- align-items: center;
- gap: 0.25rem;
+/* Responsive adjustments for vertical tabs */
+@media (max-width: 767.98px) {
+ .hi-vertical-nav {
+ min-width: 150px;
+ }
}
-.attr-v2-status-message.success::before {
- content: '✓';
- font-weight: bold;
- color: var(--success-color, #28a745);
-}
-/* Scrollable Content Area (Natural Scrolling) */
-.attr-v2-scrollable-content {
- padding: 1rem 0;
- /* Natural scrolling - no height restrictions or overflow settings */
+/* Pagination styling overrides for app theming */
+.pagination-lg .page-link {
+ color: var(--primary-color) !important;
+ border-color: #dee2e6 !important;
+ /* Force consistent height for all pagination buttons */
+ height: 3rem !important;
+ min-height: 3rem !important;
+ display: flex !important;
+ align-items: center !important;
+ justify-content: center !important;
+ padding: 0.5rem 0.75rem !important;
+ box-sizing: border-box !important;
+ line-height: 1.2 !important;
}
-/* Touch-friendly Form Controls - Consistent heights */
-.attr-v2-container input,
-.attr-v2-container select,
-.attr-v2-container textarea {
- min-height: 44px; /* Touch-friendly minimum for form inputs */
- padding: 0.75rem;
- font-size: 0.875rem;
- border-radius: 0.375rem;
+/* Ensure spans inside page-links don't affect height and are properly centered */
+.pagination-lg .page-link span {
+ display: flex !important;
+ align-items: center !important;
+ justify-content: center !important;
+ height: 100% !important;
}
-.attr-v2-container input[type="text"],
-.attr-v2-container input[type="email"],
-.attr-v2-container input[type="url"],
-.attr-v2-container select {
- height: 44px; /* Exact height for single-line inputs */
+.pagination-lg .page-link:hover {
+ color: var(--primary-highlight-color) !important;
+ background-color: #e9ecef !important;
+ border-color: #dee2e6 !important;
}
-.attr-v2-container textarea {
- min-height: 44px;
- resize: vertical;
+.pagination-lg .page-item.active .page-link {
+ background-color: var(--primary-color) !important;
+ border-color: var(--primary-color) !important;
+ color: var(--on-primary-color) !important;
}
-/* Section Titles - Reduced size to match mockup */
-.attr-v2-section-title {
- font-size: 0.875rem;
- font-weight: 600;
- color: var(--secondary-text-color);
- margin-bottom: 0.5rem;
- padding-bottom: 0.25rem;
- text-transform: uppercase;
- letter-spacing: 0.025em;
- border-bottom: 1px solid var(--line-color);
+.pagination-lg .page-item.disabled .page-link {
+ color: #6c757d !important;
+ background-color: #fff !important;
+ border-color: #dee2e6 !important;
}
-/* File Grid Layout */
-.attr-v2-file-section {
- margin-bottom: 2rem;
-}
-.attr-v2-file-grid {
- display: grid;
- grid-template-columns: repeat(3, 1fr);
- gap: 1rem;
- margin-top: 0.75rem;
+.btn-control {
+ width: 100%;
+ white-space: nowrap;
+ font-size: 0.75rem;
+ font-weight: bold;
}
-.attr-v2-file-card {
- /* No border or padding on main card - components handle their own styling */
- border-radius: 0.375rem;
- background: transparent;
- transition: all 0.2s ease;
- display: flex;
- flex-direction: column;
- overflow: hidden; /* Maintain rounded corners */
+input[type="number"] {
+ max-width: 8rem;
}
-
-.attr-v2-file-thumbnail {
- position: relative;
- display: flex;
- flex-direction: column;
+.hi-location-view {
+ justify-content: center;
align-items: center;
- padding: 1rem;
- /* Diagonal hatch pattern background */
- background: repeating-linear-gradient(
- 45deg,
- #f8f9fa,
- #f8f9fa 10px,
- #e9ecef 10px,
- #e9ecef 20px
- );
- border-radius: 0.375rem 0.375rem 0 0; /* Rounded top corners only */
- cursor: pointer;
-}
+ height: calc(100vh - var(--top-buttons-height) - var(--bottom-buttons-height) );
+ touch-action: none;
-.attr-v2-file-type-label {
- font-size: 0.8rem;
- font-weight: 700;
- color: var(--text-color);
- margin-top: 0.5rem;
- text-transform: uppercase;
- letter-spacing: 0.05em;
}
+.hi-location-view-svg {
+ max-height: calc(100vh - var(--top-buttons-height) - var(--bottom-buttons-height) );
+ width: auto;
+ height: auto;
+ display: block;
+ cursor: pointer;
+}
-.attr-v2-file-info {
- flex-grow: 1;
- background: var(--white);
- border: 1px solid var(--line-color);
- border-top: none; /* No border on top - seamless with thumbnail */
- border-radius: 0 0 0.375rem 0.375rem; /* Rounded bottom corners only */
- padding: 0.75rem;
+.integration-title img {
+ height: 2rem;
}
-.attr-v2-file-name {
- font-size: 0.875rem;
- font-weight: 500;
- margin-bottom: 0.25rem;
- word-break: break-word;
+#hi-integration-settings nav {
+ border-right: 1px solid #888888;
+ height: calc( 100vh - var(--top-buttons-height) - var(--bottom-buttons-height) - 6rem);
+ overflow-y: auto;
}
-
-/* File title input - styled to appear like text initially */
-.attr-v2-file-title-input {
- font-size: 0.875rem;
- font-weight: 500;
- margin-bottom: 0.25rem;
- word-break: break-word;
-
- /* Minimal styling - appears like text */
- border: 1px solid transparent;
- background: transparent;
- padding: 2px 4px;
- border-radius: 3px;
+#hi-integration-settings nav hr {
+ flex: 0 0 auto; /* Prevent shrinking or growing */
width: 100%;
- transition: all 0.2s ease;
-
- /* Inherit text color and font */
- color: inherit;
- font-family: inherit;
- line-height: inherit;
+ border-top: 1px solid #202020;
}
-
-/* Focused and activated state - stronger input appearance */
-.attr-v2-file-title-input:focus,
-.attr-v2-file-title-input.activated {
- border-color: var(--primary-color, #007bff);
- background: var(--white, #ffffff);
- box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
- outline: none;
+.drag-over {
+ border: 2px dashed #888888;
}
-/* Hover state - subtle indication it's interactive */
-.attr-v2-file-title-input:hover:not(:focus) {
- border-color: var(--line-color, #dee2e6);
- background: rgba(0, 0, 0, 0.02);
+.form-group label {
+ color: #060606 !important;
}
-
-.attr-v2-file-filename {
- font-size: 0.75rem;
- color: var(--muted-color);
- word-break: break-word;
+.input-group-text {
+ color: var(--black);
+ background-color: #f0f0f0;
}
-
-.attr-v2-file-actions {
- display: flex;
- gap: 0.25rem;
- justify-content: center;
- margin-top: 0.75rem;
- padding-top: 0.75rem;
- border-top: 1px solid var(--line-color);
+select,
+textarea,
+input[type="text"],
+input[type="password"],
+.dropdown-menu {
+ color: var(--black) !important;
+ background-color: #f8f8f8 !important;
}
-
-.attr-v2-file-actions button {
- min-height: 44px; /* Touch-friendly minimum */
- min-width: 44px;
- padding: 0.375rem;
- font-size: 0.875rem;
- border-radius: 0.25rem;
+.hi-custom-select .input-group-text {
+ height: calc(1.5em + 0.75rem + 2px);
+ line-height: 1.5;
}
-
-/* Reorder Controls - Overlay in upper right of thumbnail */
-.attr-v2-reorder-controls {
- position: absolute;
- top: 4px;
- right: 4px;
- display: flex;
- flex-direction: row;
- gap: 1px;
- background: rgba(255, 255, 255, 0.9);
- border-radius: 0.25rem;
- padding: 2px;
- z-index: 1;
+#hi-server-error-msg {
+ position: fixed;
+ display: none;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ padding: 1rem;
+ z-index: 1060;
+ text-align: center;
+ font-size: 2rem;
+ font-weight: bold;
+ color: var(--warning-color);
+ background-color: #282425;
+ border-radius: 0.8rem;
+ border: 0.1rem solid #282425;
+ box-shadow: 0 0 1rem rgba(0, 0, 0, 0.5);
}
-/* Disable thumbnail hover when hovering over reorder controls */
-.attr-v2-file-thumbnail:hover:has(.attr-v2-reorder-controls:hover) {
- background-color: var(--background-color) !important;
- transform: none !important;
+#hi-server-error-msg > div {
+ margin-top: 1rem;
+ padding: 3rem;
+ width: 36rem;
+ height: 14rem;
+ color: #282425;
+ font-size: 4rem;
+ background-color: var(--warning-color);
+ border-bottom-left-radius: 0.8rem;
+ border-bottom-right-radius: 0.8rem;
+ text-align: center;
}
-/* Enhance reorder controls hover state */
-.attr-v2-reorder-controls:hover {
- background: rgba(255, 255, 255, 1);
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
+svg[action-state="move"] {
+ cursor: move;
}
-
-/* Ensure buttons within controls maintain their hover states */
-.attr-v2-reorder-controls button:hover {
- background-color: var(--background-color);
- border-color: var(--line-color);
+svg[action-state="rotate"] {
+ cursor: url('/static/css/cursor-rotate.png') 16 16, auto;
}
-
-/* JavaScript-based hover state override */
-.attr-v2-file-thumbnail.reorder-hover:hover {
- background-color: var(--background-color) !important;
- transform: none !important;
+svg[action-state="scale"] {
+ cursor: url('/static/css/cursor-scale.png') 16 16, auto;
}
-/* Fallback for browsers that don't support :has() - JavaScript handles it */
-@supports not selector(:has(*)) {
- .attr-v2-file-thumbnail:hover:has(.attr-v2-reorder-controls:hover) {
- /* This won't work in unsupported browsers, JS handles it instead */
- }
+svg .highlighted {
+ filter: drop-shadow(0 0 10px var(--status-highlighted-color));
}
-.attr-v2-reorder-controls button {
- /* Touch-friendly size with small visual appearance */
- min-width: 24px;
- min-height: 24px;
- padding: 6px;
- font-size: 10px;
- line-height: 1;
- border-radius: 0.25rem;
- position: relative;
- /* Center the small chevron icon within the larger touch area */
- display: flex;
- align-items: center;
- justify-content: center;
+g.hi-icon {
+ pointer-events: all;
}
-
-.attr-v2-reorder-controls button:disabled {
- opacity: 0.3;
- cursor: not-allowed;
- background-color: var(--background-color);
- border-color: var(--line-color);
- color: var(--muted-color);
+path.hi-path-closed[hover] {
}
-
-.attr-v2-reorder-controls button:disabled:hover {
- transform: none;
- box-shadow: none;
+path.hover-target {
+ stroke: none;
+ stroke-width: 10;
+ fill: none;
+ pointer-events: all;
}
-
-/* Attribute List Layout */
-.attr-v2-attribute-section {
- margin-bottom: 2rem;
+path.hi-path-closed[hover] {
+ stroke: var(--status-hover-color);
+ stroke-width: 4;
}
-
-.attr-v2-attribute-list {
- display: flex;
- flex-direction: column;
- gap: 0.75rem;
+path.hover-target[hover] + path.hi-path-open {
+ stroke: var(--status-hover-color);
+ stroke-width: 5;
+ filter: drop-shadow(0 0 5px var(--status-hover-color));
}
-.attr-v2-attribute-card {
- border: 1px solid var(--line-color);
- border-radius: 0.375rem;
- padding: 0.75rem;
- background: var(--white);
- transition: all 0.2s ease;
+g[status="active"] {
+ outline: 2px solid var(--status-active-color);
+ filter: drop-shadow(0 0 5px var(--status-active-color));
}
-
-.attr-v2-attribute-header {
- display: flex;
- justify-content: space-between;
- align-items: flex-start;
- margin-bottom: 0.5rem;
+g[status="recent"] {
+ outline: 2px solid var(--status-recent-color);
+ filter: drop-shadow(0 0 5px var(--status-recent-color));
}
-
-.attr-v2-attribute-name {
- font-size: 0.875rem;
- font-weight: 500;
- margin: 0;
- display: flex;
- align-items: center;
- gap: 0.5rem;
+g[status="past"] {
+ outline: 2px solid var(--status-past-color);
+ filter: drop-shadow(0 0 5px var(--status-past-color));
}
-.attr-v2-attribute-actions {
- display: flex;
- gap: 0.25rem;
+g[status="off"] path.hi-state-bg {
+ fill: var(--status-off-color);
}
-
-.attr-v2-attribute-actions button {
- padding: 0.375rem;
- min-width: 44px; /* Touch-friendly minimum */
- min-height: 44px; /* Touch-friendly minimum */
- border: none;
- background: transparent;
- color: var(--secondary-text-color);
- border-radius: 0.25rem;
- font-size: 0.875rem;
-}
-
-.attr-v2-attribute-actions button:hover {
- background: var(--background-color);
- color: var(--text-color);
-}
-
-.attr-v2-attribute-value {
- margin-top: 0.5rem;
-}
-
-/* Comprehensive Visual State System */
-
-
-/* Error State (validation failures) */
-.attr-v2-file-card.error,
-.attr-v2-attribute-card.error {
- border-left: 3px solid var(--danger-color);
- background-color: rgba(220, 53, 69, 0.1);
- box-shadow: 0 2px 4px rgba(220, 53, 69, 0.1);
-}
-
-.attr-v2-error-message {
- color: var(--danger-color);
- font-size: 0.875rem;
- margin-top: 0.25rem;
- display: flex;
- align-items: center;
- gap: 0.25rem;
-}
-
-/* Loading State (during operations) */
-.attr-v2-file-card.loading,
-.attr-v2-attribute-card.loading {
- opacity: 0.7;
- pointer-events: none;
- position: relative;
-}
-
-.attr-v2-loading-overlay {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background: rgba(255, 255, 255, 0.8);
- display: flex;
- align-items: center;
- justify-content: center;
- border-radius: 0.25rem;
-}
-
-.attr-v2-loading-spinner {
- width: 20px;
- height: 20px;
- border: 2px solid var(--line-color);
- border-top: 2px solid var(--primary-color);
- border-radius: 50%;
- animation: spin 1s linear infinite;
-}
-
-/* Success State (after successful operations) */
-.attr-v2-file-card.success,
-.attr-v2-attribute-card.success {
- border-left: 3px solid var(--success-color);
- background-color: var(--success-bg-light);
- transition: all 0.3s ease;
-}
-
-.attr-v2-success-message {
- color: var(--success-color);
- font-size: 0.875rem;
- margin-top: 0.25rem;
- display: flex;
- align-items: center;
- gap: 0.25rem;
-}
-
-
-.attr-v2-undo-delete {
- margin-top: 0.5rem;
- padding: 0.5rem;
- background: rgba(255, 193, 7, 0.1);
- border: 1px solid var(--warning-color);
- border-radius: 0.25rem;
-}
-
-.attr-v2-undo-delete button {
- min-height: 32px;
- padding: 0.25rem 0.75rem;
-}
-
-/* Animation Keyframes */
-@keyframes pulse {
- 0% { opacity: 1; }
- 50% { opacity: 0.5; }
- 100% { opacity: 1; }
-}
-
-@keyframes spin {
- 0% { transform: rotate(0deg); }
- 100% { transform: rotate(360deg); }
-}
-
-@keyframes fadeIn {
- 0% { opacity: 0; transform: translateY(-10px); }
- 100% { opacity: 1; transform: translateY(0); }
-}
-
-@keyframes slideUp {
- 0% { opacity: 1; transform: translateY(0); }
- 100% { opacity: 0; transform: translateY(-10px); }
-}
-
-/* Smooth Transitions for All Interactive Elements */
-
-/* Card State Transitions */
-.attr-v2-file-card,
-.attr-v2-attribute-card {
- transition: all 0.2s ease-in-out;
-}
-
-.attr-v2-file-card:hover,
-.attr-v2-attribute-card:hover {
- transform: translateY(-1px);
- box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
-}
-
-/* Button Transitions */
-.attr-v2-action-buttons button,
-.attr-v2-file-actions button,
-.attr-v2-attribute-actions button,
-.attr-v2-reorder-controls button,
-.attr-v2-update-btn {
- transition: all 0.15s ease;
-}
-
-.attr-v2-action-buttons button:hover,
-.attr-v2-file-actions button:hover,
-.attr-v2-attribute-actions button:hover,
-.attr-v2-reorder-controls button:hover:not(:disabled),
-.attr-v2-update-btn:hover {
- transform: translateY(-1px);
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
-}
-
-/* Form Element Transitions */
-.attr-v2-container input,
-.attr-v2-container select,
-.attr-v2-container textarea {
- transition: border-color 0.15s ease, box-shadow 0.15s ease;
-}
-
-.attr-v2-container input:focus,
-.attr-v2-container select:focus,
-.attr-v2-container textarea:focus {
- border-color: var(--primary-color);
- box-shadow: 0 0 0 0.2rem rgba(23, 112, 114, 0.25);
- outline: none;
-}
-
-/* Enhanced focus states for buttons and interactive elements */
-.attr-v2-action-buttons button:focus,
-.attr-v2-file-actions button:focus,
-.attr-v2-attribute-actions button:focus,
-.attr-v2-reorder-controls button:focus,
-.attr-v2-update-btn:focus {
- outline: 2px solid var(--primary-color);
- outline-offset: 2px;
- box-shadow: 0 0 0 0.2rem rgba(23, 112, 114, 0.25);
-}
-
-.attr-v2-reorder-controls button:focus:disabled {
- outline-color: var(--muted-color);
- box-shadow: 0 0 0 0.2rem rgba(126, 126, 129, 0.25);
-}
-
-/* Card focus states for keyboard navigation */
-.attr-v2-file-card:focus-within,
-.attr-v2-attribute-card:focus-within {
- outline: 2px solid var(--primary-color);
- outline-offset: 2px;
-}
-
-/* Add form focus enhancement */
-.attr-v2-add-form:focus-within {
- box-shadow: 0 4px 12px rgba(23, 112, 114, 0.15);
-}
-
-/* Add Form Animation */
-.attr-v2-add-form {
- transition: all 0.3s ease;
- animation: fadeIn 0.3s ease when visible;
-}
-
-.attr-v2-add-form.collapsed {
- display: none;
-}
-
-.attr-v2-add-form:not(.collapsed) {
- animation: fadeIn 0.3s ease;
-}
-
-/* Status Message Transitions */
-.attr-v2-status-message {
- transition: opacity 0.25s ease, color 0.25s ease;
-}
-
-/* Thumbnail Hover Effect */
-.attr-v2-file-thumbnail {
- transition: background-color 0.15s ease, transform 0.15s ease;
-}
-
-.attr-v2-file-thumbnail:hover {
- background-color: var(--primary-color-light, #e7f3ff);
- transform: scale(1.02);
-}
-
-/* Responsive Design - Mobile First with Tablet Primary */
-
-/* Small screens - 2 columns for very narrow widths */
-@media (max-width: 575px) {
- /* Adjust modal for very small screens */
- .hi-modal-dialog-700 {
- max-width: 95%;
- margin: 0.5rem;
- }
-
- /* File grid: 2 columns on very small screens */
- .attr-v2-file-grid {
- grid-template-columns: repeat(2, 1fr);
- gap: 0.75rem;
- }
-}
-
-/* Mobile Landscape (576px to 1023px) - Keep 3 columns */
-@media (min-width: 576px) and (max-width: 1023px) {
- /* File grid maintains 3 columns */
- .attr-v2-file-grid {
- grid-template-columns: repeat(3, 1fr);
- gap: 0.875rem;
- }
-
- /* Action bar may stack buttons vertically on very small landscape */
- .attr-v2-action-bar-content {
- flex-direction: column;
- gap: 0.75rem;
- align-items: stretch;
- }
-
- .attr-v2-action-buttons {
- justify-content: center;
- flex-wrap: wrap;
- }
-
- /* Attrribute actions stack vertically */
- .attr-v2-attribute-actions {
- flex-direction: column;
- gap: 0.25rem;
- align-items: flex-end;
- }
-}
-
-/* Tablet Landscape (1024px+) - PRIMARY TARGET */
-@media (min-width: 1024px) {
- /* Optimal layout - all features at full capacity */
- .hi-modal-dialog-700 {
- max-width: 700px;
- }
-
- /* File grid: 3 columns optimal */
- .attr-v2-file-grid {
- grid-template-columns: repeat(3, 1fr);
- gap: 1rem;
- }
-
- /* Action bar horizontal layout */
- .attr-v2-action-bar-content {
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- }
-
- /* Enhanced hover effects for mouse/trackpad */
- .attr-v2-file-card:hover,
- .attr-v2-attribute-card:hover {
- transform: translateY(-2px);
- box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
- }
-
- /* Better button spacing */
- .attr-v2-attribute-actions {
- flex-direction: row;
- gap: 0.25rem;
- }
-}
-
-/* Desktop (1200px+) - SECONDARY TARGET */
-@media (min-width: 1200px) {
- /* Enhanced layout with more space - maintain 3 columns */
- .attr-v2-file-grid {
- grid-template-columns: repeat(3, 1fr);
- gap: 1.25rem;
- }
-
- /* More generous spacing */
- .attr-v2-scrollable-content {
- padding: 1.5rem 0;
- }
-
- .attr-v2-attribute-list {
- gap: 1rem;
- }
-
- /* Enhanced hover effects */
- .attr-v2-file-card:hover,
- .attr-v2-attribute-card:hover {
- transform: translateY(-3px);
- box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
- }
-
- /* Larger touch targets can be more refined */
- .attr-v2-reorder-controls button,
- .attr-v2-attribute-actions button {
- min-width: 32px;
- min-height: 32px;
- padding: 8px;
- }
-}
-
-/* High DPI / Retina Displays */
-@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
- /* Sharper borders and shadows */
- .attr-v2-file-card,
- .attr-v2-attribute-card {
- border-width: 0.5px;
- }
-
- .attr-v2-sticky-panel {
- border-bottom-width: 0.5px;
- }
-}
-
-/* Touch Device Optimizations */
-@media (hover: none) and (pointer: coarse) {
- /* Touch-only devices: remove hover effects, ensure touch targets */
- .attr-v2-file-card:hover,
- .attr-v2-attribute-card:hover,
- .attr-v2-file-thumbnail:hover,
- .attr-v2-action-buttons button:hover,
- .attr-v2-file-actions button:hover,
- .attr-v2-attribute-actions button:hover {
- transform: none;
- box-shadow: none;
- background-color: initial;
- }
-
- /* Ensure all touch targets are adequate */
- .attr-v2-attribute-actions button,
- .attr-v2-file-actions button,
- .attr-v2-reorder-controls button {
- min-height: 44px; /* Touch-friendly standard */
- min-width: 44px;
- padding: 10px;
- }
-}
-
-/* Reduced Motion Preference */
-@media (prefers-reduced-motion: reduce) {
- /* Disable animations for users who prefer reduced motion */
- .attr-v2-file-card,
- .attr-v2-attribute-card,
- .attr-v2-action-buttons button,
- .attr-v2-file-actions button,
- .attr-v2-attribute-actions button,
- .attr-v2-reorder-controls button,
- .attr-v2-container input,
- .attr-v2-container select,
- .attr-v2-container textarea,
- .attr-v2-add-form,
- .attr-v2-file-thumbnail {
- animation: none;
- transition: none;
- }
-
-
- .attr-v2-loading-spinner {
- animation: spin 0.1s linear infinite;
- }
-}
-
-/* Add Attrribute Form */
-.attr-v2-add-form {
- border: 1px solid var(--line-color);
- border-radius: 0.375rem;
- background: var(--white);
- margin-top: 1rem;
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
- transition: all 0.3s ease;
- overflow: hidden;
-}
-
-.attr-v2-add-form.collapsed {
- display: none;
-}
-
-.attr-v2-add-form-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 0.75rem 1rem;
- border-bottom: 1px solid var(--line-color);
- background: var(--background-color);
-}
-
-.attr-v2-add-form-header h6 {
- margin: 0;
- font-size: 0.875rem;
- font-weight: 600;
- color: var(--text-color);
-}
-
-.attr-v2-add-form-content {
- padding: 1rem;
-}
-
-.attr-v2-add-form-actions {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-top: 1rem;
- padding-top: 1rem;
- border-top: 1px solid var(--line-color);
-}
-
-/* Add form field layout improvements */
-.attr-v2-add-form-content .row {
- align-items: end;
-}
-
-.attr-v2-add-form-content .custom-control {
- padding-top: 0.5rem;
-}
-
-.btn-control {
- width: 100%;
- white-space: nowrap;
- font-size: 0.75rem;
- font-weight: bold;
-}
-
-input[type="number"] {
- max-width: 8rem;
-}
-.hi-location-view {
- justify-content: center;
- align-items: center;
- height: calc(100vh - var(--top-buttons-height) - var(--bottom-buttons-height) );
- touch-action: none;
-
-}
-.hi-location-view-svg {
- max-height: calc(100vh - var(--top-buttons-height) - var(--bottom-buttons-height) );
- width: auto;
- height: auto;
- display: block;
- cursor: pointer;
-}
-
-#hi-integration-settings nav {
- border-right: 1px solid #888888;
- height: calc( 100vh - var(--top-buttons-height) - var(--bottom-buttons-height) - 6rem);
- overflow-y: auto;
-}
-#hi-integration-settings nav hr {
- flex: 0 0 auto; /* Prevent shrinking or growing */
- width: 100%;
- border-top: 1px solid #202020;
-}
-.drag-over {
- border: 2px dashed #888888;
-}
-
-.form-group label {
- color: #060606 !important;
-}
-.input-group-text {
- color: var(--black);
- background-color: #f0f0f0;
-}
-select,
-textarea,
-input[type="text"],
-input[type="password"],
-.dropdown-menu {
- color: var(--black) !important;
- background-color: #f8f8f8 !important;
-}
-.hi-custom-select .input-group-text {
- height: calc(1.5em + 0.75rem + 2px);
- line-height: 1.5;
-}
-.plus-icon {
- font-size: 1.5rem;
- color: var(--on-primary-color);
- background-color: var(--primary-color);
- padding: 0 0.25rem 0 0.25rem;
-}
-#hi-server-error-msg {
- position: fixed;
- display: none;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- padding: 1rem;
- z-index: 1060;
- text-align: center;
- font-size: 2rem;
- font-weight: bold;
- color: var(--warning-color);
- background-color: #282425;
- border-radius: 0.8rem;
- border: 0.1rem solid #282425;
- box-shadow: 0 0 1rem rgba(0, 0, 0, 0.5);
-}
-
-#hi-server-error-msg > div {
- margin-top: 1rem;
- padding: 3rem;
- width: 36rem;
- height: 14rem;
- color: #282425;
- font-size: 4rem;
- background-color: var(--warning-color);
- border-bottom-left-radius: 0.8rem;
- border-bottom-right-radius: 0.8rem;
- text-align: center;
-}
-
-svg[action-state="move"] {
- cursor: move;
-}
-svg[action-state="rotate"] {
- cursor: url('/static/css/cursor-rotate.png') 16 16, auto;
-}
-svg[action-state="scale"] {
- cursor: url('/static/css/cursor-scale.png') 16 16, auto;
-}
-
-svg .highlighted {
- filter: drop-shadow(0 0 10px var(--status-highlighted-color));
-}
-
-g.hi-icon {
- pointer-events: all;
-}
-path.hi-path-closed[hover] {
-}
-path.hover-target {
- stroke: none;
- stroke-width: 10;
- fill: none;
- pointer-events: all;
-}
-path.hi-path-closed[hover] {
- stroke: var(--status-hover-color);
- stroke-width: 4;
-}
-path.hover-target[hover] + path.hi-path-open {
- stroke: var(--status-hover-color);
- stroke-width: 5;
- filter: drop-shadow(0 0 5px var(--status-hover-color));
-}
-
-g[status="active"] {
- outline: 2px solid var(--status-active-color);
- filter: drop-shadow(0 0 5px var(--status-active-color));
-}
-g[status="recent"] {
- outline: 2px solid var(--status-recent-color);
- filter: drop-shadow(0 0 5px var(--status-recent-color));
-}
-g[status="past"] {
- outline: 2px solid var(--status-past-color);
- filter: drop-shadow(0 0 5px var(--status-past-color));
-}
-
-g[status="off"] path.hi-state-bg {
- fill: var(--status-off-color);
-}
-div[status="off"] {
- color: var(--on-status-off-color);
- background-color: var(--status-off-color);
-}
-g[status="on"] {
- filter: drop-shadow(0 0 5px var(--status-on-color));
-}
-g[status="on"] path.hi-state-bg {
- fill: var(--status-on-color);
-}
-div[status="on"] {
- color: var(--on-status-on-color);
- background-color: var(--status-on-color);
-}
-
-g[status="open"] {
- filter: drop-shadow(0 0 5px var(--status-bad-color));
-}
-g[status="connected"] {
- filter: drop-shadow(0 0 5px var(--status-ok-color));
-}
-g[status="disconnected"] {
- filter: drop-shadow(0 0 5px var(--status-bad-color));
-}
-g[status="high"] {
- filter: drop-shadow(0 0 5px var(--status-ok-color));
-}
-g[status="low"] {
- filter: drop-shadow(0 0 5px var(--status-bad-color));
-}
-
-div[status] {
- color: var(--black);
- background-color: var(--white);
- border-color: var(--black);
- border-style: solid;
- border-width: 2px;
- border-radius: 8px;
-}
-div[status="active"] {
- color: var(--on-status-active-color);
- background-color: var(--status-active-color);
-}
-div[status="idle"] {
- color: var(--on-status-ok-color);
- background-color: var(--status-ok-color);
-}
-div[status="recent"] {
- color: var(--on-status-recent-color);
- background-color: var(--status-recent-color);
-}
-div[status="past"] {
- color: var(--on-status-past-color);
- background-color: var(--status-past-color);
-}
-div[status="open"] {
- color: var(--on-status-bad-color);
- background-color: var(--status-bad-color);
-}
-div[status="closed"] {
- color: var(--on-status-idle-color);
- background-color: var(--status-idle-color);
-}
-div[status="RAID_OK"],
-div[status="connected"] {
- color: var(--on-status-ok-color);
- background-color: var(--status-ok-color);
-}
-div[status="disconnected"] {
- color: var(--on-status-bad-color);
- background-color: var(--status-bad-color);
-}
-div[status="high"] {
- color: var(--on-status-ok-color);
- background-color: var(--status-ok-color);
-}
-div[status="low"] {
- color: var(--on-status-bad-color);
- background-color: var(--status-bad-color);
-}
-
-g[hover] {
- filter: drop-shadow(0 0 10px var(--status-hover-color)) !important;
-}
-
-.display-only-svg-icon {
- width: 2rem;
- height: auto;
-}
-
-.switch {
- position: relative;
- display: inline-block;
- width: 50px;
- height: 24px;
-}
-.switch input {
- opacity: 0;
- width: 0;
- height: 0;
-}
-.slider {
- position: absolute;
- cursor: pointer;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background-color: #ccc;
- transition: 0.4s;
- border-radius: 24px;
-}
-.slider:before {
- position: absolute;
- content: "";
- height: 18px;
- width: 18px;
- left: 3px;
- bottom: 3px;
- background-color: white;
- transition: 0.4s;
- border-radius: 50%;
-}
-.switch input:checked + .slider {
- background-color: var(--success-color);
-}
-.switch input:checked + .slider:before {
- transform: translateX(26px);
-}
-
-#hi-alert-banner-container {
-}
-.hi-alarm-level-info {
- color: var(--on-success-color);
- background-color: var(--success-color);
-}
-
-.hi-alarm-level-warning {
- color: var(--on-warning-color);
- background-color: var(--warning-color);
-}
-
-.hi-alarm-level-critical {
- color: var(--on-error-color);
- background-color: var(--error-color);
-}
-
-#hi-sleep-overlay {
- position: fixed;
- display: none;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background-color: black;
- z-index: 9999;
- transition: opacity 0.3s ease;
-}
-
-.scroll-container {
- overflow-x: auto;
- white-space: nowrap;
- adding-bottom: 10px;
-}
-
-.row.flex-nowrap {
- flex-wrap: nowrap;
-}
-.weather-forecast-daily-col {
- min-width: 100px;
-}
-
-
-.details-popup-wrapper {
- position: relative;
-}
-.details-popup-summary {
- cursor: pointer;
-}
-.details-popup-content {
- display: none;
- position: absolute;
- top: 100%;
- left: 0;
- z-index: 10;
- background: white;
- border: 1px solid #ccc;
- padding: 1em;
- width: 100%;
- box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
- cursor: pointer;
-}
-
-/* Camera button status styling */
-.btn-camera[status="active"] {
- color: var(--on-status-active-color) !important;
- background-color: var(--status-active-color) !important;
- border-color: var(--status-active-color) !important;
- box-shadow: 0 0 5px var(--status-active-color);
-}
-
-.btn-camera[status="recent"] {
- color: var(--on-status-recent-color) !important;
- background-color: var(--status-recent-color) !important;
- border-color: var(--status-recent-color) !important;
- box-shadow: 0 0 3px var(--status-recent-color);
-}
-
-.btn-camera[status="past"] {
- color: var(--on-status-past-color) !important;
- background-color: var(--status-past-color) !important;
- border-color: var(--status-past-color) !important;
-}
-
-.btn-camera[status="idle"] {
- /* Default button styling - no changes needed */
-}
-
-/* Auto-view indicator styling */
-/* Auto-view transient state styling */
-.auto-view-active {
- border: 3px solid var(--warning-color) !important;
- border-radius: 4px;
- box-shadow: 0 0 0 1px rgba(236, 165, 0, 0.3);
- transition: all 0.3s ease-in-out;
-}
-
-.auto-view-corner-badge {
- background-color: var(--warning-color);
- color: var(--on-warning-color);
- padding: 6px 12px;
- border-radius: 0;
- font-size: 12px;
- font-weight: 500;
- display: flex;
- align-items: center;
- gap: 4px;
- box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.15);
- width: auto;
- min-width: fit-content;
- backdrop-filter: blur(5px);
- pointer-events: none;
- border-top: 1px solid rgba(236, 165, 0, 0.3);
- border-left: 1px solid rgba(236, 165, 0, 0.3);
-}
-
-.auto-view-badge-icon {
- font-size: 14px;
- opacity: 0.9;
-}
-
-.auto-view-badge-text {
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-/* Removed pulse animation as requested */
-
-/* Responsive adjustments for smaller screens */
-@media (max-width: 768px) {
- .auto-view-corner-badge {
- font-size: 11px;
- padding: 4px 8px;
- }
-
- .auto-view-badge-icon {
- font-size: 12px;
- }
-}
-
-/* ===== ATTRIBUTE CHANGE INDICATORS ===== */
-
-/* Visual indicator for modified attribute fields */
-.attribute-modified {
- border: 2px solid var(--warning-color) !important;
- background-color: rgba(236, 165, 0, 0.05);
- transition: border-color 0.2s ease-in-out, background-color 0.2s ease-in-out;
-}
-
-/* Asterisk indicator for modified fields */
-.attribute-modified-indicator {
- color: var(--warning-color);
- font-weight: bold;
- font-size: 1.1em;
- margin-left: 4px;
-}
-
-
-/* Focus states for modified fields */
-.attribute-modified:focus {
- border-color: var(--warning-color);
- box-shadow: 0 0 0 0.2rem rgba(236, 165, 0, 0.25);
-}
-
-
-/* History icon styling - matches plus-icon pattern */
-.history-icon {
- font-size: 1rem;
- color: var(--primary-color);
- padding: 0 0.25rem;
-}
-
-/* ==========================================
- Video Interface - Camera Event History
- ========================================== */
-
-/* Timeline Container */
-.timeline-container {
- max-height: 600px;
- overflow-y: auto;
- background-color: var(--white);
- border-right: 1px solid var(--line-color);
- padding-right: 1rem;
-}
-
-/* Timeline Groups */
-.timeline-group-label {
- color: var(--primary-color);
- padding: 8px 0;
- border-bottom: 2px solid var(--primary-color);
- margin-bottom: 12px;
- font-weight: 600;
- font-size: 0.875rem;
- text-transform: uppercase;
- letter-spacing: 0.5px;
-}
-
-/* Timeline Items */
-.timeline-item {
- padding: 10px;
- margin-bottom: 6px;
- border-left: 3px solid var(--line-color);
- transition: all 0.2s ease;
- border-radius: 0 4px 4px 0;
-}
-
-.timeline-item:hover {
- background-color: var(--edit-primary-bg-color);
- border-left-color: var(--primary-highlight-color);
- transform: translateX(2px);
-}
-
-.timeline-item.active {
- background-color: var(--edit-primary-bg-color);
- border-left-color: var(--secondary-color);
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
-}
-
-.timeline-item .time {
- font-weight: 500;
- color: var(--black);
-}
-
-.timeline-item.active .time {
- color: var(--primary-color);
-}
-
-/* Video Container */
-.video-container {
- border: 2px solid var(--line-color);
- border-radius: 8px;
- overflow: hidden;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
- background-color: var(--black);
-}
-
-.video-container img {
- display: block;
- width: 100%;
- height: auto;
-}
-
-/* Event Header */
-.response-header {
- border-bottom: 1px solid var(--line-color);
- padding-bottom: 0.75rem;
-}
-
-.response-header h6 {
- color: var(--primary-color);
- font-weight: 600;
- margin-bottom: 0.25rem;
-}
-
-/* Event Details Expansion Bar */
-.response-details-bar {
- border-top: 1px solid var(--line-color);
- margin-top: 1.5rem;
-}
-
-.details-expander {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 0.75rem 1rem;
- background: linear-gradient(to bottom, #f8f9fa, #f1f3f5);
- text-decoration: none;
- color: #6c757d;
- transition: all 0.2s ease;
- cursor: pointer;
-}
-
-.details-expander:hover {
- background: #e9ecef;
- text-decoration: none;
- color: #495057;
-}
-
-.details-expander:focus {
- outline: 2px solid var(--primary-color);
- outline-offset: -2px;
- text-decoration: none;
-}
-
-.details-label {
- font-size: 0.9rem;
- font-weight: 500;
- letter-spacing: 0.5px;
- text-transform: uppercase;
-}
-
-.details-chevron {
- font-size: 0.8rem;
- transition: transform 0.2s ease;
-}
-
-.details-expander[aria-expanded="true"] .details-chevron {
- transform: rotate(180deg);
-}
-
-.details-content {
- padding: 1rem;
- background-color: #f8f9fa;
- border-top: 1px solid #e9ecef;
-}
-
-.detail-row {
- display: grid;
- grid-template-columns: minmax(120px, 1fr) 2fr;
- gap: 1rem;
- padding: 0.5rem 0;
- border-bottom: 1px solid #e9ecef;
-}
-
-.detail-row:last-child {
- border-bottom: none;
-}
-
-.detail-label {
- font-size: 0.85rem;
- color: #6c757d;
- font-weight: 500;
-}
-
-.detail-value {
- font-size: 0.85rem;
- color: #212529;
- word-break: break-word;
-}
-
-/* Timeline Pagination */
-.timeline-pagination-top,
-.timeline-pagination-bottom {
- padding: 0.25rem;
-}
-
-.timeline-pagination-top .btn,
-.timeline-pagination-bottom .btn {
- font-size: 0.8rem;
- padding: 0.4rem;
- transition: all 0.2s ease;
- border-color: var(--primary-color);
- color: var(--primary-color);
-}
-
-.timeline-pagination-top .btn:hover,
-.timeline-pagination-bottom .btn:hover {
- transform: translateY(-1px);
- background-color: var(--primary-color);
- color: var(--on-primary-color);
-}
-
-
-/* ==========================================
- Loading States & Error Handling
- ========================================== */
-
-/* Video Placeholder/Error State */
-.video-placeholder {
- min-height: 400px;
- background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
- border-radius: 8px;
- position: relative;
-}
-
-.video-placeholder-icon {
- color: var(--primary-color);
- opacity: 0.5;
-}
-
-.video-placeholder h5 {
- color: var(--primary-color);
- font-weight: 600;
-}
-
-.video-placeholder p {
- color: var(--black);
- opacity: 0.8;
-}
-
-/* Loading Animation for Video */
-.video-container.loading {
- position: relative;
- min-height: 400px;
-}
-
-.video-container.loading::before {
- content: '';
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
- background-size: 200% 100%;
- animation: loading 1.5s infinite;
- border-radius: 8px;
-}
-
-.video-container.loading::after {
- content: 'Loading video stream...';
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- color: var(--primary-color);
- font-weight: 500;
-}
-
-@keyframes loading {
- 0% {
- background-position: 200% 0;
- }
- 100% {
- background-position: -200% 0;
- }
-}
-
-/* Error State for Timeline */
-.timeline-container.error {
- background-color: var(--edit-secondary-bg-color);
- padding: 1rem;
- text-align: center;
-}
-
-.timeline-container.error::before {
- content: '⚠ Unable to load event history';
- color: var(--error-color);
- font-weight: 600;
-}
-
-/* ==========================================
- Accessibility & Keyboard Navigation
- ========================================== */
-
-/* Focus indicators for keyboard navigation */
-.timeline-item a:focus {
- outline: 2px solid var(--secondary-color);
- outline-offset: 2px;
- border-radius: 4px;
-}
-
-
-/* High contrast mode support */
-@media (prefers-contrast: high) {
- .timeline-item.active {
- border-left-width: 4px;
- font-weight: bold;
- }
-
- .timeline-group-label {
- border-bottom-width: 3px;
- }
-}
-
-/* Reduced motion support */
-@media (prefers-reduced-motion: reduce) {
- .timeline-item,
- .video-container.loading::before {
- transition: none;
- animation: none;
- }
-}
-
-/* Screen reader only content */
-.sr-only {
- position: absolute;
- width: 1px;
- height: 1px;
- padding: 0;
- margin: -1px;
- overflow: hidden;
- clip: rect(0, 0, 0, 0);
- white-space: nowrap;
- border: 0;
-}
-
-/* ==========================================
- Responsive Design - Landscape Optimized
- ========================================== */
-
-/* Small landscape devices (landscape phones, 568px and up) */
-@media (min-width: 568px) and (orientation: landscape) {
- .timeline-container {
- max-height: 400px; /* Reduce height for smaller landscape screens */
- }
-}
-
-/* Medium landscape devices (tablets, 768px and up) */
-@media (min-width: 768px) and (orientation: landscape) {
- .timeline-container {
- max-height: 500px;
- }
-
- /* Optimize column widths for landscape tablets */
- .entity-video-sensor-history .col-md-3 {
- flex: 0 0 25%;
- max-width: 25%;
- }
-
- .entity-video-sensor-history .col-md-9 {
- flex: 0 0 75%;
- max-width: 75%;
- }
-}
-
-/* Large landscape devices (laptops/desktops, 992px and up) */
-@media (min-width: 992px) and (orientation: landscape) {
- .timeline-container {
- max-height: 600px;
- }
-
- /* Wider timeline on larger screens */
- .entity-video-sensor-history .col-md-3 {
- flex: 0 0 20%;
- max-width: 20%;
- }
-
- .entity-video-sensor-history .col-md-9 {
- flex: 0 0 80%;
- max-width: 80%;
- }
-}
-
-/* Extra large landscape devices (large desktops, 1200px and up) */
-@media (min-width: 1200px) {
- .video-container {
- max-width: 1000px; /* Limit video size on very large screens */
- margin: 0 auto;
- }
-}
-
-/* Landscape-specific optimizations */
-@media (orientation: landscape) {
- /* Compact timeline items for landscape */
- .timeline-item {
- padding: 8px;
- margin-bottom: 4px;
- }
-
- .timeline-group-label {
- padding: 6px 0;
- margin-bottom: 8px;
- }
-
-
- /* Compact details bar in landscape */
- .details-expander {
- padding: 0.5rem 0.75rem;
- }
-
- .details-content {
- padding: 0.75rem;
- }
-}
-
-/* Handle small screens that don't meet minimum requirements */
-@media (max-width: 767px) {
- /* Stack detail rows on mobile */
- .detail-row {
- grid-template-columns: 1fr;
- gap: 0.25rem;
- }
-
- .detail-label {
- font-weight: 600;
- color: #495057;
- }
-
- .details-expander {
- padding: 0.6rem 0.75rem;
- }
-
- .details-label {
- font-size: 0.85rem;
- }
- /* Stack layout vertically on very small screens */
- .entity-video-sensor-history .row {
- flex-direction: column;
- }
-
- .entity-video-sensor-history .col-md-3,
- .entity-video-sensor-history .col-md-9 {
- max-width: 100%;
- width: 100%;
- }
-
- .timeline-container {
- max-height: 200px;
- margin-bottom: 1rem;
- border-right: none;
- border-bottom: 1px solid var(--line-color);
- }
-}
-
-/* Video Interface Header Styles */
-.video-interface-header {
- border-bottom: 2px solid #e9ecef;
- padding: 0.75rem;
- margin: -0.75rem -0.75rem 0.75rem -0.75rem;
- border-radius: 0.5rem 0.5rem 0 0;
-}
-
-/* Page-specific header backgrounds */
-.video-interface-header.current-stream {
- background-color: var(--secondary-color);
- color: var(--on-secondary-color);
- border-bottom-color: var(--secondary-color);
-}
-
-.video-interface-header.event-history {
- background-color: var(--tertiary-color);
- color: var(--on-tertiary-color);
- border-bottom-color: var(--tertiary-color);
-}
-
-.entity-title {
- color: #343a40;
- font-weight: 600;
- font-size: 1.1rem;
-}
-
-.video-interface-header.current-stream .entity-title,
-.video-interface-header.event-history .entity-title {
- color: inherit;
-}
-
-.last-activity-badge {
- font-size: 0.85rem;
- padding: 0.25rem 0.5rem;
- background-color: #f8f9fa;
- border-radius: 12px;
- border: 1px solid #e9ecef;
-}
-
-.video-interface-header.current-stream .last-activity-badge {
- background-color: rgba(255, 255, 255, 0.2);
- border-color: rgba(255, 255, 255, 0.3);
- color: inherit;
-}
-
-.video-interface-header.event-history .last-activity-badge {
- background-color: rgba(255, 255, 255, 0.1);
- border-color: rgba(255, 255, 255, 0.2);
- color: inherit;
-}
-
-.video-nav-tabs {
- display: flex;
- gap: 0;
-}
-
-.video-nav-tab {
- padding: 0.5rem 1rem;
- text-decoration: none;
- color: #6c757d;
- border: 1px solid #dee2e6;
- background-color: #f8f9fa;
- transition: all 0.15s ease-in-out;
- position: relative;
- font-size: 0.9rem;
- font-weight: 500;
- cursor: pointer;
-}
-
-.video-nav-tab:first-child {
- border-top-left-radius: 0.375rem;
- border-bottom-left-radius: 0.375rem;
-}
-
-.video-nav-tab:last-child {
- border-top-right-radius: 0.375rem;
- border-bottom-right-radius: 0.375rem;
- border-left: none;
-}
-
-.video-nav-tab:not(:first-child):not(:last-child) {
- border-left: none;
-}
-
-.video-nav-tab:hover:not(.disabled):not(.active) {
- color: #495057;
- background-color: #e9ecef;
- text-decoration: none;
-}
-
-.video-nav-tab.active {
- color: #fff;
- background-color: #007bff;
- border-color: #007bff;
- z-index: 1;
-}
-
-/* Active tab styling for colored headers */
-.video-interface-header.current-stream .video-nav-tab.active {
- background-color: rgba(255, 255, 255, 0.9);
- color: var(--secondary-color);
- border-color: rgba(255, 255, 255, 0.9);
-}
-
-.video-interface-header.event-history .video-nav-tab.active {
- background-color: rgba(255, 255, 255, 0.9);
- color: var(--tertiary-color);
- border-color: rgba(255, 255, 255, 0.9);
-}
-
-/* Inactive tab styling for colored headers */
-.video-interface-header.current-stream .video-nav-tab:not(.active):not(.disabled),
-.video-interface-header.event-history .video-nav-tab:not(.active):not(.disabled) {
- background-color: rgba(255, 255, 255, 0.1);
- color: rgba(255, 255, 255, 0.8);
- border-color: rgba(255, 255, 255, 0.2);
-}
-
-.video-interface-header.current-stream .video-nav-tab:hover:not(.disabled):not(.active),
-.video-interface-header.event-history .video-nav-tab:hover:not(.disabled):not(.active) {
- background-color: rgba(255, 255, 255, 0.2);
- color: rgba(255, 255, 255, 1);
- border-color: rgba(255, 255, 255, 0.3);
-}
-
-.video-nav-tab.disabled {
- color: #6c757d;
- background-color: #f8f9fa;
- border-color: #dee2e6;
- cursor: not-allowed;
- opacity: 0.6;
-}
-
-/* Responsive adjustments */
-@media (max-width: 768px) {
- .video-interface-header .d-flex {
- flex-direction: column;
- align-items: flex-start !important;
- gap: 0.75rem;
- }
-
- .video-nav-tabs {
- width: 100%;
- justify-content: center;
- }
-
- .video-nav-tab {
- flex: 1;
- text-align: center;
- font-size: 0.85rem;
- padding: 0.4rem 0.6rem;
- }
-
- .entity-title {
- font-size: 1rem;
- }
-
- .last-activity-badge {
- font-size: 0.8rem;
- }
-}
-
-@media (max-width: 480px) {
- .video-nav-tab i {
- display: none; /* Hide icons on very small screens */
- }
-
- .video-nav-tab {
- padding: 0.4rem 0.5rem;
- font-size: 0.8rem;
- }
-}
-
-/* ===== ICON SYSTEM ===== */
-
-/* Base icon class */
-.hi-icon {
- display: inline-block;
- vertical-align: middle;
- fill: currentColor;
- stroke: currentColor;
- flex-shrink: 0;
-}
-
-/* Icon sizes */
-.hi-icon-sm {
- width: 0.875rem;
- height: 0.875rem;
-}
-
-.hi-icon-md {
- width: 1rem;
- height: 1rem;
-}
-
-.hi-icon-lg {
- width: 1.25rem;
- height: 1.25rem;
-}
-
-.hi-icon-xl {
- width: 1.5rem;
- height: 1.5rem;
-}
-
-/* Semantic icon colors using existing CSS variables */
-.hi-icon-primary {
- color: var(--primary-color);
-}
-
-.hi-icon-secondary {
- color: var(--secondary-color);
+div[status="off"] {
+ color: var(--on-status-off-color);
+ background-color: var(--status-off-color);
}
-
-.hi-icon-success {
- color: var(--success-color);
+g[status="on"] {
+ filter: drop-shadow(0 0 5px var(--status-on-color));
}
-
-.hi-icon-warning {
- color: var(--warning-color);
+g[status="on"] path.hi-state-bg {
+ fill: var(--status-on-color);
}
-
-.hi-icon-error {
- color: var(--error-color);
+div[status="on"] {
+ color: var(--on-status-on-color);
+ background-color: var(--status-on-color);
}
-.hi-icon-muted {
- color: var(--muted-color);
+g[status="open"] {
+ filter: drop-shadow(0 0 5px var(--status-bad-color));
}
-
-/* Icon spacing utilities */
-.hi-icon-left {
- margin-right: 0.375rem;
+g[status="connected"] {
+ filter: drop-shadow(0 0 5px var(--status-ok-color));
}
-
-.hi-icon-right {
- margin-left: 0.375rem;
+g[status="disconnected"] {
+ filter: drop-shadow(0 0 5px var(--status-bad-color));
}
-
-/* Icon button integration */
-.btn .hi-icon {
- vertical-align: text-top;
+g[status="high"] {
+ filter: drop-shadow(0 0 5px var(--status-ok-color));
}
-
-/* Enhanced icon alignment for V2 components */
-.attr-v2-action-buttons .hi-icon-left,
-.attr-v2-file-actions .hi-icon,
-.attr-v2-attribute-actions .hi-icon {
- vertical-align: middle;
+g[status="low"] {
+ filter: drop-shadow(0 0 5px var(--status-bad-color));
}
-.attr-v2-action-buttons button .hi-icon-left {
- margin-right: 0.5rem;
+div[status] {
+ color: var(--black);
+ background-color: var(--white);
+ border-color: var(--black);
+ border-style: solid;
+ border-width: 2px;
+ border-radius: 8px;
}
+div[status="active"] {
+ color: var(--on-status-active-color);
+ background-color: var(--status-active-color);
}
-
-/* Ensure icons work well in different contexts */
-.card-header .hi-icon,
-.card-title .hi-icon {
- margin-right: 0.375rem;
+div[status="idle"] {
+ color: var(--on-status-ok-color);
+ background-color: var(--status-ok-color);
}
-
-.alert .hi-icon {
- margin-right: 0.5rem;
+div[status="recent"] {
+ color: var(--on-status-recent-color);
+ background-color: var(--status-recent-color);
}
-
-/* Legacy icon class deprecation helpers */
-.plus-icon,
-.history-icon {
- /* These classes are deprecated. Use {% icon %} template tag instead */
- opacity: 0.7;
+div[status="past"] {
+ color: var(--on-status-past-color);
+ background-color: var(--status-past-color);
}
-
-/* High contrast mode support */
-@media (prefers-contrast: high) {
- .hi-icon {
- stroke-width: 2;
- }
+div[status="open"] {
+ color: var(--on-status-bad-color);
+ background-color: var(--status-bad-color);
}
-
-/* Reduced motion support */
-@media (prefers-reduced-motion: reduce) {
- .hi-icon {
- transition: none;
- }
+div[status="closed"] {
+ color: var(--on-status-idle-color);
+ background-color: var(--status-idle-color);
}
-
-/* Pagination styling overrides for app theming */
-.pagination-lg .page-link {
- color: var(--primary-color) !important;
- border-color: #dee2e6 !important;
- /* Force consistent height for all pagination buttons */
- height: 3rem !important;
- min-height: 3rem !important;
- display: flex !important;
- align-items: center !important;
- justify-content: center !important;
- padding: 0.5rem 0.75rem !important;
- box-sizing: border-box !important;
- line-height: 1.2 !important;
+div[status="RAID_OK"],
+div[status="connected"] {
+ color: var(--on-status-ok-color);
+ background-color: var(--status-ok-color);
}
-
-/* Ensure spans inside page-links don't affect height and are properly centered */
-.pagination-lg .page-link span {
- display: flex !important;
- align-items: center !important;
- justify-content: center !important;
- height: 100% !important;
+div[status="disconnected"] {
+ color: var(--on-status-bad-color);
+ background-color: var(--status-bad-color);
}
-
-.pagination-lg .page-link:hover {
- color: var(--primary-highlight-color) !important;
- background-color: #e9ecef !important;
- border-color: #dee2e6 !important;
+div[status="high"] {
+ color: var(--on-status-ok-color);
+ background-color: var(--status-ok-color);
}
-
-.pagination-lg .page-item.active .page-link {
- background-color: var(--primary-color) !important;
- border-color: var(--primary-color) !important;
- color: var(--on-primary-color) !important;
+div[status="low"] {
+ color: var(--on-status-bad-color);
+ background-color: var(--status-bad-color);
}
-.pagination-lg .page-item.disabled .page-link {
- color: #6c757d !important;
- background-color: #fff !important;
- border-color: #dee2e6 !important;
+g[hover] {
+ filter: drop-shadow(0 0 10px var(--status-hover-color)) !important;
}
-/* ====================================================================== */
-/* SECRET FIELD STYLING */
-/* ====================================================================== */
-
-.attr-v2-secret-field {
- position: relative;
+.display-only-svg-icon {
+ width: 2rem;
+ height: auto;
}
-.attr-v2-secret-input-wrapper {
+.switch {
position: relative;
- display: flex;
- align-items: stretch;
-}
-
-.attr-v2-secret-input-wrapper input,
-.attr-v2-secret-input-wrapper textarea {
- flex: 1;
- padding-right: 44px; /* Space for toggle button */
-}
-
-.attr-v2-secret-toggle {
- position: absolute;
- right: 4px;
- top: 50%;
- transform: translateY(-50%);
- z-index: 1;
- min-width: 36px;
- height: 36px;
- border: 1px solid #ced4da;
- background: var(--background-color);
- padding: 6px;
- display: flex;
- align-items: center;
- justify-content: center;
-}
-
-.attr-v2-secret-toggle:hover {
- background: var(--hover-background-color);
- border-color: #adb5bd;
-}
-
-.attr-v2-secret-toggle:focus {
- outline: 2px solid var(--primary-color);
- outline-offset: 2px;
- border-color: var(--primary-color);
-}
-
-/* Secret field in hidden state */
-.attr-v2-secret-field.hidden input,
-.attr-v2-secret-field.hidden textarea {
- -webkit-text-security: disc;
- font-family: 'Courier New', monospace;
- letter-spacing: 0.1em;
-}
-
-/* Fallback for browsers that don't support text-security */
-.attr-v2-secret-field.hidden input:not([type="password"]),
-.attr-v2-secret-field.hidden textarea {
- color: transparent;
- text-shadow: 0 0 0 #495057;
-}
-
-/* Touch device optimizations */
-@media (max-width: 768px) {
- .attr-v2-secret-toggle {
- min-width: 44px;
- height: 44px;
- }
-}
-
-/* Secret field readonly visual indicators */
-.attr-v2-secret-input[readonly] {
- background-color: #f8f9fa;
- cursor: default;
- border-color: #dee2e6;
-}
-
-.attr-v2-secret-input[readonly]:focus {
- background-color: #f8f9fa;
- border-color: #dee2e6;
- box-shadow: none;
-}
-
-/* When secret field is editable (shown), give it normal input styling */
-.attr-v2-secret-input[type="text"]:not([readonly]) {
- background-color: #ffffff;
- cursor: text;
-}
-
-.attr-v2-secret-input[type="text"]:not([readonly]):focus {
- border-color: var(--primary-color);
- box-shadow: 0 0 0 0.2rem rgba(23, 112, 114, 0.25);
-}
-
-/* Secret checkbox positioning and alignment */
-.attr-v2-secret-checkbox {
- margin-top: 0.75rem;
- margin-bottom: 0.5rem;
-}
-
-.attr-v2-secret-checkbox .custom-control {
- display: flex;
- align-items: center;
-}
-
-.attr-v2-secret-checkbox .custom-control-label {
- line-height: 1;
- padding-top: 0;
- margin-bottom: 0;
- font-size: 0.875rem;
-}
-
-/* ====================================================================== */
-/* V2 DIRTY STATE TRACKING STYLING */
-/* ====================================================================== */
-
-/* Dirty message area in sticky panel */
-.attr-v2-dirty-message {
- font-size: 0.875rem;
- color: transparent;
- transition: all 0.2s ease-in-out;
- min-width: 120px;
- padding: 0.25rem 0.5rem;
- border-radius: 0.25rem;
-}
-
-.attr-v2-dirty-message.active {
- color: #8B4513; /* Darker brown text for better contrast */
- background-color: #FFF3CD; /* Light warning background */
- border-left: 3px solid var(--warning-color);
- font-weight: 500;
-}
-
-/* Field-level dirty indicators */
-.attr-v2-field-dirty {
- border-left: 3px solid var(--warning-color) !important;
- background-color: rgba(255, 193, 7, 0.05) !important;
- transition: border-color 0.2s ease-in-out, background-color 0.2s ease-in-out;
-}
-
-.attr-v2-field-dirty:focus {
- border-left-color: var(--primary-color) !important;
- box-shadow: -3px 0 0 0 var(--primary-color), 0 0 0 0.2rem rgba(23, 112, 114, 0.25);
-}
-
-/* Dirty indicator dot */
-.attr-v2-dirty-indicator {
display: inline-block;
- margin-left: 0.5rem;
- color: var(--warning-color);
- font-size: 0.75rem;
- font-weight: bold;
- opacity: 0.8;
- animation: pulse 2s infinite;
-}
-
-/* Attrribute name dirty styling - fallback approach for broader browser support */
-.attr-v2-attribute-name.has-dirty-indicator {
- font-weight: 600;
- color: var(--warning-color);
-}
-
-/* Entity name dirty styling - fallback approach */
-.form-group.has-dirty-field small {
- color: var(--warning-color);
- font-weight: 500;
-}
-
-/* Modern browser support with :has() */
-@supports selector(:has(*)) {
- .attr-v2-attribute-name:has(.attr-v2-dirty-indicator) {
- font-weight: 600;
- color: var(--warning-color);
- }
-
- .form-group:has(.attr-v2-field-dirty) small {
- color: var(--warning-color);
- font-weight: 500;
- }
-
- .attr-v2-new-attribute .attr-v2-attribute-name:has(.attr-v2-dirty-indicator) {
- color: var(--primary-color);
- }
-}
-
-/* New attribute form dirty state - different styling */
-.attr-v2-new-attribute .attr-v2-field-dirty {
- border-left-color: var(--primary-color) !important;
- background-color: rgba(23, 112, 114, 0.08) !important;
-}
-
-.attr-v2-new-attribute .attr-v2-dirty-indicator {
- color: var(--primary-color);
-}
-
-.attr-v2-new-attribute .attr-v2-attribute-name.has-dirty-indicator {
- color: var(--primary-color);
-}
-
-/* Reduce motion for accessibility */
-@media (prefers-reduced-motion: reduce) {
- .attr-v2-dirty-indicator {
- animation: none;
- opacity: 1;
- }
-
- .attr-v2-field-dirty,
- .attr-v2-dirty-message {
- transition: none;
- }
-}
-
-/* ====================================================================== */
-/* ADD ATTRIBUTE FORM STYLING */
-/* ====================================================================== */
-
-.attr-v2-add-form {
- border: 1px solid #dee2e6;
- border-radius: 0.375rem;
- background: var(--background-color);
- margin-bottom: 1rem;
- overflow: hidden;
- transition: all 0.3s ease;
-}
-
-.attr-v2-add-form.collapsed {
- display: none;
-}
-
-.attr-v2-add-form-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 0.75rem 1rem;
- background: var(--highlight-background-color);
- border-bottom: 1px solid #dee2e6;
+ width: 50px;
+ height: 24px;
}
-
-.attr-v2-add-form-header h6 {
- margin: 0;
- font-weight: 600;
- color: var(--text-color);
+.switch input {
+ opacity: 0;
+ width: 0;
+ height: 0;
}
-
-.attr-v2-add-form-content {
- padding: 1rem;
+.slider {
+ position: absolute;
+ cursor: pointer;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background-color: #ccc;
+ transition: 0.4s;
+ border-radius: 24px;
}
-
-.attr-v2-add-form-actions {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-top: 1rem;
- padding-top: 1rem;
- border-top: 1px solid #dee2e6;
+.slider:before {
+ position: absolute;
+ content: "";
+ height: 18px;
+ width: 18px;
+ left: 3px;
+ bottom: 3px;
+ background-color: white;
+ transition: 0.4s;
+ border-radius: 50%;
}
-
-/* ====================================================================== */
-/* COMPACT BASIC INFO HEADER */
-/* ====================================================================== */
-
-.attr-v2-basic-info {
- background: var(--white);
- border: 1px solid var(--line-color);
- border-radius: 0.375rem;
- padding: 0.5rem 0.75rem;
- margin-bottom: 0.5rem;
+.switch input:checked + .slider {
+ background-color: var(--success-color);
}
-
-.attr-v2-basic-info .row {
- margin-left: -0.375rem;
- margin-right: -0.375rem;
+.switch input:checked + .slider:before {
+ transform: translateX(26px);
}
-.attr-v2-basic-info [class*="col-"] {
- padding-left: 0.375rem;
- padding-right: 0.375rem;
+#hi-alert-banner-container {
+}
+.hi-alarm-level-info {
+ color: var(--on-success-color);
+ background-color: var(--success-color);
}
-/* Force block layout for labels - very specific selector */
-.attr-v2-basic-info .form-group small,
-.attr-v2-basic-info .form-group .text-muted,
-.attr-v2-basic-info small,
-.attr-v2-basic-info .text-muted {
- display: block !important;
- font-size: 0.75rem !important;
- color: var(--muted-color) !important;
- margin-bottom: 0.25rem !important;
- font-weight: 500 !important;
- text-transform: uppercase !important;
- letter-spacing: 0.5px !important;
- width: 100% !important;
- line-height: 1 !important;
- clear: both !important;
+.hi-alarm-level-warning {
+ color: var(--on-warning-color);
+ background-color: var(--warning-color);
}
-.attr-v2-basic-info .form-control-sm {
- font-size: 0.875rem;
- padding: 0.375rem 0.5rem;
- height: calc(1.5em + 0.75rem + 2px);
- width: 100%; /* Ensure full width */
+.hi-alarm-level-critical {
+ color: var(--on-error-color);
+ background-color: var(--error-color);
}
-.attr-v2-basic-info .form-control {
- width: 100%; /* Ensure full width for all form controls */
+#hi-sleep-overlay {
+ position: fixed;
+ display: none;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background-color: black;
+ z-index: 9999;
+ transition: opacity 0.3s ease;
}
-.attr-v2-basic-info select.form-control-sm {
- padding-right: 1.75rem;
- background-position: right 0.375rem center;
- background-size: 16px 12px;
+.scroll-container {
+ overflow-x: auto;
white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
+ adding-bottom: 10px;
}
-/* Ensure columns don't break layout */
-.attr-v2-basic-info .col-md-8,
-.attr-v2-basic-info .col-md-4,
-.attr-v2-basic-info .col-sm-6 {
- min-width: 0; /* Allow flex shrinking */
+.row.flex-nowrap {
+ flex-wrap: nowrap;
}
-
-/* Remove bottom margin from form groups in header */
-.attr-v2-basic-info .form-group {
- margin-bottom: 0;
+.weather-forecast-daily-col {
+ min-width: 100px;
}
-/* Error state styling */
-.attr-v2-basic-info .form-control.is-invalid,
-.attr-v2-basic-info .form-control:invalid {
- border-color: var(--danger-color);
+.details-popup-wrapper {
+ position: relative;
}
-
-.attr-v2-basic-info .invalid-feedback {
- font-size: 0.75rem;
- margin-top: 0.25rem;
+.details-popup-summary {
+ cursor: pointer;
+}
+.details-popup-content {
+ display: none;
+ position: absolute;
+ top: 100%;
+ left: 0;
+ z-index: 10;
+ background: white;
+ border: 1px solid #ccc;
+ padding: 1em;
+ width: 100%;
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
+ cursor: pointer;
}
-/* ====================================================================== */
-/* ERROR MESSAGE STYLING */
-/* ====================================================================== */
-
-/* Non-field errors container - page level (owner form) */
-.attr-v2-sticky-panel .attr-v2-non-field-errors {
- border-left: 3px solid #dc2626;
- padding-left: 1rem;
- margin: 0.5rem 0;
+/* Getting Started Guide Styles */
+.getting-started-guide {
+ background: var(--white);
+ border-radius: 0.5rem;
+ padding: 1rem;
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
+ border: 1px solid var(--line-color);
}
-.attr-v2-sticky-panel .attr-v2-non-field-errors .attr-v2-error-item {
- color: #dc2626;
- font-size: 0.875rem;
- margin: 0.25rem 0;
+.getting-started-guide .guide-header {
display: flex;
- align-items: flex-start;
- gap: 0.5rem;
+ align-items: center;
+ margin-bottom: 1rem;
+ padding-bottom: 0.5rem;
+ border-bottom: 1px solid var(--line-color);
}
-.attr-v2-sticky-panel .attr-v2-non-field-errors .attr-v2-error-item:before {
- content: "•";
- color: #dc2626;
- font-weight: bold;
- flex-shrink: 0;
+.getting-started-guide .guide-header .hi-icon {
+ margin-right: 0.5rem;
}
-/* Formset non-form errors (same style as owner non-field errors) */
-.attr-v2-formset-errors {
- border-left: 3px solid #dc2626;
- padding-left: 1rem;
- margin: 0.5rem 0;
+.getting-started-guide .guide-header h5 {
+ margin: 0;
+ color: var(--black);
+ font-weight: 600;
}
-.attr-v2-formset-errors .attr-v2-error-item {
- color: #dc2626;
- font-size: 0.875rem;
- margin: 0.25rem 0;
- display: flex;
- align-items: flex-start;
- gap: 0.5rem;
+.getting-started-guide .mode-explanation {
+ background: var(--edit-primary-bg-color);
+ border-radius: 0.375rem;
+ padding: 0.75rem;
+ margin-bottom: 1rem;
+ border-left: 3px solid var(--primary-color);
+ border: 1px solid rgba(23, 112, 114, 0.3);
}
-.attr-v2-formset-errors .attr-v2-error-item:before {
- content: "•";
- color: #dc2626;
- font-weight: bold;
- flex-shrink: 0;
+.getting-started-guide .mode-explanation .badge {
+ font-size: 0.75rem;
+ margin-bottom: 0.25rem;
}
-/* Non-field errors - individual attribute card level (most subtle) */
-.attr-v2-attribute-card .attr-v2-non-field-errors {
- margin: 0.5rem 0 0 0;
- padding: 0;
+.getting-started-guide .steps {
+ margin-bottom: 1rem;
}
-.attr-v2-attribute-card .attr-v2-non-field-errors .attr-v2-error-item {
- color: #dc2626;
- font-size: 0.8125rem;
- margin: 0.25rem 0;
+.getting-started-guide .step {
display: flex;
align-items: flex-start;
- gap: 0.375rem;
-}
-
-.attr-v2-attribute-card .attr-v2-non-field-errors .attr-v2-error-item:before {
- content: "•";
- color: #dc2626;
- font-weight: bold;
- flex-shrink: 0;
+ margin-bottom: 1rem;
+ padding-bottom: 1rem;
+ border-bottom: 1px solid var(--line-color);
}
-/* Field-level errors */
-.attr-v2-field-errors {
- color: #dc2626;
- font-size: 0.8125rem;
- margin-top: 0.25rem;
- display: flex;
- flex-direction: column;
- gap: 0.125rem;
+.getting-started-guide .step:last-child {
+ border-bottom: none;
+ margin-bottom: 0;
+ padding-bottom: 0;
}
-.attr-v2-field-errors .attr-v2-error-text {
+.getting-started-guide .step-number {
+ background: var(--primary-color);
+ color: var(--on-primary-color);
+ width: 24px;
+ height: 24px;
+ border-radius: 50%;
display: flex;
- align-items: flex-start;
- gap: 0.375rem;
-}
-
-.attr-v2-field-errors .attr-v2-error-text:before {
- content: "•";
- color: #dc2626;
+ align-items: center;
+ justify-content: center;
+ font-size: 0.8rem;
font-weight: bold;
+ margin-right: 0.75rem;
flex-shrink: 0;
+ margin-top: 2px;
}
-/* Invalid form controls */
-.attr-v2-attribute-card .form-control.is-invalid,
-.attr-v2-basic-info .form-control.is-invalid {
- border-color: #dc2626;
- background-image: none;
-}
-
-.attr-v2-attribute-card .form-control.is-invalid:focus,
-.attr-v2-basic-info .form-control.is-invalid:focus {
- border-color: #dc2626;
- box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.25);
-}
-
-/* ====================================================================== */
-/* INLINE HISTORY STYLING */
-/* ====================================================================== */
-
-.attr-v2-inline-history {
- margin-top: 0.75rem;
+.getting-started-guide .step-content strong {
+ color: var(--black);
+ font-size: 0.9rem;
}
-.attr-v2-history-inline-content {
- background: var(--highlight-background-color);
- border: 1px solid var(--line-color);
- border-radius: 0.375rem;
- padding: 0.75rem;
- font-size: 0.875rem;
+.getting-started-guide .step-content .small {
+ color: var(--muted-color);
+ margin-top: 0.25rem;
+ line-height: 1.3;
}
-.attr-v2-history-header {
- margin-bottom: 0.5rem;
- padding-bottom: 0.5rem;
- border-bottom: 1px solid var(--line-color);
+.getting-started-guide .help-hint {
display: flex;
- justify-content: space-between;
align-items: center;
+ background: var(--edit-tertiary-bg-color);
+ padding: 0.5rem;
+ border-radius: 0.25rem;
+ border: 1px solid var(--line-color);
}
-.attr-v2-history-close {
- color: var(--danger-color);
- text-decoration: none;
-}
-
-.attr-v2-history-close:hover {
- color: var(--danger-color);
- text-decoration: none;
-}
-
-.attr-v2-history-current {
- font-size: 0.8125rem;
-}
-
-.attr-v2-history-current .badge-primary {
- background-color: var(--success-color);
- border-color: var(--success-color);
-}
-
-.attr-v2-history-toggle .btn-link {
- color: var(--text-color);
- text-decoration: none;
+.getting-started-guide .help-hint .hi-icon {
+ margin-right: 0.5rem;
}
-.attr-v2-history-toggle .btn-link:hover {
- color: var(--primary-color);
- text-decoration: underline;
+.getting-started-guide .help-hint small {
+ color: var(--muted-color);
}
-.attr-v2-history-record {
- padding: 0.375rem 0;
- border-bottom: 1px solid rgba(0,0,0,0.05);
-}
+/* ================================= */
+/* Editing Help Modal Styles */
+/* ================================= */
-.attr-v2-history-record:last-child {
- border-bottom: none;
+.editing-help-guide {
+ font-size: 0.9rem;
}
-.attr-v2-history-record .badge {
- font-size: 0.75rem;
- max-width: 300px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- display: inline-block;
- vertical-align: top;
+.editing-help-guide .guide-header {
+ display: flex;
+ align-items: center;
+ gap: 0.75rem;
+ margin-bottom: 1.25rem;
+ padding-bottom: 0.75rem;
+ border-bottom: 2px solid var(--line-color);
}
-.attr-v2-history-current .badge {
- font-size: 0.75rem;
- max-width: 300px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- display: inline-block;
- vertical-align: top;
+.editing-help-guide .guide-header h5 {
+ margin: 0;
+ color: var(--black);
+ font-weight: 600;
}
-.attr-v2-history-record .btn-xs {
- font-size: 0.75rem;
- padding: 0.125rem 0.5rem;
- line-height: 1.2;
+.editing-help-categories {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: 1.5rem;
+ margin-bottom: 1.5rem;
}
-.attr-v2-history-toggle {
- padding-top: 0.5rem;
- border-top: 1px solid rgba(0,0,0,0.05);
+.editing-help-guide .help-category {
+ background: var(--white);
+ border: 1px solid var(--line-color);
+ border-radius: 0.5rem;
+ padding: 1rem;
+ transition: all 0.2s ease;
}
-.attr-v2-history-empty {
- text-align: center;
- padding: 1rem 0;
- color: var(--muted-color);
+.editing-help-guide .help-category:hover {
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+ border-color: var(--primary-color);
}
-/* ====================================================================== */
-/* DELETION STATES WITH WATERMARKS */
-/* ====================================================================== */
-
-/* File Card Deletion Styling */
-.attr-v2-file-card.marked-for-deletion {
- opacity: 0.9;
- transition: all 0.3s ease;
+.editing-help-guide .category-header {
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+ margin-bottom: 0.75rem;
+ padding-bottom: 0.5rem;
+ border-bottom: 1px solid var(--edit-tertiary-bg-color);
}
-.attr-v2-file-card.marked-for-deletion .attr-v2-file-thumbnail {
- position: relative;
- background: linear-gradient(rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.1)),
- repeating-linear-gradient(45deg, #f8f9fa, #f8f9fa 10px, #e9ecef 10px, #e9ecef 20px);
+.editing-help-guide .category-icon {
+ width: 32px;
+ height: 32px;
+ background: var(--edit-primary-bg-color);
+ border-radius: 50%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-shrink: 0;
}
-.attr-v2-file-card.marked-for-deletion .attr-v2-file-thumbnail::after {
- content: "PENDING DELETION";
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%) rotate(-15deg);
- font-size: 0.875rem;
+.editing-help-guide .category-title {
font-weight: 600;
- color: var(--danger-color);
- opacity: 0.3;
- text-transform: uppercase;
- letter-spacing: 2px;
- pointer-events: none;
- white-space: nowrap;
- z-index: 10;
-}
-
-.attr-v2-file-card.marked-for-deletion .attr-v2-file-info {
- border-color: var(--danger-color);
- background: rgba(220, 53, 69, 0.05);
-}
-
-/* Attrribute Card Deletion Styling */
-.attr-v2-attribute-card.marked-for-deletion {
- position: relative;
- background: rgba(220, 53, 69, 0.05);
- border-left: 4px solid var(--danger-color);
- overflow: hidden;
- opacity: 0.9;
- transition: all 0.3s ease;
+ margin: 0;
+ color: var(--black);
+ font-size: 1rem;
}
-.attr-v2-attribute-card.marked-for-deletion::after {
- content: "PENDING DELETION";
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- font-size: 1.5rem;
- font-weight: 700;
- color: var(--danger-color);
- opacity: 0.1;
- text-transform: uppercase;
- letter-spacing: 2px;
- pointer-events: none;
- z-index: 10;
- white-space: nowrap;
+.editing-help-guide .help-actions {
+ list-style: none;
+ padding: 0;
+ margin: 0;
}
-/* Keep inputs interactive but let watermark show through */
-.attr-v2-attribute-card.marked-for-deletion .form-control,
-.attr-v2-attribute-card.marked-for-deletion textarea,
-.attr-v2-attribute-card.marked-for-deletion input {
- position: relative;
- background-color: rgba(255, 255, 255, 0.9);
+.editing-help-guide .help-actions li {
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+ padding: 0.375rem 0;
+ border-bottom: 1px solid var(--edit-tertiary-bg-color);
}
-/* Undo button visibility when marked for deletion */
-.marked-for-deletion .attr-v2-delete-btn {
- display: none !important;
+.editing-help-guide .help-actions li:last-child {
+ border-bottom: none;
}
-.marked-for-deletion .attr-v2-undo-btn {
- display: inline-flex !important;
+.editing-help-guide .action-method {
+ font-family: 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
+ background: var(--edit-tertiary-bg-color);
+ padding: 0.125rem 0.375rem;
+ border-radius: 0.25rem;
+ font-size: 0.8rem;
+ color: var(--primary-highlight-color);
+ white-space: nowrap;
+ font-weight: 600;
}
-/* ====================================================================== */
-/* ENTITY EDIT MODAL V2 STYLING IMPROVEMENTS */
-/* ====================================================================== */
-
-/* Task 1: Standardize delete icon colors to red */
-.attr-v2-attribute-actions .attr-v2-delete-btn {
- color: #dc3545 !important;
- border-color: #dc3545 !important;
+.editing-help-guide .action-description {
+ flex: 1;
+ color: var(--muted-color);
+ font-size: 0.85rem;
}
-.attr-v2-attribute-actions .attr-v2-delete-btn:hover {
- background-color: #dc3545 !important;
- color: white !important;
+.editing-help-guide .help-note {
+ padding: 1rem;
+ background: var(--edit-secondary-bg-color);
+ border-radius: 0.5rem;
+ border-left: 4px solid var(--secondary-color);
}
-/* Task 2: Style "Add New Attrribute" form for visual distinction */
-.attr-v2-new-attribute {
- background-color: rgba(23, 112, 114, 0.05) !important;
- border: 2px dashed rgba(23, 112, 114, 0.3) !important;
- border-radius: 8px;
+.editing-help-guide .note-header {
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+ margin-bottom: 0.5rem;
}
-.attr-v2-new-attribute .attr-v2-attribute-header h6 {
- color: var(--primary-color);
+.editing-help-guide .note-title {
font-weight: 600;
- font-style: italic;
-}
-
-
-/* Task 3: Make Add File and Add Attrribute buttons consistent size */
-.attr-v2-action-buttons label.btn {
- min-height: 44px;
- padding: 0.375rem 0.75rem;
- font-size: 0.875rem;
- border-radius: 0.25rem;
- display: inline-flex;
- align-items: center;
- justify-content: center;
- line-height: 1.5;
- cursor: pointer;
+ color: var(--black);
+ margin: 0;
+ font-size: 0.9rem;
}
-/* Task 4: Make attribute name/labels more prominent than values */
-.attr-v2-attribute-name {
- font-size: 0.9rem !important;
- font-weight: 600 !important;
- color: var(--primary-text-color) !important;
- margin-bottom: 0.5rem;
- letter-spacing: 0.5px;
+.editing-help-guide .note-content {
+ margin: 0;
+ color: var(--muted-color);
+ font-size: 0.9rem;
}
-/* Touch device optimizations */
+/* Responsive behavior for smaller modals */
@media (max-width: 768px) {
-
- .attr-v2-add-form-actions {
- flex-direction: column;
- gap: 0.75rem;
- align-items: stretch;
+ .editing-help-guide .editing-help-categories {
+ grid-template-columns: 1fr;
+ gap: 1rem;
}
}
diff --git a/src/hi/static/css/stream-browser.css b/src/hi/static/css/stream-browser.css
new file mode 100644
index 00000000..6418b7f8
--- /dev/null
+++ b/src/hi/static/css/stream-browser.css
@@ -0,0 +1,676 @@
+
+/* ==========================================
+ Video Interface - Camera Event History
+ ========================================== */
+
+
+/* Camera button status styling */
+.btn-camera[status="active"] {
+ color: var(--on-status-active-color) !important;
+ background-color: var(--status-active-color) !important;
+ border-color: var(--status-active-color) !important;
+ box-shadow: 0 0 5px var(--status-active-color);
+}
+
+.btn-camera[status="recent"] {
+ color: var(--on-status-recent-color) !important;
+ background-color: var(--status-recent-color) !important;
+ border-color: var(--status-recent-color) !important;
+ box-shadow: 0 0 3px var(--status-recent-color);
+}
+
+.btn-camera[status="past"] {
+ color: var(--on-status-past-color) !important;
+ background-color: var(--status-past-color) !important;
+ border-color: var(--status-past-color) !important;
+}
+
+.btn-camera[status="idle"] {
+ /* Default button styling - no changes needed */
+}
+
+/* Auto-view indicator styling */
+/* Auto-view transient state styling */
+.auto-view-active {
+ border: 3px solid var(--warning-color) !important;
+ border-radius: 4px;
+ box-shadow: 0 0 0 1px rgba(236, 165, 0, 0.3);
+ transition: all 0.3s ease-in-out;
+}
+
+.auto-view-corner-badge {
+ background-color: var(--warning-color);
+ color: var(--on-warning-color);
+ padding: 6px 12px;
+ border-radius: 0;
+ font-size: 12px;
+ font-weight: 500;
+ display: flex;
+ align-items: center;
+ gap: 4px;
+ box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.15);
+ width: auto;
+ min-width: fit-content;
+ backdrop-filter: blur(5px);
+ pointer-events: none;
+ border-top: 1px solid rgba(236, 165, 0, 0.3);
+ border-left: 1px solid rgba(236, 165, 0, 0.3);
+}
+
+.auto-view-badge-icon {
+ font-size: 14px;
+ opacity: 0.9;
+}
+
+.auto-view-badge-text {
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+/* Removed pulse animation as requested */
+
+/* Responsive adjustments for smaller screens */
+@media (max-width: 768px) {
+ .auto-view-corner-badge {
+ font-size: 11px;
+ padding: 4px 8px;
+ }
+
+ .auto-view-badge-icon {
+ font-size: 12px;
+ }
+}
+
+/* Timeline Container */
+.timeline-container {
+ max-height: 600px;
+ overflow-y: auto;
+ background-color: var(--white);
+ border-right: 1px solid var(--line-color);
+ padding-right: 1rem;
+}
+
+/* Timeline Groups */
+.timeline-group-label {
+ color: var(--primary-color);
+ padding: 8px 0;
+ border-bottom: 2px solid var(--primary-color);
+ margin-bottom: 12px;
+ font-weight: 600;
+ font-size: 0.875rem;
+ text-transform: uppercase;
+ letter-spacing: 0.5px;
+}
+
+/* Timeline Items */
+.timeline-item {
+ padding: 10px;
+ margin-bottom: 6px;
+ border-left: 3px solid var(--line-color);
+ transition: all 0.2s ease;
+ border-radius: 0 4px 4px 0;
+}
+
+.timeline-item:hover {
+ background-color: var(--edit-primary-bg-color);
+ border-left-color: var(--primary-highlight-color);
+ transform: translateX(2px);
+}
+
+.timeline-item.active {
+ background-color: var(--edit-primary-bg-color);
+ border-left-color: var(--secondary-color);
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
+}
+
+.timeline-item .time {
+ font-weight: 500;
+ color: var(--black);
+}
+
+.timeline-item.active .time {
+ color: var(--primary-color);
+}
+
+/* Video Container */
+.video-container {
+ border: 2px solid var(--line-color);
+ border-radius: 8px;
+ overflow: hidden;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+ background-color: var(--black);
+}
+
+.video-container img {
+ display: block;
+ width: 100%;
+ height: auto;
+}
+
+/* Event Header */
+.response-header {
+ border-bottom: 1px solid var(--line-color);
+ padding-bottom: 0.75rem;
+}
+
+.response-header h6 {
+ color: var(--primary-color);
+ font-weight: 600;
+ margin-bottom: 0.25rem;
+}
+
+/* Event Details Expansion Bar */
+.response-details-bar {
+ border-top: 1px solid var(--line-color);
+ margin-top: 1.5rem;
+}
+
+.details-expander {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 0.75rem 1rem;
+ background: linear-gradient(to bottom, #f8f9fa, #f1f3f5);
+ text-decoration: none;
+ color: #6c757d;
+ transition: all 0.2s ease;
+ cursor: pointer;
+}
+
+.details-expander:hover {
+ background: #e9ecef;
+ text-decoration: none;
+ color: #495057;
+}
+
+.details-expander:focus {
+ outline: 2px solid var(--primary-color);
+ outline-offset: -2px;
+ text-decoration: none;
+}
+
+.details-label {
+ font-size: 0.9rem;
+ font-weight: 500;
+ letter-spacing: 0.5px;
+ text-transform: uppercase;
+}
+
+.details-chevron {
+ font-size: 0.8rem;
+ transition: transform 0.2s ease;
+}
+
+.details-expander[aria-expanded="true"] .details-chevron {
+ transform: rotate(180deg);
+}
+
+.details-content {
+ padding: 1rem;
+ background-color: #f8f9fa;
+ border-top: 1px solid #e9ecef;
+}
+
+.detail-row {
+ display: grid;
+ grid-template-columns: minmax(120px, 1fr) 2fr;
+ gap: 1rem;
+ padding: 0.5rem 0;
+ border-bottom: 1px solid #e9ecef;
+}
+
+.detail-row:last-child {
+ border-bottom: none;
+}
+
+.detail-label {
+ font-size: 0.85rem;
+ color: #6c757d;
+ font-weight: 500;
+}
+
+.detail-value {
+ font-size: 0.85rem;
+ color: #212529;
+ word-break: break-word;
+}
+
+/* Timeline Pagination */
+.timeline-pagination-top,
+.timeline-pagination-bottom {
+ padding: 0.25rem;
+}
+
+.timeline-pagination-top .btn,
+.timeline-pagination-bottom .btn {
+ font-size: 0.8rem;
+ padding: 0.4rem;
+ transition: all 0.2s ease;
+ border-color: var(--primary-color);
+ color: var(--primary-color);
+}
+
+.timeline-pagination-top .btn:hover,
+.timeline-pagination-bottom .btn:hover {
+ transform: translateY(-1px);
+ background-color: var(--primary-color);
+ color: var(--on-primary-color);
+}
+
+
+/* ==========================================
+ Loading States & Error Handling
+ ========================================== */
+
+/* Video Placeholder/Error State */
+.video-placeholder {
+ min-height: 400px;
+ background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
+ border-radius: 8px;
+ position: relative;
+}
+
+.video-placeholder-icon {
+ color: var(--primary-color);
+ opacity: 0.5;
+}
+
+.video-placeholder h5 {
+ color: var(--primary-color);
+ font-weight: 600;
+}
+
+.video-placeholder p {
+ color: var(--black);
+ opacity: 0.8;
+}
+
+/* Loading Animation for Video */
+.video-container.loading {
+ position: relative;
+ min-height: 400px;
+}
+
+.video-container.loading::before {
+ content: '';
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
+ background-size: 200% 100%;
+ animation: loading 1.5s infinite;
+ border-radius: 8px;
+}
+
+.video-container.loading::after {
+ content: 'Loading video stream...';
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ color: var(--primary-color);
+ font-weight: 500;
+}
+
+@keyframes loading {
+ 0% {
+ background-position: 200% 0;
+ }
+ 100% {
+ background-position: -200% 0;
+ }
+}
+
+/* Error State for Timeline */
+.timeline-container.error {
+ background-color: var(--edit-secondary-bg-color);
+ padding: 1rem;
+ text-align: center;
+}
+
+.timeline-container.error::before {
+ content: '⚠ Unable to load event history';
+ color: var(--error-color);
+ font-weight: 600;
+}
+
+/* ==========================================
+ Accessibility & Keyboard Navigation
+ ========================================== */
+
+/* Focus indicators for keyboard navigation */
+.timeline-item a:focus {
+ outline: 2px solid var(--secondary-color);
+ outline-offset: 2px;
+ border-radius: 4px;
+}
+
+
+/* High contrast mode support */
+@media (prefers-contrast: high) {
+ .timeline-item.active {
+ border-left-width: 4px;
+ font-weight: bold;
+ }
+
+ .timeline-group-label {
+ border-bottom-width: 3px;
+ }
+}
+
+/* Reduced motion support */
+@media (prefers-reduced-motion: reduce) {
+ .timeline-item,
+ .video-container.loading::before {
+ transition: none;
+ animation: none;
+ }
+}
+
+/* Screen reader only content */
+.sr-only {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ padding: 0;
+ margin: -1px;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ white-space: nowrap;
+ border: 0;
+}
+
+/* ==========================================
+ Responsive Design - Landscape Optimized
+ ========================================== */
+
+/* Small landscape devices (landscape phones, 568px and up) */
+@media (min-width: 568px) and (orientation: landscape) {
+ .timeline-container {
+ max-height: 400px; /* Reduce height for smaller landscape screens */
+ }
+}
+
+/* Medium landscape devices (tablets, 768px and up) */
+@media (min-width: 768px) and (orientation: landscape) {
+ .timeline-container {
+ max-height: 500px;
+ }
+
+ /* Optimize column widths for landscape tablets */
+ .entity-video-sensor-history .col-md-3 {
+ flex: 0 0 25%;
+ max-width: 25%;
+ }
+
+ .entity-video-sensor-history .col-md-9 {
+ flex: 0 0 75%;
+ max-width: 75%;
+ }
+}
+
+/* Large landscape devices (laptops/desktops, 992px and up) */
+@media (min-width: 992px) and (orientation: landscape) {
+ .timeline-container {
+ max-height: 600px;
+ }
+
+ /* Wider timeline on larger screens */
+ .entity-video-sensor-history .col-md-3 {
+ flex: 0 0 20%;
+ max-width: 20%;
+ }
+
+ .entity-video-sensor-history .col-md-9 {
+ flex: 0 0 80%;
+ max-width: 80%;
+ }
+}
+
+/* Extra large landscape devices (large desktops, 1200px and up) */
+@media (min-width: 1200px) {
+ .video-container {
+ max-width: 1000px; /* Limit video size on very large screens */
+ margin: 0 auto;
+ }
+}
+
+/* Landscape-specific optimizations */
+@media (orientation: landscape) {
+ /* Compact timeline items for landscape */
+ .timeline-item {
+ padding: 8px;
+ margin-bottom: 4px;
+ }
+
+ .timeline-group-label {
+ padding: 6px 0;
+ margin-bottom: 8px;
+ }
+
+
+ /* Compact details bar in landscape */
+ .details-expander {
+ padding: 0.5rem 0.75rem;
+ }
+
+ .details-content {
+ padding: 0.75rem;
+ }
+}
+
+/* Handle small screens that don't meet minimum requirements */
+@media (max-width: 767px) {
+ /* Stack detail rows on mobile */
+ .detail-row {
+ grid-template-columns: 1fr;
+ gap: 0.25rem;
+ }
+
+ .detail-label {
+ font-weight: 600;
+ color: #495057;
+ }
+
+ .details-expander {
+ padding: 0.6rem 0.75rem;
+ }
+
+ .details-label {
+ font-size: 0.85rem;
+ }
+ /* Stack layout vertically on very small screens */
+ .entity-video-sensor-history .row {
+ flex-direction: column;
+ }
+
+ .entity-video-sensor-history .col-md-3,
+ .entity-video-sensor-history .col-md-9 {
+ max-width: 100%;
+ width: 100%;
+ }
+
+ .timeline-container {
+ max-height: 200px;
+ margin-bottom: 1rem;
+ border-right: none;
+ border-bottom: 1px solid var(--line-color);
+ }
+}
+
+/* Video Interface Header Styles */
+.video-interface-header {
+ border-bottom: 2px solid #e9ecef;
+ padding: 0.75rem;
+ margin: -0.75rem -0.75rem 0.75rem -0.75rem;
+ border-radius: 0.5rem 0.5rem 0 0;
+}
+
+/* Page-specific header backgrounds */
+.video-interface-header.current-stream {
+ background-color: var(--secondary-color);
+ color: var(--on-secondary-color);
+ border-bottom-color: var(--secondary-color);
+}
+
+.video-interface-header.event-history {
+ background-color: var(--tertiary-color);
+ color: var(--on-tertiary-color);
+ border-bottom-color: var(--tertiary-color);
+}
+
+.entity-title {
+ color: #343a40;
+ font-weight: 600;
+ font-size: 1.1rem;
+}
+
+.video-interface-header.current-stream .entity-title,
+.video-interface-header.event-history .entity-title {
+ color: inherit;
+}
+
+.last-activity-badge {
+ font-size: 0.85rem;
+ padding: 0.25rem 0.5rem;
+ background-color: #f8f9fa;
+ border-radius: 12px;
+ border: 1px solid #e9ecef;
+}
+
+.video-interface-header.current-stream .last-activity-badge {
+ background-color: rgba(255, 255, 255, 0.2);
+ border-color: rgba(255, 255, 255, 0.3);
+ color: inherit;
+}
+
+.video-interface-header.event-history .last-activity-badge {
+ background-color: rgba(255, 255, 255, 0.1);
+ border-color: rgba(255, 255, 255, 0.2);
+ color: inherit;
+}
+
+.video-nav-tabs {
+ display: flex;
+ gap: 0;
+}
+
+.video-nav-tab {
+ padding: 0.5rem 1rem;
+ text-decoration: none;
+ color: #6c757d;
+ border: 1px solid #dee2e6;
+ background-color: #f8f9fa;
+ transition: all 0.15s ease-in-out;
+ position: relative;
+ font-size: 0.9rem;
+ font-weight: 500;
+ cursor: pointer;
+}
+
+.video-nav-tab:first-child {
+ border-top-left-radius: 0.375rem;
+ border-bottom-left-radius: 0.375rem;
+}
+
+.video-nav-tab:last-child {
+ border-top-right-radius: 0.375rem;
+ border-bottom-right-radius: 0.375rem;
+ border-left: none;
+}
+
+.video-nav-tab:not(:first-child):not(:last-child) {
+ border-left: none;
+}
+
+.video-nav-tab:hover:not(.disabled):not(.active) {
+ color: #495057;
+ background-color: #e9ecef;
+ text-decoration: none;
+}
+
+.video-nav-tab.active {
+ color: #fff;
+ background-color: #007bff;
+ border-color: #007bff;
+ z-index: 1;
+}
+
+/* Active tab styling for colored headers */
+.video-interface-header.current-stream .video-nav-tab.active {
+ background-color: rgba(255, 255, 255, 0.9);
+ color: var(--secondary-color);
+ border-color: rgba(255, 255, 255, 0.9);
+}
+
+.video-interface-header.event-history .video-nav-tab.active {
+ background-color: rgba(255, 255, 255, 0.9);
+ color: var(--tertiary-color);
+ border-color: rgba(255, 255, 255, 0.9);
+}
+
+/* Inactive tab styling for colored headers */
+.video-interface-header.current-stream .video-nav-tab:not(.active):not(.disabled),
+.video-interface-header.event-history .video-nav-tab:not(.active):not(.disabled) {
+ background-color: rgba(255, 255, 255, 0.1);
+ color: rgba(255, 255, 255, 0.8);
+ border-color: rgba(255, 255, 255, 0.2);
+}
+
+.video-interface-header.current-stream .video-nav-tab:hover:not(.disabled):not(.active),
+.video-interface-header.event-history .video-nav-tab:hover:not(.disabled):not(.active) {
+ background-color: rgba(255, 255, 255, 0.2);
+ color: rgba(255, 255, 255, 1);
+ border-color: rgba(255, 255, 255, 0.3);
+}
+
+.video-nav-tab.disabled {
+ color: #6c757d;
+ background-color: #f8f9fa;
+ border-color: #dee2e6;
+ cursor: not-allowed;
+ opacity: 0.6;
+}
+
+/* Responsive adjustments */
+@media (max-width: 768px) {
+ .video-interface-header .d-flex {
+ flex-direction: column;
+ align-items: flex-start !important;
+ gap: 0.75rem;
+ }
+
+ .video-nav-tabs {
+ width: 100%;
+ justify-content: center;
+ }
+
+ .video-nav-tab {
+ flex: 1;
+ text-align: center;
+ font-size: 0.85rem;
+ padding: 0.4rem 0.6rem;
+ }
+
+ .entity-title {
+ font-size: 1rem;
+ }
+
+ .last-activity-badge {
+ font-size: 0.8rem;
+ }
+}
+
+@media (max-width: 480px) {
+ .video-nav-tab i {
+ display: none; /* Hide icons on very small screens */
+ }
+
+ .video-nav-tab {
+ padding: 0.4rem 0.5rem;
+ font-size: 0.8rem;
+ }
+}
diff --git a/src/hi/static/img/integrations/home-assistant.png b/src/hi/static/img/integrations/home-assistant.png
new file mode 100644
index 00000000..968fd019
Binary files /dev/null and b/src/hi/static/img/integrations/home-assistant.png differ
diff --git a/src/hi/static/img/integrations/zoneminder.png b/src/hi/static/img/integrations/zoneminder.png
new file mode 100644
index 00000000..4aa9e833
Binary files /dev/null and b/src/hi/static/img/integrations/zoneminder.png differ
diff --git a/src/hi/static/js/attr.js b/src/hi/static/js/attr.js
index 29e156d1..3c4985ec 100644
--- a/src/hi/static/js/attr.js
+++ b/src/hi/static/js/attr.js
@@ -288,6 +288,13 @@
// Parse response into normalized format
const data = this.parseResponse(response);
+ // Handle redirects first - if redirect is present, do it immediately
+ if (data.redirect) {
+ console.log('Form response contains redirect, navigating to:', data.redirect);
+ window.location.href = data.redirect;
+ return;
+ }
+
// Process DOM updates first (works for both success and error)
const lastAppendTarget = this.processDOMUpdates(data, options);
diff --git a/src/hi/static/js/attribute-changes.js b/src/hi/static/js/attribute-changes.js
deleted file mode 100644
index 26723306..00000000
--- a/src/hi/static/js/attribute-changes.js
+++ /dev/null
@@ -1,249 +0,0 @@
-// Attribute Changes Tracker
-// Provides visual indicators for unsaved attribute changes
-
-(function($) {
- 'use strict';
-
- // Namespace for attribute change tracking
- const AttributeChanges = {
-
- // Configuration
- config: {
- modifiedClass: 'attribute-modified',
- indicatorClass: 'attribute-modified-indicator',
- debounceDelay: 300
- },
-
- // State tracking
- state: {
- originalValues: new Map(),
- modifiedFields: new Set(),
- debounceTimers: new Map()
- },
-
- // Initialize the change tracking system
- init: function() {
- this.captureOriginalValues();
- this.bindEvents();
- },
-
- // Capture original values for all attribute fields
- captureOriginalValues: function() {
- const self = this;
-
- // Find all attribute form fields
- $('.hi-attribute-list').find('input, textarea, select').each(function() {
- const $field = $(this);
- const fieldId = $field.attr('id');
-
- if (fieldId && !fieldId.endsWith('-show')) { // Skip password show/hide checkboxes
- // Only capture if we don't already have this field tracked
- if (!self.state.originalValues.has(fieldId)) {
- let originalValue = self.getFieldValue($field);
- self.state.originalValues.set(fieldId, originalValue);
-
- // Add data attribute for reference
- $field.attr('data-original-value', originalValue);
- }
- }
- });
- },
-
- // Get normalized field value based on field type
- getFieldValue: function($field) {
- const fieldType = $field.prop('type');
- const tagName = $field.prop('tagName').toLowerCase();
-
- if (fieldType === 'checkbox') {
- return $field.is(':checked') ? 'true' : 'false';
- } else if (tagName === 'select') {
- return $field.val() || '';
- } else {
- // For text fields and textareas, normalize whitespace
- return ($field.val() || '').trim();
- }
- },
-
- // Check if field has changed from original value
- hasFieldChanged: function($field) {
- const fieldId = $field.attr('id');
- const originalValue = this.state.originalValues.get(fieldId);
- const currentValue = this.getFieldValue($field);
-
- return originalValue !== currentValue;
- },
-
- // Bind event listeners using document-level delegation
- bindEvents: function() {
- const self = this;
-
- // Handle input changes with debouncing for text fields
- // Use document-level delegation to handle dynamically loaded forms
- $(document).on('input keyup', '.hi-attribute-list input[type="text"], .hi-attribute-list input[type="password"], .hi-attribute-list textarea', function() {
- const $field = $(this);
- const fieldId = $field.attr('id');
-
- // Skip if no ID (shouldn't happen for attribute fields)
- if (!fieldId) return;
-
- // Clear existing debounce timer
- if (self.state.debounceTimers.has(fieldId)) {
- clearTimeout(self.state.debounceTimers.get(fieldId));
- }
-
- // Set new debounce timer
- const timer = setTimeout(function() {
- self.handleFieldChange($field);
- self.state.debounceTimers.delete(fieldId);
- }, self.config.debounceDelay);
-
- self.state.debounceTimers.set(fieldId, timer);
- });
-
- // Handle immediate changes for select and checkbox
- $(document).on('change', '.hi-attribute-list select, .hi-attribute-list input[type="checkbox"]', function() {
- self.handleFieldChange($(this));
- });
-
- // Handle form submission to clear indicators
- $(document).on('submit', 'form', function() {
- // Only clear if this form contains attributes
- if ($(this).find('.hi-attribute-list').length > 0) {
- self.clearAllIndicators();
- }
- });
-
- // Handle successful async form submission (using antinode.js pattern)
- $(document).on('an:success', function(e) {
- // Clear indicators if there are any modified fields
- if (self.state.modifiedFields.size > 0) {
- self.clearAllIndicators();
- }
- });
- },
-
- // Handle individual field change
- handleFieldChange: function($field) {
- const fieldId = $field.attr('id');
-
- if (!fieldId || fieldId.endsWith('-show')) {
- return; // Skip password show/hide checkboxes
- }
-
- const hasChanged = this.hasFieldChanged($field);
-
- if (hasChanged) {
- this.addFieldIndicator($field);
- this.state.modifiedFields.add(fieldId);
- } else {
- this.removeFieldIndicator($field);
- this.state.modifiedFields.delete(fieldId);
- }
-
- this.updatePageState();
- },
-
- // Add visual indicator to field
- addFieldIndicator: function($field) {
- const $container = $field.closest('.input-group, div');
-
- // Add modified class to field
- $field.addClass(this.config.modifiedClass);
-
- // Add asterisk indicator if not already present
- if ($container.find('.' + this.config.indicatorClass).length === 0) {
- const $indicator = $('<span class="' + this.config.indicatorClass + '">*</span>');
-
- // Find the best place to insert the indicator
- const $label = $container.find('.input-group-text').first();
- if ($label.length > 0) {
- $label.append(' ').append($indicator);
- } else {
- $container.append($indicator);
- }
- }
- },
-
- // Remove visual indicator from field
- removeFieldIndicator: function($field) {
- const $container = $field.closest('.input-group, div');
-
- // Remove modified class
- $field.removeClass(this.config.modifiedClass);
-
- // Remove asterisk indicator
- $container.find('.' + this.config.indicatorClass).remove();
- },
-
- // Update form-level dirty state for submit button and form styling
- updatePageState: function() {
- const hasChanges = this.state.modifiedFields.size > 0;
-
- // Add/remove dirty attribute on forms containing attribute lists
- $('form').each(function() {
- const $form = $(this);
- if ($form.find('.hi-attribute-list').length > 0) {
- if (hasChanges) {
- $form.attr('data-dirty', 'true');
- } else {
- $form.removeAttr('data-dirty');
- }
- }
- });
- },
-
-
-
- // Clear all indicators and reset state
- clearAllIndicators: function() {
- const self = this;
-
- // Clear all visual indicators
- $('.' + this.config.modifiedClass).removeClass(this.config.modifiedClass);
- $('.' + this.config.indicatorClass).remove();
-
- // Clear form dirty attributes
- $('form[data-dirty]').removeAttr('data-dirty');
-
- // Clear state
- this.state.modifiedFields.clear();
-
- // Clear debounce timers
- this.state.debounceTimers.forEach(function(timer) {
- clearTimeout(timer);
- });
- this.state.debounceTimers.clear();
- },
-
- // Public method to manually refresh original values (for dynamic content)
- refreshOriginalValues: function() {
- this.clearAllIndicators();
- this.state.originalValues.clear();
- this.captureOriginalValues();
- },
-
- // Initialize tracking for newly loaded attribute forms
- initializeNewForms: function() {
- // Capture original values for any new forms
- this.captureOriginalValues();
- }
- };
-
- // Initialize when DOM is ready
- $(document).ready(function() {
- // Always initialize - event delegation works without existing elements
- AttributeChanges.init();
- });
-
- // Hook into antinode async content loading to handle dynamic forms
- $(document).on('an:success', function() {
- // Reinitialize to capture original values for any newly loaded forms
- AttributeChanges.initializeNewForms();
- });
-
- // Add to Hi namespace for potential external access
- if (window.Hi) {
- window.Hi.AttributeChanges = AttributeChanges;
- }
-
-})(jQuery);
\ No newline at end of file
diff --git a/src/hi/templates/icons/info-circle.html b/src/hi/templates/icons/info-circle.html
new file mode 100644
index 00000000..833b33e2
--- /dev/null
+++ b/src/hi/templates/icons/info-circle.html
@@ -0,0 +1,3 @@
+<svg class="{{ class_attr }}" viewBox="0 0 24 24" fill="currentColor" {{ accessibility_attrs }}>
+ <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/>
+</svg>
\ No newline at end of file
diff --git a/src/hi/templates/icons/move.html b/src/hi/templates/icons/move.html
new file mode 100644
index 00000000..c744e896
--- /dev/null
+++ b/src/hi/templates/icons/move.html
@@ -0,0 +1,3 @@
+<svg class="{{ class_attr }}" viewBox="0 0 24 24" fill="currentColor" {{ accessibility_attrs }}>
+ <path d="M13 9h-2V7l-3 3 3 3v-2h2v2l3-3-3-3v2zm-2 8v2l-3-3 3-3v2h2v-2l3 3-3 3v-2h-2zm8-4h-2v2l-3-3 3-3v2h2V7l3 3-3 3v2zM6 11v2H4v-2h2V9L1 12l3 3v-2h2z"/>
+</svg>
\ No newline at end of file
diff --git a/src/hi/templates/icons/path.html b/src/hi/templates/icons/path.html
new file mode 100644
index 00000000..8c2bc2f9
--- /dev/null
+++ b/src/hi/templates/icons/path.html
@@ -0,0 +1,3 @@
+<svg class="{{ class_attr }}" viewBox="0 0 24 24" fill="currentColor" {{ accessibility_attrs }}>
+ <path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2zM8.5 12.5c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zm7 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"/>
+</svg>
\ No newline at end of file
diff --git a/src/hi/templates/icons/question-circle.html b/src/hi/templates/icons/question-circle.html
new file mode 100644
index 00000000..4bf44807
--- /dev/null
+++ b/src/hi/templates/icons/question-circle.html
@@ -0,0 +1,3 @@
+<svg class="{{ class_attr }}" viewBox="0 0 24 24" fill="currentColor" {{ accessibility_attrs }}>
+ <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"/>
+</svg>
\ No newline at end of file
diff --git a/src/hi/templates/icons/rocket.html b/src/hi/templates/icons/rocket.html
new file mode 100644
index 00000000..08aa0d7c
--- /dev/null
+++ b/src/hi/templates/icons/rocket.html
@@ -0,0 +1,5 @@
+<svg class="{{ class_attr }}" viewBox="0 0 24 24" fill="currentColor" {{ accessibility_attrs }}>
+ <path d="M9.19 6.35c-2.04 2.29-3.44 5.58-3.57 8.15L2 18l3.5-3.5c2.57-.13 5.86-1.53 8.15-3.57C15.87 8.98 19.38 5.5 22 2c-3.5 2.62-6.98 6.13-8.93 8.35z"/>
+ <path d="M5.5 12.5c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5S7.83 11 7 11s-1.5.67-1.5 1.5zM18 7c.55 0 1-.45 1-1s-.45-1-1-1-1 .45-1 1 .45 1 1 1z"/>
+ <path d="M2 22l7-3-2-2L4 20l-2 2z"/>
+</svg>
\ No newline at end of file
diff --git a/src/hi/templates/icons/rotate.html b/src/hi/templates/icons/rotate.html
new file mode 100644
index 00000000..96539e77
--- /dev/null
+++ b/src/hi/templates/icons/rotate.html
@@ -0,0 +1,4 @@
+<svg class="{{ class_attr }}" viewBox="0 0 24 24" fill="currentColor" {{ accessibility_attrs }}>
+ <path d="M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6z"/>
+ <path d="M18.76 7.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26z"/>
+</svg>
\ No newline at end of file
diff --git a/src/hi/templates/icons/zoom.html b/src/hi/templates/icons/zoom.html
new file mode 100644
index 00000000..d51496a4
--- /dev/null
+++ b/src/hi/templates/icons/zoom.html
@@ -0,0 +1,4 @@
+<svg class="{{ class_attr }}" viewBox="0 0 24 24" fill="currentColor" {{ accessibility_attrs }}>
+ <path d="M15.5 14h-.79l-.28-.27A6.5 6.5 0 1 0 13.16 15.28l.27.28v.79l5 4.99L20.49 19l-4.99-5zM9.5 14C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/>
+ <path d="M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"/>
+</svg>
\ No newline at end of file
diff --git a/src/hi/templates/modals/action_refresh.html b/src/hi/templates/modals/action_refresh.html
new file mode 100644
index 00000000..f015fd41
--- /dev/null
+++ b/src/hi/templates/modals/action_refresh.html
@@ -0,0 +1,6 @@
+{% extends "modals/action_1.html" %}
+
+{% block action_center %}
+<a id="hi-modal-refresh" role="button" {% if autofocus %}autofocus="autofocus"{% endif %}
+ class="btn btn-lg btn-secondary" href="#" data-dismiss="modal" onclick="window.location.reload()">OK</a>
+{% endblock %}
diff --git a/src/hi/templates/pages/base.html b/src/hi/templates/pages/base.html
index 94cda6a4..3664d3a4 100644
--- a/src/hi/templates/pages/base.html
+++ b/src/hi/templates/pages/base.html
@@ -23,6 +23,7 @@
const gHiViewMode = "{{ request.view_parameters.view_mode }}";
</script>
{% javascript 'js_before_content' %}
+ {% block header_post_javascript %}{% endblock %}
{% include "alert/panes/alert_banner.html" %}
diff --git a/src/hi/templates/pages/hi_grid.html b/src/hi/templates/pages/hi_grid.html
index 4d879a83..5cfb9283 100644
--- a/src/hi/templates/pages/hi_grid.html
+++ b/src/hi/templates/pages/hi_grid.html
@@ -1,6 +1,10 @@
{% extends "pages/base.html" %}
{% load pipeline %}
+{% block header_post_javascript %}
+{% javascript 'js_hi_grid_header_content' %}
+{% endblock %}
+
{% block content %}
<div id="{{ DIVID.TOP }}" class="fixed-top" hi-edit="{{ request.view_parameters.is_editing }}">
@@ -15,12 +19,12 @@
<div class="row">
<div class="col-9 scrollable-column ">
<div id="{{ DIVID.MAIN }}">
- {% include main_template_name %}
+ {% include main_template_name %}
</div>
</div>
<div class="col-3 fixed-column hi-side">
<div id="{{ DIVID.SIDE }}">
- {% include side_template_name %}
+ {% include side_template_name %}
</div>
</div>
</div>