Skip to content

Home Information - Your home, your data, organized.

Python

[Refactor] Complete icon standardization and UX improvements (#120)

Tony C3d1e7f0cd38b
diff --git a/docs/dev/Templates.md b/docs/dev/Templates.md
index 02ea9418..d653aa8a 100644
--- a/docs/dev/Templates.md
+++ b/docs/dev/Templates.md
@@ -25,3 +25,73 @@ This are gathered in `src/hi/constants.py:DIV_IDS`:
- `#hi-top-buttons`
- `#hi-button-bottons`
- `#hi-config-integration-tab` - Integrations use this for any configuration-related views.
+
+## Icon Usage Guidelines
+
+### Icon System
+
+Use the standardized `{% icon %}` template tag. See `hi/apps/common/templatetags/icons.py` for implementation details and parameters.
+
+### UX Principles for Icon Usage
+
+**Primary Value**: Icons provide faster recognition, universal language, space efficiency, and visual hierarchy.
+
+**ALWAYS Add Icons When:**
+- **Universal Actions**: Add (+), Delete (trash), Edit (pencil), Save (checkmark), Cancel (Γ—)
+- **Navigation**: Back/Forward arrows, Up/Down, Expand/Collapse
+- **Media Controls**: Play, Pause, Video, Camera
+- **Status/Feedback**: Success, Warning, Error, Info
+
+**Key Principle**: Focus on **ACTION TYPE** (add, delete, edit), not object specificity. "Add Item" and "Add Rule" both get the same + icon because they're both "add" actions.
+
+### Implementation Requirements
+
+- Always include `{% load icons %}` at top of templates
+- Icons should supplement text, not replace it for important actions
+- Use semantic size and color parameters when available
+- Include appropriate ARIA labels for accessibility
+- Maintain consistency: same action = same icon across the application
+
+### Examples
+
+```django
+{% load icons %}
+
+<!-- Primary action with icon -->
+<button class="btn btn-primary">
+ {% icon "plus" size="sm" css_class="hi-icon-left" %}
+ Add New Rule
+</button>
+
+<!-- Edit action -->
+<a class="btn btn-secondary" href="/edit/">
+ {% icon "edit" size="sm" css_class="hi-icon-left" %}
+ Edit
+</a>
+
+<!-- Save/Submit action -->
+<button class="btn btn-success" type="submit">
+ {% icon "save" size="sm" css_class="hi-icon-left" %}
+ Save Changes
+</button>
+
+<!-- Cancel action -->
+<a class="btn btn-tertiary" href="#" data-dismiss="modal">
+ {% icon "cancel" size="sm" css_class="hi-icon-left" %}
+ Cancel
+</a>
+
+<!-- Delete action - icon-only for space constraints -->
+<button class="btn btn-danger" aria-label="Delete item">
+ {% icon "delete" size="sm" %}
+</button>
+
+<!-- Modal close - icon-only (universal convention) -->
+<button type="button" class="close" data-dismiss="modal" aria-label="Close">
+ {% icon "close" size="sm" %}
+</button>
+```
+
+**Available Icons**: See `hi/apps/common/templatetags/icons.py` for the complete list of available icons.
+
+See existing templates for more examples.
diff --git a/src/hi/apps/alert/templates/alert/modals/alert_details.html b/src/hi/apps/alert/templates/alert/modals/alert_details.html
index a5e4bb2d..72465058 100644
--- a/src/hi/apps/alert/templates/alert/modals/alert_details.html
+++ b/src/hi/apps/alert/templates/alert/modals/alert_details.html
@@ -2,6 +2,7 @@
{% load humanize %}
{% load tz %}
{% load video_tags %}
+{% load icons %}
{% block title_text %}
{{ alert.title }}
@@ -52,7 +53,7 @@
<div class="card">
<div class="card-header bg-primary text-white">
<h6 class="mb-0">
- <span class="mr-2">&#128247;</span>Visual Content
+ {% icon "camera" size="sm" css_class="hi-icon-left" %}Visual Content
</h6>
</div>
<div class="card-body p-2">
@@ -74,8 +75,8 @@
<h6 class="mb-0">
<a class="text-white text-decoration-none" data-toggle="collapse" href="#videoSources"
role="button" aria-expanded="false" aria-controls="videoSources">
- <span class="mr-2">&#128247;</span>Visual Content ({{ video_source_count }} sources)
- <span class="ml-2">&#9654;</span>
+ {% icon "camera" size="sm" css_class="hi-icon-left" %}Visual Content ({{ video_source_count }} sources)
+ {% icon "play" size="sm" css_class="hi-icon-right" %}
</a>
</h6>
</div>
@@ -139,7 +140,7 @@
<h6 class="mb-0">
<a class="text-decoration-none" data-toggle="collapse" href="#additionalAlarms"
role="button" aria-expanded="false" aria-controls="additionalAlarms">
- <span class="mr-2">&#9654;</span>Previous Alarms ({{ alert.alarm_count|add:"-1" }})
+ {% icon "play" size="sm" css_class="hi-icon-left" %}Previous Alarms ({{ alert.alarm_count|add:"-1" }})
</a>
</h6>
</div>
diff --git a/src/hi/apps/alert/templates/alert/panes/alarm_sensor_response.html b/src/hi/apps/alert/templates/alert/panes/alarm_sensor_response.html
index 532056a3..705fd656 100644
--- a/src/hi/apps/alert/templates/alert/panes/alarm_sensor_response.html
+++ b/src/hi/apps/alert/templates/alert/panes/alarm_sensor_response.html
@@ -1,4 +1,5 @@
{% load video_tags %}
+{% load icons %}
<div>
{% if show_video_inline %}
{% sensor_response_video_stream sensor_response as video_url %}
@@ -21,7 +22,7 @@
<small>
<a href="{% url 'console_entity_video_sensor_history' entity_id=sensor_response.sensor.entity_state.entity.id sensor_id=sensor_response.sensor.id %}"
data-async="true" class="text-muted">
- πŸ“Ή Browse Video Timeline
+ {% icon "video" size="sm" css_class="hi-icon-left" %}Browse Video Timeline
</a>
</small>
</div>
diff --git a/src/hi/apps/alert/templates/alert/panes/alert_banner.html b/src/hi/apps/alert/templates/alert/panes/alert_banner.html
index 0b31d1ce..3941b6af 100644
--- a/src/hi/apps/alert/templates/alert/panes/alert_banner.html
+++ b/src/hi/apps/alert/templates/alert/panes/alert_banner.html
@@ -1,19 +1,30 @@
+{% load icons %}
<div id="{{ DIVID.ALERT_BANNER_CONTAINER }}" class="fixed-top"
style="z-index: 1045; display: none;">
<div id="{{ DIVID.ALERT_BANNER_CONTENT }}"></div>
<button id="hi-alert-banner-toggle" class="btn btn-sm btn-secondary position-absolute"
style="left: 50%; transform: translateX(-50%);"
- onclick="Hi_alert_toggleAlertBanner();">&#9650;&#9650;&#9650;&#9650;</button>
+ onclick="Hi_alert_toggleAlertBanner();" aria-label="Toggle alert banner">
+ {% icon "chevron-up" size="sm" css_class="hi-icon-left" %}
+ {% icon "chevron-up" size="sm" css_class="hi-icon-left" %}
+ {% icon "chevron-up" size="sm" css_class="hi-icon-left" %}
+ {% icon "chevron-up" size="sm" %}
+ </button>
</div>
<script type="text/javascript" charset="utf-8">
+ // Pre-rendered icon HTML for JavaScript use
+ const ALERT_BANNER_ICONS = {
+ showState: '{% filter escapejs %}{% icon "chevron-up" size="sm" css_class="hi-icon-left" %}{% icon "chevron-up" size="sm" css_class="hi-icon-left" %}{% icon "chevron-up" size="sm" css_class="hi-icon-left" %}{% icon "chevron-up" size="sm" %}{% endfilter %}',
+ hideState: '{% filter escapejs %}{% icon "chevron-down" size="sm" css_class="hi-icon-left" %}{% icon "chevron-down" size="sm" css_class="hi-icon-left" %}Alerts{% icon "chevron-down" size="sm" css_class="hi-icon-right" %}{% icon "chevron-down" size="sm" css_class="hi-icon-right" %}{% endfilter %}'
+ };
+
function Hi_alert_toggleAlertBanner() {
if ( $('#{{ DIVID.ALERT_BANNER_CONTENT }}').is(':visible') ) {
$('#{{ DIVID.ALERT_BANNER_CONTENT }}').hide();
- $('#hi-alert-banner-toggle').html( '&#9660;&#9660;Alerts&#9660;&#9660;' );
-
+ $('#hi-alert-banner-toggle').html( ALERT_BANNER_ICONS.hideState );
} else {
$('#{{ DIVID.ALERT_BANNER_CONTENT }}').show()
- $('#hi-alert-banner-toggle').html( '&#9650;&#9650;&#9650;&#9650;' );
+ $('#hi-alert-banner-toggle').html( ALERT_BANNER_ICONS.showState );
}
}
</script>
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
index a28c898f..bbf3f90c 100644
--- a/src/hi/apps/attribute/templates/attribute/panes/attribute_form_boolean.html
+++ b/src/hi/apps/attribute/templates/attribute/panes/attribute_form_boolean.html
@@ -1,4 +1,5 @@
{% 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 }}" />
@@ -15,7 +16,7 @@
class="btn btn-outline-secondary btn-sm attribute-history-btn"
data-async="modal"
title="View attribute history">
- <span class="history-icon">&#9201;</span>
+ {% icon "history" size="sm" aria_label="View history" %}
</a>
{% endif %}
</div>
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
index ce9336fd..31297748 100644
--- a/src/hi/apps/attribute/templates/attribute/panes/attribute_form_enum.html
+++ b/src/hi/apps/attribute/templates/attribute/panes/attribute_form_enum.html
@@ -1,4 +1,5 @@
{% 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 }}" />
@@ -25,7 +26,7 @@
class="btn btn-outline-secondary btn-sm attribute-history-btn"
data-async="modal"
title="View attribute history">
- <span class="history-icon">&#9201;</span>
+ {% icon "history" size="sm" aria_label="View history" %}
</a>
{% 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
index b0b1fd1a..76c79322 100644
--- a/src/hi/apps/attribute/templates/attribute/panes/attribute_form_new.html
+++ b/src/hi/apps/attribute/templates/attribute/panes/attribute_form_new.html
@@ -1,9 +1,10 @@
{% 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 }}">
- <span class="plus-icon">&#43;</span> Add New Attribute
+ {% 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 }}">
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
index e5f2f4ba..3e076bc3 100644
--- a/src/hi/apps/attribute/templates/attribute/panes/attribute_form_text.html
+++ b/src/hi/apps/attribute/templates/attribute/panes/attribute_form_text.html
@@ -1,3 +1,4 @@
+{% load icons %}
<input type="hidden" id="{{ attribute_form.name.id_for_label }}"
name="{{ attribute_form.name.html_name }}"
value="{{ attribute_form.instance.name }}" />
@@ -27,7 +28,7 @@
class="btn btn-outline-secondary btn-sm attribute-history-btn"
data-async="modal"
title="View attribute history">
- <span class="history-icon">&#9201;</span>
+ {% icon "history" size="sm" aria_label="View history" %}
</a>
{% endif %}
</div>
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
index 352b68f5..162f3a4a 100644
--- a/src/hi/apps/attribute/templates/attribute/panes/attribute_upload_form.html
+++ b/src/hi/apps/attribute/templates/attribute/panes/attribute_upload_form.html
@@ -1,6 +1,7 @@
+{% load icons %}
<label for="{{ attribute_upload_form.file_value.id_for_label }}"
class="btn btn-primary btn-control">
- UPLOAD FILE
+ {% 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 }}"
diff --git a/src/hi/apps/audio/templates/audio/modals/audio_permission_guidance.html b/src/hi/apps/audio/templates/audio/modals/audio_permission_guidance.html
index 7ac131f2..8ade13dc 100644
--- a/src/hi/apps/audio/templates/audio/modals/audio_permission_guidance.html
+++ b/src/hi/apps/audio/templates/audio/modals/audio_permission_guidance.html
@@ -1,4 +1,5 @@
{% extends "modals/action_2_with_cancel.html" %}
+{% load icons %}
{% block modal_dialog_id %}audio-guidance-modal{% endblock %}
@@ -19,11 +20,11 @@
<!-- Firefox Instructions -->
<div class="card mb-3">
<div class="card-header">
- <strong>🦊 Firefox</strong>
+ <strong>Firefox</strong>
</div>
<div class="card-body">
<ol class="mb-2">
- <li>Click the <strong>πŸ”’ lock icon</strong> or <strong>πŸ›‘οΈ shield icon</strong> in the address bar</li>
+ <li>Click the <strong>{% icon "lock" size="sm" %} lock icon</strong> or <strong>{% icon "shield" size="sm" %} shield icon</strong> in the address bar</li>
<li>Find <strong>"Autoplay"</strong> setting</li>
<li>Change from <strong>"Block Audio"</strong> to <strong>"Allow Audio and Video"</strong></li>
<li>Refresh this page</li>
@@ -34,11 +35,11 @@
<!-- Chrome Instructions -->
<div class="card mb-3">
<div class="card-header">
- <strong>🎯 Chrome</strong>
+ <strong>Chrome</strong>
</div>
<div class="card-body">
<ol class="mb-2">
- <li>Click the <strong>πŸ”’ lock icon</strong> in the address bar</li>
+ <li>Click the <strong>{% icon "lock" size="sm" %} lock icon</strong> in the address bar</li>
<li>Find <strong>"Sound"</strong> setting</li>
<li>Change from <strong>"Block"</strong> to <strong>"Allow"</strong></li>
<li>Chrome will prompt you to refresh - click <strong>"Reload"</strong></li>
@@ -49,7 +50,7 @@
<!-- Safari Instructions -->
<div class="card mb-3">
<div class="card-header">
- <strong>🧭 Safari</strong>
+ <strong>Safari</strong>
</div>
<div class="card-body">
<ol class="mb-2">
@@ -63,7 +64,7 @@
</div>
<div class="alert alert-info mt-3">
- <strong>πŸ’‘ Why is this needed?</strong> Modern browsers block background audio by default to prevent annoying ads. Since this is a monitoring application that you actively want to receive alerts from, enabling audio is safe and recommended.
+ <strong>{% icon "lightbulb" size="sm" css_class="hi-icon-left" %}Why is this needed?</strong> Modern browsers block background audio by default to prevent annoying ads. Since this is a monitoring application that you actively want to receive alerts from, enabling audio is safe and recommended.
</div>
{% endblock %}
diff --git a/src/hi/apps/collection/templates/collection/edit/modals/collection_add.html b/src/hi/apps/collection/templates/collection/edit/modals/collection_add.html
index 263fe306..cc37718d 100644
--- a/src/hi/apps/collection/templates/collection/edit/modals/collection_add.html
+++ b/src/hi/apps/collection/templates/collection/edit/modals/collection_add.html
@@ -1,4 +1,5 @@
{% extends "modals/action_with_cancel.html" %}
+{% load icons %}
{% block preamble %}
<form action="{% url 'collection_add' %}" method="post"
@@ -26,7 +27,7 @@ New Collection
{% block action_right %}
<button id="hi-add-collection-button" type="submit" class="btn btn-lg btn-success"
name="action" value="add">
- ADD
+ {% icon "plus" size="sm" css_class="hi-icon-left" %}ADD
</button>
{% endblock %}
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 46d4609f..a1ea318c 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
@@ -1,3 +1,4 @@
+{% load icons %}
<div>
{% if request.view_parameters.is_editing %}
{% include "edit/panes/side_header.html" %}
@@ -10,7 +11,7 @@
<a href="{% url 'entity_edit_entity_add' %}"
class="btn btn-success btn-control" role="button"
data-async="modal" >
- ADD NEW ITEM
+ {% icon "plus" size="sm" css_class="hi-icon-left" %}ADD NEW ITEM
</a>
</div>
diff --git a/src/hi/apps/collection/templates/collection/panes/collection_buttons.html b/src/hi/apps/collection/templates/collection/panes/collection_buttons.html
index 2e2c43f6..ce8f26d8 100644
--- a/src/hi/apps/collection/templates/collection/panes/collection_buttons.html
+++ b/src/hi/apps/collection/templates/collection/panes/collection_buttons.html
@@ -1,3 +1,4 @@
+{% load icons %}
<div class="d-flex justify-content-start draggable-container">
{% for collection in collection_list %}
<div id="{{ collection.html_id }}-button"
@@ -18,7 +19,7 @@
<a href="{% url 'collection_add' %}"
class="btn btn-success btn-control" role="button"
data-async="modal" >
- ADD
+ {% icon "plus" size="sm" css_class="hi-icon-left" %}ADD
</a>
</div>
{% endif %}
diff --git a/src/hi/apps/common/templates/common/panes/pagination.html b/src/hi/apps/common/templates/common/panes/pagination.html
index bbdecb50..5b93ad3d 100644
--- a/src/hi/apps/common/templates/common/panes/pagination.html
+++ b/src/hi/apps/common/templates/common/panes/pagination.html
@@ -1,5 +1,6 @@
{% load humanize %}
{% load common_template_helpers %}
+{% load icons %}
{% if pagination.required or show_total_items %}
<div class="my-4">
{% if pagination and show_total_items %}
@@ -11,18 +12,18 @@
<ul class="pagination pagination-lg justify-content-center">
{% if pagination.has_previous_page %}
<li class="page-item"><a class="page-link" href="{{ pagination.base_url }}?page={{ pagination.previous_page_number }}" {% if pagination.async_urls %}data-async="true"{%endif %} >
- <span class="d-none d-sm-block" >&lt; Previous</span>
- <span class="d-xs d-sm-none" >&lt;</span>
+ {% icon "chevron-left" size="sm" css_class="hi-icon-right" %}
+ <span class="d-none d-sm-block">Previous</span>
</a></li>
{% else %}
<li class="page-item disabled"><span class="page-link text-muted">
- <span class="d-none d-sm-block" >&lt; Previous</span>
- <span class="d-xs d-sm-none" >&lt;</span>
+ {% icon "chevron-left" size="sm" css_class="hi-icon-right" %}
+ <span class="d-none d-sm-block">Previous</span>
</span></li>
{% endif %}
{% if pagination.has_pages_before %}
- <li class="page-item"><a class="page-link" href="{{ pagination.base_url }}?page=1" {% if pagination.async_urls %}data-async="true"{%endif %} >&laquo;</a></li>
+ <li class="page-item"><a class="page-link" href="{{ pagination.base_url }}?page=1" {% if pagination.async_urls %}data-async="true"{%endif %} >{% icon "chevron-double-left" size="sm" aria_label="First page" %}</a></li>
{% endif %}
{% for page_number in pagination.page_number_list %}
@@ -34,18 +35,18 @@
{% endfor %}
{% if pagination.has_pages_after %}
- <li class="page-item"><a class="page-link" href="{{ pagination.base_url }}?page={{ pagination.page_count }}" {% if pagination.async_urls %}data-async="true"{%endif %} >&raquo;</a></li>
+ <li class="page-item"><a class="page-link" href="{{ pagination.base_url }}?page={{ pagination.page_count }}" {% if pagination.async_urls %}data-async="true"{%endif %} >{% icon "chevron-double-right" size="sm" aria_label="Last page" %}</a></li>
{% endif %}
{% if pagination.has_next_page %}
<li class="page-item"><a class="page-link" href="{{ pagination.base_url }}?page={{ pagination.next_page_number }}" {% if pagination.async_urls %}data-async="true"{%endif %} >
- <span class="d-none d-sm-block" >Next &gt;</span>
- <span class="d-xs d-sm-none" >&gt;</span>
+ <span class="d-none d-sm-block">Next</span>
+ {% icon "chevron-right" size="sm" css_class="hi-icon-left" %}
</a></li>
{% else %}
<li class="page-item disabled"><span class="page-link text-muted">
- <span class="d-none d-sm-block" >Next &gt;</span>
- <span class="d-xs d-sm-none" >&gt;</span>
+ <span class="d-none d-sm-block">Next</span>
+ {% icon "chevron-right" size="sm" css_class="hi-icon-left" %}
</span></li>
{% endif %}
</ul>
diff --git a/src/hi/apps/common/templates/common/tests/ui/home.html b/src/hi/apps/common/templates/common/tests/ui/home.html
new file mode 100644
index 00000000..b5052591
--- /dev/null
+++ b/src/hi/apps/common/templates/common/tests/ui/home.html
@@ -0,0 +1,29 @@
+{% extends "pages/base.html" %}
+{% block head_title %}HI: Common UI Tests{% endblock %}
+
+{% block content %}
+<div class="container-fluid m-4">
+
+ <h2 class="text-info">Common Components: UI Tests</h2>
+
+ <div class="row">
+ <div class="col-xl-4 col-lg-4 col-md-6 col-12">
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ <h3 class="panel-title text-primary">Icon System</h3>
+ </div>
+ <div class="panel-body">
+ <ul>
+ <li>
+ <a href="{% url 'common_tests_ui_icons' %}">
+ Icon Browser (Auto-Discovery)
+ </a>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+
+</div>
+{% endblock %}
\ No newline at end of file
diff --git a/src/hi/apps/common/templates/common/tests/ui/icon_browser.html b/src/hi/apps/common/templates/common/tests/ui/icon_browser.html
new file mode 100644
index 00000000..25c709d9
--- /dev/null
+++ b/src/hi/apps/common/templates/common/tests/ui/icon_browser.html
@@ -0,0 +1,155 @@
+{% extends "pages/base.html" %}
+{% load icons %}
+{% block head_title %}HI: Icon Browser{% endblock %}
+
+{% block content %}
+<div class="container-fluid m-4">
+
+ <h2 class="text-info">Icon Browser</h2>
+ <p class="text-muted">Auto-discovery: {{ total_icons }} icons available</p>
+
+ <div class="row mb-4">
+ <div class="col-12">
+ <h3 class="text-primary">All Available Icons</h3>
+ <p>Icons displayed with default size (md) and no color override:</p>
+
+ <div class="row">
+ {% for icon_name in available_icons %}
+ <div class="col-xl-2 col-lg-3 col-md-4 col-sm-6 col-12 mb-3">
+ <div class="card">
+ <div class="card-body text-center">
+ <div class="mb-2">
+ {% icon icon_name %}
+ </div>
+ <small class="text-muted">{{ icon_name }}</small>
+ </div>
+ </div>
+ </div>
+ {% endfor %}
+ </div>
+ </div>
+ </div>
+
+ <div class="row mb-4">
+ <div class="col-12">
+ <h3 class="text-primary">Size Variations</h3>
+ <p>Same icon (plus) in all available sizes:</p>
+
+ <div class="row">
+ {% for size in available_sizes %}
+ <div class="col-xl-2 col-lg-3 col-md-4 col-sm-6 col-12 mb-3">
+ <div class="card">
+ <div class="card-body text-center">
+ <div class="mb-2">
+ {% icon "plus" size=size %}
+ </div>
+ <small class="text-muted">{{ size }}</small>
+ </div>
+ </div>
+ </div>
+ {% endfor %}
+ </div>
+ </div>
+ </div>
+
+ <div class="row mb-4">
+ <div class="col-12">
+ <h3 class="text-primary">Color Variations</h3>
+ <p>Same icon (save) in all available colors:</p>
+
+ <div class="row">
+ {% for color in available_colors %}
+ <div class="col-xl-2 col-lg-3 col-md-4 col-sm-6 col-12 mb-3">
+ <div class="card">
+ <div class="card-body text-center">
+ <div class="mb-2">
+ {% icon "save" color=color %}
+ </div>
+ <small class="text-muted">{{ color }}</small>
+ </div>
+ </div>
+ </div>
+ {% endfor %}
+ </div>
+ </div>
+ </div>
+
+ <div class="row mb-4">
+ <div class="col-12">
+ <h3 class="text-primary">Usage Examples</h3>
+ <p>Common icon usage patterns from the UX guidelines:</p>
+
+ <div class="row">
+ <div class="col-12">
+ <h4>Buttons with Icons</h4>
+ <div class="mb-3">
+ <button class="btn btn-primary">
+ {% icon "plus" size="sm" css_class="hi-icon-left" %}
+ Add New Item
+ </button>
+
+ <button class="btn btn-secondary">
+ {% icon "edit" size="sm" css_class="hi-icon-left" %}
+ Edit
+ </button>
+
+ <button class="btn btn-success">
+ {% icon "save" size="sm" css_class="hi-icon-left" %}
+ Save Changes
+ </button>
+
+ <button class="btn btn-danger">
+ {% icon "delete" size="sm" %}
+ </button>
+ </div>
+
+ <h4>Media Controls</h4>
+ <div class="mb-3">
+ <button class="btn btn-outline-primary">
+ {% icon "play" size="sm" css_class="hi-icon-left" %}
+ Play
+ </button>
+
+ <button class="btn btn-outline-secondary">
+ {% icon "camera" size="sm" css_class="hi-icon-left" %}
+ Camera
+ </button>
+
+ <button class="btn btn-outline-info">
+ {% icon "video" size="sm" css_class="hi-icon-left" %}
+ Video
+ </button>
+
+ <button class="btn btn-outline-dark">
+ {% icon "history" size="sm" css_class="hi-icon-left" %}
+ History
+ </button>
+ </div>
+
+ <h4>Navigation Controls</h4>
+ <div class="mb-3">
+ <button class="btn btn-outline-secondary">
+ {% icon "chevron-left" size="sm" css_class="hi-icon-left" %}
+ Previous
+ </button>
+
+ <button class="btn btn-outline-secondary">
+ Next
+ {% icon "chevron-right" size="sm" css_class="hi-icon-right" %}
+ </button>
+
+ <button class="btn btn-outline-secondary">
+ {% icon "chevron-double-left" size="sm" %}
+ </button>
+
+ <button class="btn btn-outline-secondary">
+ {% icon "chevron-double-right" size="sm" %}
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+</div>
+{% endblock %}
\ No newline at end of file
diff --git a/src/hi/apps/common/templatetags/icons.py b/src/hi/apps/common/templatetags/icons.py
new file mode 100644
index 00000000..f1b0b728
--- /dev/null
+++ b/src/hi/apps/common/templatetags/icons.py
@@ -0,0 +1,168 @@
+"""
+Icon template tags for consistent SVG icon rendering throughout the application.
+
+This module provides template tags for rendering inline SVG icons with consistent
+styling and accessibility features. All icons are self-contained (no external
+dependencies) and integrate with the existing CSS variable system.
+
+Usage:
+ {% load icons %}
+ {% icon "plus" size="md" color="primary" aria_label="Add item" %}
+ {% icon "chevron-up" %}
+"""
+
+from django import template
+from django.template.loader import get_template
+from django.utils.safestring import mark_safe
+
+register = template.Library()
+
+# Define available icon names to prevent arbitrary file inclusion
+AVAILABLE_ICONS = {
+ 'plus',
+ 'chevron-up',
+ 'chevron-down',
+ 'chevron-left',
+ 'chevron-right',
+ 'chevron-double-left',
+ 'chevron-double-right',
+ 'camera',
+ 'play',
+ 'history',
+ 'video',
+ 'lock',
+ 'shield',
+ 'lightbulb',
+ 'sync',
+ 'clock',
+ 'edit',
+ 'delete',
+ 'save',
+ 'cancel',
+ 'close',
+ 'upload'
+}
+
+# Define available sizes
+ICON_SIZES = {'sm', 'md', 'lg', 'xl'}
+
+# Define available semantic colors (matching CSS variables)
+ICON_COLORS = {
+ 'primary',
+ 'secondary',
+ 'success',
+ 'warning',
+ 'error',
+ 'muted'
+}
+
+
+def icon(name, size='md', color=None, aria_label=None, title=None, css_class=''):
+ """
+ Render an inline SVG icon with consistent styling and accessibility.
+
+ Args:
+ name (str): Icon name (must be in AVAILABLE_ICONS)
+ size (str): Icon size ('sm', 'md', 'lg', 'xl'). Default: 'md'
+ color (str): Semantic color ('primary', 'secondary', etc.). Default: None
+ aria_label (str): Accessibility label. If provided, icon is meaningful.
+ If None, icon is decorative (aria-hidden="true")
+ title (str): Tooltip text. Default: None
+ css_class (str): Additional CSS classes. Default: ''
+
+ Returns:
+ SafeString: Rendered SVG icon HTML
+
+ Raises:
+ template.TemplateSyntaxError: If icon name is not available
+ """
+
+ # Validate icon name
+ if name not in AVAILABLE_ICONS:
+ raise template.TemplateSyntaxError(
+ f'Icon "{name}" is not available. '
+ f'Available icons: {", ".join(sorted(AVAILABLE_ICONS))}'
+ )
+
+ # Validate size
+ if size not in ICON_SIZES:
+ size = 'md' # Default fallback
+
+ # Validate color
+ if color and color not in ICON_COLORS:
+ color = None # Invalid color, use default
+
+ # Build CSS classes
+ classes = ['hi-icon', f'hi-icon-{size}']
+
+ if color:
+ classes.append(f'hi-icon-{color}')
+
+ if css_class:
+ classes.append(css_class)
+
+ class_attr = ' '.join(classes)
+
+ # Build accessibility attributes
+ accessibility_attrs = []
+
+ if aria_label:
+ # Meaningful icon - has semantic meaning
+ accessibility_attrs.append(f'aria-label="{aria_label}"')
+ accessibility_attrs.append('role="img"')
+ else:
+ # Decorative icon - no semantic meaning
+ accessibility_attrs.append('aria-hidden="true"')
+
+ if title:
+ accessibility_attrs.append(f'title="{title}"')
+
+ accessibility_str = ' '.join(accessibility_attrs)
+
+ try:
+ # Load the specific icon template
+ icon_template = get_template(f'icons/{name}.html')
+
+ # Create context for the icon template
+ icon_context = {
+ 'class_attr': class_attr,
+ 'accessibility_attrs': accessibility_str,
+ }
+
+ # Render the icon template
+ rendered_icon = icon_template.render(icon_context)
+
+ return mark_safe(rendered_icon)
+
+ except template.TemplateDoesNotExist:
+ # Fallback if icon template doesn't exist
+ return mark_safe(
+ f'<span class="{class_attr}" {accessibility_str}>[{name}]</span>'
+ )
+
+
+def icon_list():
+ """
+ Return a sorted list of available icon names.
+ Useful for documentation or debugging.
+
+ Returns:
+ list: Sorted list of available icon names
+ """
+ return sorted(AVAILABLE_ICONS)
+
+
+def has_icon(name):
+ """
+ Template filter to check if an icon is available.
+
+ Args:
+ name (str): Icon name to check
+
+ Returns:
+ bool: True if icon is available, False otherwise
+ """
+ return name in AVAILABLE_ICONS
diff --git a/src/hi/apps/common/tests/ui/__init__.py b/src/hi/apps/common/tests/ui/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/src/hi/apps/common/tests/ui/urls.py b/src/hi/apps/common/tests/ui/urls.py
new file mode 100644
index 00000000..f71d4efd
--- /dev/null
+++ b/src/hi/apps/common/tests/ui/urls.py
@@ -0,0 +1,14 @@
+from django.urls import re_path
+
+from . import views
+
+
+urlpatterns = [
+ re_path(r'^$',
+ views.TestUiCommonHomeView.as_view(),
+ name='common_tests_ui'),
+
+ re_path(r'^icons$',
+ views.TestUiIconBrowserView.as_view(),
+ name='common_tests_ui_icons'),
+]
diff --git a/src/hi/apps/common/tests/ui/views.py b/src/hi/apps/common/tests/ui/views.py
new file mode 100644
index 00000000..c1e8171d
--- /dev/null
+++ b/src/hi/apps/common/tests/ui/views.py
@@ -0,0 +1,34 @@
+from django.shortcuts import render
+from django.views.generic import View
+
+from hi.apps.common.templatetags.icons import AVAILABLE_ICONS, ICON_SIZES, ICON_COLORS
+
+
+class TestUiCommonHomeView(View):
+ """Home view for common app UI testing."""
+
+ def get(self, request, *args, **kwargs):
+ context = {}
+ return render(request, "common/tests/ui/home.html", context)
+
+
+class TestUiIconBrowserView(View):
+ """
+ Auto-discovery view for browsing all available icons.
+ Automatically displays any new icons added to the system without manual updates.
+ """
+
+ def get(self, request, *args, **kwargs):
+ # Get all available icons from the icon system
+ available_icons = sorted(AVAILABLE_ICONS)
+ available_sizes = sorted(ICON_SIZES)
+ available_colors = sorted(ICON_COLORS)
+
+ context = {
+ 'available_icons': available_icons,
+ 'available_sizes': available_sizes,
+ 'available_colors': available_colors,
+ 'total_icons': len(available_icons)
+ }
+ return render(request, "common/tests/ui/icon_browser.html", context)
+
diff --git a/src/hi/apps/console/templates/console/panes/entity_video_pane.html b/src/hi/apps/console/templates/console/panes/entity_video_pane.html
index d36fd97e..0a8b887c 100644
--- a/src/hi/apps/console/templates/console/panes/entity_video_pane.html
+++ b/src/hi/apps/console/templates/console/panes/entity_video_pane.html
@@ -1,4 +1,5 @@
{% load video_tags %}
+{% load icons %}
<div class="entity-video-pane">
<!-- Unified Tab-Style Header -->
<div class="video-interface-header current-stream mb-3">
@@ -8,7 +9,7 @@
</div>
<div class="video-nav-tabs" role="tablist">
<span class="video-nav-tab active" role="tab">
- <i class="fas fa-video mr-1"></i>Current Stream
+ {% icon "video" size="sm" css_class="hi-icon-left" %}Current Stream
</span>
{% if video_sensor %}
<a href="{% url 'console_entity_video_sensor_history' entity.id video_sensor.id %}"
@@ -16,11 +17,11 @@
data-async="#main-content"
onclick="sessionStorage.setItem('navigatingFromLiveStream', 'true');"
role="tab">
- <i class="fas fa-history mr-1"></i>Event History
+ {% icon "history" size="sm" css_class="hi-icon-left" %}Event History
</a>
{% else %}
<span class="video-nav-tab disabled" title="No video sensors available" role="tab">
- <i class="fas fa-history mr-1"></i>Event History
+ {% icon "history" size="sm" css_class="hi-icon-left" %}Event History
</span>
{% endif %}
</div>
diff --git a/src/hi/apps/console/templates/console/panes/entity_video_sensor_history.html b/src/hi/apps/console/templates/console/panes/entity_video_sensor_history.html
index b874dc2d..792aade8 100644
--- a/src/hi/apps/console/templates/console/panes/entity_video_sensor_history.html
+++ b/src/hi/apps/console/templates/console/panes/entity_video_sensor_history.html
@@ -1,5 +1,6 @@
{% load video_tags %}
{% load tz %}
+{% load icons %}
{% timezone USER_TIMEZONE %}
<div class="entity-video-sensor-history">
@@ -15,10 +16,10 @@
data-async="#main-content"
aria-label="Return to live camera stream"
role="tab">
- <i class="fas fa-video mr-1"></i>Current Stream
+ {% icon "video" size="sm" css_class="hi-icon-left" %}Current Stream
</a>
<span class="video-nav-tab active" role="tab">
- <i class="fas fa-history mr-1"></i>Event History
+ {% icon "history" size="sm" css_class="hi-icon-left" %}Event History
</span>
</div>
</div>
@@ -107,7 +108,7 @@
<div class="video-container mb-3" role="img" aria-label="Event video playback">
{% sensor_response_video_stream sensor_history_data.current_sensor_response as video_url %}
{% if video_url %}
- <img class="img-fluid" src="{{ video_url }}" alt="Video recording from {{ sensor_history_data.current_sensor_response.timestamp|localtime|date:'F j, Y g:i A' }}" data-event-id="{{ sensor_history_data.current_sensor_response.sensor_history_id }}" onerror="this.style.display='none'; this.outerHTML='<div class=\'alert alert-warning text-center d-flex align-items-center justify-content-center\' style=\'min-height: 240px;\'><div><div class=\'mb-2\'>πŸ“Ή</div><h6>Video No Longer Available</h6></div></div>'">
+ <img class="img-fluid" src="{{ video_url }}" alt="Video recording from {{ sensor_history_data.current_sensor_response.timestamp|localtime|date:'F j, Y g:i A' }}" data-event-id="{{ sensor_history_data.current_sensor_response.sensor_history_id }}" onerror="this.style.display='none'; this.outerHTML='<div class=\'alert alert-warning text-center d-flex align-items-center justify-content-center\' style=\'min-height: 240px;\'><div><div class=\'mb-2\'>[VIDEO]</div><h6>Video No Longer Available</h6></div></div>'">
{% else %}
<!-- Fallback when no video stream is available -->
<div class="video-placeholder d-flex align-items-center justify-content-center">
diff --git a/src/hi/apps/entity/templates/entity/edit/panes/entity_edit.html b/src/hi/apps/entity/templates/entity/edit/panes/entity_edit.html
index 978578da..0cff9ccd 100644
--- a/src/hi/apps/entity/templates/entity/edit/panes/entity_edit.html
+++ b/src/hi/apps/entity/templates/entity/edit/panes/entity_edit.html
@@ -1,3 +1,4 @@
+{% load icons %}
<form action="{% url 'entity_edit' entity_id=entity.id %}"
method="post"
class="form" data-async="true">
@@ -13,7 +14,7 @@
<div class="text-center" >
<button id="hi-add-entity-edit-button" type="submit" class="btn btn-primary"
name="action" value="update">
- UPDATE
+ {% icon "save" size="sm" css_class="hi-icon-left" %}UPDATE
</button>
</div>
</form>
diff --git a/src/hi/apps/entity/templates/entity/panes/entity_state_status_card.html b/src/hi/apps/entity/templates/entity/panes/entity_state_status_card.html
index 95fd4b07..862fc378 100644
--- a/src/hi/apps/entity/templates/entity/panes/entity_state_status_card.html
+++ b/src/hi/apps/entity/templates/entity/panes/entity_state_status_card.html
@@ -1,3 +1,4 @@
+{% load icons %}
<div>
{% for entity_state_status_data in entity_state_status_data_list %}
<div class="d-flex justify-content-start py-1">
@@ -30,7 +31,7 @@
<small>
<a href="{% url 'console_entity_video_sensor_history' entity_id=sensor_response.sensor.entity_state.entity.id sensor_id=sensor_response.sensor.id %}"
data-async="true" class="text-muted">
- πŸ“Ή Browse Video
+ {% icon "video" size="sm" css_class="hi-icon-left" %}Browse Video
</a>
</small>
{% endif %}
diff --git a/src/hi/apps/event/templates/event/edit/modals/event_definition_add.html b/src/hi/apps/event/templates/event/edit/modals/event_definition_add.html
index 233d795d..8d4d948a 100644
--- a/src/hi/apps/event/templates/event/edit/modals/event_definition_add.html
+++ b/src/hi/apps/event/templates/event/edit/modals/event_definition_add.html
@@ -1,4 +1,5 @@
{% extends "modals/action_with_cancel.html" %}
+{% load icons %}
{% block preamble %}
<form action="{% url 'event_definition_add' %}"
@@ -20,7 +21,7 @@ New Trigger Rule
{% block action_right %}
<button id="hi-add-event-definition-button" type="submit" class="btn btn-lg btn-success"
name="action" value="add">
- ADD
+ {% icon "plus" size="sm" css_class="hi-icon-left" %}ADD
</button>
{% endblock %}
diff --git a/src/hi/apps/event/templates/event/edit/modals/event_definition_edit.html b/src/hi/apps/event/templates/event/edit/modals/event_definition_edit.html
index bc28838e..eb8019b4 100644
--- a/src/hi/apps/event/templates/event/edit/modals/event_definition_edit.html
+++ b/src/hi/apps/event/templates/event/edit/modals/event_definition_edit.html
@@ -1,4 +1,5 @@
{% extends "modals/action_with_cancel.html" %}
+{% load icons %}
{% block preamble %}
<form action="{% url 'event_definition_edit' id=event_definition.id %}"
@@ -20,7 +21,7 @@ Edit Trigger Rule
{% block action_right %}
<button id="hi-edit-event-definition-button" type="submit" class="btn btn-lg btn-success"
name="action" value="edit">
- UPDATE
+ {% icon "save" size="sm" css_class="hi-icon-left" %}UPDATE
</button>
{% endblock %}
diff --git a/src/hi/apps/event/templates/event/edit/panes/alarm_action_form.html b/src/hi/apps/event/templates/event/edit/panes/alarm_action_form.html
index 1a2ab5c4..97ec240f 100644
--- a/src/hi/apps/event/templates/event/edit/panes/alarm_action_form.html
+++ b/src/hi/apps/event/templates/event/edit/panes/alarm_action_form.html
@@ -1,10 +1,11 @@
{% load common_template_helpers %}
+{% load icons %}
{% generate_uuid as unique_id %}
{% if not alarm_action_form.instance.pk %}
<div class="my-3">
<a class="" data-toggle="collapse" href="#hi-alarm-action-new-{{ unique_id }}"
role="button" aria-expanded="false" aria-controls="hi-alarm-action-new-{{ unique_id }}">
- <span class="plus-icon">&#43;</span> Add Alarm Action
+ {% icon "plus" size="sm" css_class="hi-icon-left" %} Add Alarm Action
</a>
</div>
<div class="collapse my-2" id="hi-alarm-action-new-{{ unique_id }}">
diff --git a/src/hi/apps/event/templates/event/edit/panes/control_action_form.html b/src/hi/apps/event/templates/event/edit/panes/control_action_form.html
index 15062145..90bd18d0 100644
--- a/src/hi/apps/event/templates/event/edit/panes/control_action_form.html
+++ b/src/hi/apps/event/templates/event/edit/panes/control_action_form.html
@@ -1,10 +1,11 @@
{% load common_template_helpers %}
+{% load icons %}
{% generate_uuid as unique_id %}
{% if not control_action_form.instance.pk %}
<div class="my-3">
<a class="" data-toggle="collapse" href="#hi-control-action-new-{{ unique_id }}"
role="button" aria-expanded="false" aria-controls="hi-control-action-new-{{ unique_id }}">
- <span class="plus-icon">&#43;</span> Add Control Action
+ {% icon "plus" size="sm" css_class="hi-icon-left" %} Add Control Action
</a>
</div>
<div class="collapse my-2" id="hi-control-action-new-{{ unique_id }}">
diff --git a/src/hi/apps/event/templates/event/edit/panes/event_clause_form.html b/src/hi/apps/event/templates/event/edit/panes/event_clause_form.html
index b3808943..967b1830 100644
--- a/src/hi/apps/event/templates/event/edit/panes/event_clause_form.html
+++ b/src/hi/apps/event/templates/event/edit/panes/event_clause_form.html
@@ -1,10 +1,11 @@
{% load common_template_helpers %}
+{% load icons %}
{% generate_uuid as unique_id %}
{% if not event_clause_form.instance.pk %}
<div class="my-3">
<a class="" data-toggle="collapse" href="#hi-event-clause-new-{{ unique_id }}"
role="button" aria-expanded="false" aria-controls="hi-event-clause-new-{{ unique_id }}">
- <span class="plus-icon">&#43;</span> Add New Clause
+ {% icon "plus" size="sm" css_class="hi-icon-left" %} Add New Clause
</a>
</div>
<div class="collapse my-2" id="hi-event-clause-new-{{ unique_id }}">
diff --git a/src/hi/apps/event/templates/event/modals/event_history.html b/src/hi/apps/event/templates/event/modals/event_history.html
index 20dc3688..dc85423e 100644
--- a/src/hi/apps/event/templates/event/modals/event_history.html
+++ b/src/hi/apps/event/templates/event/modals/event_history.html
@@ -1,4 +1,5 @@
{% extends "modals/action_done.html" %}
+{% load icons %}
{% block modal_dialog_class %}hi-modal-dialog-800{% endblock %}
@@ -11,7 +12,7 @@ Trigger History
<div class="row mb-3">
<div class="col-12">
<h5 class="mb-0">
- <i class="fas fa-history text-primary mr-2"></i>
+ {% icon "history" size="sm" color="primary" css_class="hi-icon-left" %}
Trigger History
</h5>
<small class="text-muted">Recent trigger events and their details</small>
diff --git a/src/hi/apps/event/templates/event/panes/event_definitions.html b/src/hi/apps/event/templates/event/panes/event_definitions.html
index d0c75c8f..613c935e 100644
--- a/src/hi/apps/event/templates/event/panes/event_definitions.html
+++ b/src/hi/apps/event/templates/event/panes/event_definitions.html
@@ -1,4 +1,5 @@
{% extends "config/pages/config_base.html" %}
+{% load icons %}
{% block config_content %}
<div class="container-fluid">
@@ -8,7 +9,7 @@
<a role="button" class="btn btn-primary"
href="{% url 'event_definition_add' %}"
data-async="modal" >
- ADD NEW RULE
+ {% icon "plus" size="sm" css_class="hi-icon-left" %}ADD NEW RULE
</a>
</div>
</div>
@@ -32,7 +33,7 @@
<a role="button" class="btn btn-primary"
href="{% url 'event_definition_edit' id=event_definition.id %}"
data-async="modal" >
- EDIT
+ {% icon "edit" size="sm" css_class="hi-icon-left" %}EDIT
</a>
</td>
<td>
@@ -54,8 +55,9 @@
<td>
<a role="button" class="btn btn-danger"
href="{% url 'event_definition_delete' id=event_definition.id %}"
- data-async="modal" >
- X
+ data-async="modal"
+ aria-label="Delete rule">
+ {% icon "delete" size="sm" %}
</a>
</td>
</tr>
diff --git a/src/hi/apps/event/templates/event/panes/event_history_list.html b/src/hi/apps/event/templates/event/panes/event_history_list.html
index fd1332fc..110991e9 100644
--- a/src/hi/apps/event/templates/event/panes/event_history_list.html
+++ b/src/hi/apps/event/templates/event/panes/event_history_list.html
@@ -1,5 +1,6 @@
{% load tz %}
{% load humanize %}
+{% load icons %}
{% timezone USER_TIMEZONE %}
{% if event_history_list %}
<div class="timeline-items">
@@ -43,7 +44,7 @@
class="btn btn-sm btn-outline-primary mr-1 mb-1"
data-async="#main-content"
title="View video from {{ entity_display.entity.name }} around this event">
- <i class="fas fa-video"></i> {{ entity_display.entity.name }}
+ {% icon "video" size="sm" css_class="hi-icon-left" %}{{ entity_display.entity.name }}
</a>
{% else %}
<span class="text-info mr-2">{{ entity_display.entity.name }}</span>{% if not forloop.last %}, {% endif %}
@@ -62,7 +63,7 @@
{% else %}
<div class="card border-0 bg-light">
<div class="card-body text-center py-4">
- <i class="fas fa-clock text-muted fa-2x mb-3"></i>
+ {% icon "clock" size="xl" color="muted" css_class="mb-3" %}
<h6 class="text-muted">No Event History</h6>
<p class="text-muted mb-0">No trigger events have been recorded yet.</p>
</div>
diff --git a/src/hi/apps/location/templates/location/edit/modals/location_add.html b/src/hi/apps/location/templates/location/edit/modals/location_add.html
index 26ab4e9e..79e03c2f 100644
--- a/src/hi/apps/location/templates/location/edit/modals/location_add.html
+++ b/src/hi/apps/location/templates/location/edit/modals/location_add.html
@@ -1,4 +1,5 @@
{% extends "modals/action_with_cancel.html" %}
+{% load icons %}
{% block preamble %}
<form action="{% url 'location_edit_location_add' %}" method="post" enctype="multipart/form-data"
@@ -19,7 +20,7 @@ New Location
{% block action_right %}
<button id="hi-add-location-button" type="submit" class="btn btn-lg btn-success"
name="action" value="add">
- ADD
+ {% icon "plus" size="sm" css_class="hi-icon-left" %}ADD
</button>
{% endblock %}
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 04730953..74fc0bbf 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
@@ -1,4 +1,5 @@
{% extends "modals/action_with_cancel.html" %}
+{% load icons %}
{% block preamble %}
<form action="{% url 'location_edit_location_add' %}" method="post" enctype="multipart/form-data"
@@ -19,7 +20,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">
- CREATE
+ {% icon "plus" size="sm" css_class="hi-icon-left" %}CREATE
</button>
{% endblock %}
diff --git a/src/hi/apps/location/templates/location/edit/modals/location_view_add.html b/src/hi/apps/location/templates/location/edit/modals/location_view_add.html
index e1e38c3e..73e9222c 100644
--- a/src/hi/apps/location/templates/location/edit/modals/location_view_add.html
+++ b/src/hi/apps/location/templates/location/edit/modals/location_view_add.html
@@ -1,4 +1,5 @@
{% extends "modals/action_with_cancel.html" %}
+{% load icons %}
{% block preamble %}
<form action="{% url 'location_edit_location_view_add' %}" method="post"
@@ -19,7 +20,7 @@ New View for {{ location.name }}
{% block action_right %}
<button id="hi-add-location-view-button" type="submit" class="btn btn-lg btn-success"
name="action" value="add">
- ADD
+ {% icon "plus" size="sm" css_class="hi-icon-left" %}ADD
</button>
{% endblock %}
diff --git a/src/hi/apps/location/templates/location/edit/panes/location_edit.html b/src/hi/apps/location/templates/location/edit/panes/location_edit.html
index 98a02a94..35b4634e 100644
--- a/src/hi/apps/location/templates/location/edit/panes/location_edit.html
+++ b/src/hi/apps/location/templates/location/edit/panes/location_edit.html
@@ -1,3 +1,4 @@
+{% load icons %}
<form action="{% url 'location_edit_location_edit' location_id=location.id %}"
method="post" enctype="multipart/form-data"
class="form" data-async="true">
@@ -12,7 +13,7 @@
<div class="text-center" >
<button id="hi-add-location-button" type="submit" class="btn btn-primary"
name="action" value="update">
- UPDATE
+ {% icon "save" size="sm" css_class="hi-icon-left" %}UPDATE
</button>
</div>
</form>
@@ -33,7 +34,7 @@
<a href="{% url 'location_edit_svg_replace' location_id=location.id %}"
id="hi-svg-replace-link" class="btn btn-primary btn-control" role="button"
data-async="true">
- REPLACE BACKGROUND SVG IMAGE
+ {% icon "upload" size="sm" css_class="hi-icon-left" %}REPLACE BACKGROUND SVG IMAGE
</a>
</div>
@@ -41,7 +42,7 @@
<a href="{% url 'location_edit_location_delete' location_id=location.id %}"
id="hi-delete-location-link" class="btn btn-danger btn-control" role="button"
data-async="true">
- DELETE LOCATION AND ALL VIEWS
+ {% icon "delete" size="sm" css_class="hi-icon-left" %}DELETE LOCATION AND ALL VIEWS
</a>
</div>
{% endif %}
diff --git a/src/hi/apps/location/templates/location/edit/panes/location_item_position_form.html b/src/hi/apps/location/templates/location/edit/panes/location_item_position_form.html
index 300f12f8..4db4782a 100644
--- a/src/hi/apps/location/templates/location/edit/panes/location_item_position_form.html
+++ b/src/hi/apps/location/templates/location/edit/panes/location_item_position_form.html
@@ -1,3 +1,4 @@
+{% load icons %}
{% for hidden in location_item_position_form.hidden_fields %}
{{ hidden }}
{% endfor %}
@@ -49,6 +50,6 @@
<div class="text-center" >
<button id="hi-add-entity-edit-button" type="submit" class="btn btn-primary"
name="action" value="update">
- UPDATE
+ {% icon "save" size="sm" css_class="hi-icon-left" %}UPDATE
</button>
</div>
diff --git a/src/hi/apps/location/templates/location/edit/panes/location_view_edit.html b/src/hi/apps/location/templates/location/edit/panes/location_view_edit.html
index 29011b7a..cb1973ac 100644
--- a/src/hi/apps/location/templates/location/edit/panes/location_view_edit.html
+++ b/src/hi/apps/location/templates/location/edit/panes/location_view_edit.html
@@ -1,3 +1,4 @@
+{% load icons %}
<form action="{% url 'location_edit_location_view_edit' location_view_id=location_view.id %}"
method="post"
class="form" data-async="true">
@@ -9,7 +10,7 @@
<div class="text-center" >
<button id="hi-add-location-view-button" type="submit" class="btn btn-primary"
name="action" value="update">
- UPDATE
+ {% icon "save" size="sm" css_class="hi-icon-left" %}UPDATE
</button>
</div>
</form>
@@ -18,7 +19,7 @@
<a href="{% url 'location_edit_location_view_delete' location_view_id=location_view.id %}"
id="hi-delete-location-view-link" class="btn btn-danger btn-control" role="button"
data-async="true">
- DELETE THIS VIEW
+ {% icon "delete" size="sm" css_class="hi-icon-left" %}DELETE THIS VIEW
</a>
</div>
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 0ebc24c8..239d13e5 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
@@ -1,3 +1,4 @@
+{% load icons %}
<div>
{% if request.view_parameters.is_editing %}
{% include "edit/panes/side_header.html" %}
@@ -10,7 +11,7 @@
<a href="{% url 'entity_edit_entity_add' %}"
class="btn btn-success btn-control" role="button"
data-async="modal" >
- ADD NEW ITEM
+ {% icon "plus" size="sm" css_class="hi-icon-left" %}ADD NEW ITEM
</a>
</div>
diff --git a/src/hi/apps/location/templates/location/panes/location_dropdown.html b/src/hi/apps/location/templates/location/panes/location_dropdown.html
index 14ced3f4..d09851f9 100644
--- a/src/hi/apps/location/templates/location/panes/location_dropdown.html
+++ b/src/hi/apps/location/templates/location/panes/location_dropdown.html
@@ -1,3 +1,4 @@
+{% load icons %}
<div>
{% if location_list %}
<div class="dropdown">
@@ -30,7 +31,7 @@
<a role="menuitem" class="dropdown-item plain"
href="{% url 'location_edit_location_add' %}"
data-async="modal">
- ADD NEW LOCATION
+ {% icon "plus" size="sm" css_class="hi-icon-left" %}ADD NEW LOCATION
</a>
{% endif %}
</div>
diff --git a/src/hi/apps/location/templates/location/panes/location_view_buttons.html b/src/hi/apps/location/templates/location/panes/location_view_buttons.html
index ac7c39d4..a27c8ce3 100644
--- a/src/hi/apps/location/templates/location/panes/location_view_buttons.html
+++ b/src/hi/apps/location/templates/location/panes/location_view_buttons.html
@@ -1,3 +1,4 @@
+{% load icons %}
<div class="d-flex justify-content-start draggable-container">
{% for location_view in location_view_list %}
<div id="{{ location_view.html_id }}-button"
@@ -16,7 +17,7 @@
<a href="{% url 'location_edit_location_view_add' %}"
class="btn btn-success btn-control" role="button"
data-async="modal" >
- ADD
+ {% icon "plus" size="sm" css_class="hi-icon-left" %}ADD
</a>
</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
index 04f5246a..f7358d08 100644
--- a/src/hi/services/hass/templates/hass/panes/hass_settings.html
+++ b/src/hi/services/hass/templates/hass/panes/hass_settings.html
@@ -1,3 +1,4 @@
+{% load icons %}
<div id="hi-hass-settings">
<form action="{% url 'hass_settings' %}" method="post"
class="form" data-async="#hi-hass-settings" data-mode="replace">
@@ -11,7 +12,7 @@
<button id="hi-hass-setting-button" type="submit" class="btn btn-primary"
name="action" value="update">
- UPDATE
+ {% icon "save" size="sm" css_class="hi-icon-left" %}UPDATE
</button>
</form>
</div>
diff --git a/src/hi/services/zoneminder/templates/zoneminder/panes/zm_settings.html b/src/hi/services/zoneminder/templates/zoneminder/panes/zm_settings.html
index 354291ce..6549f737 100644
--- a/src/hi/services/zoneminder/templates/zoneminder/panes/zm_settings.html
+++ b/src/hi/services/zoneminder/templates/zoneminder/panes/zm_settings.html
@@ -1,3 +1,4 @@
+{% load icons %}
<div id="hi-zm-settings">
<form action="{% url 'zm_settings' %}" method="post"
class="form" data-async="#hi-zm-settings" data-mode="replace">
@@ -11,7 +12,7 @@
<button id="hi-zm-setting-button" type="submit" class="btn btn-primary"
name="action" value="update">
- UPDATE SETTINGS
+ {% icon "save" size="sm" css_class="hi-icon-left" %}UPDATE SETTINGS
</button>
</form>
</div>
diff --git a/src/hi/simulator/templates/simulator/modals/sim_entity_edit.html b/src/hi/simulator/templates/simulator/modals/sim_entity_edit.html
index 8a7f99b9..f46a65e6 100644
--- a/src/hi/simulator/templates/simulator/modals/sim_entity_edit.html
+++ b/src/hi/simulator/templates/simulator/modals/sim_entity_edit.html
@@ -1,4 +1,5 @@
{% extends "modals/action_with_cancel.html" %}
+{% load icons %}
{% block preamble %}
<form action="{% url 'simulator_entity_edit' sim_entity_id=db_sim_entity.id %}" method="post"
@@ -19,7 +20,7 @@ Edit Entity
{% block action_right %}
<button id="hi-simulator-entity-edit-submit" type="submit" class="btn btn-lg btn-success"
name="action" value="edit">
- UPDATE
+ {% icon "save" size="sm" css_class="hi-icon-left" %}UPDATE
</button>
{% endblock %}
diff --git a/src/hi/simulator/templates/simulator/modals/sim_profile_create.html b/src/hi/simulator/templates/simulator/modals/sim_profile_create.html
index 5e8fce80..fc8c0da0 100644
--- a/src/hi/simulator/templates/simulator/modals/sim_profile_create.html
+++ b/src/hi/simulator/templates/simulator/modals/sim_profile_create.html
@@ -1,4 +1,5 @@
{% extends "modals/action_with_cancel.html" %}
+{% load icons %}
{% block preamble %}
<form action="{% url 'simulator_profile_create' %}" method="post"
@@ -17,7 +18,7 @@ Create Simulator Profile
{% block action_right %}
<button id="hi-simulator-profile-create-submit" type="submit" class="btn btn-lg btn-success"
name="action" value="create">
- CREATE
+ {% icon "plus" size="sm" css_class="hi-icon-left" %}CREATE
</button>
{% endblock %}
diff --git a/src/hi/simulator/templates/simulator/modals/sim_profile_edit.html b/src/hi/simulator/templates/simulator/modals/sim_profile_edit.html
index 10387672..422ae0ef 100644
--- a/src/hi/simulator/templates/simulator/modals/sim_profile_edit.html
+++ b/src/hi/simulator/templates/simulator/modals/sim_profile_edit.html
@@ -1,4 +1,5 @@
{% extends "modals/action_with_cancel.html" %}
+{% load icons %}
{% block preamble %}
<form action="{% url 'simulator_profile_edit' profile_id=sim_profile_form.instance.id %}" method="post"
@@ -17,7 +18,7 @@ Edit Simulator Profile
{% block action_right %}
<button id="hi-simulator-profile-edit-submit" type="submit" class="btn btn-lg btn-success"
name="action" value="edit">
- UPDATE
+ {% icon "save" size="sm" css_class="hi-icon-left" %}UPDATE
</button>
{% endblock %}
diff --git a/src/hi/simulator/templates/simulator/panes/sim_entity.html b/src/hi/simulator/templates/simulator/panes/sim_entity.html
index 527812d2..f9e4960e 100644
--- a/src/hi/simulator/templates/simulator/panes/sim_entity.html
+++ b/src/hi/simulator/templates/simulator/panes/sim_entity.html
@@ -1,3 +1,4 @@
+{% load icons %}
<div class="row">
<div class="col-3">
{{ sim_entity.name }}
@@ -11,7 +12,9 @@
</div>
<div class="col-2">
<a href="{% url 'simulator_entity_edit' sim_entity_id=sim_entity.id %}"
- class="btn btn-primary" data-async="modal">EDIT</a>
+ class="btn btn-primary" data-async="modal">
+ {% icon "edit" size="sm" css_class="hi-icon-left" %}EDIT
+ </a>
<a href="{% url 'simulator_entity_delete' sim_entity_id=sim_entity.id %}"
class="btn btn-danger" data-async="modal">X</a>
</div>
diff --git a/src/hi/static/css/main.css b/src/hi/static/css/main.css
index 726bf820..93d5439b 100644
--- a/src/hi/static/css/main.css
+++ b/src/hi/static/css/main.css
@@ -1408,3 +1408,146 @@ form[data-dirty] {
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);
+}
+
+.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.25rem;
+}
+
+.hi-icon-right {
+ margin-left: 0.25rem;
+}
+
+/* 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;
+ }
+}
+
+/* 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;
+}
+
+/* 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;
+}
+
+.pagination-lg .page-link:hover {
+ color: var(--primary-highlight-color) !important;
+ background-color: #e9ecef !important;
+ border-color: #dee2e6 !important;
+}
+
+.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;
+}
+
+.pagination-lg .page-item.disabled .page-link {
+ color: #6c757d !important;
+ background-color: #fff !important;
+ border-color: #dee2e6 !important;
+}
diff --git a/src/hi/static/js/audio.js b/src/hi/static/js/audio.js
index 71f9ae9d..9aedbe4b 100644
--- a/src/hi/static/js/audio.js
+++ b/src/hi/static/js/audio.js
@@ -400,7 +400,7 @@
}
async function _setInitialBaselineState() {
- if (Hi.DEBUG) { console.log('🎯 Setting initial baseline audio state (clean page load)'); }
+ if (Hi.DEBUG) { console.log('[AUDIO] Setting initial baseline audio state (clean page load)'); }
try {
const state = await _getAudioPermissionState();
@@ -432,7 +432,7 @@
currentAudioState = state;
if (hasBaselineStateChanged()) {
- if (Hi.DEBUG) { console.log(`πŸ“Š Baseline state changed: ${baselineAudioState} β†’ ${currentAudioState}`); }
+ if (Hi.DEBUG) { console.log(`[AUDIO] Baseline state changed: ${baselineAudioState} β†’ ${currentAudioState}`); }
// Update button display
await _updateAudioButtonState();
@@ -469,19 +469,19 @@
async function _startBaselineMonitoring() {
- if (Hi.DEBUG) { console.log('🎯 Starting baseline audio monitoring system'); }
+ if (Hi.DEBUG) { console.log('[AUDIO] Starting baseline audio monitoring system'); }
// Set initial baseline immediately on page load (cleanest state)
await _setInitialBaselineState();
// Only start baseline monitoring if baseline state is blocked
if (baselineAudioState === AudioPermissionState.BLOCKED) {
- if (Hi.DEBUG) { console.log('πŸ”„ Starting baseline state monitoring (baseline is blocked)'); }
+ if (Hi.DEBUG) { console.log('[AUDIO] Starting baseline state monitoring (baseline is blocked)'); }
baselineRecheckTimer = setInterval(async () => {
await _checkForBaselineStateChange();
}, BASELINE_STATE_MONITOR_INTERVAL_MS );
} else {
- if (Hi.DEBUG) { console.log('βœ… Baseline state is allowed - no monitoring needed'); }
+ if (Hi.DEBUG) { console.log('[AUDIO] Baseline state is allowed - no monitoring needed'); }
}
}
@@ -542,7 +542,7 @@
if (Hi.DEBUG) { console.log('πŸ“‹ Showing guidance dialog (baseline blocked + audio enabled)'); }
await _showAudioPermissionGuidanceDialog();
} else {
- if (Hi.DEBUG) { console.log('πŸ”„ No guidance needed - normal button toggle'); }
+ if (Hi.DEBUG) { console.log('[AUDIO] No guidance needed - normal button toggle'); }
// Normal case: just toggle audio setting and update button
if (Hi.settings.isAudioEnabled()) {
if (Hi.DEBUG) { console.log('πŸ”‡ Disabling audio'); }
@@ -554,24 +554,24 @@
await _updateAudioButtonState();
}
} catch (error) {
- if (Hi.DEBUG) { console.error('❌ Error handling audio button click:', error); }
+ if (Hi.DEBUG) { console.error('[AUDIO ERROR] Error handling audio button click:', error); }
}
}
async function _showAudioPermissionGuidanceDialog() {
try {
- if (Hi.DEBUG) { console.log('πŸ”„ Fetching and showing audio permission guidance dialog...'); }
+ if (Hi.DEBUG) { console.log('[AUDIO] Fetching and showing audio permission guidance dialog...'); }
// Use antinode's direct API instead of triggering events
if (typeof window.AN !== 'undefined') {
if (Hi.DEBUG) { console.log('πŸ“‘ Using antinode AN.get() to fetch modal content'); }
window.AN.get('/audio/permission-guidance');
} else {
- if (Hi.DEBUG) { console.log('⚠️ Antinode not available, using fallback approach'); }
+ if (Hi.DEBUG) { console.log('[AUDIO WARNING] Antinode not available, using fallback approach'); }
// Fallback: manual AJAX call
$.get('/audio/permission-guidance')
.done(function(html) {
- if (Hi.DEBUG) { console.log('βœ… Got guidance HTML, creating modal'); }
+ if (Hi.DEBUG) { console.log('[AUDIO] Got guidance HTML, creating modal'); }
// Create modal manually
let modalId = 'audio-guidance-modal-' + Date.now();
let modalHtml = `<div id="${modalId}" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">${html}</div>`;
@@ -579,14 +579,14 @@
$(`#${modalId}`).modal('show');
})
.fail(function(xhr, status, error) {
- if (Hi.DEBUG) { console.error('❌ Failed to fetch guidance dialog:', error); }
+ if (Hi.DEBUG) { console.error('[AUDIO ERROR] Failed to fetch guidance dialog:', error); }
alert('Audio is blocked by your browser. Please check your browser\'s autoplay settings.');
});
}
if (Hi.DEBUG) { console.log('πŸš€ Audio guidance dialog request initiated'); }
} catch (error) {
- if (Hi.DEBUG) { console.error('❌ Error showing audio guidance dialog:', error); }
+ if (Hi.DEBUG) { console.error('[AUDIO ERROR] Error showing audio guidance dialog:', error); }
// Fallback: show simple alert
alert('Audio is blocked by your browser. Please check your browser\'s autoplay settings.');
}
@@ -611,14 +611,14 @@
diagnosticAudioTimer = setInterval(() => {
diagnosticCounter++;
- if (Hi.DEBUG) { console.log(`πŸ”” Diagnostic background audio #${diagnosticCounter}`); }
+ if (Hi.DEBUG) { console.log(`[AUDIO] Diagnostic background audio #${diagnosticCounter}`); }
try {
// Use the same method as real weather alerts (no user activation)
_startAudibleSignal('ConsoleInfo');
- if (Hi.DEBUG) { console.log(`βœ… Diagnostic audio #${diagnosticCounter} triggered`); }
+ if (Hi.DEBUG) { console.log(`[AUDIO] Diagnostic audio #${diagnosticCounter} triggered`); }
} catch (error) {
- if (Hi.DEBUG) { console.log(`❌ Diagnostic audio #${diagnosticCounter} failed:`, error); }
+ if (Hi.DEBUG) { console.log(`[AUDIO ERROR] Diagnostic audio #${diagnosticCounter} failed:`, error); }
}
}, 10000);
}
diff --git a/src/hi/static/js/auto-view.js b/src/hi/static/js/auto-view.js
index 2030a604..ef472fe6 100644
--- a/src/hi/static/js/auto-view.js
+++ b/src/hi/static/js/auto-view.js
@@ -257,7 +257,7 @@
// Create corner badge with reason and subtle animation
const indicator = $(`
<div id="auto-view-indicator" class="auto-view-corner-badge">
- <div class="auto-view-badge-icon">πŸ”„</div>
+ <div class="auto-view-badge-icon">↻</div>
<div class="auto-view-badge-text">Auto-view: ${this.formatReason(reason)}</div>
</div>
`);
diff --git a/src/hi/templates/icons/camera.html b/src/hi/templates/icons/camera.html
new file mode 100644
index 00000000..1d232720
--- /dev/null
+++ b/src/hi/templates/icons/camera.html
@@ -0,0 +1,3 @@
+<svg class="{{ class_attr }}" viewBox="0 0 24 24" fill="currentColor" {{ accessibility_attrs }}>
+ <path d="M9 3h6l1.83 2H20c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V7c0-1.1.9-2 2-2h3.17L9 3zm3 15c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm0-8c1.65 0 3 1.35 3 3s-1.35 3-3 3-3-1.35-3-3 1.35-3 3-3z"/>
+</svg>
\ No newline at end of file
diff --git a/src/hi/templates/icons/cancel.html b/src/hi/templates/icons/cancel.html
new file mode 100644
index 00000000..af3b55f6
--- /dev/null
+++ b/src/hi/templates/icons/cancel.html
@@ -0,0 +1,3 @@
+<svg class="{{ class_attr }}" viewBox="0 0 24 24" fill="currentColor" {{ accessibility_attrs }}>
+ <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/>
+</svg>
\ No newline at end of file
diff --git a/src/hi/templates/icons/chevron-double-left.html b/src/hi/templates/icons/chevron-double-left.html
new file mode 100644
index 00000000..8ed631f8
--- /dev/null
+++ b/src/hi/templates/icons/chevron-double-left.html
@@ -0,0 +1,4 @@
+<svg class="{{ class_attr }}" viewBox="0 0 24 24" fill="currentColor" {{ accessibility_attrs }}>
+ <path d="M18.4 4.4c.3-.3.8-.3 1.1 0 .3.3.3.8 0 1.1L12.8 12l6.6 6.6c.3.3.3.8 0 1.1-.3.3-.8.3-1.1 0l-7.1-7.1c-.3-.3-.3-.8 0-1.1l7.1-7.1z"/>
+ <path d="M11.4 4.4c.3-.3.8-.3 1.1 0 .3.3.3.8 0 1.1L5.8 12l6.6 6.6c.3.3.3.8 0 1.1-.3.3-.8.3-1.1 0l-7.1-7.1c-.3-.3-.3-.8 0-1.1l7.1-7.1z"/>
+</svg>
\ No newline at end of file
diff --git a/src/hi/templates/icons/chevron-double-right.html b/src/hi/templates/icons/chevron-double-right.html
new file mode 100644
index 00000000..d7eb4fd5
--- /dev/null
+++ b/src/hi/templates/icons/chevron-double-right.html
@@ -0,0 +1,4 @@
+<svg class="{{ class_attr }}" viewBox="0 0 24 24" fill="currentColor" {{ accessibility_attrs }}>
+ <path d="M5.6 4.4c-.3-.3-.8-.3-1.1 0-.3.3-.3.8 0 1.1L11.2 12l-6.6 6.6c-.3.3-.3.8 0 1.1.3.3.8.3 1.1 0l7.1-7.1c.3-.3.3-.8 0-1.1l-7.1-7.1z"/>
+ <path d="M12.6 4.4c-.3-.3-.8-.3-1.1 0-.3.3-.3.8 0 1.1L18.2 12l-6.6 6.6c-.3.3-.3.8 0 1.1.3.3.8.3 1.1 0l7.1-7.1c.3-.3.3-.8 0-1.1l-7.1-7.1z"/>
+</svg>
\ No newline at end of file
diff --git a/src/hi/templates/icons/chevron-down.html b/src/hi/templates/icons/chevron-down.html
new file mode 100644
index 00000000..80ff5bc1
--- /dev/null
+++ b/src/hi/templates/icons/chevron-down.html
@@ -0,0 +1,3 @@
+<svg class="{{ class_attr }}" viewBox="0 0 24 24" fill="currentColor" {{ accessibility_attrs }}>
+ <path d="M4.4 8.6c-.3.3-.3.8 0 1.1l7.1 7.1c.3.3.8.3 1.1 0l7.1-7.1c.3-.3.3-.8 0-1.1-.3-.3-.8-.3-1.1 0L12 15.2l-6.6-6.6c-.3-.3-.8-.3-1.1 0z"/>
+</svg>
\ No newline at end of file
diff --git a/src/hi/templates/icons/chevron-left.html b/src/hi/templates/icons/chevron-left.html
new file mode 100644
index 00000000..c36d5484
--- /dev/null
+++ b/src/hi/templates/icons/chevron-left.html
@@ -0,0 +1,3 @@
+<svg class="{{ class_attr }}" viewBox="0 0 24 24" fill="currentColor" {{ accessibility_attrs }}>
+ <path d="M15.4 4.4c.3-.3.8-.3 1.1 0 .3.3.3.8 0 1.1L9.8 12l6.6 6.6c.3.3.3.8 0 1.1-.3.3-.8.3-1.1 0l-7.1-7.1c-.3-.3-.3-.8 0-1.1l7.1-7.1z"/>
+</svg>
\ No newline at end of file
diff --git a/src/hi/templates/icons/chevron-right.html b/src/hi/templates/icons/chevron-right.html
new file mode 100644
index 00000000..f565679a
--- /dev/null
+++ b/src/hi/templates/icons/chevron-right.html
@@ -0,0 +1,3 @@
+<svg class="{{ class_attr }}" viewBox="0 0 24 24" fill="currentColor" {{ accessibility_attrs }}>
+ <path d="M8.6 4.4c-.3-.3-.8-.3-1.1 0-.3.3-.3.8 0 1.1L14.2 12l-6.6 6.6c-.3.3-.3.8 0 1.1.3.3.8.3 1.1 0l7.1-7.1c.3-.3.3-.8 0-1.1l-7.1-7.1z"/>
+</svg>
\ No newline at end of file
diff --git a/src/hi/templates/icons/chevron-up.html b/src/hi/templates/icons/chevron-up.html
new file mode 100644
index 00000000..84c8b6c6
--- /dev/null
+++ b/src/hi/templates/icons/chevron-up.html
@@ -0,0 +1,3 @@
+<svg class="{{ class_attr }}" viewBox="0 0 24 24" fill="currentColor" {{ accessibility_attrs }}>
+ <path d="M4.4 15.4c-.3-.3-.3-.8 0-1.1l7.1-7.1c.3-.3.8-.3 1.1 0l7.1 7.1c.3.3.3.8 0 1.1-.3.3-.8.3-1.1 0L12 8.8l-6.6 6.6c-.3.3-.8.3-1.1 0z"/>
+</svg>
\ No newline at end of file
diff --git a/src/hi/templates/icons/clock.html b/src/hi/templates/icons/clock.html
new file mode 100644
index 00000000..968b205a
--- /dev/null
+++ b/src/hi/templates/icons/clock.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 2zm3.5 6L13 10.5V7c0-.55-.45-1-1-1s-1 .45-1 1v4.5c0 .28.11.52.29.71.18.18.43.29.71.29.28 0 .52-.11.71-.29l2.5-2.5c.39-.39.39-1.02 0-1.41-.39-.39-1.02-.39-1.41 0z"/>
+</svg>
\ No newline at end of file
diff --git a/src/hi/templates/icons/close.html b/src/hi/templates/icons/close.html
new file mode 100644
index 00000000..af3b55f6
--- /dev/null
+++ b/src/hi/templates/icons/close.html
@@ -0,0 +1,3 @@
+<svg class="{{ class_attr }}" viewBox="0 0 24 24" fill="currentColor" {{ accessibility_attrs }}>
+ <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/>
+</svg>
\ No newline at end of file
diff --git a/src/hi/templates/icons/delete.html b/src/hi/templates/icons/delete.html
new file mode 100644
index 00000000..141ff356
--- /dev/null
+++ b/src/hi/templates/icons/delete.html
@@ -0,0 +1,3 @@
+<svg class="{{ class_attr }}" viewBox="0 0 24 24" fill="currentColor" {{ accessibility_attrs }}>
+ <path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/>
+</svg>
\ No newline at end of file
diff --git a/src/hi/templates/icons/edit.html b/src/hi/templates/icons/edit.html
new file mode 100644
index 00000000..a7c61e59
--- /dev/null
+++ b/src/hi/templates/icons/edit.html
@@ -0,0 +1,3 @@
+<svg class="{{ class_attr }}" viewBox="0 0 24 24" fill="currentColor" {{ accessibility_attrs }}>
+ <path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/>
+</svg>
\ No newline at end of file
diff --git a/src/hi/templates/icons/history.html b/src/hi/templates/icons/history.html
new file mode 100644
index 00000000..ab4fcf1a
--- /dev/null
+++ b/src/hi/templates/icons/history.html
@@ -0,0 +1,3 @@
+<svg class="{{ class_attr }}" viewBox="0 0 24 24" fill="currentColor" {{ accessibility_attrs }}>
+ <path d="M13 3c4.97 0 9 4.03 9 9H20c-.55 0-1 .45-1 1s.45 1 1 1h2c1.1 0 2-.9 2-2 0-5.52-4.48-10-10-10S2 6.48 2 12s4.48 10 10 10c2.76 0 5.26-1.12 7.07-2.93.39-.39.39-1.02 0-1.41-.39-.39-1.02-.39-1.41 0A7.93 7.93 0 0 1 12 20c-4.41 0-8-3.59-8-8s3.59-8 8-8zm-1 5v4.5l3.5 2.1c.38.23.87.11 1.1-.27.23-.38.11-.87-.27-1.1L13 11.4V8c0-.55-.45-1-1-1s-1 .45-1 1z"/>
+</svg>
\ No newline at end of file
diff --git a/src/hi/templates/icons/lightbulb.html b/src/hi/templates/icons/lightbulb.html
new file mode 100644
index 00000000..8514397e
--- /dev/null
+++ b/src/hi/templates/icons/lightbulb.html
@@ -0,0 +1,3 @@
+<svg class="{{ class_attr }}" viewBox="0 0 24 24" fill="currentColor" {{ accessibility_attrs }}>
+ <path d="M9 21c0 .5.4 1 1 1h4c.6 0 1-.5 1-1v-1H9v1zm3-19C8.1 2 5 5.1 5 9c0 2.4 1.2 4.5 3 5.7V17c0 .5.4 1 1 1h6c.6 0 1-.5 1-1v-2.3c1.8-1.3 3-3.4 3-5.7 0-3.9-3.1-7-7-7z"/>
+</svg>
\ No newline at end of file
diff --git a/src/hi/templates/icons/lock.html b/src/hi/templates/icons/lock.html
new file mode 100644
index 00000000..7d6a15da
--- /dev/null
+++ b/src/hi/templates/icons/lock.html
@@ -0,0 +1,3 @@
+<svg class="{{ class_attr }}" viewBox="0 0 24 24" fill="currentColor" {{ accessibility_attrs }}>
+ <path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm3 9c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"/>
+</svg>
\ No newline at end of file
diff --git a/src/hi/templates/icons/play.html b/src/hi/templates/icons/play.html
new file mode 100644
index 00000000..0276f808
--- /dev/null
+++ b/src/hi/templates/icons/play.html
@@ -0,0 +1,3 @@
+<svg class="{{ class_attr }}" viewBox="0 0 24 24" fill="currentColor" {{ accessibility_attrs }}>
+ <path d="M8 5.14v14.72c0 .41.47.65.81.42l8.58-5.66c.27-.18.27-.66 0-.84L8.81 7.12c-.34-.23-.81.01-.81.42z"/>
+</svg>
\ No newline at end of file
diff --git a/src/hi/templates/icons/plus.html b/src/hi/templates/icons/plus.html
new file mode 100644
index 00000000..f7c10965
--- /dev/null
+++ b/src/hi/templates/icons/plus.html
@@ -0,0 +1,3 @@
+<svg class="{{ class_attr }}" viewBox="0 0 24 24" fill="currentColor" {{ accessibility_attrs }}>
+ <path d="M12 4.5c.3 0 .6.2.6.6v6.4h6.4c.3 0 .6.2.6.5s-.2.6-.6.6h-6.4v6.4c0 .3-.2.6-.5.6s-.6-.2-.6-.6v-6.4H4.6c-.3 0-.6-.2-.6-.5s.2-.6.6-.6h6.4V5.1c0-.3.2-.6.5-.6z"/>
+</svg>
\ No newline at end of file
diff --git a/src/hi/templates/icons/save.html b/src/hi/templates/icons/save.html
new file mode 100644
index 00000000..7a5e0b03
--- /dev/null
+++ b/src/hi/templates/icons/save.html
@@ -0,0 +1,3 @@
+<svg class="{{ class_attr }}" viewBox="0 0 24 24" fill="currentColor" {{ accessibility_attrs }}>
+ <path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
+</svg>
\ No newline at end of file
diff --git a/src/hi/templates/icons/shield.html b/src/hi/templates/icons/shield.html
new file mode 100644
index 00000000..a0b54097
--- /dev/null
+++ b/src/hi/templates/icons/shield.html
@@ -0,0 +1,3 @@
+<svg class="{{ class_attr }}" viewBox="0 0 24 24" fill="currentColor" {{ accessibility_attrs }}>
+ <path d="M12 2L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-3z"/>
+</svg>
\ No newline at end of file
diff --git a/src/hi/templates/icons/sync.html b/src/hi/templates/icons/sync.html
new file mode 100644
index 00000000..4b4f6a6e
--- /dev/null
+++ b/src/hi/templates/icons/sync.html
@@ -0,0 +1,3 @@
+<svg class="{{ class_attr }}" viewBox="0 0 24 24" fill="currentColor" {{ accessibility_attrs }}>
+ <path d="M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"/>
+</svg>
\ No newline at end of file
diff --git a/src/hi/templates/icons/upload.html b/src/hi/templates/icons/upload.html
new file mode 100644
index 00000000..744d8d82
--- /dev/null
+++ b/src/hi/templates/icons/upload.html
@@ -0,0 +1,4 @@
+<svg viewBox="0 0 24 24" class="{{ class_attr }}" {{ accessibility_attrs }}>
+ <path d="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z" />
+ <path d="M12,11L16,15H13V19H11V15H8L12,11Z" />
+</svg>
\ No newline at end of file
diff --git a/src/hi/templates/icons/video.html b/src/hi/templates/icons/video.html
new file mode 100644
index 00000000..6db94736
--- /dev/null
+++ b/src/hi/templates/icons/video.html
@@ -0,0 +1,3 @@
+<svg class="{{ class_attr }}" viewBox="0 0 24 24" fill="currentColor" {{ accessibility_attrs }}>
+ <path d="M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4c.55.55 1.33.16 1.33-.62V7.12c0-.78-.78-1.17-1.33-.62L17 10.5z"/>
+</svg>
\ No newline at end of file
diff --git a/src/hi/templates/modals/action_with_cancel.html b/src/hi/templates/modals/action_with_cancel.html
index f8d7d885..67c4e182 100644
--- a/src/hi/templates/modals/action_with_cancel.html
+++ b/src/hi/templates/modals/action_with_cancel.html
@@ -1,6 +1,9 @@
{% extends "modals/action_2.html" %}
+{% load icons %}
{% block action_left %}
<a id="hi-modal-cancel" role="button" {% if autofocus %}autofocus="autofocus"{% endif %}
- class="btn btn-lg btn-tertiary" href="#" data-dismiss="modal">CANCEL</a>
+ class="btn btn-lg btn-tertiary" href="#" data-dismiss="modal">
+ {% icon "cancel" size="sm" css_class="hi-icon-left" %}CANCEL
+</a>
{% endblock %}
diff --git a/src/hi/templates/modals/base.html b/src/hi/templates/modals/base.html
index ac24a12b..5e80e9bd 100644
--- a/src/hi/templates/modals/base.html
+++ b/src/hi/templates/modals/base.html
@@ -18,9 +18,12 @@
</div>
<div class="col-md-1 col-1 align-self-center m-0 pl-1 text-right">
{% block dismiss_button %}
+ {% load icons %}
<button id="modal_dismiss_x"
type="button" class=" w-100 text-center text-white close"
- data-dismiss="modal" aria-hidden="true">X</button>
+ data-dismiss="modal" aria-label="Close modal">
+ {% icon "close" size="sm" %}
+ </button>
{% endblock %}
</div>
</div>
diff --git a/src/hi/urls.py b/src/hi/urls.py
index e8621287..c2ac4ca9 100644
--- a/src/hi/urls.py
+++ b/src/hi/urls.py
@@ -63,5 +63,5 @@ handler404 = 'hi.views.custom_404_handler'
if settings.DEBUG:
urlpatterns += [
- re_path( r'^testing', include('hi.testing.urls' )),
+ re_path( r'^testing/', include('hi.testing.urls' )),
]