mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Backport the column icon fix from master
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
bea3a7b982
commit
6847a331a7
|
@ -2,7 +2,10 @@
|
||||||
|
|
||||||
namespace App\Presenters;
|
namespace App\Presenters;
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Storage;
|
use App\Helpers\Helper;
|
||||||
|
use App\Models\Setting;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Support\Facades\Gate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class UserPresenter
|
* Class UserPresenter
|
||||||
|
@ -168,21 +171,22 @@ class UserPresenter extends Presenter
|
||||||
"formatter" => "usersLinkObjFormatter"
|
"formatter" => "usersLinkObjFormatter"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"field" => "assets_count",
|
'field' => 'assets_count',
|
||||||
"searchable" => false,
|
'searchable' => false,
|
||||||
"sortable" => true,
|
'sortable' => true,
|
||||||
"switchable" => true,
|
'switchable' => true,
|
||||||
"title" => ' <span class="hidden-md hidden-lg">Assets</span>'
|
'escape' => true,
|
||||||
.'<span class="hidden-xs"><i class="fa fa-barcode fa-lg"></i></span>',
|
'class' => 'css-barcode',
|
||||||
"visible" => true,
|
'title' => 'Assets',
|
||||||
|
'visible' => true,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"field" => "licenses_count",
|
"field" => "licenses_count",
|
||||||
"searchable" => false,
|
"searchable" => false,
|
||||||
"sortable" => true,
|
"sortable" => true,
|
||||||
"switchable" => true,
|
"switchable" => true,
|
||||||
"title" => ' <span class="hidden-md hidden-lg">Licenses</span>'
|
'class' => 'css-license',
|
||||||
.'<span class="hidden-xs"><i class="fa fa-floppy-o fa-lg"></i></span>',
|
"title" => 'License',
|
||||||
"visible" => true,
|
"visible" => true,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
@ -190,8 +194,8 @@ class UserPresenter extends Presenter
|
||||||
"searchable" => false,
|
"searchable" => false,
|
||||||
"sortable" => true,
|
"sortable" => true,
|
||||||
"switchable" => true,
|
"switchable" => true,
|
||||||
"title" => ' <span class="hidden-md hidden-lg">Consumables</span>'
|
'class' => 'css-consumable',
|
||||||
.'<span class="hidden-xs"><i class="fa fa-tint fa-lg"></i></span>',
|
"title" => 'Consumables',
|
||||||
"visible" => true,
|
"visible" => true,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
@ -199,8 +203,8 @@ class UserPresenter extends Presenter
|
||||||
"searchable" => false,
|
"searchable" => false,
|
||||||
"sortable" => true,
|
"sortable" => true,
|
||||||
"switchable" => true,
|
"switchable" => true,
|
||||||
"title" => ' <span class="hidden-md hidden-lg">Accessories</span>'
|
'class' => 'css-accessory',
|
||||||
.'<span class="hidden-xs"><i class="fa fa-keyboard-o fa-lg"></i></span>',
|
"title" => 'Accessories',
|
||||||
"visible" => true,
|
"visible" => true,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
@ -317,20 +321,16 @@ class UserPresenter extends Presenter
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($this->avatar) {
|
if ($this->avatar) {
|
||||||
return Storage::disk('public')->url('avatars/'.$this->avatar, $this->avatar);
|
return config('app.url').'/uploads/avatars/'.$this->avatar;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->email != '') {
|
if ((Setting::getSettings()->load_remote=='1') && ($this->email!='')) {
|
||||||
/**
|
|
||||||
* @see https://en.gravatar.com/site/implement/images/
|
|
||||||
* Return a default [Myster Person] gravatar if the user does not have one
|
|
||||||
*/
|
|
||||||
$gravatar = md5(strtolower(trim($this->email)));
|
$gravatar = md5(strtolower(trim($this->email)));
|
||||||
// return "//gravatar.com/avatar/".$gravatar.'?d=mp';
|
return "//gravatar.com/avatar/".$gravatar;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set a fun, gender-neutral default icon when there is no email
|
// Set a fun, gender-neutral default icon
|
||||||
return url('/img/default-sm.png');
|
return url('/').'/img/default-sm.png';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,17 +3,78 @@
|
||||||
{{-- Page title --}}
|
{{-- Page title --}}
|
||||||
@section('title')
|
@section('title')
|
||||||
|
|
||||||
@if (Request::get('status')=='deleted')
|
@if (request('status')=='deleted')
|
||||||
{{ trans('general.deleted') }}
|
{{ trans('general.deleted') }}
|
||||||
@else
|
@else
|
||||||
{{ trans('general.current') }}
|
{{ trans('general.current') }}
|
||||||
@endif
|
@endif
|
||||||
{{ trans('general.users') }}
|
{{ trans('general.users') }}
|
||||||
|
@parent
|
||||||
|
|
||||||
@parent
|
|
||||||
@stop
|
@stop
|
||||||
|
|
||||||
@section('header_right')
|
@section('header_right')
|
||||||
|
|
||||||
|
<style>
|
||||||
|
/**
|
||||||
|
This is kind of weird, but it is necessary to prevent the column-selector code from barfing, since
|
||||||
|
any HTML used in the UserPresenter "title" attribute breaks the column selector HTML.
|
||||||
|
|
||||||
|
Instead, we use CSS to add the icon into the table header, which leaves the column selector
|
||||||
|
"title" text as-is.
|
||||||
|
|
||||||
|
See https://github.com/snipe/snipe-it/issues/7989
|
||||||
|
|
||||||
|
*/
|
||||||
|
th.css-barcode > .th-inner,
|
||||||
|
th.css-license > .th-inner,
|
||||||
|
th.css-consumable > .th-inner,
|
||||||
|
th.css-accessory > .th-inner
|
||||||
|
{
|
||||||
|
font-size: 0px;
|
||||||
|
line-height: 4!important;
|
||||||
|
text-align: left;
|
||||||
|
text-rendering: auto;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
th.css-barcode > .th-inner::before,
|
||||||
|
th.css-license > .th-inner::before,
|
||||||
|
th.css-consumable > .th-inner::before,
|
||||||
|
th.css-accessory > .th-inner::before
|
||||||
|
|
||||||
|
{
|
||||||
|
display: inline-block;
|
||||||
|
font: normal normal normal 14px/1 FontAwesome;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
th.css-barcode > .th-inner::before
|
||||||
|
{
|
||||||
|
content: "\f02a";
|
||||||
|
}
|
||||||
|
|
||||||
|
th.css-license > .th-inner::before
|
||||||
|
{
|
||||||
|
content: "\f0c7";
|
||||||
|
}
|
||||||
|
|
||||||
|
th.css-consumable > .th-inner::before
|
||||||
|
{
|
||||||
|
content: "\f043";
|
||||||
|
}
|
||||||
|
|
||||||
|
th.css-accessory > .th-inner::before
|
||||||
|
{
|
||||||
|
content: "\f11c";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
@can('create', \App\Models\User::class)
|
@can('create', \App\Models\User::class)
|
||||||
@if ($snipeSettings->ldap_enabled == 1)
|
@if ($snipeSettings->ldap_enabled == 1)
|
||||||
<a href="{{ route('ldap/user') }}" class="btn btn-default pull-right"><span class="fa fa-sitemap"></span> LDAP Sync</a>
|
<a href="{{ route('ldap/user') }}" class="btn btn-default pull-right"><span class="fa fa-sitemap"></span> LDAP Sync</a>
|
||||||
|
@ -21,7 +82,7 @@
|
||||||
<a href="{{ route('users.create') }}" class="btn btn-primary pull-right" style="margin-right: 5px;"> {{ trans('general.create') }}</a>
|
<a href="{{ route('users.create') }}" class="btn btn-primary pull-right" style="margin-right: 5px;"> {{ trans('general.create') }}</a>
|
||||||
@endcan
|
@endcan
|
||||||
|
|
||||||
@if (Request::get('status')=='deleted')
|
@if (request('status')=='deleted')
|
||||||
<a class="btn btn-default pull-right" href="{{ route('users.index') }}" style="margin-right: 5px;">{{ trans('admin/users/table.show_current') }}</a>
|
<a class="btn btn-default pull-right" href="{{ route('users.index') }}" style="margin-right: 5px;">{{ trans('admin/users/table.show_current') }}</a>
|
||||||
@else
|
@else
|
||||||
<a class="btn btn-default pull-right" href="{{ route('users.index', ['status' => 'deleted']) }}" style="margin-right: 5px;">{{ trans('admin/users/table.show_deleted') }}</a>
|
<a class="btn btn-default pull-right" href="{{ route('users.index', ['status' => 'deleted']) }}" style="margin-right: 5px;">{{ trans('admin/users/table.show_deleted') }}</a>
|
||||||
|
@ -34,7 +95,7 @@
|
||||||
{{-- Page content --}}
|
{{-- Page content --}}
|
||||||
@section('content')
|
@section('content')
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="box box-default">
|
<div class="box box-default">
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
|
@ -44,14 +105,13 @@
|
||||||
'class' => 'form-inline',
|
'class' => 'form-inline',
|
||||||
'id' => 'bulkForm']) }}
|
'id' => 'bulkForm']) }}
|
||||||
|
|
||||||
@if (Request::get('status')!='deleted')
|
@if (request('status')!='deleted')
|
||||||
@can('delete', \App\Models\User::class)
|
@can('delete', \App\Models\User::class)
|
||||||
<div id="toolbar">
|
<div id="toolbar">
|
||||||
<label for="bulk_actions" class="sr-only">Bulk Actions</label>
|
<label for="bulk_actions" class="sr-only">Bulk Actions</label>
|
||||||
<select name="bulk_actions" class="form-control select2" style="width: 200px;" aria-label="bulk_actions">
|
<select name="bulk_actions" class="form-control select2" style="width: 200px;" aria-label="bulk_actions">
|
||||||
<option value="delete">Bulk Checkin & Delete</option>
|
<option value="delete">Bulk Checkin & Delete</option>
|
||||||
<option value="edit">Bulk Edit</option>
|
<option value="edit">Bulk Edit</option>
|
||||||
<option value="bulkpasswordreset">Send Password Reset</option>
|
|
||||||
</select>
|
</select>
|
||||||
<button class="btn btn-default" id="bulkEdit" disabled>Go</button>
|
<button class="btn btn-default" id="bulkEdit" disabled>Go</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -75,7 +135,7 @@
|
||||||
id="usersTable"
|
id="usersTable"
|
||||||
class="table table-striped snipe-table"
|
class="table table-striped snipe-table"
|
||||||
data-url="{{ route('api.users.index',
|
data-url="{{ route('api.users.index',
|
||||||
array('deleted'=> (Request::get('status')=='deleted') ? 'true' : 'false','company_id'=>e(Request::get('company_id')))) }}"
|
array('deleted'=> (request('status')=='deleted') ? 'true' : 'false','company_id'=>e(request('company_id')))) }}"
|
||||||
data-export-options='{
|
data-export-options='{
|
||||||
"fileName": "export-users-{{ date('Y-m-d') }}",
|
"fileName": "export-users-{{ date('Y-m-d') }}",
|
||||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||||
|
@ -87,11 +147,12 @@
|
||||||
</div><!-- /.box-body -->
|
</div><!-- /.box-body -->
|
||||||
</div><!-- /.box -->
|
</div><!-- /.box -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@stop
|
@stop
|
||||||
|
|
||||||
@section('moar_scripts')
|
@section('moar_scripts')
|
||||||
|
|
||||||
@include ('partials.bootstrap-table')
|
@include ('partials.bootstrap-table')
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue