config.blade.php 10.9 KB
@extends('layout.admin', ['title' => 'Админка - Настройки'])

@section('content')
    <h4 class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300">
        Реквизиты сайта (конфигурация)
    </h4>
    <form action="" method="POST" enctype="multipart/form-data">
        @csrf

    <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800">
        <label class="block text-sm">
            <span class="text-gray-700 dark:text-gray-400">Имя компании</span>
            <input name="name" id="name"
                   class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
                   placeholder="Имя компании" value="{{ old('name') ?? $config->name ?? '' }}"
            />
            @error('name')
            <span class="text-xs text-red-600 dark:text-red-400">
                  {{ $message }}
            </span>
            @enderror
        </label><br>

        <label class="block text-sm">
            <span class="text-gray-700 dark:text-gray-400">Адрес</span>
            <input name="address" id="address"
                   class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
                   placeholder="Адрес" value="{{ old('address') ?? $config->address ?? '' }}"
            />
            @error('address')
            <span class="text-xs text-red-600 dark:text-red-400">
                  {{ $message }}
            </span>
            @enderror
        </label><br>

        <label class="block text-sm">
            <span class="text-gray-700 dark:text-gray-400">ФИО директора компании</span>
            <input name="fio_director" id="fio_director"
                   class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
                   placeholder="ФИО директора" value="{{ old('fio_director') ?? $config->fio_director ?? '' }}"
            />
            @error('fio_director')
            <span class="text-xs text-red-600 dark:text-red-400">
                  {{ $message }}
            </span>
            @enderror
        </label><br>

        <label class="block text-sm">
            <span class="text-gray-700 dark:text-gray-400">Email</span>
            <input name="email" id="email"
                   class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
                   placeholder="Почта" value="{{ old('email') ?? $config->email ?? '' }}"
            />
            @error('email')
            <span class="text-xs text-red-600 dark:text-red-400">
                  {{ $message }}
            </span>
            @enderror
        </label><br>

        <label class="block text-sm">
            <span class="text-gray-700 dark:text-gray-400">Телефон</span>
            <input name="telephone" id="telephone"
                   class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
                   placeholder="Телефон" value="{{ old('telephone') ?? $config->telephone ?? '' }}"
            />
            @error('telephone')
            <span class="text-xs text-red-600 dark:text-red-400">
                  {{ $message }}
            </span>
            @enderror
        </label><br>

        <label class="block text-sm">
            <span class="text-gray-700 dark:text-gray-400">Сайт</span>
            <input name="site" id="site"
                   class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
                   placeholder="Сайт" value="{{ old('site') ?? $config->site ?? '' }}"
            />
            @error('site')
            <span class="text-xs text-red-600 dark:text-red-400">
                  {{ $message }}
            </span>
            @enderror
        </label><br>

        <label class="block text-sm">
            <span class="text-gray-700 dark:text-gray-400">Телеграм</span>
            <input name="telegram" id="telegram"
                   class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
                   placeholder="Телеграм линк" value="{{ old('telegram') ?? $config->telegram ?? '' }}"
            />
            @error('telegram')
            <span class="text-xs text-red-600 dark:text-red-400">
                  {{ $message }}
            </span>
            @enderror
        </label><br>

        <label class="block text-sm">
            <span class="text-gray-700 dark:text-gray-400">Вконтакте</span>
            <input name="vkontact" id="vkontact"
                   class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
                   placeholder="Вконтакте линк" value="{{ old('vkontact') ?? $config->vkontact ?? '' }}"
            />
            @error('vkontact')
            <span class="text-xs text-red-600 dark:text-red-400">
                  {{ $message }}
            </span>
            @enderror
        </label><br>

        <label class="block text-sm">
            <span class="text-gray-700 dark:text-gray-400">Лого</span>
            <input name="logo" id="logo" type="file"
                   class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
                   placeholder="Лого" value="{{ old('logo') ?? $config->logo ?? '' }}"
            />

            @if (isset($config->logo))
              <img src="<?=asset(Storage::url($config->logo))?>" width="150"/>
            @endif

            @error('logo')
            <span class="text-xs text-red-600 dark:text-red-400">
                  {{ $message }}
            </span>
            @enderror
        </label><br>

        <label class="block text-sm">
            <span class="text-gray-700 dark:text-gray-400">Картинка</span>
            <input name="image" id="image" type="file"
                   class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
                   placeholder="Картинка"
            />

            @if (isset($config->image))
                <img src="<?=asset(Storage::url($config->image))?>" width="150"/>
            @endif


            @error('image')
            <span class="text-xs text-red-600 dark:text-red-400">
                  {{ $message }}
            </span>
            @enderror
        </label><br>

        <label class="block text-sm">
            <span class="text-gray-700 dark:text-gray-400">Карта</span>
            <input name="map" id="map"
                   class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
                   placeholder="Карта" value="{{ old('map') ?? $config->map ?? '' }}"
            />
            @error('map')
            <span class="text-xs text-red-600 dark:text-red-400">
                  {{ $message }}
            </span>
            @enderror
        </label><br>

        <label class="block text-sm">
            <span class="text-gray-700 dark:text-gray-400">Описание</span>
            <textarea id="text" name="text"
                    class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-textarea focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray"
                    rows="3"
                    placeholder="Описание"
                >{{ old('text') ?? $config->text ?? '' }}</textarea>

            @error('text')
            <span class="text-xs text-red-600 dark:text-red-400">
                  {{ $message }}
            </span>
            @enderror
        </label><br>

        <label class="block text-sm">
            <span class="text-gray-700 dark:text-gray-400">Время повторного отклика для соискателя (в днях)</span>
            <input name="time_mess" id="time_mess"
                   class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
                   placeholder="Время отклика" value="{{ old('time_mess') ?? $config->time_mess ?? '' }}"
            />
            @error('time_mess')
            <span class="text-xs text-red-600 dark:text-red-400">
                  {{ $message }}
            </span>
            @enderror
        </label><br>

        <label class="block text-sm">
            <span class="text-gray-700 dark:text-gray-400">Время действия резюме (в днях)</span>
            <input name="time_resume" id="time_resume"
                   class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
                   placeholder="Время резюме" value="{{ old('time_resume') ?? $config->time_resume ?? '' }}"
            />
            @error('time_resume')
            <span class="text-xs text-red-600 dark:text-red-400">
                  {{ $message }}
            </span>
            @enderror
        </label><br>

        <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4">
            <div>
                <button class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">
                    Сохранить
                </button>
            </div>
        </div>
    </div>
    </form>
@endsection