Файловый менеджер - Редактировать - /home/clickysoft/public_html/jmapi5.clickysoft.net/resources/views/admin/categories/create.blade.php
Назад
@extends('layouts.admin') @section('content') <div class="card"> <div class="card-header"> {{ trans('global.create') }} {{ trans('cruds.category.title_singular') }} </div> <div class="card-body"> <form method="POST" action="{{ route("admin.categories.store") }}" enctype="multipart/form-data"> @csrf <div class="form-group"> <label class="required" for="name">{{ trans('cruds.category.fields.name') }}</label> <input class="form-control {{ $errors->has('name') ? 'is-invalid' : '' }}" type="text" name="name" id="name" value="{{ old('name', '') }}" required> @if($errors->has('name')) <span class="text-danger">{{ $errors->first('name') }}</span> @endif <span class="help-block">{{ trans('cruds.category.fields.name_helper') }}</span> </div> <div class="form-group"> <label class="required" for="slug">{{ trans('cruds.category.fields.slug') }}</label> <input class="form-control {{ $errors->has('slug') ? 'is-invalid' : '' }}" type="text" name="slug" id="slug" value="{{ old('slug', '') }}" required> @if($errors->has('slug')) <span class="text-danger">{{ $errors->first('slug') }}</span> @endif <span class="help-block">{{ trans('cruds.category.fields.slug_helper') }}</span> </div> <div class="form-group"> <label for="featured_image">{{ trans('cruds.category.fields.featured_image') }}</label> <div class="needsclick dropzone {{ $errors->has('featured_image') ? 'is-invalid' : '' }}" id="featured_image-dropzone"> </div> @if($errors->has('featured_image')) <span class="text-danger">{{ $errors->first('featured_image') }}</span> @endif <span class="help-block">{{ trans('cruds.category.fields.featured_image_helper') }}</span> </div> <div class="form-group"> <label for="parent_id">{{ trans('cruds.category.fields.parent') }}</label> <select class="form-control select2 {{ $errors->has('parent') ? 'is-invalid' : '' }}" name="parent_id" id="parent_id"> @foreach($parents as $id => $entry) <option value="{{ $id }}" {{ old('parent_id') == $id ? 'selected' : '' }}>{{ $entry }}</option> @endforeach </select> @if($errors->has('parent')) <span class="text-danger">{{ $errors->first('parent') }}</span> @endif <span class="help-block">{{ trans('cruds.category.fields.parent_helper') }}</span> </div> <div class="form-group"> <label class="required">{{ trans('cruds.category.fields.status') }}</label> @foreach(App\Models\Category::STATUS_RADIO as $key => $label) <div class="form-check {{ $errors->has('status') ? 'is-invalid' : '' }}"> <input class="form-check-input" type="radio" id="status_{{ $key }}" name="status" value="{{ $key }}" {{ old('status', '1') === (string) $key ? 'checked' : '' }} required> <label class="form-check-label" for="status_{{ $key }}">{{ $label }}</label> </div> @endforeach @if($errors->has('status')) <span class="text-danger">{{ $errors->first('status') }}</span> @endif <span class="help-block">{{ trans('cruds.category.fields.status_helper') }}</span> </div> <div class="form-group"> <button class="btn btn-danger" type="submit"> {{ trans('global.save') }} </button> </div> </form> </div> </div> @endsection @section('scripts') <script> Dropzone.options.featuredImageDropzone = { url: '{{ route('admin.categories.storeMedia') }}', maxFilesize: 2, // MB acceptedFiles: '.jpeg,.jpg,.png,.gif', maxFiles: 1, addRemoveLinks: true, headers: { 'X-CSRF-TOKEN': "{{ csrf_token() }}" }, params: { size: 2, width: 4096, height: 4096 }, success: function (file, response) { $('form').find('input[name="featured_image"]').remove() $('form').append('<input type="hidden" name="featured_image" value="' + response.name + '">') }, removedfile: function (file) { file.previewElement.remove() if (file.status !== 'error') { $('form').find('input[name="featured_image"]').remove() this.options.maxFiles = this.options.maxFiles + 1 } }, init: function () { @if(isset($category) && $category->featured_image) var file = {!! json_encode($category->featured_image) !!} this.options.addedfile.call(this, file) this.options.thumbnail.call(this, file, file.preview ?? file.preview_url) file.previewElement.classList.add('dz-complete') $('form').append('<input type="hidden" name="featured_image" value="' + file.file_name + '">') this.options.maxFiles = this.options.maxFiles - 1 @endif }, error: function (file, response) { if ($.type(response) === 'string') { var message = response //dropzone sends it's own error messages in string } else { var message = response.errors.file } file.previewElement.classList.add('dz-error') _ref = file.previewElement.querySelectorAll('[data-dz-errormessage]') _results = [] for (_i = 0, _len = _ref.length; _i < _len; _i++) { node = _ref[_i] _results.push(node.textContent = message) } return _results } } </script> @endsection
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка