mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 12:20:22 +00:00
Implemented new Userfield type "Link" (references #258)
This commit is contained in:
@@ -20,9 +20,10 @@
|
|||||||
- Equipment improvements/fixes
|
- Equipment improvements/fixes
|
||||||
- Fixed that the delete button not always deleted the currently selected equipment item
|
- Fixed that the delete button not always deleted the currently selected equipment item
|
||||||
- Userfield improvements/fixes
|
- Userfield improvements/fixes
|
||||||
- New userfield type "Select list" for a list of predefined values where a single or also multiple values can then be selected on the entity object
|
- New Userfield type "Select list" for a list of predefined values where a single or also multiple values can then be selected on the entity object
|
||||||
- Fixed that the Userfield type "Preset list" had always the caption "Product group" instead of the configured one (thanks @oncleben31)
|
- New Userfield type "Link" - a single-line-textbox where the content will be rendered as a clickable link
|
||||||
- Userfields of type "checkbox" are rendered as a checkmark in tables when checked (instead of "1" as till now)
|
- Userfields of type "checkbox" are rendered as a checkmark in tables when checked (instead of "1" as till now)
|
||||||
|
- Fixed that the Userfield type "Preset list" had always the caption "Product group" instead of the configured one (thanks @oncleben31)
|
||||||
- General improvements/fixes
|
- General improvements/fixes
|
||||||
- Improved the handling which entry page to use with disabled feature flags (thanks @nielstholenaar)
|
- Improved the handling which entry page to use with disabled feature flags (thanks @nielstholenaar)
|
||||||
- Boolean settings provided via environment variables (so the strings `true` and `false`) are now parsed correctly (thanks @mduret)
|
- Boolean settings provided via environment variables (so the strings `true` and `false`) are now parsed correctly (thanks @mduret)
|
||||||
|
@@ -38,3 +38,6 @@ msgstr "Select list (a single item can be selected)"
|
|||||||
|
|
||||||
msgid "preset-checklist"
|
msgid "preset-checklist"
|
||||||
msgstr "Select list (multiple items can be selected)"
|
msgstr "Select list (multiple items can be selected)"
|
||||||
|
|
||||||
|
msgid "link"
|
||||||
|
msgstr "Link"
|
||||||
|
@@ -38,3 +38,6 @@ msgstr ""
|
|||||||
|
|
||||||
msgid "preset-checklist"
|
msgid "preset-checklist"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "link"
|
||||||
|
msgstr ""
|
||||||
|
@@ -13,6 +13,7 @@ class UserfieldsService extends BaseService
|
|||||||
const USERFIELD_TYPE_CHECKBOX = 'checkbox';
|
const USERFIELD_TYPE_CHECKBOX = 'checkbox';
|
||||||
const USERFIELD_TYPE_PRESET_LIST = 'preset-list';
|
const USERFIELD_TYPE_PRESET_LIST = 'preset-list';
|
||||||
const USERFIELD_TYPE_PRESET_CHECKLIST = 'preset-checklist';
|
const USERFIELD_TYPE_PRESET_CHECKLIST = 'preset-checklist';
|
||||||
|
const USERFIELD_TYPE_LINK = 'link';
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
@@ -10,6 +10,8 @@
|
|||||||
@if($userfieldObject->value == 1)<i class="fas fa-check"></i>@endif
|
@if($userfieldObject->value == 1)<i class="fas fa-check"></i>@endif
|
||||||
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_PRESET_CHECKLIST)
|
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_PRESET_CHECKLIST)
|
||||||
{!! str_replace(',', '<br>', $userfieldObject->value) !!}
|
{!! str_replace(',', '<br>', $userfieldObject->value) !!}
|
||||||
|
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_LINK)
|
||||||
|
<a href="{{ $userfieldObject->value }}" target="_blank">{{ $userfieldObject->value }}</a>
|
||||||
@else
|
@else
|
||||||
{{ $userfieldObject->value }}
|
{{ $userfieldObject->value }}
|
||||||
@endif
|
@endif
|
||||||
|
@@ -93,6 +93,11 @@
|
|||||||
@endforeach
|
@endforeach
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_LINK)
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="name">{{ $userfield->caption }}</label>
|
||||||
|
<input type="link" class="form-control userfield-input" data-userfield-name="{{ $userfield->name }}">
|
||||||
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@endforeach
|
@endforeach
|
||||||
|
Reference in New Issue
Block a user