Merge: integrar cambios del trabajo con chat en tiempo real
This commit is contained in:
@@ -1,95 +1,137 @@
|
||||
<x-form-section submit="updateProfileInformation">
|
||||
<x-slot name="title">
|
||||
{{ __('Profile Information') }}
|
||||
{{ __('Información de perfil') }}
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="description">
|
||||
{{ __('Update your account\'s profile information and email address.') }}
|
||||
{{ __('Actualice la información de su cuenta y dirección de correo electrónico.') }}
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="form">
|
||||
<!-- Profile Photo -->
|
||||
@if (Laravel\Jetstream\Jetstream::managesProfilePhotos())
|
||||
<div x-data="{photoName: null, photoPreview: null}" class="col-span-6 sm:col-span-4">
|
||||
<!-- Profile Photo File Input -->
|
||||
<input type="file" id="photo" class="hidden"
|
||||
wire:model.live="photo"
|
||||
x-ref="photo"
|
||||
x-on:change="
|
||||
photoName = $refs.photo.files[0].name;
|
||||
const reader = new FileReader();
|
||||
reader.onload = (e) => {
|
||||
photoPreview = e.target.result;
|
||||
};
|
||||
reader.readAsDataURL($refs.photo.files[0]);
|
||||
" />
|
||||
<div class="col-12">
|
||||
<div class="row">
|
||||
|
||||
<x-label for="photo" value="{{ __('Photo') }}" />
|
||||
|
||||
<!-- Current Profile Photo -->
|
||||
<div class="mt-2" x-show="! photoPreview">
|
||||
<img src="{{ $this->user->profile_photo_url }}" alt="{{ $this->user->name }}" class="rounded-full size-20 object-cover">
|
||||
|
||||
<!-- Columna derecha: Nombre y correo -->
|
||||
<div class="col-12 col-md-8">
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="name" class="form-label fw-bold">Nombre</label>
|
||||
<input id="name" type="text" class="form-control"
|
||||
wire:model="state.name" required autocomplete="name" />
|
||||
<x-input-error for="name" class="mt-1" />
|
||||
</div>
|
||||
|
||||
<div class=" mb-3">
|
||||
<label for="apellidoPaterno" class="form-label fw-bold">Apellido paterno</label>
|
||||
<input id="apellidoPaterno" type="text" class="form-control"
|
||||
wire:model="state.apellidoPaterno" autocomplete="off" />
|
||||
<x-input-error for="apellidoPaterno" class="mt-1" />
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="apellidoMaterno" class="form-label fw-bold">Apellido materno</label>
|
||||
<input id="apellidoMaterno" type="text" class="form-control"
|
||||
wire:model="state.apellidoMaterno" autocomplete="off" />
|
||||
<x-input-error for="apellidoMaterno" class="mt-1" />
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="email" class="form-label fw-bold">Correo electrónico</label>
|
||||
<input id="email" type="email" class="form-control"
|
||||
wire:model="state.email" required autocomplete="username" />
|
||||
<x-input-error for="email" class="mt-1" />
|
||||
|
||||
@if (Laravel\Fortify\Features::enabled(Laravel\Fortify\Features::emailVerification()) && ! $this->user->hasVerifiedEmail())
|
||||
<p class="text-muted small mt-2">
|
||||
Tu dirección de correo no está verificada.
|
||||
<button type="button" class="btn btn-link btn-sm p-0"
|
||||
wire:click.prevent="sendEmailVerification">
|
||||
Reenviar verificación
|
||||
</button>
|
||||
</p>
|
||||
|
||||
@if ($this->verificationLinkSent)
|
||||
<p class="text-success small mt-1">
|
||||
<i class="fas fa-check mr-1"></i>
|
||||
Se envió un nuevo enlace de verificación a tu correo.
|
||||
</p>
|
||||
@endif
|
||||
@endif
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- New Profile Photo Preview -->
|
||||
<div class="mt-2" x-show="photoPreview" style="display: none;">
|
||||
<span class="block rounded-full size-20 bg-cover bg-no-repeat bg-center"
|
||||
x-bind:style="'background-image: url(\'' + photoPreview + '\');'">
|
||||
</span>
|
||||
|
||||
<!-- Columna izquierda: Foto -->
|
||||
@if (Laravel\Jetstream\Jetstream::managesProfilePhotos())
|
||||
<div x-data="{photoName: null, photoPreview: null}" class="col-12 col-md-4 d-flex flex-column align-items-center mb-4">
|
||||
|
||||
<input type="file" id="photo" class="d-none"
|
||||
wire:model.live="photo"
|
||||
x-ref="photo"
|
||||
x-on:change="
|
||||
photoName = $refs.photo.files[0].name;
|
||||
const reader = new FileReader();
|
||||
reader.onload = (e) => { photoPreview = e.target.result; };
|
||||
reader.readAsDataURL($refs.photo.files[0]);
|
||||
" />
|
||||
|
||||
<label class="form-label fw-bold mb-3">Foto de perfil</label>
|
||||
|
||||
<!-- Foto actual -->
|
||||
<div x-show="! photoPreview" class="mb-3">
|
||||
<img src="{{ $this->user->profile_photo_url }}"
|
||||
alt="{{ $this->user->name }}"
|
||||
class="rounded-circle border shadow-sm"
|
||||
style="width: 120px; height: 120px; object-fit: cover;">
|
||||
</div>
|
||||
|
||||
<!-- Preview nueva foto -->
|
||||
<div x-show="photoPreview" style="display: none;" class="mb-3">
|
||||
<span class="rounded-circle d-block border shadow-sm"
|
||||
x-bind:style="'background-image: url(\'' + photoPreview + '\'); width:120px; height:120px; border-radius:50%; background-size:cover; background-position:center;'">
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- Botones debajo de la foto -->
|
||||
<div class="d-flex flex-column align-items-center gap-2" style="width: 160px;">
|
||||
<button type="button" class="btn btn-sm btn-outline-secondary w-100"
|
||||
x-on:click.prevent="$refs.photo.click()">
|
||||
<i class="fas fa-camera mr-1"></i> Cambiar foto
|
||||
</button>
|
||||
|
||||
@if ($this->user->profile_photo_path)
|
||||
<button type="button" class="btn btn-sm btn-outline-danger w-100"
|
||||
wire:click="deleteProfilePhoto">
|
||||
<i class="fas fa-trash mr-1"></i> Eliminar foto
|
||||
</button>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<x-input-error for="photo" class="mt-2" />
|
||||
</div>
|
||||
|
||||
<x-secondary-button class="mt-2 me-2" type="button" x-on:click.prevent="$refs.photo.click()">
|
||||
{{ __('Select A New Photo') }}
|
||||
</x-secondary-button>
|
||||
|
||||
@if ($this->user->profile_photo_path)
|
||||
<x-secondary-button type="button" class="mt-2" wire:click="deleteProfilePhoto">
|
||||
{{ __('Remove Photo') }}
|
||||
</x-secondary-button>
|
||||
@endif
|
||||
|
||||
<x-input-error for="photo" class="mt-2" />
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Name -->
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<x-label for="name" value="{{ __('Name') }}" />
|
||||
<x-input id="name" type="text" class="mt-1 block w-full" wire:model="state.name" required autocomplete="name" />
|
||||
<x-input-error for="name" class="mt-2" />
|
||||
</div>
|
||||
|
||||
<!-- Email -->
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<x-label for="email" value="{{ __('Email') }}" />
|
||||
<x-input id="email" type="email" class="mt-1 block w-full" wire:model="state.email" required autocomplete="username" />
|
||||
<x-input-error for="email" class="mt-2" />
|
||||
|
||||
@if (Laravel\Fortify\Features::enabled(Laravel\Fortify\Features::emailVerification()) && ! $this->user->hasVerifiedEmail())
|
||||
<p class="text-sm mt-2">
|
||||
{{ __('Your email address is unverified.') }}
|
||||
|
||||
<button type="button" class="underline text-sm text-gray-600 hover:text-gray-900 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500" wire:click.prevent="sendEmailVerification">
|
||||
{{ __('Click here to re-send the verification email.') }}
|
||||
</button>
|
||||
</p>
|
||||
|
||||
@if ($this->verificationLinkSent)
|
||||
<p class="mt-2 font-medium text-sm text-green-600">
|
||||
{{ __('A new verification link has been sent to your email address.') }}
|
||||
</p>
|
||||
@endif
|
||||
@endif
|
||||
</div>
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="actions">
|
||||
<x-action-message class="me-3" on="saved">
|
||||
{{ __('Saved.') }}
|
||||
</x-action-message>
|
||||
|
||||
<x-button wire:loading.attr="disabled" wire:target="photo">
|
||||
{{ __('Save') }}
|
||||
</x-button>
|
||||
|
||||
<button type="submit" class="btn btn-primary"
|
||||
wire:loading.attr="disabled" wire:target="photo">
|
||||
<span wire:loading wire:target="photo"
|
||||
class="spinner-border spinner-border-sm mr-1"
|
||||
role="status" aria-hidden="true"></span>
|
||||
Guardar
|
||||
</button>
|
||||
</x-slot>
|
||||
|
||||
|
||||
</x-form-section>
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user