@extends('twill::layouts.form', [ 'contentFieldsetLabel' => twillTrans('twill::lang.user-management.content-fieldset-label'), 'editModalTitle' => twillTrans('twill::lang.user-management.edit-modal-title'), 'reloadOnSuccess' => true ]) @php $isSuperAdmin = isset($item->role) ? $item->role === 'SUPERADMIN' : false; @endphp @section('contentFields') @can('edit-user-roles') @if($item->id !== $currentUser->id) @endif @endcan @if(config('twill.enabled.users-image')) @endif @if(config('twill.enabled.users-description')) @endif @php $languageOptions = array_map( function($locale) { return [ 'value' => $locale, 'label' => getLanguageLabelFromLocaleCode($locale, true) ]; }, config('twill.available_user_locales', ['en']) ); @endphp @if($with2faSettings ?? false) @unless($item->google_2fa_enabled ?? false)
{!! twillTrans('twill::lang.user-management.2fa-description', ['link' => 'https://github.com/antonioribeiro/google2fa#google-authenticator-apps']) !!}
@else @endunless @endif @can('manage-users') @if(config('twill.enabled.users-2fa') && $item->google_2fa_enabled && ($item->id !== $currentUser->id)) @endif @endcan @if(\A17\Twill\Facades\TwillPermissions::levelIsOneOf([\A17\Twill\Enums\PermissionLevel::LEVEL_ROLE_GROUP, \A17\Twill\Enums\PermissionLevel::LEVEL_ROLE_GROUP_ITEM])) @can('edit-user-groups') @else @if($item->groups->count()) @php $groups = json_encode($item->groups->map(function ($group) { return [ 'label' => $group->name, 'value' => $group->id ]; })); $values = json_encode($item->groups->map(function ($group) { return $group->id; })); @endphp @endif @endcan @endif @stop @section('fieldsets') @if(\A17\Twill\Facades\TwillPermissions::levelIs(\A17\Twill\Enums\PermissionLevel::LEVEL_ROLE_GROUP_ITEM)) @can('edit-users') @unless($item->isSuperAdmin() || $item->id === $currentUser->id) @foreach($permissionModules as $moduleName => $moduleItems) @endforeach @endif @endcan @endif @stop @push('vuexStore') window['{{ config('twill.js_namespace') }}'].STORE.publication.submitOptions = { draft: [ { name: 'save', text: {!! json_encode(twillTrans('twill::lang.user-management.update-disabled-user')) !!} }, { name: 'save-close', text: {!! json_encode(twillTrans('twill::lang.user-management.update-disabled-and-close')) !!} }, { name: 'save-new', text: {!! json_encode(twillTrans('twill::lang.user-management.update-disabled-user-and-create-new')) !!} }, { name: 'cancel', text: {!! json_encode(twillTrans('twill::lang.user-management.cancel')) !!} } ], live: [ { name: 'publish', text: {!! json_encode(twillTrans('twill::lang.user-management.enable-user')) !!} }, { name: 'publish-close', text: {!! json_encode(twillTrans('twill::lang.user-management.enable-user-and-close')) !!} }, { name: 'publish-new', text: {!! json_encode(twillTrans('twill::lang.user-management.enable-user-and-create-new')) !!} }, { name: 'cancel', text: {!! json_encode(twillTrans('twill::lang.user-management.cancel')) !!} } ], update: [ { name: 'update', text: {!! json_encode(twillTrans('twill::lang.user-management.update')) !!} }, { name: 'update-close', text: {!! json_encode(twillTrans('twill::lang.user-management.update-and-close')) !!} }, { name: 'update-new', text: {!! json_encode(twillTrans('twill::lang.user-management.update-and-create-new')) !!} }, { name: 'cancel', text: {!! json_encode(twillTrans('twill::lang.user-management.cancel')) !!} } ] } @unless($item->isSuperAdmin()) @can('edit-users') window['{{ config('twill.js_namespace') }}'].STORE.publication.userInfo = { user_name: '{{ $item->name }}', registered_at: '{{ $item->isActivated() ? $item->registered_at->format('d M Y') : "Pending ({$item->created_at->format('d M Y')})" }}', last_login_at: '{{ $item->isActivated() && $item->last_login_at ? $item->last_login_at->format('d M Y, H:i') : null }}', resend_registration_link: '{{ $item->isPublished() && !$item->isActivated() ? route('twill.users.resend.registrationEmail', ['user' => $item]) : null }}', is_activated: {{ json_encode($item->isActivated()) }} } @endcan @endunless @if ($item->id == $currentUser->id) window['{{ config('twill.js_namespace') }}'].STORE.publication.withPublicationToggle = false @endif @endpush @push('extra_js') @endpush