mirror of
https://github.com/grocy/grocy.git
synced 2025-10-14 17:24:07 +00:00
Make it possible to add multiple files / PDFs to equipment by using Userfields (closes #978)
This commit is contained in:
@@ -1,7 +1,18 @@
|
||||
@php
|
||||
if (!isset($excludeFieldTypes))
|
||||
{
|
||||
$excludeFieldTypes = [];
|
||||
}
|
||||
@endphp
|
||||
|
||||
@if($userfields && count($userfields) > 0)
|
||||
|
||||
@foreach($userfields as $userfield)
|
||||
|
||||
@if(in_array($userfield->type, $excludeFieldTypes))
|
||||
@continue
|
||||
@endif
|
||||
|
||||
@if($userfield->show_as_column_in_tables == 1)
|
||||
@php $userfieldObject = FindObjectInArrayByPropertyValue($userfieldValues, 'name', $userfield->name) @endphp
|
||||
<td>
|
||||
@@ -26,10 +37,10 @@
|
||||
@endphp
|
||||
<a href="{{ $link }}"
|
||||
target="_blank">{{ $title }}</a>
|
||||
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_FILE)
|
||||
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_FILE && !empty($userfieldObject->value))
|
||||
<a href="{{ $U('/files/userfiles/'. $userfieldObject->value) }}"
|
||||
target="_blank">{{ base64_decode(explode('_', $userfieldObject->value)[1]) }}</a>
|
||||
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_IMAGE)
|
||||
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_IMAGE && !empty($userfieldObject->value))
|
||||
<a class="show-as-dialog-link"
|
||||
href="{{ $U('/files/userfiles/'. $userfieldObject->value . '?force_serve_as=picture') }}">
|
||||
<img src="{{ $U('/files/userfiles/'. $userfieldObject->value . '?force_serve_as=picture&best_fit_width=32&best_fit_height=32') }}"
|
||||
|
@@ -1,7 +1,18 @@
|
||||
@php
|
||||
if (!isset($excludeFieldTypes))
|
||||
{
|
||||
$excludeFieldTypes = [];
|
||||
}
|
||||
@endphp
|
||||
|
||||
@if($userfields && count($userfields) > 0)
|
||||
|
||||
@foreach($userfields as $userfield)
|
||||
|
||||
@if(in_array($userfield->type, $excludeFieldTypes))
|
||||
@continue
|
||||
@endif
|
||||
|
||||
@if($userfield->show_as_column_in_tables == 1)
|
||||
<th class="allow-grouping">{{ $userfield->caption }}</th>
|
||||
@endif
|
||||
|
@@ -176,7 +176,7 @@
|
||||
<div class="input-group-append">
|
||||
<a href="#"
|
||||
target="_blank"
|
||||
class="input-group-text userfield-file-show d-none"><i class="fas fa-eye"></i></a>
|
||||
class="input-group-text userfield-file-show d-none discrete-link"><i class="fas fa-eye"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -201,7 +201,7 @@
|
||||
</div>
|
||||
<img src=""
|
||||
alt="{{ $userfield->name }}"
|
||||
class="userfield-current-file userfield-file-show d-none lazy mt-1"
|
||||
class="userfield-current-file userfield-file-show d-none lazy mt-1 discrete-link"
|
||||
data-uf-name="{{ $userfield->name }}" />
|
||||
</div>
|
||||
@endif
|
||||
|
Reference in New Issue
Block a user