close #319 Fixed: Users and profile aren't working when using Gravatar

This commit is contained in:
cuneytsenturk 2018-05-01 14:12:22 +03:00
parent 26d25f41ae
commit 7a0cac94b8
4 changed files with 38 additions and 3 deletions

4
public/css/app.css vendored
View File

@ -600,3 +600,7 @@ input[type="number"] {
margin-top: 6px; margin-top: 6px;
margin-left: -20px; margin-left: -20px;
} }
.user.user-menu, .user.user-menu a {
min-height: 50px;
}

View File

@ -18,7 +18,19 @@
{{ Form::selectGroup('locale', trans_choice('general.languages', 1), 'flag', language()->allowed(), setting('general.default_locale')) }} {{ 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)) }}
<div class="form-group col-md-6">
{!! Form::label('picture', trans_choice('general.pictures', 1), ['class' => 'control-label']) !!}
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-picture-o"></i></div>
{!! 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']) !!}
</div>
</div>
@else
{{ Form::fileGroup('picture', trans_choice('general.pictures', 1)) }}
@endif
@permission('read-companies-companies') @permission('read-companies-companies')
{{ Form::checkboxGroup('companies', trans_choice('general.companies', 2), $companies, 'company_name') }} {{ 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)]) }}" placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.languages', 1)]) }}"
}); });
@if (setting('general.use_gravatar', '0') != '1')
$('#picture').fancyfile({ $('#picture').fancyfile({
text : '{{ trans('general.form.select.file') }}', text : '{{ trans('general.form.select.file') }}',
style : 'btn-default', style : 'btn-default',
placeholder : '{{ trans('general.form.no_file_selected') }}' placeholder : '{{ trans('general.form.no_file_selected') }}'
}); });
@endif
$('input[type=checkbox]').iCheck({ $('input[type=checkbox]').iCheck({
checkboxClass: 'icheckbox_square-green', checkboxClass: 'icheckbox_square-green',

View File

@ -23,7 +23,18 @@
{{ Form::selectGroup('locale', trans_choice('general.languages', 1), 'flag', language()->allowed()) }} {{ 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')
<div class="form-group col-md-6">
{!! Form::label('picture', trans_choice('general.pictures', 1), ['class' => 'control-label']) !!}
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-picture-o"></i></div>
{!! 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']) !!}
</div>
</div>
@else
{{ Form::fileGroup('picture', trans_choice('general.pictures', 1)) }}
@endif
@permission('read-companies-companies') @permission('read-companies-companies')
{{ Form::checkboxGroup('companies', trans_choice('general.companies', 2), $companies, 'company_name') }} {{ 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)]) }}" placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.languages', 1)]) }}"
}); });
@if (setting('general.use_gravatar', '0') != '1')
$('#picture').fancyfile({ $('#picture').fancyfile({
text : '{{ trans('general.form.select.file') }}', text : '{{ trans('general.form.select.file') }}',
style : 'btn-default', style : 'btn-default',
@ -98,6 +110,7 @@
confirmDelete("#picture-{!! $user->picture->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $user->picture->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}"); confirmDelete("#picture-{!! $user->picture->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $user->picture->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
}); });
@endif @endif
@endif
$('input[type=checkbox]').iCheck({ $('input[type=checkbox]').iCheck({
checkboxClass: 'icheckbox_square-green', checkboxClass: 'icheckbox_square-green',

View File

@ -43,8 +43,12 @@
<tr> <tr>
<td> <td>
<a href="{{ url('auth/users/' . $item->id . '/edit') }}"> <a href="{{ url('auth/users/' . $item->id . '/edit') }}">
@if (setting('general.use_gravatar', '0') == '1')
<img src="{{ $item->picture }}" class="users-image" alt="{{ $item->name }}" title="{{ $item->name }}">
@else
@if ($item->picture) @if ($item->picture)
<img src="{{ Storage::url($item->picture->id) }}" class="users-image" alt="{{ $item->name }}" title="{{ $item->name }}"> <img src="{{ Storage::url($item->picture->id) }}" class="users-image" alt="{{ $item->name }}" title="{{ $item->name }}">
@endif
@endif @endif
{{ $item->name }} {{ $item->name }}
</a> </a>