mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-04-19 04:49:36 +00:00
Add batch EDA field editing from parts table
Users can now select multiple parts in any parts table and batch-edit their EDA/KiCad fields (symbol, footprint, reference prefix, value, visibility, exclude from BOM/board/sim). Each field has an "Apply" checkbox so users control exactly which fields are changed.
This commit is contained in:
parent
078f04fe67
commit
f314578790
6 changed files with 385 additions and 0 deletions
|
|
@ -62,6 +62,9 @@
|
|||
<option {% if not is_granted('@projects.read') %}disabled{% endif %} value="add_to_project" data-url="{{ path('select_project')}}">{% trans %}part_list.action.projects.add_to_project{% endtrans %}</option>
|
||||
</optgroup>
|
||||
|
||||
<optgroup label="{% trans %}part_list.action.group.eda{% endtrans %}">
|
||||
<option {% if not is_granted('@parts.edit') %}disabled{% endif %} value="batch_edit_eda" data-turbo="false">{% trans %}part_list.action.batch_edit_eda{% endtrans %}</option>
|
||||
</optgroup>
|
||||
<optgroup label="{% trans %}part_list.action.action.delete{% endtrans %}">
|
||||
<option {% if not is_granted('@parts.delete') %}disabled{% endif %} value="delete">{% trans %}part_list.action.action.delete{% endtrans %}</option>
|
||||
</optgroup>
|
||||
|
|
|
|||
88
templates/parts/batch_eda_edit.html.twig
Normal file
88
templates/parts/batch_eda_edit.html.twig
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
{% extends "main_card.html.twig" %}
|
||||
|
||||
{% block title %}{% trans %}batch_eda.title{% endtrans %}{% endblock %}
|
||||
|
||||
{% block card_title %}
|
||||
<i class="fas fa-bolt"></i> {% trans %}batch_eda.title{% endtrans %}
|
||||
{% endblock %}
|
||||
|
||||
{% block card_content %}
|
||||
<div class="mb-3">
|
||||
<p>{% trans with {'%count%': parts|length} %}batch_eda.description{% endtrans %}</p>
|
||||
<details>
|
||||
<summary>{% trans %}batch_eda.show_parts{% endtrans %}</summary>
|
||||
<ul class="list-unstyled ms-3 mt-1">
|
||||
{% for part in parts %}
|
||||
<li><a href="{{ path('part_edit', {id: part.id}) }}">{{ part.name }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</details>
|
||||
</div>
|
||||
|
||||
{{ form_start(form) }}
|
||||
|
||||
<p class="text-muted small">{% trans %}batch_eda.apply_hint{% endtrans %}</p>
|
||||
|
||||
<table class="table table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30px;">{% trans %}batch_eda.apply{% endtrans %}</th>
|
||||
<th>{% trans %}batch_eda.field{% endtrans %}</th>
|
||||
<th>{% trans %}batch_eda.value{% endtrans %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-center align-middle">{{ form_widget(form.apply_reference_prefix) }}</td>
|
||||
<td class="align-middle">{{ form_label(form.reference_prefix) }}</td>
|
||||
<td>{{ form_widget(form.reference_prefix, {'attr': {'class': 'form-control-sm'}}) }}{{ form_errors(form.reference_prefix) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-center align-middle">{{ form_widget(form.apply_value) }}</td>
|
||||
<td class="align-middle">{{ form_label(form.value) }}</td>
|
||||
<td>{{ form_widget(form.value, {'attr': {'class': 'form-control-sm'}}) }}{{ form_errors(form.value) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-center align-middle">{{ form_widget(form.apply_kicad_symbol) }}</td>
|
||||
<td class="align-middle">{{ form_label(form.kicad_symbol) }}</td>
|
||||
<td>{{ form_widget(form.kicad_symbol) }}{{ form_errors(form.kicad_symbol) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-center align-middle">{{ form_widget(form.apply_kicad_footprint) }}</td>
|
||||
<td class="align-middle">{{ form_label(form.kicad_footprint) }}</td>
|
||||
<td>{{ form_widget(form.kicad_footprint) }}{{ form_errors(form.kicad_footprint) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-center align-middle">{{ form_widget(form.apply_visibility) }}</td>
|
||||
<td class="align-middle">{{ form_label(form.visibility) }}</td>
|
||||
<td>{{ form_widget(form.visibility) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-center align-middle">{{ form_widget(form.apply_exclude_from_bom) }}</td>
|
||||
<td class="align-middle">{{ form_label(form.exclude_from_bom) }}</td>
|
||||
<td>{{ form_widget(form.exclude_from_bom) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-center align-middle">{{ form_widget(form.apply_exclude_from_board) }}</td>
|
||||
<td class="align-middle">{{ form_label(form.exclude_from_board) }}</td>
|
||||
<td>{{ form_widget(form.exclude_from_board) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-center align-middle">{{ form_widget(form.apply_exclude_from_sim) }}</td>
|
||||
<td class="align-middle">{{ form_label(form.exclude_from_sim) }}</td>
|
||||
<td>{{ form_widget(form.exclude_from_sim) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="d-flex justify-content-between">
|
||||
{% if redirect_url %}
|
||||
<a href="{{ redirect_url }}" class="btn btn-secondary">{% trans %}batch_eda.cancel{% endtrans %}</a>
|
||||
{% else %}
|
||||
<a href="{{ path('parts_show_all') }}" class="btn btn-secondary">{% trans %}batch_eda.cancel{% endtrans %}</a>
|
||||
{% endif %}
|
||||
{{ form_widget(form.submit) }}
|
||||
</div>
|
||||
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue