Merge branch 'develop'

This commit is contained in:
snipe 2017-12-07 13:21:45 -08:00
commit ceca76b344
26 changed files with 77 additions and 91 deletions

View file

@ -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

View file

@ -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))) {

View file

@ -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))) {

View file

@ -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();

View file

@ -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',
];
}

View file

@ -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)

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -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"
}

View file

@ -322,3 +322,7 @@ img.navbar-brand-img, .navbar-brand>img {
.btn.bg-maroon, .btn.bg-purple{
min-width:90px;
}
[hidden] {
display: none !important;
}

View file

@ -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',

View file

@ -24,15 +24,15 @@
<!-- Image -->
<div class="form-group {{ $errors->has('image') ? ' has-error' : '' }}">
{{ Form::label('image', trans('general.image_upload'), array('class' => 'col-md-3 control-label')) }}
<div class="col-md-7">
@if (config('app.lock_passwords'))
<p class="help-block">{{ trans('general.lock_passwords') }}</p>
@else
{{ Form::file('image') }}
{!! $errors->first('image', '<span class="alert-msg">:message</span>') !!}
@endif
<div class="form-group {{ $errors->has('image') ? 'has-error' : '' }}">
<label class="col-md-3 control-label" for="image">{{ trans('general.image_upload') }}</label>
<div class="col-md-5">
<label class="btn btn-default">
{{ trans('button.select_file') }}
<input type="file" name="image" accept="image/gif,image/jpeg,image/png,image/svg" hidden>
</label>
<p class="help-block">Accepted filetypes are jpg, png, gif and svg</p>
{!! $errors->first('image', '<span class="alert-msg">:message</span>') !!}
</div>
</div>

View file

@ -87,14 +87,19 @@
@endif
<div class="form-group {{ $errors->has('avatar') ? 'has-error' : '' }}">
<label class="col-md-3 control-label" for="avatar">{{ trans('general.avatar_upload') }}</label>
<div class="col-md-8">
{{ Form::file('avatar') }}
<label class="col-md-3 control-label" for="avatar">{{ trans('general.image_upload') }}</label>
<div class="col-md-5">
<label class="btn btn-default">
{{ trans('button.select_file') }}
<input type="file" name="avatar" accept="image/gif,image/jpeg,image/png,image/svg" hidden>
</label>
<p class="help-block">{{ trans('general.image_filetypes_help') }}</p>
{!! $errors->first('avatar', '<span class="alert-msg">:message</span>') !!}
</div>
</div>
<!-- Two factor opt in -->
@if ($snipeSettings->two_factor_enabled=='1')
<div class="form-group {{ $errors->has('avatar') ? 'has-error' : '' }}">

View file

@ -74,13 +74,7 @@
</div>
@endif
<div class="form-group {{ $errors->has('image') ? 'has-error' : '' }}">
<label class="col-md-3 control-label" for="image">{{ trans('general.image_upload') }}</label>
<div class="col-md-5">
{{ Form::file('image') }}
{!! $errors->first('image', '<span class="alert-msg">:message</span>') !!}
</div>
</div>
@include ('partials.forms.edit.image-upload')
@stop

View file

@ -22,12 +22,5 @@
</div>
@endif
<div class="form-group {{ $errors->has('image') ? 'has-error' : '' }}">
<label class="col-md-3 control-label" for="image">{{ trans('general.image_upload') }}</label>
<div class="col-md-5">
{{ Form::file('image') }}
{!! $errors->first('image', '<span class="alert-msg">:message</span>') !!}
</div>
</div>
@include ('partials.forms.edit.image-upload')
@stop

View file

@ -33,12 +33,6 @@
</div>
@endif
<div class="form-group {{ $errors->has('image') ? 'has-error' : '' }}">
<label class="col-md-3 control-label" for="image">{{ trans('general.image_upload') }}</label>
<div class="col-md-5">
{{ Form::file('image') }}
{!! $errors->first('image', '<span class="alert-msg">:message</span>') !!}
</div>
</div>
@include ('partials.forms.edit.image-upload')
@stop

View file

@ -33,11 +33,5 @@
</div>
@endif
<div class="form-group {{ $errors->has('image') ? 'has-error' : '' }}">
<label class="col-md-3 control-label" for="image">{{ trans('general.image_upload') }}</label>
<div class="col-md-5">
{{ Form::file('image') }}
{!! $errors->first('image', '<span class="alert-msg">:message</span>') !!}
</div>
</div>
@include ('partials.forms.edit.image-upload')
@stop

View file

@ -35,13 +35,7 @@
</div>
@endif
<div class="form-group {{ $errors->has('image') ? 'has-error' : '' }}">
<label class="col-md-3 control-label" for="image">{{ trans('general.image_upload') }}</label>
<div class="col-md-5">
{{ Form::file('image') }}
{!! $errors->first('image', '<span class="alert-msg">:message</span>') !!}
</div>
</div>
@include ('partials.forms.edit.image-upload')
@stop

View file

@ -88,10 +88,10 @@
<h4>{{ $area . ': ' . $localPermission['label'] }}</h4>
</td>
<td class="col-md-1 permissions-item">
{{ 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']) }}
</td>
<td class="col-md-1 permissions-item">
{{ 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']) }}
</td>
</tr>
@ -125,10 +125,10 @@
{{ $this_permission['label'] }}
</td>
<td class="col-md-1 permissions-item">
{{ 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)]) }}
</td>
<td class="col-md-1 permissions-item">
{{ 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)]) }}
</td>
</tr>

