<commit_before>@extends('UMViews::default')


@section('content')

    <h1>All users</h1>
    <a class="btn btn-primary" href="{{ route('user.manager.create') }}">Create new user</a>
@if($users->count())
    <hr>
    <table class="table">
        <thead>
            <tr>
                <th>ID</th>
                <th>Name</th>
                <th>Email</th>
                <th>Role</th>
                <th>Actions</th>
            </tr>
        </thead>
        <tbody>
            @foreach($users as $user)
            <tr>
                <td>{{ $user->id }}</td>
                <td>{{ $user->name }}</td>
                <td>{{ $user->email }}</td>
                <td>
                    @if($user->roles->count())
                        <?php $i = 0; $maxRoles = $user->roles->count() ?>
                        @foreach($user->roles as $role)
                            <?php $i++; ?>
                            {{ $role->name }}
                            @if($i < $maxRoles)
                                <span> / </span>
                            @endif
                        @endforeach
                    @endif
                </td>
                <td>
                    <a class="btn btn-info btn-sm pull-left" href="{{ route('user.manager.edit', $user->id) }}">Edit</a>
                    {!! Form::open(['route' => ['user.manager.destroy', $user->id], 'method' => 'DELETE']) !!}
                        {!! Form::submit('Delete', ['class' => 'btn btn-danger btn-sm pull-left']) !!}
                    {!! Form::close() !!}
                </td>
            </tr>
            @endforeach
        </tbody>
    </table>
@endif
@if($deletedUsers->count())
    <hr>
    <p class="deleted-users"><strong>Deleted users:</strong></p>
    <table class="table deleted-users">
        <thead>
            <tr>
                <th>ID</th>
                <th>Name</th>
                <th>Email</th>
                <th>Role</th>
                <th>Actions</th>
            </tr>
        </thead>
        <tbody>
            @foreach($deletedUsers as $user)
            <tr>
                <td>{{ $user->id }}</td>
                <td>{{ $user->name }}</td>
                <td>{{ $user->email }}</td>
                <td>
                    @foreach($user->roles as $role)
                        {{ $role->name }} 
                    @endforeach
                </td>
                <td>
                    {!! Form::open(['route' => ['user.manager.restore', $user->id]]) !!}
                        {!! Form::submit('Restore', ['class' => 'btn btn-warning btn-sm pull-left']) !!}
                    {!! Form::close() !!}

                    {!! Form::open(['route' => ['user.manager.permanentlyDestroy', $user->id], 'method' => 'DELETE']) !!}
                        {!! Form::submit('Delete permanently', ['class' => 'btn btn-danger btn-sm pull-left']) !!}
                    {!! Form::close() !!}
                </td>
            </tr>
            @endforeach
        </tbody>
    </table>
    <hr>
@endif
@if(!$user->count() && !$deletedUsers->count())
    <p>No users found.</p>
@endif

@endsection<commit_msg>Updated README and a bug in the view<commit_after>@extends('UMViews::default')


@section('content')

    <h1>All users</h1>
    <a class="btn btn-primary" href="{{ route('user.manager.create') }}">Create new user</a>
@if($users->count())
    <hr>
    <table class="table">
        <thead>
            <tr>
                <th>ID</th>
                <th>Name</th>
                <th>Email</th>
                <th>Role</th>
                <th>Actions</th>
            </tr>
        </thead>
        <tbody>
            @foreach($users as $user)
            <tr>
                <td>{{ $user->id }}</td>
                <td>{{ $user->name }}</td>
                <td>{{ $user->email }}</td>
                <td>
                    @if($user->roles->count())
                        <?php $i = 0; $maxRoles = $user->roles->count() ?>
                        @foreach($user->roles as $role)
                            <?php $i++; ?>
                            {{ $role->name }}
                            @if($i < $maxRoles)
                                <span> / </span>
                            @endif
                        @endforeach
                    @endif
                </td>
                <td>
                    <a class="btn btn-info btn-sm pull-left" href="{{ route('user.manager.edit', $user->id) }}">Edit</a>
                    {!! Form::open(['route' => ['user.manager.destroy', $user->id], 'method' => 'DELETE']) !!}
                        {!! Form::submit('Delete', ['class' => 'btn btn-danger btn-sm pull-left']) !!}
                    {!! Form::close() !!}
                </td>
            </tr>
            @endforeach
        </tbody>
    </table>
@endif
@if($deletedUsers->count())
    <hr>
    <p class="deleted-users"><strong>Deleted users:</strong></p>
    <table class="table deleted-users">
        <thead>
            <tr>
                <th>ID</th>
                <th>Name</th>
                <th>Email</th>
                <th>Role</th>
                <th>Actions</th>
            </tr>
        </thead>
        <tbody>
            @foreach($deletedUsers as $user)
            <tr>
                <td>{{ $user->id }}</td>
                <td>{{ $user->name }}</td>
                <td>{{ $user->email }}</td>
                <td>
                    @foreach($user->roles as $role)
                        {{ $role->name }} 
                    @endforeach
                </td>
                <td>
                    {!! Form::open(['route' => ['user.manager.restore', $user->id]]) !!}
                        {!! Form::submit('Restore', ['class' => 'btn btn-warning btn-sm pull-left']) !!}
                    {!! Form::close() !!}

                    {!! Form::open(['route' => ['user.manager.permanentlyDestroy', $user->id], 'method' => 'DELETE']) !!}
                        {!! Form::submit('Delete permanently', ['class' => 'btn btn-danger btn-sm pull-left']) !!}
                    {!! Form::close() !!}
                </td>
            </tr>
            @endforeach
        </tbody>
    </table>
    <hr>
@endif
@if(!$users->count() && !$deletedUsers->count())
    <p>No users found.</p>
@endif

@endsection
{'fraction_non_alphanumeric': 0.19494470774091627, 'fraction_numerical': 0.0009478672985781991, 'mean_word_length': 1.162226775956284, 'pattern_counts': {'":': 0, '<': 163, '<?xml version=': 0, '>': 221, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6251988', 'n_tokens_mistral': 1889, 'n_tokens_neox': 1782, 'n_words': 334}