mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-03 09:44:41 +02:00
Improved styling of the BOM edit
This commit is contained in:
parent
b83b55b8d4
commit
a3ee51e76b
6 changed files with 66 additions and 11 deletions
|
@ -25,18 +25,28 @@
|
|||
{% form_theme form.bom_entries with ['Form/collection_types_layout.html.twig'] %}
|
||||
|
||||
{% import 'components/collection_type.macro.html.twig' as collection %}
|
||||
<div {{ collection.controller(form.bom_entries, 'attachment.edit.delete.confirm') }}>
|
||||
<table class="table table-striped table-sm" {{ collection.target() }}>
|
||||
<div {{ collection.controller(form.bom_entries, 'project.bom.delete.confirm') }}>
|
||||
<table class="table table-striped table-bordered table-sm" {{ collection.target() }}>
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th> {# expand button #}
|
||||
<th>{% trans %}project.bom.quantity{% endtrans %}</th>
|
||||
<th>{% trans %}project.bom.part{% endtrans %}</th>
|
||||
<th>{% trans %}project.bom.name{% endtrans %}</th>
|
||||
<th></th> {# Remove button #}
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{% for attachment in form.bom_entries %}
|
||||
{{ form_widget(attachment) }}
|
||||
{% for entry in form.bom_entries %}
|
||||
{{ form_widget(entry) }}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<button type="button" class="btn btn-success" {{ collection.create_btn() }}>
|
||||
<button type="button" class="btn btn-success mb-2" {{ collection.create_btn() }}>
|
||||
<i class="fas fa-plus-square fa-fw"></i>
|
||||
{% trans %}attachment.create{% endtrans %}
|
||||
{% trans %}project.bom.add_entry{% endtrans %}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,15 +1,39 @@
|
|||
{% block project_bom_entry_widget %}
|
||||
{% set target_id = 'expand_row-' ~ random() %}
|
||||
|
||||
{% import 'components/collection_type.macro.html.twig' as collection %}
|
||||
<tr>
|
||||
<td>
|
||||
{{ form_widget(form) }}
|
||||
<button class="btn btn-sm btn-outline-secondary" type="button" data-bs-toggle="collapse" data-bs-target="#{{ target_id }}">
|
||||
<i class="fa-solid fa-eye"></i>
|
||||
</button>
|
||||
</td>
|
||||
<td>
|
||||
{{ form_errors(form.quantity) }}
|
||||
{{ form_widget(form.quantity) }}
|
||||
</td>
|
||||
<td style="min-width: 250px;">
|
||||
{{ form_errors(form.part) }}
|
||||
{{ form_widget(form.part) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ form_errors(form.name) }}
|
||||
{{ form_widget(form.name) }}
|
||||
</td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-danger lot_btn_delete" {{ collection.delete_btn() }}>
|
||||
<i class="fas fa-trash-alt fa-fw"></i>
|
||||
{% trans %}part_lot.delete{% endtrans %}
|
||||
</button>
|
||||
{{ form_errors(form) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="p-0 d-none"></tr>
|
||||
<tr class="p-0">
|
||||
<td colspan="5" class="accordion-body collapse" id="{{ target_id }}">
|
||||
<div class="">
|
||||
{{ form_row(form.mountnames) }}
|
||||
{{ form_row(form.comment) }}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endblock %}
|
|
@ -41,7 +41,7 @@
|
|||
<div class="input-group {% if sm %}input-group-sm{% endif %}">
|
||||
{{ form_widget(form.value) }}
|
||||
{% if form.prefix is defined %}
|
||||
{{ form_widget(form.prefix, {'attr': {'class': 'form-select'}}) }}
|
||||
{{ form_widget(form.prefix, {'attr': {'class': '', 'style': 'max-width: 40px;'}}) }}
|
||||
{% endif %}
|
||||
{% if unit is not empty %}
|
||||
<label class="input-group-text">{{ unit }}</label>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue