cabinet45.blade.php 10.1 KB
@extends('layout.frontend', ['title' => 'Кабинет работодателя - РекаМоре'])

@section('scripts')
    <script src="https://cdn.ckeditor.com/ckeditor5/23.0.0/classic/ckeditor.js"></script>
    <script>
        ClassicEditor
            .create( document.querySelector( '#text' ) )
            .catch( error => {
                console.error( error );
            } );
    </script>
@endsection
@section('content')
    <section class="cabinet">
        <div class="container">
            <ul class="breadcrumbs cabinet__breadcrumbs">
                <li><a href="{{ route('index') }}">Главная</a></li>
                <li><b>Личный кабинет</b></li>
            </ul>
            <div class="cabinet__wrapper">
                <div class="cabinet__side">
                    <div class="cabinet__side-toper">
                        @include('employers.emblema')
                    </div>

                    @include('employers.menu', ['item' => 1])

                </div>
                <div class="cabinet__body">
                    @include('messages_error')

                <form  action="{{ route('employer.cabinet_save', ['Employer' => $Employer[0]->id]) }}" method="POST" enctype="multipart/form-data">
                    @csrf
                    <div class="cabinet__body-item">
                        <div class="cabinet__descr">
                            <h2 class="title cabinet__title">Мой профиль</h2>
                            <p class="cabinet__text">Все поля обязательны для заполнения *</p>
                        </div>
                        <div class="cabinet__avatar">
                            <div class="cabinet__avatar-pic">
                                @if (!empty($Employer[0]->logo))
                                    <img src="{{ asset(Storage::url($Employer[0]->logo)) }}" width="150" alt="{{ $Employer[0]->name_company }}">
                                @else
                                    <img src="{{ asset('images/logo_emp.png') }}" width="150" alt="{{ $Employer[0]->name_company }}"/>
                                @endif
                            </div>
                            <div class="cabinet__avatar-form">
                                <label class="file">
                                        <span class="file__input">
                                            <input type="file" name="logo">
                                            <span class="button">
                                                <svg>
                                                    <use xlink:href="{{ asset('images/sprite.svg#plus') }}"></use>
                                                </svg>
                                                Загрузить
                                            </span>
                                        </span>
                                </label>
                                <p class="cabinet__text">Загрузите логотип в формате .svg, .jpg, .png или .jpeg</p>
                            </div>
                        </div>
                        <div class="cabinet__inputs">
                            <div class="cabinet__inputs-item form-group">
                                <label class="form-group__label">Название судоходной компании</label>
                                <div class="form-group__item">
                                    <input type="text" class="input" name="name_company" id="name_company" placeholder="ООО Река Море" value="{{ old('name_company') ?? $Employer[0]->name_company ?? '' }}" required>
                                    @error('name_company')
                                    <span class="text-xs text-red-600">
                                          {{ $message }}
                                    </span>
                                    @enderror
                                </div>
                            </div>
                            <div class="cabinet__inputs-item form-group">
                                <label class="form-group__label">Электронная почта</label>
                                <div class="form-group__item">
                                    <input type="email" name="email" class="input" placeholder="info@rekamore.su" value="{{ old('email') ?? $Employer[0]->email ?? '' }}" required>
                                    @error('email')
                                    <span class="text-xs text-red-600">
                                          {{ $message }}
                                    </span>
                                    @enderror
                                </div>
                            </div>

                            <div class="cabinet__inputs-item form-group">
                                <label class="form-group__label">Электронная почта (alt)</label>
                                <div class="form-group__item">
                                    <input type="email" name="email_2" class="input" placeholder="info@rekamore.su" value="{{ old('email_2') ?? $Employer[0]->email_2 ?? '' }}">
                                    @error('email')
                                    <span class="text-xs text-red-600">
                                          {{ $message }}
                                    </span>
                                    @enderror
                                </div>
                            </div>

                            <div class="cabinet__inputs-item form-group">
                                <label class="form-group__label">Номер телефона</label>
                                <div class="form-group__item">
                                    <input type="tel" name="telephone" class="input" placeholder="+7 (___) ___-__-__" value="{{ old('telephone') ?? $Employer[0]->telephone ?? '' }}" required>
                                    @error('telephone')
                                    <span class="text-xs text-red-600">
                                          {{ $message }}
                                    </span>
                                    @enderror
                                </div>
                            </div>

                            <div class="cabinet__inputs-item form-group">
                                <label class="form-group__label">Номер телефона (alt)</label>
                                <div class="form-group__item">
                                    <input type="tel" name="telephone_2" class="input" placeholder="+7 (___) ___-__-__" value="{{ old('telephone_2') ?? $Employer[0]->telephone_2 ?? '' }}">
                                    @error('telephone')
                                    <span class="text-xs text-red-600">
                                          {{ $message }}
                                    </span>
                                    @enderror
                                </div>
                            </div>

                            <div class="cabinet__inputs-item form-group">
                                <label class="form-group__label">Адрес компании</label>
                                <div class="form-group__item">
                                    <input type="text" name="address" class="input" value="{{ old('address') ?? $Employer[0]->address ?? '' }}" placeholder="692904, Приморский край, г. Находка, ул. Портовая 3А, 5 этаж">
                                    @error('address')
                                    <span class="text-xs text-red-600">
                                          {{ $message }}
                                    </span>
                                    @enderror
                                </div>
                            </div>
                            <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
                                <label class="form-group__label">Ссылка на сайт</label>
                                <div class="form-group__item">
                                    <input type="url" name="site" class="input" value="{{ old('site') ?? $Employer[0]->site ?? '' }}" placeholder="https://rekamore.su">
                                    @error('site')
                                    <span class="text-xs text-red-600">
                                          {{ $message }}
                                    </span>
                                    @enderror
                                </div>
                            </div>

                            <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
                                <label class="form-group__label">О компании</label>
                                <div class="form-group__item">

                                   <textarea name="text" id="txtarea" class="textarea ckeditor">{{ old('text') ?? $Employer[0]->text ?? '' }}</textarea>
                                    @error('text')
                                    <span class="text-xs text-red-600">
                                          {{ $message }}
                                    </span>
                                    @enderror
                                </div>
                            </div>
                        </div>
                    </div><br>
                    <button type="submit" class="button cabinet__submit">Сохранить изменения</button>
                </form>

                </div>
            </div>
        </div>

    </section>
</div>
    <!-- END TOP WRAPPER -->
    <script src="//cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script>
    <script>
        CKEDITOR.replace('txtarea');
        //CKEDITOR.replace( 'text', {
        //     filebrowserUploadUrl: "{{route('ckeditor.image-upload', ['_token' => csrf_token() ])}}",
        //     filebrowserImageUploadUrl: "{{ route('ckeditor.image-upload', ['_token' => csrf_token() ])}}",
        //     filebrowserUploadMethod: 'form'
        // });
    </script>

@endsection