Просмотр файла resources/views/blogs/create.blade.php

Размер файла: 3.35Kb
  1. @extends('layout')
  2.  
  3. @section('title', __('blogs.title_create'))
  4.  
  5. @section('breadcrumb')
  6. <nav>
  7. <ol class="breadcrumb">
  8. <li class="breadcrumb-item"><a href="/"><i class="fas fa-home"></i></a></li>
  9. <li class="breadcrumb-item"><a href="/blogs">{{ __('index.blogs') }}</a></li>
  10. <li class="breadcrumb-item active">{{ __('blogs.title_create') }}</li>
  11. </ol>
  12. </nav>
  13. @stop
  14.  
  15. @section('content')
  16. <div class="section-form mb-3 shadow cut">
  17. <form action="/blogs/create" method="post">
  18. @csrf
  19. <div class="mb-3{{ hasError('cid') }}">
  20. <label for="inputCategory" class="form-label">{{ __('blogs.blog') }}</label>
  21.  
  22. <?php $inputCategory = (int) getInput('cid', $cid); ?>
  23. <select class="form-select" id="inputCategory" name="cid">
  24.  
  25. @foreach ($categories as $category)
  26. <option value="{{ $category->id }}"{{ ($inputCategory === $category->id && ! $category->closed) ? ' selected' : '' }}{{ $category->closed ? ' disabled' : '' }}>{{ $category->name }}</option>
  27.  
  28. @if ($category->children->isNotEmpty())
  29. @foreach ($category->children as $categorysub)
  30. <option value="{{ $categorysub->id }}"{{ ($inputCategory === $categorysub->id && ! $categorysub->closed) ? ' selected' : '' }}{{ $categorysub->closed ? ' disabled' : '' }}>– {{ $categorysub->name }}</option>
  31. @endforeach
  32. @endif
  33. @endforeach
  34.  
  35. </select>
  36. <div class="invalid-feedback">{{ textError('cid') }}</div>
  37. </div>
  38.  
  39. <div class="mb-3{{ hasError('title') }}">
  40. <label for="inputTitle" class="form-label">{{ __('blogs.name') }}:</label>
  41. <input type="text" class="form-control" id="inputTitle" name="title" maxlength="50" value="{{ getInput('title') }}" required>
  42. <div class="invalid-feedback">{{ textError('title') }}</div>
  43. </div>
  44.  
  45. <div class="mb-3{{ hasError('text') }}">
  46. <label for="text" class="form-label">{{ __('blogs.article') }}:</label>
  47. <textarea class="form-control markItUp" maxlength="{{ setting('maxblogpost') }}" id="text" rows="5" name="text" required>{{ getInput('text') }}</textarea>
  48. <div class="invalid-feedback">{{ textError('text') }}</div>
  49. <span class="js-textarea-counter"></span>
  50. </div>
  51.  
  52. <div class="mb-3{{ hasError('tags') }}">
  53. <label for="inputTags" class="form-label">{{ __('blogs.tags') }}:</label>
  54. <input type="text" class="form-control" id="inputTags" name="tags" maxlength="100" value="{{ getInput('tags') }}" required>
  55. <div class="invalid-feedback">{{ textError('tags') }}</div>
  56. </div>
  57.  
  58. @include('app/_upload_image', ['files' => $files, 'type' => App\Models\Article::$morphName, 'paste' => true])
  59.  
  60. <button class="btn btn-primary">{{ __('blogs.add') }}</button>
  61. </form>
  62. </div>
  63.  
  64. <p class="text-muted fst-italic">{{ __('blogs.text_create1') }}</p>
  65.  
  66. <a href="/rules">{{ __('main.rules') }}</a> /
  67. <a href="/stickers">{{ __('main.stickers') }}</a> /
  68. <a href="/tags">{{ __('main.tags') }}</a><br><br>
  69. @stop