fix table with handling, icons implemented
This commit is contained in:
@@ -73,7 +73,22 @@
|
||||
</div>
|
||||
|
||||
<div class="detail">
|
||||
<div>{% if asset.image_path %}<img class="asset-image" src="{{ asset.image_path }}">{% elif asset.category.image_path %}<img class="asset-image" src="{{ asset.category.image_path }}">{% endif %}</div>
|
||||
<div>
|
||||
{% set visual_source = asset.visual_source or 'auto' %}
|
||||
{% if visual_source == 'asset_image' %}
|
||||
{% if asset.image_path %}<img class="asset-image" src="{{ asset.image_path }}">{% endif %}
|
||||
{% elif visual_source == 'category_image' %}
|
||||
{% if asset.category.image_path %}<img class="asset-image" src="{{ asset.category.image_path }}">{% endif %}
|
||||
{% elif visual_source == 'mesh_icon' %}
|
||||
{% if asset.mesh_icon and asset.mesh_icon >= 1 and asset.mesh_icon <= 8 %}<img class="asset-image meshcentral-device-icon" src="/static/img/meshcentral-device-icons/icons256-{{ asset.mesh_icon }}-1.png" alt="">{% endif %}
|
||||
{% elif asset.image_path %}
|
||||
<img class="asset-image" src="{{ asset.image_path }}">
|
||||
{% elif asset.category.image_path %}
|
||||
<img class="asset-image" src="{{ asset.category.image_path }}">
|
||||
{% elif asset.mesh_icon and asset.mesh_icon >= 1 and asset.mesh_icon <= 8 %}
|
||||
<img class="asset-image meshcentral-device-icon" src="/static/img/meshcentral-device-icons/icons256-{{ asset.mesh_icon }}-1.png" alt="">
|
||||
{% endif %}
|
||||
</div>
|
||||
<dl>{% for f in active_fields %}{% if f.field_name not in ['room_number', 'parent_asset_id'] %}{% set d=f.definition %}{% set v=custom_values.get(f.field_name) if d and not d.is_system else asset|attr(f.field_name) %}{% if v %}<dt>{{ t(d.translation_key, d.label) if d else f.label }}</dt><dd>{{ v }}</dd>{% endif %}{% endif %}{% endfor %}{% if asset.room_number %}<dt>{{ t('assets.room') }}</dt><dd>{{ asset.room_number }}</dd>{% endif %}
|
||||
{% if parent_asset %}<dt>{{ t('assets.parent') }}</dt><dd><a href="/assets/{{ parent_asset.id }}">{{ parent_asset.name }}</a></dd>{% endif %}
|
||||
{% if child_assets %}<dt>{{ t('assets.child_assets') }}</dt><dd>{% for child in child_assets %}<a href="/assets/{{ child.id }}">{{ child.name }}</a>{% if not loop.last %}, {% endif %}{% endfor %}</dd>{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user