Skip to content

Commit 5f56145

Browse files
authored
Merge pull request #16298 from uberbrady/tooltips_custom_fields
Add tooltips to custom fields display, especially for icons
2 parents 9b44dfd + cbe04e8 commit 5f56145

File tree

2 files changed

+35
-7
lines changed

2 files changed

+35
-7
lines changed

resources/lang/en-US/admin/custom_fields/general.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
'create_field_title' => 'Create a new custom field',
3636
'value_encrypted' => 'The value of this field is encrypted in the database. Only admin users will be able to view the decrypted value',
3737
'show_in_email' => 'Include the value of this field in checkout emails sent to the user? Encrypted fields cannot be included in emails',
38-
'show_in_email_short' => 'Include in emails.',
38+
'show_in_email_short' => 'Include in emails',
3939
'help_text' => 'Help Text',
4040
'help_text_description' => 'This is optional text that will appear below the form elements while editing an asset to provide context on the field.',
4141
'about_custom_fields_title' => 'About Custom Fields',

resources/views/custom_fields/index.blade.php

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,16 +150,34 @@ class="table table-striped snipe-table"
150150
<th data-sortable="true" data-searchable="true">{{ trans('admin/custom_fields/general.unique') }}</th>
151151
<th data-sortable="true" data-visible="false">{{ trans('admin/custom_fields/general.db_field') }}</th>
152152
<th data-sortable="true" data-searchable="true">{{ trans('admin/custom_fields/general.field_format') }}</th>
153-
<th data-sortable="true"><i class="fa fa-lock" aria-hidden="true"></i>
153+
<th data-sortable="true" data-tooltip="{{ trans('admin/custom_fields/general.encrypted') }}"><i
154+
class="fa fa-lock" aria-hidden="true"></i>
154155
<span class="hidden-xs hidden-sm hidden-md hidden-lg">{{ trans('admin/custom_fields/general.encrypted') }}</span>
155156
</th>
156-
<th data-sortable="true" class="text-center"><i class="fa fa-list" aria-hidden="true"></i>
157+
<th data-sortable="true" class="text-center"
158+
data-tooltip="{{ trans('admin/custom_fields/general.show_in_listview_short') }}"><i class="fa fa-list"
159+
aria-hidden="true"></i>
157160
<span class="hidden-xs hidden-sm hidden-md hidden-lg">{{ trans('admin/custom_fields/general.show_in_listview_short') }}</span>
158161
</th>
159-
<th data-visible="false" data-sortable="true" class="text-center"><i class="fa fa-eye" aria-hidden="true"><span class="sr-only">Visible to User</span></i></th>
160-
<th data-sortable="true" data-searchable="true" class="text-center"><i class="fa fa-envelope" aria-hidden="true"><span class="sr-only">{{ trans('admin/custom_fields/general.show_in_email_short') }}</span></i></th>
161-
<th data-sortable="true" data-searchable="true" class="text-center"><i class="fa fa-laptop fa-fw" aria-hidden="true"><span class="sr-only">{{ trans('admin/custom_fields/general.show_in_requestable_list_short') }}</span></i></th>
162-
<th data-sortable="true" data-searchable="true" class="text-center"><i class="fa-solid fa-fingerprint"><span class="sr-only">{{ trans('admin/custom_fields/general.unique') }}</span></i></th>
162+
<th data-visible="false" data-sortable="true" class="text-center"
163+
data-tooltip="{{ trans('admin/custom_fields/general.display_in_user_view_table') }}"><i
164+
class="fa fa-eye"
165+
aria-hidden="true"><span
166+
class="sr-only">{{ trans('admin/custom_fields/general.display_in_user_view_table') }}</span></i>
167+
</th>
168+
<th data-sortable="true" data-searchable="true" class="text-center"
169+
data-tooltip="{{ trans('admin/custom_fields/general.show_in_email_short') }}"><i
170+
class="fa fa-envelope" aria-hidden="true"><span
171+
class="sr-only">{{ trans('admin/custom_fields/general.show_in_email_short') }}</span></i></th>
172+
<th data-sortable="true" data-searchable="true" class="text-center"
173+
data-tooltip="{{ trans('admin/custom_fields/general.show_in_requestable_list_short') }}"><i
174+
class="fa fa-laptop fa-fw" aria-hidden="true"><span
175+
class="sr-only">{{ trans('admin/custom_fields/general.show_in_requestable_list_short') }}</span></i>
176+
</th>
177+
<th data-sortable="true" data-searchable="true" class="text-center"
178+
data-tooltip="{{ trans('admin/custom_fields/general.unique') }}"><i
179+
class="fa-solid fa-fingerprint"><span
180+
class="sr-only">{{ trans('admin/custom_fields/general.unique') }}</span></i></th>
163181
<th data-sortable="true" data-searchable="true" class="text-center">{{ trans('admin/custom_fields/general.field_element_short') }}</th>
164182
<th data-searchable="true">{{ trans('admin/custom_fields/general.fieldsets') }}</th>
165183
<th>{{ trans('button.actions') }}</th>
@@ -234,4 +252,14 @@ class="table table-striped snipe-table"
234252
@stop
235253
@section('moar_scripts')
236254
@include ('partials.bootstrap-table')
255+
<script>
256+
$(function () {
257+
$('th').each(function (index, raw_element) {
258+
var element = $(raw_element);
259+
if (element.data('tooltip')) {
260+
element.tooltip({container: 'body', title: element.data('tooltip')})
261+
}
262+
});
263+
})
264+
</script>
237265
@stop

0 commit comments

Comments
 (0)