Part-DB-server/templates/info_providers/search/part_search.html.twig

52 lines
1.9 KiB
Twig

{% 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.providers_list.title{% endtrans %}{% endblock %}
{% block card_title %}
<i class="fas fa-cloud-arrow-down"></i> {% trans %}info_providers.providers_list.title{% endtrans %}
{% endblock %}
{% block card_content %}
{{ form(form) }}
{% if results is not null %}
<table class="table table-striped table-hover">
<thead>
<tr>
<th></th>
<th>Name</th>
<th>Description</th>
<th>Manufactuer</th>
<th>MPN</th>
<th>Status</th>
<th>Provider</th>
<th></th>
</tr>
</thead>
<tbody>
{% for result in results %}
<tr>
<td><img style="width: 40px;" src="{{ result.preview_image_url }}"></td>
<td>{{ result.name }}</td>
<td>{{ result.description }}</td>
<td>{{ result.manufacturer ?? '' }}</td>
<td>{{ result.mpn ?? '' }}</td>
<td>{{ helper.m_status_to_badge(result.manufacturing_status) }}</td>
<td><a href="{{ result.provider_url ?? '#' }}">{{ result.provider_key }}: {{ result.provider_id }}</a></td>
<td>
<a class="btn btn-primary" href="{{ path('info_providers_create_part', {'providerKey': result.provider_key, 'providerId': result.provider_id}) }}" target="_blank">
<i class="fa-solid fa-plus-square"></i>
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% endblock %}