Feat: Assessment page completed with save method combining Assessment, Distraction, Assessment Command Modality Link, and Assessment Response save for creating new complete Assessnent.
This commit is contained in:
@@ -5,6 +5,65 @@
|
||||
|
||||
{% set assessment = model.assessments[0] %}
|
||||
|
||||
<form id="{{ model.ID_FORM_FILTERS }}" class="{{ model.FLAG_FILTER }} {{ model.FLAG_ROW }} {{ model.FLAG_CARD }}">
|
||||
{{ model.form_filters.hidden_tag() }}
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_COLUMN }} {{ model.FLAG_FILTER }} {{ model.FLAG_SEARCH }}">
|
||||
{{ model.form_filters.search.label }}
|
||||
{{ model.form_filters.search() }}
|
||||
{% for error in model.form_filters.search.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_COLUMN }} {{ model.FLAG_FILTER }} {{ model.ATTR_ID_ASSESSMENT }}">
|
||||
{{ model.form_filters.id_assessment.label }}
|
||||
{{ model.form_filters.id_assessment() }}
|
||||
{% for error in model.form_filters.id_assessment.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_COLUMN }} {{ model.FLAG_FILTER }} {{ model.ATTR_ID_WEATHER }}">
|
||||
{{ model.form_filters.id_weather.label }}
|
||||
{{ model.form_filters.id_weather() }}
|
||||
{% for error in model.form_filters.id_weather.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_COLUMN }} {{ model.FLAG_FILTER }} {{ model.ATTR_ID_LIGHTING_LEVEL }}">
|
||||
{{ model.form_filters.id_lighting_level.label }}
|
||||
{{ model.form_filters.id_lighting_level() }}
|
||||
{% for error in model.form_filters.id_lighting_level.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_COLUMN }} {{ model.FLAG_FILTER }} {{ model.ATTR_ID_LOCATION }}">
|
||||
{{ model.form_filters.id_location.label }}
|
||||
{{ model.form_filters.id_location() }}
|
||||
{% for error in model.form_filters.id_location.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_COLUMN }} {{ model.FLAG_FILTER }} {{ model.FLAG_USER_HANDLER }}">
|
||||
{{ model.form_filters.id_user_handler.label }}
|
||||
{{ model.form_filters.id_user_handler() }}
|
||||
{% for error in model.form_filters.id_user_handler.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_COLUMN }} {{ model.FLAG_FILTER }} {{ model.FLAG_ACTIVE_ONLY }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ model.form_filters.active_only.data }}">
|
||||
{{ model.form_filters.active_only.label }}
|
||||
{{ model.form_filters.active_only() }}
|
||||
{% for error in model.form_filters.active_only.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}
|
||||
{% set class_name = model.FLAG_FILTER + ' ' + model.FLAG_ACTIVE_ONLY + ' ' + model.FLAG_CHECKBOX %}
|
||||
{% include 'components/common/buttons/_icon_checkbox.html' %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="{{ model.FLAG_SAVE }} {{ model.FLAG_CANCEL }} {{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
|
||||
<div class="{{ model.FLAG_ROW }}">
|
||||
<div class="{{ model.FLAG_COLUMN }}">
|
||||
@@ -35,8 +94,8 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="{{ model.FLAG_ASSESSMENT }}">
|
||||
{{ model.form_filters.hidden_tag() }}
|
||||
{% set is_blank_row = (assessment.id_assessment < 1) %}
|
||||
<tr class="{{ model.FLAG_ASSESSMENT }}" {{ model.ATTR_ID_ASSESSMENT }}="{{ assessment.id_assessment }}">
|
||||
{% set weather_preview = assessment.weather %}
|
||||
<td class="{{ model.FLAG_WEATHER }} {{ model.FLAG_DDL_PREVIEW }}">
|
||||
{% include 'components/dog/_preview_DDL_weather.html' %}
|
||||
@@ -108,7 +167,7 @@
|
||||
<th class="{{ model.FLAG_COMMAND }} {{ model.FLAG_DDL_PREVIEW }}" rowspan="2">Command</th>
|
||||
<th class="{{ model.FLAG_COMMAND_MODALITY }} {{ model.FLAG_DDL_PREVIEW }}" rowspan="2">Command Modality</th>
|
||||
<th class="{{ model.FLAG_BRIBE }} {{ model.FLAG_DDL_PREVIEW }}" rowspan="2">Bribe</th>
|
||||
<th class="{{ model.FLAG_DISTANCE_FROM_HANDLER }} {{ model.FLAG_DDL_PREVIEW }}" rowspan="2">Distance From Handler</th>
|
||||
<th class="{{ model.FLAG_DISTANCE_FROM_HANDLER_METRES }} {{ model.FLAG_DDL_PREVIEW }}" rowspan="2">Distance From Handler</th>
|
||||
<th class="{{ model.FLAG_IS_IN_SIGHT_OF_HANDLER }}" colspan="3" rowspan="1">In Range Of Handler?</th>
|
||||
<th class="{{ model.FLAG_IS_ON_LEAD }} {{ model.FLAG_DDL_PREVIEW }}" rowspan="2">On Lead?</th>
|
||||
<th class="{{ model.FLAG_TRIAL_COUNT }} {{ model.FLAG_DDL_PREVIEW }}" rowspan="2">Trial Count</th>
|
||||
@@ -155,7 +214,8 @@
|
||||
<script src="{{ url_for('routes_dog.scripts_section_dog') }}"></script>
|
||||
|
||||
<script>
|
||||
var assessment = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.assessments) | tojson | safe }};
|
||||
var assessments = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.assessments) | tojson | safe }};
|
||||
var assessment = assessments[{{ assessment.id_assessment }}];
|
||||
var filterBribes = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.filter_bribes) | tojson | safe }};
|
||||
var filterCommandCategories = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.filter_command_categories) | tojson | safe }};
|
||||
var filterCommandModalities = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.filter_command_modalities) | tojson | safe }};
|
||||
@@ -169,7 +229,7 @@
|
||||
var filterUserHandlers = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.filter_user_handlers) | tojson | safe }};
|
||||
var filterWeathers = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.filter_weathers) | tojson | safe }};
|
||||
var flagCommandModality = "{{ model.FLAG_COMMAND_MODALITY }}";
|
||||
var flagDistanceFromHandler = "{{ model.FLAG_DISTANCE_FROM_HANDLER }}";
|
||||
var flagDistanceFromHandlerMetres = "{{ model.FLAG_DISTANCE_FROM_HANDLER_METRES }}";
|
||||
var flagDistractionIntensityLevelEmotional = "{{ model.FLAG_DISTRACTION_INTENSITY_LEVEL_EMOTIONAL }}";
|
||||
var flagDistractionIntensityLevelScent = "{{ model.FLAG_DISTRACTION_INTENSITY_LEVEL_SCENT }}";
|
||||
var flagDistractionIntensityLevelSight = "{{ model.FLAG_DISTRACTION_INTENSITY_LEVEL_SIGHT }}";
|
||||
|
||||
Reference in New Issue
Block a user