From 1af7cdb715776d6bfed05d37457f93876f0017f2 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 3 Apr 2023 22:35:55 -0700 Subject: [PATCH] Wrapped the image delete into the existing image upload partial Signed-off-by: snipe --- resources/views/accessories/edit.blade.php | 21 +------- resources/views/categories/edit.blade.php | 48 +++++-------------- resources/views/companies/edit.blade.php | 20 +------- resources/views/components/edit.blade.php | 22 +-------- resources/views/consumables/edit.blade.php | 23 +-------- resources/views/departments/edit.blade.php | 22 +-------- resources/views/hardware/edit.blade.php | 22 ++------- resources/views/locations/edit.blade.php | 21 +------- resources/views/manufacturers/edit.blade.php | 14 +----- resources/views/models/edit.blade.php | 21 +------- .../forms/edit/image-upload.blade.php | 19 ++++++++ resources/views/suppliers/edit.blade.php | 21 +------- resources/views/users/edit.blade.php | 24 ++-------- 13 files changed, 46 insertions(+), 252 deletions(-) diff --git a/resources/views/accessories/edit.blade.php b/resources/views/accessories/edit.blade.php index 532336182b..b3ff55d419 100644 --- a/resources/views/accessories/edit.blade.php +++ b/resources/views/accessories/edit.blade.php @@ -22,26 +22,7 @@ @include ('partials.forms.edit.quantity') @include ('partials.forms.edit.minimum_quantity') @include ('partials.forms.edit.notes') +@include ('partials.forms.edit.image-upload', ['image_path' => app('accessories_upload_path')]) - -@if (($item->image) && ($item->image!='')) -
-
- -
-
-
-
- - {!! $errors->first('image_delete', ':message') !!} -
-
-@endif - -@include ('partials.forms.edit.image-upload') @stop diff --git a/resources/views/categories/edit.blade.php b/resources/views/categories/edit.blade.php index 3d24650a73..491a40965d 100755 --- a/resources/views/categories/edit.blade.php +++ b/resources/views/categories/edit.blade.php @@ -39,20 +39,17 @@
-
-
-
+
@if ($snipeSettings->default_eula_text!='') -
@@ -61,11 +58,9 @@
-
-
-
-
- -@if ($item->image) -
- -
- {{ Form::checkbox('image_delete', '1', old('image_delete'), array('class' => 'minimal', 'aria-label'=>'image_delete')) }} - - {!! $errors->first('image_delete', ':message') !!} -
-
-@endif +@include ('partials.forms.edit.image-upload', ['image_path' => app('manufacturers_upload_path')]) - @include ('partials.forms.edit.image-upload') - @stop diff --git a/resources/views/models/edit.blade.php b/resources/views/models/edit.blade.php index f8280b86df..edcced17c4 100755 --- a/resources/views/models/edit.blade.php +++ b/resources/views/models/edit.blade.php @@ -38,26 +38,7 @@ @include ('partials.forms.edit.notes') @include ('partials.forms.edit.requestable', ['requestable_text' => trans('admin/models/general.requestable')]) +@include ('partials.forms.edit.image-upload', ['image_path' => app('models_upload_path')]) - -@if (($item->image) && ($item->image!='')) -
-
- -
-
-
-
- - {!! $errors->first('image_delete', ':message') !!} -
-
-@endif - -@include ('partials.forms.edit.image-upload') @stop \ No newline at end of file diff --git a/resources/views/partials/forms/edit/image-upload.blade.php b/resources/views/partials/forms/edit/image-upload.blade.php index 8e69477cc1..fde6af69ee 100644 --- a/resources/views/partials/forms/edit/image-upload.blade.php +++ b/resources/views/partials/forms/edit/image-upload.blade.php @@ -1,3 +1,22 @@ + +@if (($item->image) && ($item->image!='')) +
+
+ +
+
+
+
+ + {!! $errors->first('image_delete', ':message') !!} +
+
+@endif +
diff --git a/resources/views/suppliers/edit.blade.php b/resources/views/suppliers/edit.blade.php index 1f8e51c0e6..aed15fedb1 100755 --- a/resources/views/suppliers/edit.blade.php +++ b/resources/views/suppliers/edit.blade.php @@ -42,25 +42,6 @@
@include ('partials.forms.edit.notes') +@include ('partials.forms.edit.image-upload', ['image_path' => app('suppliers_upload_path')]) - -@if (($item->image) && ($item->image!='')) -
-
- -
-
-
-
- - {!! $errors->first('image_delete', ':message') !!} -
-
-@endif - -@include ('partials.forms.edit.image-upload') @stop diff --git a/resources/views/users/edit.blade.php b/resources/views/users/edit.blade.php index 8a410ecfd4..f36b4a8ebd 100755 --- a/resources/views/users/edit.blade.php +++ b/resources/views/users/edit.blade.php @@ -277,27 +277,9 @@
@endif + + @include ('partials.forms.edit.image-upload', ['fieldname' => 'avatar', 'image_path' => app('users_upload_path')]) - - @if (($user->avatar) && ($user->avatar!='')) -
-
- -
-
-
-
- - {!! $errors->first('image_delete', ':message') !!} -
-
- @endif - - @include ('partials.forms.edit.image-upload', ['fieldname' => 'avatar'])
@@ -663,7 +645,7 @@ $(document).ready(function() { $('tr.header-row input:radio').change(function() { value = $(this).attr('value'); area = $(this).data('checker-group'); - $('.radiochecker-'+area+'[value='+value+']').iCheck('check'); + $('.radiochecker-'+area+'[value='+value+']').prop('checked', true); }); $('.header-name').click(function() {