Feat(SQL, UI): 1. Updated User Calc Stored Procedure with Search functionality from previous commit on Command and Dog tables. \n 2. Corrected functionality of active field trash and add icons instead of button with replaceable text. \n 3. Improved styling on Dog Command Link page.

This commit is contained in:
2025-07-06 20:50:35 +01:00
parent 8cb8508dcd
commit 660b15cb8f
28 changed files with 1279 additions and 562 deletions

View File

@@ -1,11 +1,15 @@
{% if colour is not defined %}
{% set colour = model.COLOUR_PRIMARY %}
{% if class_name is not defined %}
{% set class_name = '' %}
{% endif %}
{% if attribute_text is not defined %}
{% set attribute_text = '' %}
{% endif %}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"
fill="{{ colour }}"
class="{{ model.FLAG_BUTTON }} {{ model.FLAG_ICON }} {{ model.FLAG_ADD }} {{ model.FLAG_ACTIVE }}"
class="{{ model.FLAG_BUTTON }} {{ model.FLAG_ICON }} {{ model.FLAG_ADD }} {{ class_name }}"
{{ attribute_text }}
>
<!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
<path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM232 344l0-64-64 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l64 0 0-64c0-13.3 10.7-24 24-24s24 10.7 24 24l0 64 64 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-64 0 0 64c0 13.3-10.7 24-24 24s-24-10.7-24-24z"/>

View File

@@ -1,11 +1,15 @@
{% if colour is not defined %}
{% set colour = model.COLOUR_PRIMARY %}
{% if class_name is not defined %}
{% set class_name = '' %}
{% endif %}
{% if attribute_text is not defined %}
{% set attribute_text = '' %}
{% endif %}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"
fill="{{ colour }}"
class="{{ model.FLAG_BUTTON }} {{ model.FLAG_ICON }} {{ model.FLAG_DELETE }} {{ model.FLAG_ACTIVE }}"
class="{{ model.FLAG_BUTTON }} {{ model.FLAG_ICON }} {{ model.FLAG_DELETE }} {{ model.FLAG_ACTIVE }} {{ class_name }}"
{{ attribute_text }}
>
<!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
<path d="M135.2 17.7L128 32 32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0-7.2-14.3C307.4 6.8 296.3 0 284.2 0L163.8 0c-12.1 0-23.2 6.8-28.6 17.7zM416 128L32 128 53.2 467c1.6 25.3 22.6 45 47.9 45l245.8 0c25.3 0 46.3-19.7 47.9-45L416 128z"/>

View File

@@ -1,2 +1,5 @@
<div class="{{ model.FLAG_COMMAND }}" >{% if not is_blank_row %}{{ command.name }}{% endif %}</div>
{% set value_previous = '0' if is_blank_row else command.id_command %}
{% set text_previous = '' if is_blank_row else command.name %}
<div class="{{ model.FLAG_COMMAND }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ value_previous }}" {{ model.ATTR_VALUE_CURRENT }}="{{ value_previous }}">{{ text_previous }}</div>

View File

@@ -1,2 +1,5 @@
<div class="{{ model.FLAG_COMMAND_CATEGORY }}" >{% if not is_blank_row %}{{ command_category.name }}{% endif %}</div>
{% set value_previous = '0' if is_blank_row else command_category.id_command_category %}
{% set text_previous = '' if is_blank_row else command_category.name %}
<div class="{{ model.FLAG_COMMAND_CATEGORY }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ value_previous }}" {{ model.ATTR_VALUE_CURRENT }}="{{ value_previous }}">{{ text_previous }}</div>

View File

@@ -1,2 +1,5 @@
<div class="{{ model.FLAG_DOG }}" >{% if not is_blank_row %}{{ dog.name }}{% endif %}</div>
{% set value_previous = '0' if is_blank_row else dog.id_dog %}
{% set text_previous = '' if is_blank_row else dog.name %}
<div class="{{ model.FLAG_DOG }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ value_previous }}" {{ model.ATTR_VALUE_CURRENT }}="{{ value_previous }}">{{ text_previous }}</div>

View File

