Files
tehnobox/resources/views/admin/home-slides/_form.blade.php
ssww23 93a655235a
Some checks failed
Deploy / deploy (push) Has been cancelled
Initial commit
2026-03-10 00:55:37 +03:00

72 lines
3.0 KiB
PHP

<label>
Блок на главной
<select name="zone" required>
@foreach ($zoneLabels as $zoneKey => $zoneLabel)
<option value="{{ $zoneKey }}" @selected(old('zone', $slide->zone ?? 'left') === $zoneKey)>{{ $zoneLabel }}</option>
@endforeach
</select>
</label>
<label>
Заголовок
<input type="text" name="title" value="{{ old('title', $slide->title ?? '') }}" maxlength="160" placeholder="Например: Скидки на видеокарты">
</label>
<label>
Подзаголовок
<textarea name="subtitle" rows="3" maxlength="1500" placeholder="Короткий текст на баннере">{{ old('subtitle', $slide->subtitle ?? '') }}</textarea>
</label>
<div class="pc-grid pc-grid-2">
<label>
Текст кнопки
<input type="text" name="button_text" value="{{ old('button_text', $slide->button_text ?? '') }}" maxlength="60" placeholder="Подробнее">
</label>
<label>
Ссылка кнопки
<input type="text" name="button_url" value="{{ old('button_url', $slide->button_url ?? '') }}" maxlength="255" placeholder="/catalog или https://...">
</label>
</div>
<div class="pc-grid pc-grid-3">
<label class="pc-checkbox">
<input type="checkbox" name="show_title" value="1" @checked(old('show_title', $slide->show_title ?? true))>
<span>Показывать заголовок</span>
</label>
<label class="pc-checkbox">
<input type="checkbox" name="show_subtitle" value="1" @checked(old('show_subtitle', $slide->show_subtitle ?? true))>
<span>Показывать описание</span>
</label>
<label class="pc-checkbox">
<input type="checkbox" name="show_button" value="1" @checked(old('show_button', $slide->show_button ?? true))>
<span>Показывать кнопку</span>
</label>
</div>
<div class="pc-grid pc-grid-2">
<label>
Порядок
<input type="number" min="0" max="9999" name="sort_order" value="{{ old('sort_order', $slide->sort_order ?? 100) }}" required>
</label>
<label>
Изображение (jpg, png, webp)
<input class="pc-file-input" type="file" name="image" accept=".jpg,.jpeg,.png,.webp,image/jpeg,image/png,image/webp" @required(empty($slide?->id))>
</label>
</div>
@if (!empty($slide?->image_url))
<div class="pc-admin-slide-current">
<div class="pc-admin-slide-current-preview" style="background-image: url('{{ $slide->image_url }}')"></div>
<span class="pc-muted">Текущее изображение. Загрузите новое, если хотите заменить.</span>
</div>
@endif
<label class="pc-checkbox">
<input type="checkbox" name="is_active" value="1" @checked(old('is_active', $slide->is_active ?? true))>
<span>Слайд активен</span>
</label>
<button class="pc-btn primary" type="submit">{{ $submitLabel ?? 'Сохранить' }}</button>