diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 8da5a4ac22..11525cb702 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -28,7 +28,7 @@ - What specific Snipe-IT page you're on, and what specific element you're interacting with to trigger the error - If a stacktrace is provided in the error, include that too. - Any errors that appear in your browser's error console. -- Confirm whether the error is reproduceable on the demo: https://snipeitapp.com/demo. +- Confirm whether the error is reproducible on the demo: https://snipeitapp.com/demo. - Include any additional information you can find in `app/storage/logs` and your webserver's logs. - Include what you've done so far in the installation, and if you got any error messages along the way. - Indicate whether or not you've manually edited any data directly in the database diff --git a/app/Http/Controllers/DepartmentsController.php b/app/Http/Controllers/DepartmentsController.php index 31b92673e9..0ed1575721 100644 --- a/app/Http/Controllers/DepartmentsController.php +++ b/app/Http/Controllers/DepartmentsController.php @@ -144,7 +144,7 @@ class DepartmentsController extends Controller return view('departments/edit', compact('item')); } - public function update(Request $request, $id) { + public function update(ImageUploadRequest $request, $id) { $this->authorize('create', Department::class); if (is_null($department = Department::find($id))) { diff --git a/app/Http/Controllers/ManufacturersController.php b/app/Http/Controllers/ManufacturersController.php index cd23d12cd4..c936b90e5d 100755 --- a/app/Http/Controllers/ManufacturersController.php +++ b/app/Http/Controllers/ManufacturersController.php @@ -123,7 +123,7 @@ class ManufacturersController extends Controller * @return \Illuminate\Http\RedirectResponse * @since [v1.0] */ - public function update(Request $request, $manufacturerId = null) + public function update(ImageUploadRequest $request, $manufacturerId = null) { // Check if the manufacturer exists if (is_null($manufacturer = Manufacturer::find($manufacturerId))) { diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index c76c5f9cf8..72fde2fe9a 100755 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -11,6 +11,7 @@ use App\Models\Setting; use Gate; use Illuminate\Http\Request; use Illuminate\Support\Facades\Hash; +use App\Http\Requests\ImageUploadRequest; /** * This controller handles all actions related to User Profiles for @@ -40,7 +41,7 @@ class ProfileController extends Controller * @since [v1.0] * @return \Illuminate\Http\RedirectResponse */ - public function postIndex() + public function postIndex(ImageUploadRequest $request) { $user = Auth::user(); diff --git a/app/Http/Requests/ImageUploadRequest.php b/app/Http/Requests/ImageUploadRequest.php index 2b8bad20f4..45e45ac3b2 100644 --- a/app/Http/Requests/ImageUploadRequest.php +++ b/app/Http/Requests/ImageUploadRequest.php @@ -24,7 +24,8 @@ class ImageUploadRequest extends Request public function rules() { return [ - 'image' => 'mimes:png,gif,jpg,jpeg,svg|max:2000' + 'image' => 'mimes:png,gif,jpg,jpeg,svg|max:2000', + 'avatar' => 'mimes:png,gif,jpg,jpeg,svg|max:2000', ]; } diff --git a/app/Policies/LicensePolicy.php b/app/Policies/LicensePolicy.php index 30ccf4a808..0fa4f0ca7d 100644 --- a/app/Policies/LicensePolicy.php +++ b/app/Policies/LicensePolicy.php @@ -16,8 +16,8 @@ class LicensePolicy extends CheckoutablePermissionsPolicy /** * Determine whether the user can view license keys * - * @param \App\User $user - * @param \App\License $license + * @param \App\Models\User $user + * @param \App\Models\License $license * @return mixed */ public function viewKeys(User $user, License $license = null) diff --git a/public/css/build/all.css b/public/css/build/all.css index 0d816efc57..a99d85233d 100644 Binary files a/public/css/build/all.css and b/public/css/build/all.css differ diff --git a/public/css/dist/all.css b/public/css/dist/all.css index 0d816efc57..a99d85233d 100644 Binary files a/public/css/dist/all.css and b/public/css/dist/all.css differ diff --git a/public/css/overrides.css b/public/css/overrides.css index 7ba454db7f..15a7cc60ce 100644 Binary files a/public/css/overrides.css and b/public/css/overrides.css differ diff --git a/public/mix-manifest.json b/public/mix-manifest.json index a4e607fcec..575d62b70e 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -2,13 +2,13 @@ "/js/build/vue.js": "/js/build/vue.js?id=e6804371942215bd1d7d", "/css/AdminLTE.css": "/css/AdminLTE.css?id=b8be19a285eaf44eec37", "/css/app.css": "/css/app.css?id=407edb63cc6b6dc62405", - "/css/overrides.css": "/css/overrides.css?id=ca0621c2a909d165534d", + "/css/overrides.css": "/css/overrides.css?id=1bdafb06a8609780f546", "/js/build/vue.js.map": "/js/build/vue.js.map?id=3b3d417664a61dcce3e9", "/css/AdminLTE.css.map": "/css/AdminLTE.css.map?id=99f5a5a03c4155cf69f6", "/css/app.css.map": "/css/app.css.map?id=bdbe05e6ecd70ccfac72", "/css/overrides.css.map": "/css/overrides.css.map?id=898c91d4a425b01b589b", - "/css/dist/all.css": "/css/dist/all.css?id=51e5995cec7ce583f5dd", + "/css/dist/all.css": "/css/dist/all.css?id=3a8aa974e7b09b52b18c", "/js/dist/all.js": "/js/dist/all.js?id=88f08e0103b14f7949b3", - "/css/build/all.css": "/css/build/all.css?id=51e5995cec7ce583f5dd", + "/css/build/all.css": "/css/build/all.css?id=3a8aa974e7b09b52b18c", "/js/build/all.js": "/js/build/all.js?id=88f08e0103b14f7949b3" } \ No newline at end of file diff --git a/resources/assets/less/overrides.less b/resources/assets/less/overrides.less index f3e816a439..710144f998 100644 --- a/resources/assets/less/overrides.less +++ b/resources/assets/less/overrides.less @@ -322,3 +322,7 @@ img.navbar-brand-img, .navbar-brand>img { .btn.bg-maroon, .btn.bg-purple{ min-width:90px; } + +[hidden] { + display: none !important; +} diff --git a/resources/lang/en/general.php b/resources/lang/en/general.php index c753a311c3..b50afe0812 100644 --- a/resources/lang/en/general.php +++ b/resources/lang/en/general.php @@ -93,6 +93,7 @@ 'image' => 'Image', 'image_delete' => 'Delete Image', 'image_upload' => 'Upload Image', + 'image_filetypes_help' => 'Accepted filetypes are jpg, png, gif, and svg.', 'import' => 'Import', 'import-history' => 'Import History', 'asset_maintenance' => 'Asset Maintenance', diff --git a/resources/views/accessories/edit.blade.php b/resources/views/accessories/edit.blade.php index 40d0468fc7..66966a3d52 100755 --- a/resources/views/accessories/edit.blade.php +++ b/resources/views/accessories/edit.blade.php @@ -24,15 +24,15 @@ -
- {{ Form::label('image', trans('general.image_upload'), array('class' => 'col-md-3 control-label')) }} -
- @if (config('app.lock_passwords')) -

{{ trans('general.lock_passwords') }}

- @else - {{ Form::file('image') }} - {!! $errors->first('image', ':message') !!} - @endif +
+ +
+ +

Accepted filetypes are jpg, png, gif and svg

+ {!! $errors->first('image', ':message') !!}
diff --git a/resources/views/account/profile.blade.php b/resources/views/account/profile.blade.php index cf57a72746..1d0032ed7a 100755 --- a/resources/views/account/profile.blade.php +++ b/resources/views/account/profile.blade.php @@ -87,14 +87,19 @@ @endif
- -
- {{ Form::file('avatar') }} + +
+ +

{{ trans('general.image_filetypes_help') }}

{!! $errors->first('avatar', ':message') !!}
+ @if ($snipeSettings->two_factor_enabled=='1')
diff --git a/resources/views/categories/edit.blade.php b/resources/views/categories/edit.blade.php index ef995c9d0d..6a7cc309bd 100755 --- a/resources/views/categories/edit.blade.php +++ b/resources/views/categories/edit.blade.php @@ -74,13 +74,7 @@
@endif -
- -
- {{ Form::file('image') }} - {!! $errors->first('image', ':message') !!} -
-
+@include ('partials.forms.edit.image-upload') @stop diff --git a/resources/views/companies/edit.blade.php b/resources/views/companies/edit.blade.php index 46d55f6532..8f63b05c4f 100644 --- a/resources/views/companies/edit.blade.php +++ b/resources/views/companies/edit.blade.php @@ -22,12 +22,5 @@
@endif -
- -
- {{ Form::file('image') }} - {!! $errors->first('image', ':message') !!} -
-
- +@include ('partials.forms.edit.image-upload') @stop diff --git a/resources/views/components/edit.blade.php b/resources/views/components/edit.blade.php index 5e1b7e2489..07db9d3cf4 100644 --- a/resources/views/components/edit.blade.php +++ b/resources/views/components/edit.blade.php @@ -33,12 +33,6 @@
@endif -
- -
- {{ Form::file('image') }} - {!! $errors->first('image', ':message') !!} -
-
+@include ('partials.forms.edit.image-upload') @stop diff --git a/resources/views/consumables/edit.blade.php b/resources/views/consumables/edit.blade.php index 632a838b40..b483008ee6 100644 --- a/resources/views/consumables/edit.blade.php +++ b/resources/views/consumables/edit.blade.php @@ -33,11 +33,5 @@
@endif -
- -
- {{ Form::file('image') }} - {!! $errors->first('image', ':message') !!} -
-
+@include ('partials.forms.edit.image-upload') @stop diff --git a/resources/views/departments/edit.blade.php b/resources/views/departments/edit.blade.php index 182e9bb9e9..ff5bbfd16f 100644 --- a/resources/views/departments/edit.blade.php +++ b/resources/views/departments/edit.blade.php @@ -35,13 +35,7 @@ @endif -
- -
- {{ Form::file('image') }} - {!! $errors->first('image', ':message') !!} -
-
+ @include ('partials.forms.edit.image-upload') @stop diff --git a/resources/views/groups/edit.blade.php b/resources/views/groups/edit.blade.php index ef455e4934..ccdc394cd0 100755 --- a/resources/views/groups/edit.blade.php +++ b/resources/views/groups/edit.blade.php @@ -88,10 +88,10 @@

{{ $area . ': ' . $localPermission['label'] }}

- {{ Form::radio('permission['.$localPermission['permission'].']', '1',$groupPermissions[$localPermission['permission'] ] == '1',['value'=>"grant", 'class'=>'minimal']) }} + {{ Form::radio('permission['.$localPermission['permission'].']', '1',(array_key_exists($localPermission['permission'], $groupPermissions) ? $groupPermissions[$localPermission['permission'] ] == '1' : null),['value'=>"grant", 'class'=>'minimal']) }} - {{ Form::radio('permission['.$localPermission['permission'].']', '0',$groupPermissions[$localPermission['permission'] ] == '0',['value'=>"grant", 'class'=>'minimal']) }} + {{ Form::radio('permission['.$localPermission['permission'].']', '0',(array_key_exists($localPermission['permission'], $groupPermissions) ? $groupPermissions[$localPermission['permission'] ] == '0' : null),['value'=>"grant", 'class'=>'minimal']) }} @@ -125,10 +125,10 @@ {{ $this_permission['label'] }} - {{ Form::radio('permission['.$this_permission['permission'].']', '1',$groupPermissions[$this_permission['permission'] ] == '1',['class'=>'minimal radiochecker-'.str_slug($area)]) }} + {{ Form::radio('permission['.$this_permission['permission'].']', '1',(array_key_exists($this_permission['permission'], $groupPermissions) ? $groupPermissions[$this_permission['permission'] ] == '1' : null),['class'=>'minimal radiochecker-'.str_slug($area)]) }} - {{ Form::radio('permission['.$this_permission['permission'].']', '0',$groupPermissions[$this_permission['permission'] ] == '0',['class'=>'minimal radiochecker-'.str_slug($area)]) }} + {{ Form::radio('permission['.$this_permission['permission'].']', '0',(array_key_exists($this_permission['permission'], $groupPermissions) ? $groupPermissions[$this_permission['permission'] ] == '0' : null),['class'=>'minimal radiochecker-'.str_slug($area)]) }} diff --git a/resources/views/locations/edit.blade.php b/resources/views/locations/edit.blade.php index eb35445fb3..253a069ce0 100755 --- a/resources/views/locations/edit.blade.php +++ b/resources/views/locations/edit.blade.php @@ -62,13 +62,7 @@ @endif -
- -
- {{ Form::file('image') }} - {!! $errors->first('image', ':message') !!} -
-
+@include ('partials.forms.edit.image-upload') @stop @if (!$item->id) diff --git a/resources/views/manufacturers/edit.blade.php b/resources/views/manufacturers/edit.blade.php index 69d0522256..af212be8fc 100755 --- a/resources/views/manufacturers/edit.blade.php +++ b/resources/views/manufacturers/edit.blade.php @@ -62,13 +62,7 @@ @endif -
- -
- {{ Form::file('image') }} - {!! $errors->first('image', ':message') !!} -
-
+@include ('partials.forms.edit.image-upload') @stop diff --git a/resources/views/models/edit.blade.php b/resources/views/models/edit.blade.php index 701a8a18df..8e8e75f3ce 100755 --- a/resources/views/models/edit.blade.php +++ b/resources/views/models/edit.blade.php @@ -56,12 +56,6 @@ @endif -
- -
- {{ Form::file('image') }} - {!! $errors->first('image', '
:message
') !!} -
-
+@include ('partials.forms.edit.image-upload') @stop diff --git a/resources/views/partials/forms/edit/image-upload.blade.php b/resources/views/partials/forms/edit/image-upload.blade.php new file mode 100644 index 0000000000..35d0a5e044 --- /dev/null +++ b/resources/views/partials/forms/edit/image-upload.blade.php @@ -0,0 +1,11 @@ +
+ +
+ +

{{ trans('general.image_filetypes_help') }}

+ {!! $errors->first('image', ':message') !!} +
+
diff --git a/resources/views/settings/branding.blade.php b/resources/views/settings/branding.blade.php index a52dbd719c..ec0ed0b531 100644 --- a/resources/views/settings/branding.blade.php +++ b/resources/views/settings/branding.blade.php @@ -61,21 +61,27 @@ +
-
- {{ Form::label('logo', trans('admin/settings/general.logo')) }} -
+
@if (config('app.lock_passwords'))

{{ trans('general.lock_passwords') }}

@else - {{ Form::file('image') }} - {!! $errors->first('image', ':message') !!} - {{ Form::checkbox('clear_logo', '1', Input::old('clear_logo'),array('class' => 'minimal')) }} Remove - @endif + +

{{ trans('general.image_filetypes_help') }}

+ + {!! $errors->first('image', ':message') !!} + {{ Form::checkbox('clear_logo', '1', Input::old('clear_logo'),array('class' => 'minimal')) }} Remove + @endif
+
diff --git a/resources/views/suppliers/edit.blade.php b/resources/views/suppliers/edit.blade.php index 5b9a2b78a8..caa7a2b14b 100755 --- a/resources/views/suppliers/edit.blade.php +++ b/resources/views/suppliers/edit.blade.php @@ -6,6 +6,7 @@ 'formAction' => ($item) ? route('suppliers.update', ['supplier' => $item->id]) : route('suppliers.store'), ]) + {{-- Page content --}} @section('inputFields') @@ -44,6 +45,7 @@ @if ($item->image) +
@@ -57,7 +59,11 @@
- {{ Form::file('image') }} + +

Accepted filetypes are jpg, png, gif and svg

{!! $errors->first('image', ':message') !!}