{% macro boolean(value) %} {% if value %} {% trans %}bool.true{% endtrans %} {% else %} {% trans %}bool.false{% endtrans %} {% endif %} {% endmacro %} {% macro array_to_tags(tags, class="badge bg-primary") %} {% for tag in tags %} {{ tag | trim }} {% endfor %} {% endmacro %} {% macro bool_icon(bool) %} {% if bool %} {% else %} {% endif %} {% endmacro %} {% macro boolean_badge(value, class="badge") %} {% if value %} {% set class = class ~ ' bg-success' %} {% else %} {% set class = class ~ ' bg-danger' %} {% endif %} {{ _self.bool_icon(value) }} {{ _self.boolean(value) }} {% endmacro %} {% macro string_to_tags(string, class="badge bg-info") %} {% for tag in string|split(',') %} {{ tag | trim }} {% endfor %} {% endmacro %} {% macro m_status_to_badge(status, class="badge") %} {% if status is enum %} {% set status = status.value %} {% endif %} {% if status is not empty %} {% set color = " bg-secondary" %} {% if status == "active" %} {% set color = " bg-success" %} {% elseif status == "nrfnd" %} {% set color = " bg-warning" %} {% elseif status == "eol" %} {% set color = " bg-warning" %} {% elseif status == "discontinued" %} {% set color = " bg-danger" %} {% endif %} {{ ("m_status." ~ status) | trans }} {% endif %} {% endmacro %} {% macro project_status_to_badge(status, class="badge") %} {% if status is not empty %} {% set color = " bg-secondary" %} {% if status == "in_production" %} {% set color = " bg-success" %} {% endif %} {{ ("project.status." ~ status) | trans }} {% endif %} {% endmacro %} {% macro structural_entity_link(entity, link_type = "list_parts") %} {# @var entity \App\Entity\Base\StructuralDBElement #} {% if entity %}
{% trans %}specifications.property{% endtrans %} | {% trans %}specifications.value{% endtrans %} |
---|---|
{{ param.name }} {% if param.symbol is not empty %}${{ param.symbol }}${% endif %} | {{ param.formattedValue }} |