<commit_before>@section('header')
    <h1><i class="fa fa-fw fa-users"></i> Users <small>User details</small></h1>
@endsection

@section('content')
    <div class="row">
        <div class="col-sm-5">
            <div class="box box-widget widget-user-2">
                <div class="widget-user-header bg-blue">
                    <div class="widget-user-image">
                        {!! Html::image($user->gravatar, $user->full_name, ['class' => 'img-circle']) !!}
                    </div>
                    <h3 class="widget-user-username">{{ $user->full_name }}</h3>
                    <h5 class="widget-user-desc">{{ $user->since_date }}</h5>
                </div>
                <div class="box-body">
                    <table class="table table-condensed">
                        <thead>
                            <tr>
                                <th>Username</th>
                                <td>{{ $user->username }}</td>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <th>First Name</th>
                                <td>{{ $user->first_name }}</td>
                            </tr>
                            <tr>
                                <th>Last Name</th>
                                <td>{{ $user->last_name }}</td>
                            </tr>
                            <tr>
                                <th>Email</th>
                                <td>{{ $user->email }}</td>
                            </tr>
                            <tr>
                                <th>Status</th>
                                <td>
                                    @if ($user->isAdmin())
                                        <span class="label label-warning" style="margin-right: 5px;">
                                            <i class="fa fa-fw fa-star"></i> SUPER ADMIN
                                        </span>
                                    @endif

                                    @if ($user->isActive())
                                        <span class="label label-success">Acitve</span>
                                    @else
                                        <span class="label label-default">Disabled</span>
                                    @endif

                                    @if ($user->trashed())
                                        <span class="label label-danger" style="margin-left: 5px;">
                                            <i class="fa fa-fw fa-trash-o"></i> Trashed
                                        </span>
                                    @endif
                                </td>
                            </tr>
                            <tr>
                                <th>Created at</th>
                                <td>{{ $user->created_at }}</td>
                            </tr>
                            <tr>
                                <th>Updated at</th>
                                <td>{{ $user->updated_at }}</td>
                            </tr>
                            @if ($user->trashed())
                                <tr>
                                    <th>Deleted at</th>
                                    <td>{{ $user->deleted_at }}</td>
                                </tr>
                            @endif
                        </tbody>
                    </table>
                </div>
                <div class="box-footer text-right">
                    <a href="{{ route('auth::foundation.users.edit', [$user->hashed_id]) }}" class="btn btn-xs btn-warning">
                        <i class="fa fa-fw fa-pencil"></i> Edit
                    </a>

                    @if ($user->isAdmin())
                        @if ($user->isActive())
                            <a href="javascript:void(0);" class="btn btn-xs btn-inverse" disabled="disabled">
                                <i class="fa fa-fw fa-power-off"></i> Disable
                            </a>
                        @else
                            <a href="javascript:void(0);" class="btn btn-xs btn-success" disabled="disabled">
                                <i class="fa fa-fw fa-power-off"></i> Activate
                            </a>
                        @endif
                    @else
                        @if ($user->isActive())
                            <button class="btn btn-xs btn-inverse" data-toggle="modal" data-target="#activateUserModal">
                                <i class="fa fa-fw fa-power-off"></i> Disable
                            </button>
                        @else
                            <button class="btn btn-xs btn-success" data-toggle="modal" data-target="#activateUserModal">
                                <i class="fa fa-fw fa-power-off"></i> Activate
                            </button>
                        @endif
                    @endif

                    @if ($user->trashed())
                        <button class="btn btn-xs btn-primary" data-toggle="modal" data-target="#restoreUserModal">
                            <i class="fa fa-fw fa-reply"></i> Restore
                        </button>
                    @endif

                    @if ($user->isAdmin())
                        <a href="javascript:void(0);" class="btn btn-xs btn-danger" disabled="disabled">
                            <i class="fa fa-fw fa-trash-o"></i> Delete
                        </a>
                    @else
                        <button class="btn btn-xs btn-danger" data-toggle="modal" data-target="#deleteUserModal">
                            <i class="fa fa-fw fa-trash-o"></i> Delete
                        </button>
                    @endif
                </div>
            </div>
        </div>
        <div class="col-sm-7">
            <div class="box box-warning">
                <div class="box-header with-border">
                    <h3 class="box-title">Roles</h3>
                </div>
                <div class="box-body table-responsive">
                    <table class="table table-condensed">
                        <thead>
                            <tr>
                                <th>Name</th>
                                <th>Description</th>
                                <th class="text-right">Actions</th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach ($user->roles as $role)
                                <tr>
                                    <td><span class="label label-primary">{{ $role->name }}</span></td>
                                    <td>{{ $role->description }}</td>
                                    <td class="text-right">
                                        <a href="{{ route('auth::foundation.roles.show', [$role->hashed_id]) }}" class="btn btn-xs btn-info" data-toggle="tooltip" data-original-title="Show">
                                            <i class="fa fa-fw fa-search"></i>
                                        </a>
                                    </td>
                                </tr>
                            @endforeach
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    {{-- ACTIVATE MODAL --}}
    <div id="activateUserModal" class="modal fade" data-backdrop="false" tabindex="-1" role="dialog" aria-labelledby="activateUserModalLabel">
        <div class="modal-dialog" role="document">
            {!! Form::open(['route' => ['auth::foundation.users.activate', $user->hashed_id], 'method' => 'PUT', 'id' => 'activateUserForm', 'class' => 'form form-loading', 'autocomplete' => 'off']) !!}
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                        <h4 class="modal-title" id="activateUserModalLabel">
                            {!! $user->isActive() ? 'Disable User' : 'Activate User' !!}
                        </h4>
                    </div>
                    <div class="modal-body">
                        <p>
                            @if ($user->isActive())
                                Are you sure you want to <span class="label label-inverse">disable</span> this user : <strong>{{ $user->username }}</strong> ?
                            @else
                                Are you sure you want to <span class="label label-success">activate</span> this user : <strong>{{ $user->username }}</strong> ?
                            @endif
                        </p>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-sm btn-default pull-left" data-dismiss="modal">Cancel</button>
                        @if ($user->isActive())
                            <button id="disableBtn" type="submit" class="btn btn-sm btn-inverse" data-loading-text="Loading&hellip;">
                                <i class="fa fa-fw fa-power-off"></i> Disable
                            </button>
                        @else
                            <button id="activateBtn" type="submit" class="btn btn-sm btn-success" data-loading-text="Loading&hellip;">
                                <i class="fa fa-fw fa-power-off"></i> Activate
                            </button>
                        @endif
                    </div>
                </div>
            {!! Form::close() !!}
        </div>
    </div>

    {{-- RESTORE MODAL --}}
    @if ($user->trashed())
        <div id="restoreUserModal" class="modal fade" data-backdrop="false" tabindex="-1" role="dialog" aria-labelledby="restoreUserModalLabel"><commit_msg>Fixing the user's show view<commit_after>@section('header')
    <h1><i class="fa fa-fw fa-users"></i> Users <small>User details</small></h1>