@@ -1,13 +1,13 @@
{% if is_blank_row %}
<tr class="{{ model.FLAG_ROW_NEW }} {{ model.FLAG_DOG_COMMAND_LINK }}" {{ model.ATTR_ID_DOG_COMMAND_LINK }}>
<td class="{{ model.FLAG_DOG }}" {{ model.ATTR_VALUE_CURRENT }}="0" {{ model.ATTR_VALUE_PREVIOUS }}="0">
<td class="{{ model.FLAG_DOG }}">
{% include 'components/dog/_preview_DDL_dog.html' %}
</td>
<td class="{{ model.FLAG_COMMAND_CATEGORY }}" {{ model.ATTR_VALUE_CURRENT }}="0" {{ model.ATTR_VALUE_PREVIOUS }}="0">
<td class="{{ model.FLAG_COMMAND_CATEGORY }}">
{% include 'components/dog/_preview_DDL_command_category.html' %}
</td>
<td class="{{ model.FLAG_COMMAND }}" {{ model.ATTR_VALUE_CURRENT }}="0" {{ model.ATTR_VALUE_PREVIOUS }}="0">
<td class="{{ model.FLAG_COMMAND }}">
{% include 'components/dog/_preview_DDL_command.html' %}
</td>
<td class="{{ model.FLAG_HAND_SIGNAL_DESCRIPTION}}">
@@ -16,28 +16,28 @@
<td class="{{ model.FLAG_NOTES}}">
<textarea class="{{ model.FLAG_NOTES }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></textarea>
</td>
{% set active = true %}
{% set active = True %}
{% include 'components/dog/_td_active.html' %}
</tr>
{% else %}
<tr class="{{ model.FLAG_DOG_COMMAND_LINK }}" {{ model.ATTR_ID_DOG_COMMAND_LINK }}="{{ link.id_link }}">
{% set dog = link.dog %}
<td class="{{ model.FLAG_DOG }}" {{ model.ATTR_VALUE_CURRENT }}="{{ dog.id_dog }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ dog.id_dog }}">
<td class="{{ model.FLAG_DOG }}">
{% include 'components/dog/_preview_DDL_dog.html' %}
</td>
{% set command_category = link.command.command_category %}
<td class="{{ model.FLAG_COMMAND_CATEGORY }}" {{ model.ATTR_VALUE_CURRENT }}="{{ command_category.id_command_category }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ command_category.id_command_category }}">
<td class="{{ model.FLAG_COMMAND_CATEGORY }}">
{% include 'components/dog/_preview_DDL_command_category.html' %}
</td>
{% set command = link.command %}
<td class="{{ model.FLAG_COMMAND }}" {{ model.ATTR_VALUE_CURRENT }}="{{ command.id_command }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ command.id_command }}">
<td class="{{ model.FLAG_COMMAND }}">
{% include 'components/dog/_preview_DDL_command.html' %}
</td>
<td class="{{ model.FLAG_HAND_SIGNAL_DESCRIPTION}}" {{ model.ATTR_VALUE_CURRENT }}="{{ link.hand_signal_description }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ link.hand_signal_description }}">
<textarea class="{{ model.FLAG_HAND_SIGNAL_DESCRIPTION }}" {{ model.ATTR_VALUE_CURRENT }}="{{ link.hand_signal_description }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ link.hand_signal_description }}">{{ link.hand_signal_description }}</textarea>
<td class="{{ model.FLAG_HAND_SIGNAL_DESCRIPTION}}">
<textarea class="{{ model.FLAG_HAND_SIGNAL_DESCRIPTION }}" {{ model.ATTR_VALUE_CURRENT }}="{{ link.hand_signal_description|escape }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ link.hand_signal_description|escape }}">{{ link.hand_signal_description }}</textarea>
</td>
<td class="{{ model.FLAG_NOTES}}" {{ model.ATTR_VALUE_CURRENT }}="{{ link.notes }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ link.notes }}">
<textarea class="{{ model.FLAG_NOTES }}" {{ model.ATTR_VALUE_CURRENT }}="{{ link.notes }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ link.notes }}">{{ link.notes }}</textarea>
<td class="{{ model.FLAG_NOTES}}">
<textarea class="{{ model.FLAG_NOTES }}" {{ model.ATTR_VALUE_CURRENT }}="{{ link.notes|escape }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ link.notes|escape }}">{{ link.notes }}</textarea>
</td>
{% set active = link.active %}
{% include 'components/dog/_td_active.html' %}

View File

@@ -2,21 +2,13 @@
{% with _active = (active is not defined or active or active is none) %}
<td class="{{ model.FLAG_ACTIVE }}">
{#
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" {% if active %}checked{% endif %} {{ model.ATTR_VALUE_CURRENT }}="{{ active | lower }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ active | lower }}">
#}
{#
<button type="button" class="{{ model.FLAG_ACTIVE }} {% if active %}{{ model.FLAG_DELETE }}{% endif %}"
{{ model.ATTR_VALUE_CURRENT }}="{{ active | lower }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ active | lower }}"
>{% if active %}x{% else %}+{% endif %}</button>
#}
{% if active %}
{% set colour = model.COLOUR_ERROR %}
{% set attribute_text = model.ATTR_VALUE_CURRENT + '=' + _active | lower + ' ' + model.ATTR_VALUE_PREVIOUS + '=' + _active | lower + '' %}
{% if _active %}
{% set class_name = '' %}
{% include 'components/common/buttons/_icon_trash.html' %}
{% else %}
{% set colour = model.COLOUR_PRIMARY %}
{% set class_name = model.FLAG_ACTIVE %}
{% include 'components/common/buttons/_icon_add.html' %}
{% endif %}
</td>
{% endwith %}
{% endwith %}

View File

@@ -60,8 +60,8 @@
var colourTextLinkVisited = "{{ model.COLOUR_TEXT_LINK_VISITED }}";
var environment = {
"name": "{{ model.app.app_config.FLASK_ENV }}",
"is_production": "{{ model.app.app_config.is_production }}",
"is_development": "{{ model.app.app_config.is_development }}",
"is_production": "{{ model.app.app_config.is_production | lower }}",
"is_development": "{{ model.app.app_config.is_development | lower }}",
};
var flagAccessLevel = "{{ model.FLAG_ACCESS_LEVEL }}";
var flagAccessLevelRequired = "{{ model.FLAG_ACCESS_LEVEL_REQUIRED }}";
@@ -179,6 +179,7 @@
var hashPageUserLogout = "{{ model.HASH_PAGE_USER_LOGOUT }}";
var idButtonApplyFilters = "#{{ model.ID_BUTTON_APPLY_FILTERS }}";
var idButtonHamburger = "#{{ model.ID_BUTTON_HAMBURGER }}";
var idContainerTemplateElements = "#{{ model.ID_CONTAINER_TEMPLATE_ELEMENTS }}";
var idCSRFToken = "#{{ model.ID_CSRF_TOKEN }}";
var idFormFilters = "#{{ model.ID_FORM_FILTERS }}";
var idLabelError = "#{{ model.ID_LABEL_ERROR }}";

View File

@@ -59,7 +59,8 @@
<th class="{{ model.FLAG_HAND_SIGNAL_DESCRIPTION }}">Hand Signal</th>
<th class="{{ model.FLAG_NOTES }}">Notes</th>
<th class="{{ model.FLAG_ACTIVE }}">
{% set colour = model.COLOUR_PRIMARY %}
{% set class_name = model.FLAG_ACTIVE %}
{% set attribute_text = '' %}
{% include 'components/common/buttons/_icon_add.html' %}
</th>
</tr>
@@ -78,6 +79,17 @@
{% include 'components/common/temporary/_overlay_confirm.html' %}
{% include 'components/common/temporary/_overlay_error.html' %}
<div id="{{ model.ID_CONTAINER_TEMPLATE_ELEMENTS }}">
<!-- Active column -->
<!-- Delete -->
{% set class_name = '' %}
{% include 'components/common/buttons/_icon_trash.html' %}
<!-- Undelete -->
{% set class_name = model.FLAG_ACTIVE %}
{% set attribute_text = '' %}
{% include 'components/common/buttons/_icon_add.html' %}
</div>
<script src="{{ url_for('routes_dog.scripts_section_dog') }}"></script>
<script>