From 7a0cac94b87ad584f2af19f8bf4649ae7a0363f8 Mon Sep 17 00:00:00 2001 From: cuneytsenturk Date: Tue, 1 May 2018 14:12:22 +0300 Subject: [PATCH] close #319 Fixed: Users and profile aren't working when using Gravatar --- public/css/app.css | 4 ++++ resources/views/auth/users/create.blade.php | 16 +++++++++++++++- resources/views/auth/users/edit.blade.php | 15 ++++++++++++++- resources/views/auth/users/index.blade.php | 6 +++++- 4 files changed, 38 insertions(+), 3 deletions(-) diff --git a/public/css/app.css b/public/css/app.css index 5ff4e5923..f349813e2 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -600,3 +600,7 @@ input[type="number"] { margin-top: 6px; margin-left: -20px; } + +.user.user-menu, .user.user-menu a { + min-height: 50px; +} diff --git a/resources/views/auth/users/create.blade.php b/resources/views/auth/users/create.blade.php index 1bae57785..7dfd10fd3 100644 --- a/resources/views/auth/users/create.blade.php +++ b/resources/views/auth/users/create.blade.php @@ -18,7 +18,19 @@ {{ Form::selectGroup('locale', trans_choice('general.languages', 1), 'flag', language()->allowed(), setting('general.default_locale')) }} - {{ Form::fileGroup('picture', trans_choice('general.pictures', 1)) }} + @if (setting('general.use_gravatar', '0') == '1') + {{ Form::hidden('picture', trans_choice('general.pictures', 1)) }} +
+ {!! Form::label('picture', trans_choice('general.pictures', 1), ['class' => 'control-label']) !!} +
+
+ {!! Form::text('fake_picture', null, ['id' => 'fake_picture', 'class' => 'form-control', 'disabled' => 'disabled', 'placeholder' => trans('settings.appearance.use_gravatar')]) !!} + {!! Form::hidden('picture', null, ['id' => 'picture', 'class' => 'form-control']) !!} +
+
+ @else + {{ Form::fileGroup('picture', trans_choice('general.pictures', 1)) }} + @endif @permission('read-companies-companies') {{ Form::checkboxGroup('companies', trans_choice('general.companies', 2), $companies, 'company_name') }} @@ -60,11 +72,13 @@ placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.languages', 1)]) }}" }); + @if (setting('general.use_gravatar', '0') != '1') $('#picture').fancyfile({ text : '{{ trans('general.form.select.file') }}', style : 'btn-default', placeholder : '{{ trans('general.form.no_file_selected') }}' }); + @endif $('input[type=checkbox]').iCheck({ checkboxClass: 'icheckbox_square-green', diff --git a/resources/views/auth/users/edit.blade.php b/resources/views/auth/users/edit.blade.php index 1c2d1b9b0..0fde89e6d 100644 --- a/resources/views/auth/users/edit.blade.php +++ b/resources/views/auth/users/edit.blade.php @@ -23,7 +23,18 @@ {{ Form::selectGroup('locale', trans_choice('general.languages', 1), 'flag', language()->allowed()) }} - {{ Form::fileGroup('picture', trans_choice('general.pictures', 1)) }} + @if (setting('general.use_gravatar', '0') == '1') +
+ {!! Form::label('picture', trans_choice('general.pictures', 1), ['class' => 'control-label']) !!} +
+
+ {!! Form::text('fake_picture', null, ['id' => 'fake_picture', 'class' => 'form-control', 'disabled' => 'disabled', 'placeholder' => trans('settings.appearance.use_gravatar')]) !!} + {!! Form::hidden('picture', null, ['id' => 'picture', 'class' => 'form-control']) !!} +
+
+ @else + {{ Form::fileGroup('picture', trans_choice('general.pictures', 1)) }} + @endif @permission('read-companies-companies') {{ Form::checkboxGroup('companies', trans_choice('general.companies', 2), $companies, 'company_name') }} @@ -68,6 +79,7 @@ placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.languages', 1)]) }}" }); + @if (setting('general.use_gravatar', '0') != '1') $('#picture').fancyfile({ text : '{{ trans('general.form.select.file') }}', style : 'btn-default', @@ -98,6 +110,7 @@ confirmDelete("#picture-{!! $user->picture->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '' . $user->picture->basename . '', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}"); }); @endif + @endif $('input[type=checkbox]').iCheck({ checkboxClass: 'icheckbox_square-green', diff --git a/resources/views/auth/users/index.blade.php b/resources/views/auth/users/index.blade.php index 6b71dedab..00058867e 100644 --- a/resources/views/auth/users/index.blade.php +++ b/resources/views/auth/users/index.blade.php @@ -43,8 +43,12 @@ + @if (setting('general.use_gravatar', '0') == '1') + {{ $item->name }} + @else @if ($item->picture) - {{ $item->name }} + {{ $item->name }} + @endif @endif {{ $item->name }}