{%- set all_measurements = table_device_measurements.query.filter( and_(table_device_measurements.device_id == each_math.unique_id, table_device_measurements.is_enabled)).all() -%} {%- if all_measurements %} {% for each_measurement in all_measurements %}
{{form_mod_math_measurement.csrf_token}} {{form_mod_math_measurement.math_id(value=each_math.unique_id)}} {{form_mod_math_measurement.math_measurement_id(value=each_measurement.unique_id)}}
{{form_mod_math_measurement.math_measurement_mod(class_='form-control btn btn-sm btn-block')}}
{%- set conversion = table_conversion.query.filter(table_conversion.unique_id == each_measurement.conversion_id).first() -%} {% if conversion %}
{% elif rescaled_measurement and rescaled_unit %}
{% elif each_measurement.measurement and each_measurement.unit %}
{% elif each_measurement.unit %}
{% else %}
{% endif %}
{{form_mod_math_measurement.name.label(class_='control-label')}}
{{form_mod_math_measurement.name(class_='form-control', value=each_measurement.name, **{'title': dict_translation['name']['phrase']})}}
{% if 'enable_measurements_select' in math_info[each_math.math_type] and math_info[each_math.math_type]['enable_measurements_select'] %}
{{form_mod_math_measurement.select_measurement_unit.label(class_='control-label')}}
{% endif %} {% if 'enable_measurements_convert' in math_info[each_math.math_type] and math_info[each_math.math_type]['enable_measurements_convert'] %}
{{form_mod_math_measurement.convert_to_measurement_unit.label(class_='control-label')}}
{% endif %}
{% endfor %} {% endif %}