From a4b93d4bbd8b2f4729b79a7d598ce3f233c578d1 Mon Sep 17 00:00:00 2001 From: Cram42 Date: Thu, 10 Nov 2022 19:20:18 +0800 Subject: [PATCH] Create Field Definitions helper control --- resources/lang/en/admin/settings/general.php | 7 +- .../label2-field-definitions.blade.php | 337 ++++++++++++++++++ resources/views/settings/labels.blade.php | 12 +- 3 files changed, 343 insertions(+), 13 deletions(-) create mode 100644 resources/views/partials/label2-field-definitions.blade.php diff --git a/resources/lang/en/admin/settings/general.php b/resources/lang/en/admin/settings/general.php index e969dd93c..fe69275c1 100644 --- a/resources/lang/en/admin/settings/general.php +++ b/resources/lang/en/admin/settings/general.php @@ -336,11 +336,8 @@ return [ 'label2_2d_type_help' => 'Format for 2D barcodes', 'label2_2d_target' => '2D Barcode Target', 'label2_2d_target_help' => 'The URL the 2D barcode points to when scanned', - 'label2_fields' => 'Fields Definition', - 'label2_fields_help' => 'Fields to show on the label in the format Label=asset_field', - 'label2_fields_help_semi' => 'Use ; to separate fields', - 'label2_fields_help_pipe' => 'Use | to allow multiple options in each field. For example Name=name|Nickname=_snipeit_my_custom_field_2 will use name if a value is set, otherwise it will use _snipeit_my_custom_field_2. This is useful to ensure field order', - 'label2_fields_help_once' => 'Each field will only be selected once per label', + 'label2_fields' => 'Field Definitions', + 'label2_fields_help' => 'Fields can be added, removed, and reordered in the left column. For each field, multiple options for Label and DataSource can be added, removed, and reordered in the right column.', 'help_asterisk_bold' => 'Text entered as **text** will be displayed as bold', 'help_blank_to_use' => 'Leave blank to use the value from :setting_name', diff --git a/resources/views/partials/label2-field-definitions.blade.php b/resources/views/partials/label2-field-definitions.blade.php new file mode 100644 index 000000000..ebd29ffe0 --- /dev/null +++ b/resources/views/partials/label2-field-definitions.blade.php @@ -0,0 +1,337 @@ +@once + @push('js') + + @endpush + @push('css') + + @endpush +@endonce + +@push('js') + +@endpush +@php + $selector = '[x-data="'.$name.'"]'; +@endphp +@push('css') + +@endpush + +
+ +
+

Fields

+
+ +
+
+ + + + +
+ +

Options

+
+ + +
+
+ + + + +
+
+
\ No newline at end of file diff --git a/resources/views/settings/labels.blade.php b/resources/views/settings/labels.blade.php index a6163a7b1..1209f6df7 100644 --- a/resources/views/settings/labels.blade.php +++ b/resources/views/settings/labels.blade.php @@ -21,6 +21,7 @@