@endsection

@section('content')
    <div class="row">
        <div class="col-sm-5">
            <div class="box box-widget widget-user-2">
                <div class="widget-user-header bg-blue">
                    <div class="widget-user-image">
                        {!! Html::image($user->gravatar, $user->full_name, ['class' => 'img-circle']) !!}
                    </div>
                    <h3 class="widget-user-username">{{ $user->full_name }}</h3>
                    <h5 class="widget-user-desc">{{ $user->since_date }}</h5>
                </div>
                <div class="box-body">
                    <table class="table table-condensed">
                        <thead>
                            <tr>
                                <th>Username</th>
                                <td>{{ $user->username }}</td>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <th>First Name</th>
                                <td>{{ $user->first_name }}</td>
                            </tr>
                            <tr>
                                <th>Last Name</th>
                                <td>{{ $user->last_name }}</td>
                            </tr>
                            <tr>
                                <th>Email</th>
                                <td>{{ $user->email }}</td>
                            </tr>
                            <tr>
                                <th>Status</th>
                                <td>
                                    @if ($user->isAdmin())
                                        <span class="label label-warning" style="margin-right: 5px;">
                                            <i class="fa fa-fw fa-star"></i> SUPER ADMIN
                                        </span>
                                    @endif

                                    @if ($user->isActive())
                                        <span class="label label-success">Acitve</span>
                                    @else
                                        <span class="label label-default">Disabled</span>
                                    @endif

                                    @if ($user->trashed())
                                        <span class="label label-danger" style="margin-left: 5px;">
                                            <i class="fa fa-fw fa-trash-o"></i> Trashed
                                        </span>
                                    @endif
                                </td>
                            </tr>
                            <tr>
                                <th>Created at</th>
                                <td>{{ $user->created_at }}</td>
                            </tr>
                            <tr>
                                <th>Updated at</th>
                                <td>{{ $user->updated_at }}</td>
                            </tr>
                            @if ($user->trashed())
                                <tr>
                                    <th>Deleted at</th>
                                    <td>{{ $user->deleted_at }}</td>
                                </tr>
                            @endif
                        </tbody>
                    </table>
                </div>
                <div class="box-footer text-right">
                    <a href="{{ route('auth::foundation.users.edit', [$user->hashed_id]) }}" class="btn btn-xs btn-warning">
                        <i class="fa fa-fw fa-pencil"></i> Edit
                    </a>

                    @if ($user->isAdmin())
                        @if ($user->isActive())
                            <a href="javascript:void(0);" class="btn btn-xs btn-inverse" disabled="disabled">
                                <i class="fa fa-fw fa-power-off"></i> Disable
                            </a>
                        @else
                            <a href="javascript:void(0);" class="btn btn-xs btn-success" disabled="disabled">
                                <i class="fa fa-fw fa-power-off"></i> Activate
                            </a>
                        @endif
                    @else
                        @if ($user->isActive())
                            <button class="btn btn-xs btn-inverse" data-toggle="modal" data-target="#activateUserModal">
                                <i class="fa fa-fw fa-power-off"></i> Disable
                            </button>
                        @else
                            <button class="btn btn-xs btn-success" data-toggle="modal" data-target="#activateUserModal">
                                <i class="fa fa-fw fa-power-off"></i> Activate
                            </button>
                        @endif
                    @endif

                    @if ($user->trashed())
                        <button class="btn btn-xs btn-primary" data-toggle="modal" data-target="#restoreUserModal">
                            <i class="fa fa-fw fa-reply"></i> Restore
                        </button>
                    @endif

                    @if ($user->isAdmin())
                        <a href="javascript:void(0);" class="btn btn-xs btn-danger" disabled="disabled">
                            <i class="fa fa-fw fa-trash-o"></i> Delete
                        </a>
                    @else
                        <button class="btn btn-xs btn-danger" data-toggle="modal" data-target="#deleteUserModal">
                            <i class="fa fa-fw fa-trash-o"></i> Delete
                        </button>
                    @endif
                </div>
            </div>
        </div>
        <div class="col-sm-7">
            <div class="box box-warning">
                <div class="box-header with-border">
                    <h3 class="box-title">Roles</h3>
                </div>
                <div class="box-body table-responsive">
                    <table class="table table-condensed">
                        <thead>
                            <tr>
                                <th>Name</th>
                                <th>Description</th>
                                <th class="text-right">Actions</th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach ($user->roles as $role)
                                <tr>
                                    <td><span class="label label-primary">{{ $role->name }}</span></td>
                                    <td>{{ $role->description }}</td>
                                    <td class="text-right">
                                        <a href="{{ route('auth::foundation.roles.show', [$role->hashed_id]) }}" class="btn btn-xs btn-info" data-toggle="tooltip" data-original-title="Show">
                                            <i class="fa fa-fw fa-search"></i>
                                        </a>
                                    </td>
                                </tr>
                            @endforeach
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    {{-- ACTIVATE MODAL --}}
    <div id="activateUserModal" class="modal fade" data-backdrop="false" tabindex="-1" role="dialog" aria-labelledby="activateUserModalLabel">
        <div class="modal-dialog" role="document">
            {!! Form::open(['route' => ['auth::foundation.users.activate', $user->hashed_id], 'method' => 'PUT', 'id' => 'activateUserForm', 'class' => 'form form-loading', 'autocomplete' => 'off']) !!}
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                        <h4 class="modal-title" id="activateUserModalLabel">
                            {{ $user->isActive() ? 'Disable User' : 'Activate User' }}
                        </h4>
                    </div>
                    <div class="modal-body">
                        @if ($user->isActive())
                            <p>Are you sure you want to <span class="label label-inverse">disable</span> this user : <strong>{{ $user->username }}</strong> ?</p>
                        @else
                            <p>Are you sure you want to <span class="label label-success">activate</span> this user : <strong>{{ $user->username }}</strong> ?</p>
                        @endif
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-sm btn-default pull-left" data-dismiss="modal">Cancel</button>
                        @if ($user->isActive())
                            <button id="disableBtn" type="submit" class="btn btn-sm btn-inverse" data-loading-text="Loading&hellip;">
                                <i class="fa fa-fw fa-power-off"></i> Disable
                            </button>
                        @else
                            <button id="activateBtn" type="submit" class="btn btn-sm btn-success" data-loading-text="Loading&hellip;">
                                <i class="fa fa-fw fa-power-off"></i> Activate
                            </button>
                        @endif
                    </div>
                </div>
            {!! Form::close() !!}
        </div>
    </div>

    {{-- RESTORE MODAL --}}
    @if ($user->trashed())
        <div id="restoreUserModal" class="modal fade" data-backdrop="false" tabindex="-1" role="dialog" aria-labelledby="restoreUserModalLabel">
{'fraction_non_alphanumeric': 0.1357858531478989, 'fraction_numerical': 0.0019939185484272965, 'mean_word_length': 0.869014346934973, 'pattern_counts': {'":': 0, '<': 403, '<?xml version=': 0, '>': 479, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 72, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4884521', 'n_tokens_mistral': 4869, 'n_tokens_neox': 4558, 'n_words': 939}