]> BookStack Code Mirror - bookstack/blob - resources/views/users/index.blade.php
Added more complexity in an attempt to make ldap host failover fit
[bookstack] / resources / views / users / index.blade.php
1 @extends('layouts.simple')
2
3 @section('body')
4     <div class="container small">
5
6         @include('settings.parts.navbar', ['selected' => 'users'])
7
8         <main class="card content-wrap">
9
10             <div class="flex-container-row wrap justify-space-between items-center">
11                 <h1 class="list-heading">{{ trans('settings.users') }}</h1>
12
13                 <div>
14                     <div class="block inline mr-xs">
15                         <form method="get" action="{{ url("/settings/users") }}">
16                             @foreach(collect($listDetails)->except('search') as $name => $val)
17                                 <input type="hidden" name="{{ $name }}" value="{{ $val }}">
18                             @endforeach
19                             <input type="text" name="search" placeholder="{{ trans('settings.users_search') }}" @if($listDetails['search']) value="{{$listDetails['search']}}" @endif>
20                         </form>
21                     </div>
22                     <a href="{{ url("/settings/users/create") }}" class="outline button mt-none">{{ trans('settings.users_add_new') }}</a>
23                 </div>
24             </div>
25
26             <table class="table">
27                 <tr>
28                     <th></th>
29                     <th>
30                         <a href="{{ sortUrl('/settings/users', $listDetails, ['sort' => 'name']) }}">{{ trans('auth.name') }}</a>
31                         /
32                         <a href="{{ sortUrl('/settings/users', $listDetails, ['sort' => 'email']) }}">{{ trans('auth.email') }}</a>
33                     </th>
34                     <th>{{ trans('settings.role_user_roles') }}</th>
35                     <th class="text-right">
36                         <a href="{{ sortUrl('/settings/users', $listDetails, ['sort' => 'last_activity_at']) }}">{{ trans('settings.users_latest_activity') }}</a>
37                     </th>
38                 </tr>
39                 @foreach($users as $user)
40                     <tr>
41                         <td class="text-center" style="line-height: 0;"><img class="avatar med" src="{{ $user->getAvatar(40)}}" alt="{{ $user->name }}"></td>
42                         <td>
43                             <a href="{{ url("/settings/users/{$user->id}") }}">
44                                 {{ $user->name }}
45                                 <br>
46                                 <span class="text-muted">{{ $user->email }}</span>
47                                 @if($user->mfa_values_count > 0)
48                                     <span title="MFA Configured" class="text-pos">@icon('lock')</span>
49                                 @endif
50                             </a>
51                         </td>
52                         <td>
53                             @foreach($user->roles as $index => $role)
54                                 <small><a href="{{ url("/settings/roles/{$role->id}") }}">{{$role->display_name}}</a>@if($index !== count($user->roles) -1),@endif</small>
55                             @endforeach
56                         </td>
57                         <td class="text-right text-muted">
58                             @if($user->last_activity_at)
59                                 <small title="{{ $user->last_activity_at->format('Y-m-d H:i:s') }}">{{ $user->last_activity_at->diffForHumans() }}</small>
60                             @endif
61                         </td>
62                     </tr>
63                 @endforeach
64             </table>
65
66             <div>
67                 {{ $users->links() }}
68             </div>
69         </main>
70
71     </div>
72
73 @stop