OwlCyberSecurity - MANAGER
Edit File: edit.blade.php
{{-- Note: User any library only in master/main.blade.php --}} {{-- DO NOT OVERRIDE UNNECESSARY LIBRARIES --}} {{-- Extending main layout --}} @extends('master.main') {{-- Content starts here --}} {{-- This section is already wrapped --}} @section('content') <style> .error_div { background-color: #ffc8c8; border-radius: 4px; padding: 0.4rem; padding-left: 1rem; color: #f11a1a; border: 1px solid #ff2a2a; } .success_div { background-color: #aedcaf; border-radius: 4px; padding: 0.4rem; padding-left: 1rem; color: #1f6d26; border: 1px solid #248526; } </style> <div class="row p-2"> <div class="col-12"> <h3>Edit Gallery</h3> </div> <div class="col" id="galleryEditMessageDiv" style="display: none;"></div> </div> <div class="row p-2"> <div class="col-12"> <div class="card"> <div class="card-body"> <div class="row"> @if (!empty($errors->all())) <div class="col-12 error_div"> {{ $errors->first() }} </div> @endif @if (session()->has('message')) <div class="col-12 error_div"> {{ session()->get('message') }} </div> @endif @if (session()->has('success')) <div class="col-12 success_div"> {{ session()->get('success') }} </div> @endif </div> <form action="{{ route('update_gallery.edit_gallery', ['id' => $gallery->id]) }}" method="POST" autocomplete="off" enctype="multipart/form-data"> @csrf <div class="row"> <div class="col-lg-12 col-md-12 col-sm-12"> <div class="form-group"> <label for="title" class="form-label">Title</label> <input type="text" name="title" id="title" class="form-control" autofocus value="{{ old('title') ?? $gallery->title }}"> </div> </div> <div class="col-lg-12 col-md-12 col-sm-12"> <div class="form-group"> <label for="image" class="form-label">Image</label> @if (isset($gallery->image) && !empty($gallery->image)) <div class="mb-4" id="image_holder"> <div class="row"> <div class="col-12"> <img src="{{ url('storage/gallery/'.$gallery->image) }}" alt="Gallery image" width="200px"> </div> </div> </div> @endif <div> <input type="file" name="image" id="image"> </div> <small>(Max image size: 1 MB; Image types allowed: jpg, jpeg, png.)</small> </div> <div class="form-group"> <button type="submit" class="custom-blue-btn width-5-rem " id="form-submit-button">Save</button> <a href="{{ route('update_gallery.edit_gallery', ['id' => $gallery->id]) }}"><button type="button" class="custom-grey-btn width-5-rem">Cancel</button></a> </div> </div> </div> </form> </div> </div> </div> </div> <script> // for messages function GalleryEditMessage(type = '', message = '', timeout = 3000) { var selectedClass = ''; var holder = $('#galleryEditMessageDiv'); if (type.toLowerCase() == 'success') { selectedClass = 'success_div'; } else { selectedClass = 'error_div'; } var ht = `<div class="${selectedClass}">${message}</div>`; holder.html(ht); holder.hide().show().fadeIn('fast').delay(timeout).fadeOut('slow', function() { $(this).stop(true); }); } // document ready end // error and success div timouts setTimeout(() => { $('.error_div').fadeOut('slow'); $('.success_div').fadeOut('slow'); }, 3000); </script> @endsection {{-- Content ends here --}} {{-- Note: User any library only in master/main.blade.php --}} {{-- DO NOT OVERRIDE UNNECESSARY LIBRARIES --}}