{% macro boolean(value) %} {% if value %} {% trans %}bool.true{% endtrans %} {% else %} {% trans %}bool.false{% endtrans %} {% endif %} {% endmacro %} {% macro attachment_icon(attachment, attachment_helper, class = "fa-fw fas fa-3x", link = true) %} {% set disabled = attachment.secure and not is_granted("show_secure", attachment) %} {% if not attachment_helper or attachment_helper.fileExisting(attachment) %} {% if link and not disabled %} {% endif %} {% if attachment.picture %} {% else %} {% endif %} {% if link and not disabled %} {% endif %} {% elseif not attachment_helper.fileExisting(attachment) %} {% endif %} {% endmacro %} {% macro string_to_tags(string, class="badge badge-info") %} {% for tag in string|split(',') %} {{ tag | trim }} {% endfor %} {% endmacro %} {% macro m_status_to_badge(status, class="badge") %} {% if status is not empty %} {% set color = " badge-secondary" %} {% if status == "active" %} {% set color = " badge-success" %} {% elseif status == "nrfnd" %} {% set color = " badge-warning" %} {% elseif status == "eol" %} {% set color = " badge-warning" %} {% elseif status == "discontinued" %} {% set color = " badge-danger" %} {% endif %} {{ ("m_status." ~ status) | trans }} {% endif %} {% endmacro %} {% macro structural_entity_link(entity, link_type = "list_parts") %} {# @var entity \App\Entity\Base\StructuralDBElement #} {% if entity %} {% else %} - {% endif %} {% endmacro %} {% macro breadcrumb_entity_link(entity, link_type = "list_parts") %} {% endmacro %} {% macro bool_icon(bool) %} {% if bool %} {% else %} {% endif %} {% endmacro %} {% macro date_user_combination(entity, lastModified, datetime_format = "short") %} {% if lastModified == true %} {{ entity.lastModified | format_datetime(datetime_format) }} {% else %} {{ entity.addedDate | format_datetime(datetime_format) }} {% endif %} {% if is_granted('show_users', entity) %} {% if lastModified == true %} {% set user = getLastEditingUser(entity) %} {% else %} {% set user = getCreatingUser(entity) %} {% endif %} {% if user is not null %} {% if user.fullName is not empty %} ({{ user.fullName }}) {% else %} (@{{ user.name }}) {% endif %} {% endif %} {% endif %} {% endmacro %} {% macro parameters_table(parameters) %} {% for param in parameters %} {% endfor %}
{% trans %}specifications.property{% endtrans %} {% trans %}specifications.value{% endtrans %}
{{ param.name }} {% if param.symbol is not empty %}${{ param.symbol }}${% endif %} {{ param.formattedValue }}
{% endmacro parameters_table %}