mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-18 16:19:34 +00:00
Merge remote-tracking branch 'origin/feature/custom-part-status' into feature/all-features
This commit is contained in:
commit
697b3a73cd
3 changed files with 16 additions and 8 deletions
|
|
@ -31,6 +31,7 @@ use App\Entity\Attachments\AttachmentUpload;
|
||||||
use App\Entity\Attachments\CategoryAttachment;
|
use App\Entity\Attachments\CategoryAttachment;
|
||||||
use App\Entity\Attachments\CurrencyAttachment;
|
use App\Entity\Attachments\CurrencyAttachment;
|
||||||
use App\Entity\Attachments\LabelAttachment;
|
use App\Entity\Attachments\LabelAttachment;
|
||||||
|
use App\Entity\Attachments\PartCustomStateAttachment;
|
||||||
use App\Entity\Attachments\ProjectAttachment;
|
use App\Entity\Attachments\ProjectAttachment;
|
||||||
use App\Entity\Attachments\FootprintAttachment;
|
use App\Entity\Attachments\FootprintAttachment;
|
||||||
use App\Entity\Attachments\GroupAttachment;
|
use App\Entity\Attachments\GroupAttachment;
|
||||||
|
|
@ -81,6 +82,7 @@ class AttachmentSubmitHandler
|
||||||
//The mapping used to determine which folder will be used for an attachment type
|
//The mapping used to determine which folder will be used for an attachment type
|
||||||
$this->folder_mapping = [
|
$this->folder_mapping = [
|
||||||
PartAttachment::class => 'part',
|
PartAttachment::class => 'part',
|
||||||
|
PartCustomStateAttachment::class => 'part_custom_state',
|
||||||
AttachmentTypeAttachment::class => 'attachment_type',
|
AttachmentTypeAttachment::class => 'attachment_type',
|
||||||
CategoryAttachment::class => 'category',
|
CategoryAttachment::class => 'category',
|
||||||
CurrencyAttachment::class => 'currency',
|
CurrencyAttachment::class => 'currency',
|
||||||
|
|
|
||||||
|
|
@ -104,13 +104,6 @@ class PartPreviewGenerator
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($part->getPartCustomState() instanceof PartCustomState) {
|
|
||||||
$attachment = $part->getPartCustomState()->getMasterPictureAttachment();
|
|
||||||
if ($this->isAttachmentValidPicture($attachment)) {
|
|
||||||
$list[] = $attachment;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($part->getManufacturer() instanceof Manufacturer) {
|
if ($part->getManufacturer() instanceof Manufacturer) {
|
||||||
$attachment = $part->getManufacturer()->getMasterPictureAttachment();
|
$attachment = $part->getManufacturer()->getMasterPictureAttachment();
|
||||||
if ($this->isAttachmentValidPicture($attachment)) {
|
if ($this->isAttachmentValidPicture($attachment)) {
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,19 @@
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% 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 #}
|
{# Favorite Status tag #}
|
||||||
{% if part.favorite %}
|
{% if part.favorite %}
|
||||||
<div class="mt-1">
|
<div class="mt-1">
|
||||||
|
|
@ -79,4 +92,4 @@
|
||||||
</a>
|
</a>
|
||||||
</h6>
|
</h6>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue