Viewing File: /home/ubuntu/btcthrottle-backend/resources/views/admin/static_pages/_form.blade.php

<!-- Multi Column with Form Separator -->
<div class="card mb-4">
    <h5 class="card-header">{{ $title }}</h5>
    <form id="staticPageForm" class="card-body" action="{{ $route }}" method="POST" enctype="multipart/form-data">
        @csrf
        <hr class="mt-0" />
        @if($static_page->id)
        <input type="hidden" name="static_page_id" id="static_page_id" value="{{ $static_page->id }}"/>
        @endif
        <div class="row g-3">
            <div class="col-md-12">
                <label class="form-label" for="title">{{ tr('title') }} *</label>
                <input type="text" id="title" name="title" class="form-control" placeholder="{{ tr('title') }}" value="{{ old('title') ?: $static_page->title }}" required />
            </div>
            <div class="col-md-6 mb-4">
            <label for="select2Icons" class="form-label">{{tr('select_footer_section')}} *</label>
            <select id="select2Icons" name="footer_section" class="select2-icons form-select">
                <option value="" selected>{{ tr('select_footer_section') }}</option>x
                <option value="{{ FOOTER_SECTION_NONE }}" @if((old('footer_section') == FOOTER_SECTION_NONE && old('footer_section') != null) || $static_page->footer_section == FOOTER_SECTION_NONE) selected @endif }}> {{ tr('footer_section_none') }} </option>
                <option value="{{ FOOTER_SECTION_1 }}" @if((old('footer_section') == FOOTER_SECTION_1 && old('footer_section') != null) || $static_page->footer_section == FOOTER_SECTION_1) selected @endif }}> {{ tr('footer_section_1') }} </option>
                <option value="{{ FOOTER_SECTION_2 }}" @if((old('footer_section') == FOOTER_SECTION_2 && old('footer_section') != null) || $static_page->footer_section == FOOTER_SECTION_2 || request('footer_section') == FOOTER_SECTION_2) selected @endif }}> {{ tr('footer_section_2') }} </option>  
                <option value="{{ FOOTER_SECTION_3 }}" @if((old('footer_section') == FOOTER_SECTION_3 && old('footer_section') != null) || $static_page->footer_section == FOOTER_SECTION_3 || request('footer_section') == FOOTER_SECTION_3) selected @endif }}> {{ tr('footer_section_3') }} </option>
            </select>
          </div>
           <div class="col-md-6 mb-4">
            <label for="select2Icons" class="form-label">{{tr('type')}} *</label>
            <select id="select2Icons"  name="type" name="footer_section" class="select2-icons form-select">
                <option value="" selected>{{ tr('select_type') }}</option>
                @foreach($page_types as $value)
                <option value="{{$value}}" @if($value == $static_page->type) selected="true" @endif>{{ ucfirst($value) }}</option>
                @endforeach
            </select>
          </div>
           
          <div class="mb-2">
                <label class="form-label" for="quill-editor">{{tr('description')}} *</label>
                <div id="quill-editor">{!!old('description', $static_page->description)!!}</div>
                <input type="hidden" name="description" id="description" value="">
              </div>
            </div>
        <div class="pt-4">
            <button type="submit" class="btn btn-primary me-sm-3 me-1">{{ tr('submit') }}</button>
            <button type="reset" class="btn btn-label-secondary">{{ tr('cancel') }}</button>
        </div>
    </form>
</div>

@section('scripts')
  <script>
  document.getElementById("staticPageForm").addEventListener("submit", function(event) {
      const quill_editor_content = quill_editor.root.innerHTML;
      if (!quill_editor_content || quill_editor_content == "<p><br></p>") {
          notifier("{{tr('field_is_required', strtolower(tr('description')))}}", "error");
          event.preventDefault();
          return false;
      } else {
        $("#description").val(quill_editor_content);
      }
    });
  </script>
@endsection
Back to Directory File Manager