This commit is contained in:
Sebastian Almberg 2026-02-25 14:57:28 +13:00 committed by GitHub
commit 489f3213ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 3277 additions and 64 deletions

View file

@ -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>

View 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 %}

View file

@ -14,6 +14,7 @@
<th>{% trans %}specifications.unit{% endtrans %}</th>
<th>{% trans %}specifications.text{% endtrans %}</th>
<th>{% trans %}specifications.group{% endtrans %}</th>
<th title="{% trans %}specifications.eda_visibility.help{% endtrans %}"><i class="fas fa-bolt fa-fw"></i></th>
<th></th>
</tr>
</thead>

View file

@ -33,6 +33,7 @@
{{ form_row(form.supplier_product_url, {'attr': {'class': 'form-control-sm'}}) }}
{{ form_widget(form.obsolete) }}
{{ form_widget(form.pricesIncludesVAT) }}
{{ form_widget(form.eda_visibility) }}
</td>
<td>
<div {{ collection.controller(form.pricedetails, 'pricedetails.edit.delete.confirm') }}>
@ -79,6 +80,9 @@
<td {{ stimulus_controller('pages/latex_preview', {"unit": true}) }}>{{ form_widget(form.unit, {"attr": {"data-pages--parameters-autocomplete-target": "unit", "data-pages--latex-preview-target": "input"}}) }}{{ form_errors(form.unit) }}<span {{ stimulus_target('pages/latex_preview', 'preview') }}></span></td>
<td>{{ form_widget(form.value_text) }}{{ form_errors(form.value_text) }}</td>
<td>{{ form_widget(form.group) }}{{ form_errors(form.group) }}</td>
{% if form.eda_visibility is defined %}
<td class="text-center">{{ form_widget(form.eda_visibility) }}</td>
{% endif %}
<td>
<button type="button" class="btn btn-danger btn-sm order_btn_delete position-relative {% if form.parent.vars.allow_delete is defined and not form.parent.vars.allow_delete %}disabled{% endif %}"
{{ collection.delete_btn() }} title="{% trans %}orderdetail.delete{% endtrans %}">