@view('header', [ 'title' => 'Sessions - Admin' ])

<div class="breadcrumb">
    <ul>
        <li><a href="/">Banq</a></li>
        <li><a href="/admin">Admin</a></li>
        <li class="is-active"><a href="/admin/sessions">Sessions</a></li>
    </ul>
</div>

<h1 class="title">Sessions</h1>

@if (count($sessions) > 0):
    @view('pagination', [ 'page' => $page, 'last_page' => $last_page ])

    <div class="columns is-multiline">
        @foreach ($sessions as $session):
            <div class="column is-one-third">
                <div class="box" style="height: 100%;">
                    <h1 class="title is-5">
                        <a href="/admin/sessions/{{ $session->id }}">{{ $session->user->username }} via {{ $session->ip }}</a>
                        @if (strtotime($session->expires_at) <= time()):
                            <div class="tag is-link" style="margin-left: 8px;">EXPIRED</div>
                        @endif
                    </h1>
                    <p><code>{{ $session->session }}</code></p>
                </div>
            </div>
        @endforeach
    </div>

    @view('pagination', [ 'page' => $page, 'last_page' => $last_page ])
@else:
    <p><i>There are no sessions found</i></p>
@endif

@view('footer')
