]> BookStack Code Mirror - bookstack/blob - resources/views/users/index.blade.php
Remove unnecessary changes
[bookstack] / resources / views / users / index.blade.php
1 @extends('simple-layout')
2
3 @section('body')
4     <div class="container small">
5
6         <div class="py-m">
7             @include('settings.navbar', ['selected' => 'users'])
8         </div>
9
10         <main class="card content-wrap">
11
12             <div class="grid right-focus v-center">
13                 <h1 class="list-heading">{{ trans('settings.users') }}</h1>
14
15                 <div class="text-right">
16                     <div class="block inline mr-s">
17                         <form method="get" action="{{ url("/settings/users") }}">
18                             @foreach(collect($listDetails)->except('search') as $name => $val)
19                                 <input type="hidden" name="{{ $name }}" value="{{ $val }}">
20                             @endforeach
21                             <input type="text" name="search" placeholder="{{ trans('settings.users_search') }}" @if($listDetails['search']) value="{{$listDetails['search']}}" @endif>
22                         </form>
23                     </div>
24                     @if(userCan('users-manage'))
25                         <a href="{{ url("/settings/users/create") }}" style="margin-top: 0;" class="outline button">{{ trans('settings.users_add_new') }}</a>
26                     @endif
27                 </div>
28             </div>
29
30             <table class="table">
31                 <tr>
32                     <th></th>
33                     <th>
34                         <a href="{{ sortUrl('/settings/users', $listDetails, ['sort' => 'name']) }}">{{ trans('auth.name') }}</a>
35                         /
36                         <a href="{{ sortUrl('/settings/users', $listDetails, ['sort' => 'email']) }}">{{ trans('auth.email') }}</a>
37                     </th>
38                     <th>{{ trans('settings.role_user_roles') }}</th>
39                     <th class="text-right">
40                         <a href="{{ sortUrl('/settings/users', $listDetails, ['sort' => 'latest_activity']) }}">{{ trans('settings.users_latest_activity') }}</a>
41                     </th>
42                 </tr>
43                 @foreach($users as $user)
44                     <tr>
45                         <td class="text-center" style="line-height: 0;"><img class="avatar med" src="{{ $user->getAvatar(40)}}" alt="{{ $user->name }}"></td>
46                         <td>
47                             @if(userCan('users-manage') || $currentUser->id == $user->id)
48                                 <a href="{{ url("/settings/users/{$user->id}") }}">
49                                     @endif
50                                     {{ $user->name }} <br> <span class="text-muted">{{ $user->email }}</span>
51                                     @if(userCan('users-manage') || $currentUser->id == $user->id)
52                                 </a>
53                             @endif
54                         </td>
55                         <td>
56                             @foreach($user->roles as $index => $role)
57                                 <small><a href="{{ url("/settings/roles/{$role->id}") }}">{{$role->display_name}}</a>@if($index !== count($user->roles) -1),@endif</small>
58                             @endforeach
59                         </td>
60                         <td class="text-right text-muted">
61                             @if($user->latestActivity)
62                                 <small title="{{ $user->latestActivity->created_at->format('Y-m-d H:i:s') }}">{{ $user->latestActivity->created_at->diffForHumans() }}</small>
63                             @endif
64                         </td>
65                     </tr>
66                 @endforeach
67             </table>
68
69             <div>
70                 {{ $users->links() }}
71             </div>
72         </main>
73
74     </div>
75
76 @stop