mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 09:35:49 +02:00
Show mount names as comma separated tags
This commit is contained in:
parent
b074095038
commit
b1ed52bcc3
3 changed files with 20 additions and 2 deletions
|
@ -76,7 +76,7 @@ class ProjectBomEntriesDataTable implements DataTableTypeInterface
|
||||||
])
|
])
|
||||||
|
|
||||||
->add('quantity', TextColumn::class, [
|
->add('quantity', TextColumn::class, [
|
||||||
'label' => $this->translator->trans('project.bom.quantity'),
|
'label' => $this->translator->trans('project.bom.quantity'),
|
||||||
'className' => 'text-center',
|
'className' => 'text-center',
|
||||||
'render' => function ($value, ProjectBOMEntry $context) {
|
'render' => function ($value, ProjectBOMEntry $context) {
|
||||||
//If we have a non-part entry, only show the rounded quantity
|
//If we have a non-part entry, only show the rounded quantity
|
||||||
|
@ -132,7 +132,15 @@ class ProjectBomEntriesDataTable implements DataTableTypeInterface
|
||||||
])
|
])
|
||||||
|
|
||||||
->add('mountnames', TextColumn::class, [
|
->add('mountnames', TextColumn::class, [
|
||||||
|
'label' => 'project.bom.mountnames',
|
||||||
|
'render' => function ($value, ProjectBOMEntry $context) {
|
||||||
|
$html = '';
|
||||||
|
|
||||||
|
foreach (explode(',', $context->getMountnames()) as $mountname) {
|
||||||
|
$html .= sprintf('<span class="badge badge-secondary bg-secondary">%s</span> ', htmlspecialchars($mountname));
|
||||||
|
}
|
||||||
|
return $html;
|
||||||
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{% import "components/attachments.macro.html.twig" as attachments %}
|
{% import "components/attachments.macro.html.twig" as attachments %}
|
||||||
|
{% import "helper.twig" as helper %}
|
||||||
|
|
||||||
<table class="table table-striped table-sm table-hover table-responsive-sm">
|
<table class="table table-striped table-sm table-hover table-responsive-sm">
|
||||||
<thead>
|
<thead>
|
||||||
|
@ -13,12 +14,15 @@
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for bom_entry in part.projectBomEntries %}
|
{% for bom_entry in part.projectBomEntries %}
|
||||||
|
{# @var bom_entry App\Entity\Project\ProjectBOMEntry #}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{% if bom_entry.project.masterPictureAttachment is not null %}{{ attachments.attachment_icon(bom_entry.project.masterPictureAttachment, attachment_manager) }}{% endif %}</td>
|
<td>{% if bom_entry.project.masterPictureAttachment is not null %}{{ attachments.attachment_icon(bom_entry.project.masterPictureAttachment, attachment_manager) }}{% endif %}</td>
|
||||||
<td><a href="{{ url('project_info', {'id': bom_entry.project.iD}) }}">{{ bom_entry.project.name }}</a></td> {# Name #}
|
<td><a href="{{ url('project_info', {'id': bom_entry.project.iD}) }}">{{ bom_entry.project.name }}</a></td> {# Name #}
|
||||||
<td>{{ bom_entry.project.description|format_markdown }}</td> {# Description #}
|
<td>{{ bom_entry.project.description|format_markdown }}</td> {# Description #}
|
||||||
<td>{{ bom_entry.quantity | format_amount(part.partUnit) }}</td>
|
<td>{{ bom_entry.quantity | format_amount(part.partUnit) }}</td>
|
||||||
<td>{{ bom_entry.mountnames }}</td>
|
<td>{% for tag in bom_entry.mountnames|split(',') %}
|
||||||
|
<span class="badge bg-secondary badge-secondary" >{{ tag | trim }}</span>
|
||||||
|
{% endfor %}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
|
|
@ -9953,5 +9953,11 @@ Element 3</target>
|
||||||
<target>BOM Qty.</target>
|
<target>BOM Qty.</target>
|
||||||
</segment>
|
</segment>
|
||||||
</unit>
|
</unit>
|
||||||
|
<unit id="gqYIO6x" name="project.bom.mountnames">
|
||||||
|
<segment>
|
||||||
|
<source>project.bom.mountnames</source>
|
||||||
|
<target>Mount names</target>
|
||||||
|
</segment>
|
||||||
|
</unit>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue