snipe-it/resources/views/users/index.blade.php

162 lines
4.8 KiB
PHP
Raw Normal View History

2016-03-25 01:18:05 -07:00
@extends('layouts/default')
{{-- Page title --}}
@section('title')
@if (Input::get('status')=='deleted')
{{ trans('general.deleted') }}
@else
{{ trans('general.current') }}
@endif
{{ trans('general.users') }}
@parent
@stop
@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 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: 0;
line-height: 4!important;
text-align: center;
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>
Discussion: Moving to policies for controller based authorization (#3080) * Make delete routes work. We put a little form in the modal that spoofs the delete field. * Fix route on creating a user. * Fix redundant id parameter. * Port acceptance tests to new urls. * Initial work on migrating to model based policies instead of global gates. Will allow for much more detailed permissions bits in the future. * This needs to stay for the dashboard checks. * Add user states for permissions to build tests. * Build up unit tests for gates/permissions. Move accessories/consumables/assets to policies instead of in authserviceprovider * Migrate various locations to new syntax. Update test to be more specific * Fix functional tests. Add an artisan command for installing a settings setup on travis-ci * Try a different id... Need to come up with a better way of passing the id for tests that need an existing one. * Try to fix travis * Update urls to use routes and not hardcode old paths. Also fix some migration errors found along the way.: * Add a environment for travis functional tests. * Adjust config file to make travis use it. * Use redirect()->route instead of redirect()-to * Dump all failures in the output directory if travis fails. * Cleanups and minor fixes. * Adjust the supplier modelfactory to comply with new validation restrictions. * Some test fixes. * Locales can be longer than 5 characters according to faker... fex gez_ET. Increase lenght in mysql and add a validation * Update test database dump to latest migrations.
2016-12-19 11:04:28 -08:00
@can('create', \App\Models\User::class)
@if ($snipeSettings->ldap_enabled == 1)
2017-07-08 02:24:20 -07:00
<a href="{{ route('ldap/user') }}" class="btn btn-default pull-right"><span class="fa fa-sitemap"></span> LDAP Sync</a>
@endif
<a href="{{ route('users.create') }}" class="btn btn-primary pull-right" style="margin-right: 5px;"> {{ trans('general.create') }}</a>
2016-08-02 00:54:38 -07:00
@endcan
@if (Input::get('status')=='deleted')
<a class="btn btn-default pull-right" href="{{ route('users.index') }}" style="margin-right: 5px;">{{ trans('admin/users/table.show_current') }}</a>
@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>
@endif
Discussion: Moving to policies for controller based authorization (#3080) * Make delete routes work. We put a little form in the modal that spoofs the delete field. * Fix route on creating a user. * Fix redundant id parameter. * Port acceptance tests to new urls. * Initial work on migrating to model based policies instead of global gates. Will allow for much more detailed permissions bits in the future. * This needs to stay for the dashboard checks. * Add user states for permissions to build tests. * Build up unit tests for gates/permissions. Move accessories/consumables/assets to policies instead of in authserviceprovider * Migrate various locations to new syntax. Update test to be more specific * Fix functional tests. Add an artisan command for installing a settings setup on travis-ci * Try a different id... Need to come up with a better way of passing the id for tests that need an existing one. * Try to fix travis * Update urls to use routes and not hardcode old paths. Also fix some migration errors found along the way.: * Add a environment for travis functional tests. * Adjust config file to make travis use it. * Use redirect()->route instead of redirect()-to * Dump all failures in the output directory if travis fails. * Cleanups and minor fixes. * Adjust the supplier modelfactory to comply with new validation restrictions. * Some test fixes. * Locales can be longer than 5 characters according to faker... fex gez_ET. Increase lenght in mysql and add a validation * Update test database dump to latest migrations.
2016-12-19 11:04:28 -08:00
@can('view', \App\Models\User::class)
<a class="btn btn-default pull-right" href="{{ route('users.export') }}" style="margin-right: 5px;">Export</a>
@endcan
2016-03-25 01:18:05 -07:00
@stop
{{-- Page content --}}
@section('content')
<div class="row">
<div class="col-md-12">
<div class="box box-default">
<div class="box-body">
{{ Form::open([
'method' => 'POST',
'route' => ['users/bulkedit'],
'class' => 'form-inline',
2017-01-18 19:28:35 -08:00
'id' => 'bulkForm']) }}
2016-03-25 01:18:05 -07:00
2016-05-12 21:01:31 -07:00
@if (Input::get('status')!='deleted')
@can('delete', \App\Models\User::class)
<div id="toolbar">
2020-03-31 22:50:14 -07:00
<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">
2017-03-03 17:17:51 -08:00
<option value="delete">Bulk Checkin &amp; Delete</option>
<option value="edit">Bulk Edit</option>
</select>
<button class="btn btn-default" id="bulkEdit" disabled>Go</button>
</div>
@endcan
2016-05-12 21:01:31 -07:00
@endif
2016-03-25 01:18:05 -07:00
<table
data-click-to-select="true"
data-columns="{{ \App\Presenters\UserPresenter::dataTableLayout() }}"
data-cookie-id-table="usersTable"
data-pagination="true"
data-id-table="usersTable"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
data-toolbar="#toolbar"
id="usersTable"
class="table table-striped snipe-table"
data-url="{{ route('api.users.index',
2017-09-06 17:11:43 -07:00
array('deleted'=> (Input::get('status')=='deleted') ? 'true' : 'false','company_id'=>e(Input::get('company_id')))) }}"
data-export-options='{
"fileName": "export-users-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
2016-03-25 01:18:05 -07:00
{{ Form::close() }}
</div><!-- /.box-body -->
</div><!-- /.box -->
</div>
</div>
@stop
2016-03-25 01:18:05 -07:00
@section('moar_scripts')val
@include ('partials.bootstrap-table')
2016-03-25 01:18:05 -07:00
2016-03-25 01:18:05 -07:00
@stop