mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-25 20:39:31 +00:00
Added a part info tab to show in which projects the part is used.
This commit is contained in:
parent
d5b1c6be0a
commit
7f38095e82
4 changed files with 64 additions and 5 deletions
26
templates/Parts/info/_projects.html.twig
Normal file
26
templates/Parts/info/_projects.html.twig
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{% import "components/attachments.macro.html.twig" as attachments %}
|
||||
|
||||
<table class="table table-striped table-sm table-hover table-responsive-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>{% trans %}entity.info.name{% endtrans %}</th>
|
||||
<th>{% trans %}description.label{% endtrans %}</th>
|
||||
<th>{% trans %}project.bom.quantity{% endtrans %}</th>
|
||||
<th>{% trans %}project.bom.mountnames{% endtrans %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{% for bom_entry in part.projectBomEntries %}
|
||||
<tr>
|
||||
<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>{{ bom_entry.project.description|format_markdown }}</td> {# Description #}
|
||||
<td>{{ bom_entry.quantity | format_amount(part.partUnit) }}</td>
|
||||
<td>{{ bom_entry.mountnames }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
Loading…
Add table
Add a link
Reference in a new issue