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,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 %}