mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-04-16 19:39:36 +00:00
* Add admin editor for KiCad autocomplete lists * Add custom KiCad autocomplete list settings * Ignore the footprints_custom.txt and symbols_custom.txt in git and create them on the fly if needed Otherwise it breaks the update mechanism * Added comments * Include kicad custom files in config backup command --------- Co-authored-by: Jan Böhmer <mail@jan-boehmer.de>
75 lines
3.7 KiB
Twig
75 lines
3.7 KiB
Twig
{% extends "main_card.html.twig" %}
|
|
{% macro genId(widget) %}{{ widget.vars.full_name }}{% endmacro %}
|
|
|
|
{% form_theme form "form/settings_form.html.twig" %}
|
|
|
|
{% block title %}{% trans %}settings.title{% endtrans %}{% endblock %}
|
|
|
|
{% block card_title %}<i class="fa-solid fa-gears fa-fw"></i> {% trans %}settings.title{% endtrans %}{% endblock %}
|
|
|
|
{% block card_content %}
|
|
{{ form_start(form) }}
|
|
|
|
{# Tabs #}
|
|
<ul class="nav nav-tabs">
|
|
{% for tab_widget in form %}
|
|
{# Create a tab for each compound form #}
|
|
{% if tab_widget.vars.compound ?? false %}
|
|
<li class="nav-item">
|
|
<button type="button" class="nav-link {% if loop.first %}active{% endif %}" aria-current="page" data-bs-toggle="tab"
|
|
id="settings-{{ _self.genId(tab_widget) }}-tab" data-bs-target="#settings-{{ _self.genId(tab_widget) }}-pane"
|
|
>{{ (tab_widget.vars.label ?? tab_widget.vars.name|humanize)|trans }}</button>
|
|
</li>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</ul>
|
|
|
|
{# Panes #}
|
|
<div class="tab-content">
|
|
{% for tab_widget in form %}
|
|
{# Create a tab for each compound form #}
|
|
{% if tab_widget.vars.compound ?? false %}
|
|
<div class="tab-pane fade pt-2 {% if loop.first %}show active{% endif %}" id="settings-{{ _self.genId(tab_widget) }}-pane">
|
|
{{ form_help(tab_widget) }}
|
|
{{ form_errors(tab_widget) }}
|
|
|
|
{% for section_widget in tab_widget %}
|
|
{% set settings_object = section_widget.vars.value %}
|
|
|
|
{% if section_widget.vars.embedded_settings_metadata is defined %} {# Check if we have nested embedded settings or not #}
|
|
<fieldset>
|
|
<legend class="{{ offset_label }}">
|
|
<i class="fa-solid {{ settings_icon(settings_object)|default('fa-sliders') }} fa-fw"></i>
|
|
{{ (section_widget.vars.label ?? section_widget.vars.name|humanize)|trans }}
|
|
</legend>
|
|
<div class="row">
|
|
<div class="{{ offset_label }} col mb-3 ps-2">
|
|
<b>{{ form_help(section_widget) }}</b>
|
|
{{ form_errors(section_widget) }}
|
|
</div>
|
|
</div>
|
|
{{ form_widget(section_widget) }}
|
|
{% if section_widget.vars.name == 'kicadEDA' %}
|
|
<div class="row">
|
|
<div class="{{ offset_label }} col mt-2 ps-2">
|
|
<a href="{{ path('settings_kicad_lists') }}" class="btn btn-outline-secondary btn-sm">
|
|
<i class="fa-solid fa-pen-to-square fa-fw"></i> {% trans %}settings.misc.kicad_eda.editor.link{% endtrans %}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
</fieldset>
|
|
{% if not loop.last %}
|
|
<hr class="mx-0 mb-2 mt-2">
|
|
{% endif %}
|
|
{% else %} {# If not a compound render as normal row #}
|
|
{{ form_row(section_widget) }}
|
|
{% endif %}
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</div>
|
|
|
|
{{ form_end(form) }}
|
|
{% endblock %}
|