Added an web page to quickly add a new part from a web URL

This commit is contained in:
Jan Böhmer 2026-02-01 18:18:58 +01:00
parent 722eb7ddab
commit 909cab0044
6 changed files with 124 additions and 5 deletions

View file

@ -10,9 +10,9 @@
<!-- <span class="navbar-toggler-icon"></span> -->
<i class="fas fa-folder-open fa-lg fa-fw"></i>
</button>
{% if is_granted("@tools.label_scanner") %}
{% if is_granted("@tools.label_scanner") %}
<a href="{{ path('scan_dialog') }}" class="navbar-toggler nav-link ms-3">
<i class="fas fa-camera-retro fa-fw"></i>
<i class="fas fa-camera-retro fa-fw"></i>
</a>
{% endif %}
</div>
@ -52,6 +52,14 @@
{% trans %}info_providers.search.title{% endtrans %}
</a>
</li>
{% if settings_instance('generic_web_provider').enabled %}
<li>
<a class="dropdown-item" href="{{ path('info_providers_from_url') }}">
<i class="fa-fw fa-solid fa-book-atlas"></i>
{% trans %}info_providers.from_url.title{% endtrans %}
</a>
</li>
{% endif %}
{% endif %}
{% if is_granted('@parts.import') %}
@ -69,7 +77,7 @@
{% if is_granted('@parts.read') %}
{{ search.search_form("navbar") }}
{# {% include "_navbar_search.html.twig" %} #}
{# {% include "_navbar_search.html.twig" %} #}
{% endif %}
@ -145,4 +153,4 @@
</ul>
</div>
</div>
</nav>
</nav>

View file

@ -0,0 +1,21 @@
{% extends "main_card.html.twig" %}
{% import "info_providers/providers.macro.html.twig" as providers_macro %}
{% import "helper.twig" as helper %}
{% block title %}
{% trans %}info_providers.from_url.title{% endtrans %}
{% endblock %}
{% block card_title %}
<i class="fas fa-book-atlas"></i> {% trans %}info_providers.from_url.title{% endtrans %}
{% endblock %}
{% block card_content %}
<p class="text-muted offset-3">{% trans %}info_providers.from_url.help{% endtrans %}</p>
{{ form_start(form) }}
{{ form_row(form.url) }}
{{ form_row(form.submit) }}
{{ form_end(form) }}
{% endblock %}