View file

@ -62,13 +62,7 @@
</div>
@endif
<div class="form-group {{ $errors->has('image') ? 'has-error' : '' }}">
<label class="col-md-3 control-label" for="image">{{ trans('general.image_upload') }}</label>
<div class="col-md-5">
{{ Form::file('image') }}
{!! $errors->first('image', '<span class="alert-msg">:message</span>') !!}
</div>
</div>
@include ('partials.forms.edit.image-upload')
@stop
@if (!$item->id)

View file

@ -62,13 +62,7 @@
</div>
@endif
<div class="form-group {{ $errors->has('image') ? 'has-error' : '' }}">
<label class="col-md-3 control-label" for="image">{{ trans('general.image_upload') }}</label>
<div class="col-md-5">
{{ Form::file('image') }}
{!! $errors->first('image', '<span class="alert-msg">:message</span>') !!}
</div>
</div>
@include ('partials.forms.edit.image-upload')
@stop

View file

@ -56,12 +56,6 @@
</div>
@endif
<div class="form-group {{ $errors->has('image') ? 'has-error' : '' }}">
<label class="col-md-3 control-label" for="image">{{ trans('general.image_upload') }}</label>
<div class="col-md-5">
{{ Form::file('image') }}
{!! $errors->first('image', '<span class="alert-msg"><br>:message</span>') !!}
</div>
</div>
@include ('partials.forms.edit.image-upload')
@stop

View file

@ -0,0 +1,11 @@
<div class="form-group {{ $errors->has('image') ? 'has-error' : '' }}">
<label class="col-md-3 control-label" for="image">{{ trans('general.image_upload') }}</label>
<div class="col-md-5">
<label class="btn btn-default">
{{ trans('button.select_file') }}
<input type="file" name="image" accept="image/gif,image/jpeg,image/png,image/svg" hidden>
</label>
<p class="help-block">{{ trans('general.image_filetypes_help') }}</p>
{!! $errors->first('image', '<span class="alert-msg">:message</span>') !!}
</div>
</div>

View file

@ -61,21 +61,27 @@
<!-- Logo -->
<div class="form-group {{ $errors->has('image') ? 'has-error' : '' }}">
<div class="col-md-3">
{{ Form::label('logo', trans('admin/settings/general.logo')) }}
</div>
<label class="col-md-3 control-label" for="image">
{{ Form::label('logo', trans('admin/settings/general.logo')) }}</label>
<div class="col-md-9">
@if (config('app.lock_passwords'))
<p class="help-block">{{ trans('general.lock_passwords') }}</p>
@else
{{ Form::file('image') }}
{!! $errors->first('image', '<span class="alert-msg">:message</span>') !!}
{{ Form::checkbox('clear_logo', '1', Input::old('clear_logo'),array('class' => 'minimal')) }} Remove
@endif
<label class="btn btn-default">
{{ trans('button.select_file') }}
<input type="file" name="image" accept="image/gif,image/jpeg,image/png,image/svg" hidden>
</label>
<p class="help-block">{{ trans('general.image_filetypes_help') }}</p>
{!! $errors->first('image', '<span class="alert-msg">:message</span>') !!}
{{ Form::checkbox('clear_logo', '1', Input::old('clear_logo'),array('class' => 'minimal')) }} Remove
@endif
</div>
</div>
<!-- Branding -->
<div class="form-group {{ $errors->has('brand') ? 'error' : '' }}">
<div class="col-md-3">

View file

@ -6,6 +6,7 @@
'formAction' => ($item) ? route('suppliers.update', ['supplier' => $item->id]) : route('suppliers.store'),
])
{{-- Page content --}}
@section('inputFields')
@ -44,6 +45,7 @@
<!-- Image -->
@if ($item->image)
<div class="form-group {{ $errors->has('image_delete') ? 'has-error' : '' }}">
<label class="col-md-3 control-label" for="image_delete">{{ trans('general.image_delete') }}</label>
<div class="col-md-5">
@ -57,7 +59,11 @@
<div class="form-group {{ $errors->has('image') ? 'has-error' : '' }}">
<label class="col-md-3 control-label" for="image">{{ trans('general.image_upload') }}</label>
<div class="col-md-5">
{{ Form::file('image') }}
<label class="btn btn-default">
{{ trans('button.select_file') }}
<input type="file" name="image" accept="image/gif,image/jpeg,image/png,image/svg" hidden>
</label>
<p class="help-block">Accepted filetypes are jpg, png, gif and svg</p>
{!! $errors->first('image', '<span class="alert-msg">:message</span>') !!}
</div>
</div>