@extends('admin.layouts.main', [
    'scripts' => [
        path_asset('path.backoffice.js_path') . '/view/user/backend-users-list.js'
    ]
])

@section('content')
    <h1>Manage Backend Users</h1>
    <div id="backend_users">
        @if($canInsert)
            <button type="button" data-toggle="tooltip" data-placement="right" class="btn btn-default command-add list-add-btn" title="{{ Lang::get('backend.new_user') }}">
                <span class="icon glyphicon glyphicon-plus"></span>
            </button>
        @endif
        <table id="grid" class="table table-condensed table-hover table-striped">
            <thead>
            <tr>
                <th data-column-id="id" data-type="numeric" data-identifier="true">ID</th>
                <th data-column-id="first_name" data-order="asc">First name</th>
                <th data-column-id="last_name">Last name</th>
                <th data-column-id="email">Email</th>
                <th data-column-id="role">Role</th>
                <th data-column-id="commands" data-formatter="commands" data-sortable="false">{{ trans('backend.actions') }}</th>
            </tr>
            </thead>
        </table>
    </div>
    <script>
        $(function() {
            var manageUsersView = new Eae.View.BackendUsersList({
                el : $('#backend_users'),
                userId : {{ $loggedUser->id }},
                canInsert: {{ $canInsert ? 'true' : 'false' }}
            });
        });
    </script>
@stop
