Home Information - Your home, your data, organized.
Python
CSS fixes and refactor for some integration templates.
Tony Cassandrada77f356df26
diff --git a/src/hi/integrations/templates/integrations/modals/integrations_select.html b/src/hi/integrations/templates/integrations/modals/integrations_select.htmlindex dadc7473..a037c70f 100644--- a/src/hi/integrations/templates/integrations/modals/integrations_select.html+++ b/src/hi/integrations/templates/integrations/modals/integrations_select.html@@ -14,8 +14,7 @@ All Integrations<div class="col-6 d-flex align-items-center"><img src="{% static integration_data.integration_metadata.logo_static_path %}"alt="{{ integration_data.integration_metadata.label }}"- class="img-fluid mr-2"- style="max-height: 24px; width: auto;">+ class="img-fluid mr-2 hi-integration-logo">{{ integration_data.integration_metadata.label }}</div><div class="col-3">@@ -24,7 +23,7 @@ All Integrations{% icon "disabled" size="sm" css_class="hi-icon-left" %}Not configured</span>{% elif integration_data.integration.is_paused %}- <span class="font-weight-bold text-warning">+ <span class="font-weight-bold text-secondary">{% icon "pause" size="sm" css_class="hi-icon-left" %}Paused</span>{% else %}diff --git a/src/hi/integrations/templates/integrations/modals/sync_result.html b/src/hi/integrations/templates/integrations/modals/sync_result.htmlindex a94897fd..14f2336f 100644--- a/src/hi/integrations/templates/integrations/modals/sync_result.html+++ b/src/hi/integrations/templates/integrations/modals/sync_result.html@@ -40,12 +40,10 @@{% block body %}{% if integration_data %}<div class="d-flex align-items-center mb-3 pb-2 border-bottom">- <img class="mr-2"- style="height: 24px; width: auto;"+ <img class="mr-2 hi-integration-logo"src="{% static integration_data.integration_metadata.logo_static_path %}"alt="{{ integration_data.label }} Logo">- <div class="text-muted small text-uppercase"- style="letter-spacing: 0.05em;">+ <div class="text-muted small text-uppercase hi-uppercase-label">{{ integration_data.label }}</div></div>@@ -59,7 +57,7 @@{% endcomment %}{% if sync_result.error_list and not sync_result.has_changes %}<div class="text-center mb-4">- <div class="text-danger mb-1" style="font-size: 2.5rem; line-height: 1;">⚠</div>+ <div class="text-danger mb-1 hi-sync-result-hero-icon">⚠</div><h3 class="text-danger mb-1">{% if is_initial_import %}Import failed{% else %}Refresh failed{% endif %}</h3>@@ -69,7 +67,7 @@</div>{% elif sync_result.error_list %}<div class="text-center mb-4">- <div class="text-warning mb-1" style="font-size: 2.5rem; line-height: 1;">⚠</div>+ <div class="text-warning mb-1 hi-sync-result-hero-icon">⚠</div><h3 class="text-warning mb-1">{% if is_initial_import %}Import completed with errors{% else %}Refresh completed with errors{% endif %}</h3>@@ -79,7 +77,7 @@</div>{% elif not sync_result.has_changes %}<div class="text-center mb-4">- <div class="text-muted mb-1" style="font-size: 2.5rem; line-height: 1;">—</div>+ <div class="text-muted mb-1 hi-sync-result-hero-icon">—</div><h3 class="text-muted mb-1">{% if is_initial_import %}Nothing to import{% else %}Nothing new{% endif %}</h3>@@ -93,7 +91,7 @@</div>{% else %}<div class="text-center mb-3">- <div class="text-success mb-1" style="font-size: 2.5rem; line-height: 1;">✓</div>+ <div class="text-success mb-1 hi-sync-result-hero-icon">✓</div><h3 class="text-success mb-1">{% if is_initial_import %}Import complete{% else %}Refresh complete{% endif %}</h3>@@ -109,32 +107,26 @@<div class="d-flex justify-content-around text-center mb-4 pb-3 border-bottom">{% if sync_result.created_list %}<div class="px-3">- <div class="text-success font-weight-bold"- style="font-size: 2rem; line-height: 1;">+ <div class="text-success font-weight-bold hi-sync-result-stat-number">{{ sync_result.created_list|length }}</div>- <div class="text-muted small text-uppercase"- style="letter-spacing: 0.05em;">Created</div>+ <div class="text-muted small text-uppercase hi-uppercase-label">Created</div></div>{% endif %}{% if sync_result.updated_list %}<div class="px-3">- <div class="text-info font-weight-bold"- style="font-size: 2rem; line-height: 1;">+ <div class="text-info font-weight-bold hi-sync-result-stat-number">{{ sync_result.updated_list|length }}</div>- <div class="text-muted small text-uppercase"- style="letter-spacing: 0.05em;">Updated</div>+ <div class="text-muted small text-uppercase hi-uppercase-label">Updated</div></div>{% endif %}{% if sync_result.removed_list %}<div class="px-3">- <div class="text-secondary font-weight-bold"- style="font-size: 2rem; line-height: 1;">+ <div class="text-secondary font-weight-bold hi-sync-result-stat-number">{{ sync_result.removed_list|length }}</div>- <div class="text-muted small text-uppercase"- style="letter-spacing: 0.05em;">Removed</div>+ <div class="text-muted small text-uppercase hi-uppercase-label">Removed</div></div>{% endif %}</div>@@ -146,13 +138,11 @@the affordance to the entity names themselves.{% endcomment %}{% if sync_result.removed_list %}- <div class="mb-3 pl-3" style="border-left: 3px solid #6c757d;">- <div class="small text-secondary text-uppercase mb-1"- style="letter-spacing: 0.05em;">+ <div class="mb-3 pl-3 hi-category-section hi-category-section--secondary">+ <div class="small text-secondary text-uppercase mb-1 hi-uppercase-label">Removed ({{ sync_result.removed_list|length }})</div>- <ul class="list-unstyled small mb-0"- style="max-height: 160px; overflow-y: auto;">+ <ul class="list-unstyled small mb-0 hi-sync-result-item-list">{% for name in sync_result.removed_list %}<li>{{ name }}</li>{% endfor %}@@ -161,13 +151,11 @@{% endif %}{% if sync_result.updated_list %}- <div class="mb-3 pl-3" style="border-left: 3px solid #17a2b8;">- <div class="small text-info text-uppercase mb-1"- style="letter-spacing: 0.05em;">+ <div class="mb-3 pl-3 hi-category-section hi-category-section--info">+ <div class="small text-info text-uppercase mb-1 hi-uppercase-label">Updated ({{ sync_result.updated_list|length }})</div>- <ul class="list-unstyled small mb-0"- style="max-height: 160px; overflow-y: auto;">+ <ul class="list-unstyled small mb-0 hi-sync-result-item-list">{% for name in sync_result.updated_list %}<li>{{ name }}</li>{% endfor %}@@ -176,13 +164,11 @@{% endif %}{% if sync_result.created_list %}- <div class="mb-3 pl-3" style="border-left: 3px solid #28a745;">- <div class="small text-success text-uppercase mb-1"- style="letter-spacing: 0.05em;">+ <div class="mb-3 pl-3 hi-category-section hi-category-section--success">+ <div class="small text-success text-uppercase mb-1 hi-uppercase-label">Created ({{ sync_result.created_list|length }})</div>- <ul class="list-unstyled small mb-0"- style="max-height: 160px; overflow-y: auto;">+ <ul class="list-unstyled small mb-0 hi-sync-result-item-list">{% for name in sync_result.created_list %}<li>{{ name }}</li>{% endfor %}@@ -203,11 +189,10 @@{% comment %}Errors detail — expanded by default when present.{% endcomment %}{% if sync_result.error_list %}-<div class="mb-2 pl-3" style="border-left: 3px solid #dc3545;">- <a class="small text-danger text-uppercase" data-toggle="collapse"+<div class="mb-2 pl-3 hi-category-section hi-category-section--danger">+ <a class="small text-danger text-uppercase hi-uppercase-label" data-toggle="collapse"href="#hi-sync-result-errors" role="button"- aria-expanded="true" aria-controls="hi-sync-result-errors"- style="letter-spacing: 0.05em;">+ aria-expanded="true" aria-controls="hi-sync-result-errors">Errors ({{ sync_result.error_list|length }})</a><div class="collapse show" id="hi-sync-result-errors">@@ -229,8 +214,7 @@Show details ({{ sync_result.info_list|length }})</a><div class="collapse" id="hi-sync-result-info">- <ul class="small mt-1 mb-0 text-muted"- style="max-height: 200px; overflow-y: auto;">+ <ul class="small mt-1 mb-0 text-muted hi-sync-result-info-list">{% for info_message in sync_result.info_list %}<li>{{ info_message }}</li>{% endfor %}diff --git a/src/hi/static/css/main.css b/src/hi/static/css/main.cssindex 92f7909a..fbc091cf 100644--- a/src/hi/static/css/main.css+++ b/src/hi/static/css/main.css@@ -23,6 +23,7 @@--error-color: #721817;--on-error-color: #ffffff;--error-highlight-color: #a01111;+ --danger-color: var(--error-color);--muted-color: #7e7e81;--on-muted-color: #ffffff;--line-color: #cccccc;@@ -2089,3 +2090,65 @@ g[hover] {text-align: center;margin-top: 0.25rem;}++/* ==================== */+/* Integration Sync Result Modal */+/* ==================== */++.hi-integration-logo {+ max-height: 24px;+ /* max-width clamps SVGs that lack intrinsic width/height+ attributes (browsers default unsized SVGs to ~300x150,+ which would distort the row layout). */+ max-width: 24px;+ width: auto;+ height: auto;+}++.hi-uppercase-label {+ letter-spacing: 0.05em;+}++.hi-sync-result-hero-icon {+ font-size: 2.5rem;+ line-height: 1;+}++.hi-sync-result-stat-number {+ font-size: 2rem;+ line-height: 1;+}++/* Color-coded category section borders. The modifier names mirror+ Bootstrap's text-* utility vocabulary so callers pick the right+ color by semantic name, but the actual color values come from the+ project's brand theme variables for consistency with the+ project-overridden text utilities (e.g. .text-secondary renders+ --secondary-color, not Bootstrap grey). */+.hi-category-section {+ border-left: 3px solid var(--secondary-color);+}+.hi-category-section--secondary {+ border-left-color: var(--secondary-color);+}+.hi-category-section--info {+ border-left-color: var(--info-color);+}+.hi-category-section--success {+ border-left-color: var(--success-color);+}+.hi-category-section--danger {+ border-left-color: var(--danger-color);+}++.hi-sync-result-item-list {+ max-height: 160px;+ overflow-y: auto;+}++/* Diagnostic-notes list is taller than the per-category item lists+ because info messages tend to be longer and more numerous. */+.hi-sync-result-info-list {+ max-height: 200px;+ overflow-y: auto;+}diff --git a/src/hi/static/img/integrations/homebox.svg b/src/hi/static/img/integrations/homebox.svgindex 08670bbb..43124dcf 100644--- a/src/hi/static/img/integrations/homebox.svg+++ b/src/hi/static/img/integrations/homebox.svg@@ -1,4 +1,4 @@-<svg viewBox="0 0 10817 9730" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:5.42683">+<svg width="10817" height="9730" viewBox="0 0 10817 9730" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:5.42683"><path d="M9310.16 2560.9c245.302 249.894 419.711 539.916 565.373 845.231 47.039 98.872 36.229 215.514-28.2 304.05-64.391 88.536-172.099 134.676-280.631 120.28 0 .053-.039.053-.039.053" style="fill:gray;stroke:#000;stroke-width:206.41px"/><path d="M5401.56 487.044c-127.958 6.227-254.855 40.77-370.992 103.628-765.271 414.225-2397.45 1297.68-3193.03 1728.32-137.966 74.669-250.327 183.605-328.791 313.046l3963.09 2122.43s-249.048 416.428-470.593 786.926c-189.24 316.445-592.833 429.831-919.198 258.219l-2699.36-1419.32v2215.59c0 226.273 128.751 435.33 337.755 548.466 764.649 413.885 2620.97 1418.66 3385.59 1832.51 209.018 113.137 466.496 113.137 675.514 0 764.623-413.857 2620.94-1418.63 3385.59-1832.51 208.989-113.136 337.743-322.193 337.743-548.466v-3513.48c0-318.684-174.59-611.722-454.853-763.409-795.543-430.632-2427.75-1314.09-3193.02-1728.32-141.693-76.684-299.364-111.227-455.442-103.628" style="fill:#dadada;stroke:#000;stroke-width:206.42px"/><path d="M5471.83 4754.46V504.71c-127.958 6.226-325.127 23.1-441.264 85.958-765.271 414.225-2397.45 1297.68-3193.03 1728.32-137.966 74.669-250.327 183.605-328.791 313.046l3963.09 2122.43Z" style="fill:gray;stroke:#000;stroke-width:206.42px"/>