mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-25 20:39:31 +00:00
Some checks failed
Build assets artifact / Build assets artifact (push) Has been cancelled
Docker Image Build / docker (push) Has been cancelled
Docker Image Build (FrankenPHP) / docker (push) Has been cancelled
Static analysis / Static analysis (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.2, mysql) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.3, mysql) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.4, mysql) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.5, mysql) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.2, postgres) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.3, postgres) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.4, postgres) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.5, postgres) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.2, sqlite) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.3, sqlite) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.4, sqlite) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.5, sqlite) (push) Has been cancelled
* Benutzerdefinierten Bauteilstatus einführen * PartCustomStateController hinzufügen * Umstellung Migrationen bzgl. Multi-Plattform-Support. Zunächst MySQL, SQLite Statements integrieren. * Postgre Statements integrieren * Semikolon in Migration entfernen * Migration für PartCustomState aktualisieren * Benutzerdefinierten Bauteilstatus in TableSettings aufnehmen * PartCustomStateControllerTest: Attribute für PHPUnit-Gruppen umgestellt * PartCustomState: Mapping für Parameter korrigieren * PartCustomState: Darstellung und Zuordnung von Anhängen ergänzt Die Sidebar wurde um die Anzeige des benutzerdefinierten Bauteilstatus erweitert, inklusive Vorschaubild, sofern vorhanden. * Migrationen zusammenführen * PartCustomState: Anpassungen bzgl. Tests * PartCustomStateEndpoint hinzufügen * Made custom part states plural for consistency with other entity captions * Fixed phpunit error * Fixed phpstan issues --------- Co-authored-by: Marcel Diegelmann <marcel.diegelmann@gmail.com> Co-authored-by: Jan Böhmer <mail@jan-boehmer.de>
95 lines
3.3 KiB
Twig
95 lines
3.3 KiB
Twig
{% import "helper.twig" as helper %}
|
|
|
|
{% if timeTravel is not null %}
|
|
<b class="mb-2">{% trans with {'%timestamp%': timeTravel|format_datetime('short')} %}part.info.timetravel_hint{% endtrans %}</b>
|
|
{% endif %}
|
|
|
|
{% if part.projectBuildPart %}
|
|
<b class="mb-2">{% trans %}part.info.projectBuildPart.hint{% endtrans %}: <a href="{{ entity_url(part.builtProject) }}">{{ part.builtProject.name }}</a></b>
|
|
{% endif %}
|
|
|
|
<div class="mb-3">
|
|
<span class="text-muted" title="{% trans %}lastModified{% endtrans %}">
|
|
<i class="fas fa-history fa-fw"></i> {{ helper.entity_last_modified(part) }}
|
|
</span>
|
|
<br>
|
|
<span class="text-muted mt-1" title="{% trans %}createdAt{% endtrans %}">
|
|
<i class="fas fa-calendar-plus fa-fw"></i> {{ helper.entity_created_at(part) }}
|
|
</span>
|
|
</div>
|
|
|
|
{# Part mass #}
|
|
{% if part.mass %}
|
|
<div>
|
|
<h6>
|
|
<span class="badge bg-secondary" title="{% trans %}part.mass.tooltip{% endtrans %}"><i class="fas fa-weight-hanging fa-fw"></i> {{ part.mass | format_si("g") }}</span>
|
|
</h6>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{# Needs Review tag #}
|
|
{% if part.needsReview %}
|
|
<div class="mt-1">
|
|
<h6>
|
|
<span class="badge bg-warning"><i class="fas fa-ambulance fa-fw"></i> {% trans %}part.needs_review.badge{% endtrans %}</span>
|
|
</h6>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if part.partCustomState is not null %}
|
|
<div class="mt-1">
|
|
<h6>
|
|
<span class="badge bg-primary" title="{% trans %}part_custom_state.caption{% endtrans %}"><i class="fas fa-tools fa-fw"></i> {{ part.partCustomState.name }}</span>
|
|
|
|
{% if part.partCustomState is not null and part.partCustomState.masterPictureAttachment and attachment_manager.fileExisting(part.partCustomState.masterPictureAttachment) %}
|
|
<br/>
|
|
<img class="img-fluid img-thumbnail thumbnail-sm" src="{{ attachment_thumbnail(part.partCustomState.masterPictureAttachment, 'thumbnail_md') }}" alt="{% trans %}attachment.preview.alt{% endtrans %}" />
|
|
{% endif %}
|
|
</h6>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{# Favorite Status tag #}
|
|
{% if part.favorite %}
|
|
<div class="mt-1">
|
|
<h6>
|
|
<span class="badge bg-success"><i class="fas fa-award fa-fw"></i> {% trans %}part.favorite.badge{% endtrans %}</span>
|
|
</h6>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if part.obsolete %}
|
|
<div class="mt-1">
|
|
<h6>
|
|
<span class="badge bg-danger"><i class="fas fa-ghost fa-fw"></i> {% trans %}part.obsolete.badge{% endtrans %}</span>
|
|
</h6>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{# Manufacturing status tag #}
|
|
<div class="mt-1">
|
|
<h6>
|
|
{{ helper.m_status_to_badge(part.manufacturingStatus) }}
|
|
</h6>
|
|
</div>
|
|
|
|
{# Show tags #}
|
|
{% if part.tags is not empty %}
|
|
<div class="mt-1">
|
|
<h6 style="line-height: 1.5;">
|
|
{{ helper.string_to_tags(part.tags) }}
|
|
</h6>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{# Info provider badge #}
|
|
{% if part.providerReference.providerCreated %}
|
|
<div class="mt-1">
|
|
<h6>
|
|
<a href="{{ part.providerReference.providerUrl ?? '#' }}" class="badge bg-info badge-info" title="{% trans %}part.info_provider_reference.badge{% endtrans %}">
|
|
<i class="fa-solid fa-cloud"></i>
|
|
{{ info_provider_label(part.providerReference.providerKey)|default(part.providerReference.providerKey) }}
|
|
</a>
|
|
</h6>
|
|
</div>
|
|
{% endif %}
|