mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
Improved styling of image in structural entity select
This commit is contained in:
parent
08b60cd149
commit
5ea791eac7
3 changed files with 23 additions and 4 deletions
|
@ -83,7 +83,7 @@ export default class extends Controller {
|
||||||
}
|
}
|
||||||
name += "<b>" + escape(data.text) + "</b>";
|
name += "<b>" + escape(data.text) + "</b>";
|
||||||
|
|
||||||
return '<div>' + (data.image ? "<img style='max-height: 1.5rem; max-width: 2rem; margin-right: 5px;' ' src='" + data.image + "'/>" : "") + name + '</div>';
|
return '<div>' + (data.image ? "<img class='structural-entity-select-image' style='margin-right: 5px;' ' src='" + data.image + "'/>" : "") + name + '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
renderOption(data, escape) {
|
renderOption(data, escape) {
|
||||||
|
@ -117,7 +117,7 @@ export default class extends Controller {
|
||||||
|
|
||||||
let image = "";
|
let image = "";
|
||||||
if (data.image) {
|
if (data.image) {
|
||||||
image = '<img style="max-height: 1.5rem; max-width: 2rem; margin-left: 5px;" src="' + data.image + '"/>';
|
image = '<img class="structural-entity-select-image" style="margin-left: 5px;" src="' + data.image + '"/>';
|
||||||
}
|
}
|
||||||
|
|
||||||
return '<div>' + level_html + escape(data.text) + image + symbol_badge + parent_badge + filter_badge + '</div>';
|
return '<div>' + level_html + escape(data.text) + image + symbol_badge + parent_badge + filter_badge + '</div>';
|
||||||
|
|
|
@ -30,8 +30,20 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.avatar-xs {
|
.avatar-xs {
|
||||||
height: 1.2rem;
|
height: 1.2em;
|
||||||
width: 1.2rem;
|
width: 1.2em;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.entity-image-xs {
|
||||||
|
height: 1.2em;
|
||||||
|
width: 2.0em;
|
||||||
|
object-fit: contain;
|
||||||
|
}
|
||||||
|
|
||||||
|
.structural-entity-select-image {
|
||||||
|
height: 1.5em;
|
||||||
|
max-width: 2.0em;
|
||||||
|
object-fit: contain;
|
||||||
}
|
}
|
|
@ -181,6 +181,13 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
|
{% macro entity_preview_xs(entity) %}
|
||||||
|
{# @var entity \App\Entity\Contracts\HasMasterAttachmentInterface #}
|
||||||
|
{% if entity.masterPictureAttachment and entity.masterPictureAttachment.picture and attachment_manager.fileExisting(entity.masterPictureAttachment) %}
|
||||||
|
<img src="{{ attachment_thumbnail(entity.masterPictureAttachment, 'thumbnail_xs') }}" class="entity-image-xs">
|
||||||
|
{% endif %}
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro parameters_table(parameters) %}
|
{% macro parameters_table(parameters) %}
|
||||||
<table class="table table-hover table-striped table-sm">
|
<table class="table table-hover table-striped table-sm">
|
||||||
<thead>
|
<thead>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue