관리-도구
편집 파일: features.blade.php
@extends('layouts.app') @section('content') <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script> <link href="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote-lite.min.css" rel="stylesheet"> <script src="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote-lite.min.js"></script> <!-- jQuery --> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <!-- Bootstrap JS --> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script> <!-- partial --> <div class="main-panel"> <div class="content-wrapper"> <style> .description-cell { max-width: 200px; /* Adjust the value as needed */ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } </style> <div class="row"> <div class="col-lg-12 grid-margin stretch-card"> <div class="card"> <div class="card-body"> <div class="d-flex justify-content-between"> <h3 class="text-center"><b>Positions</b></h3> <button class="btn btn-success" data-toggle="modal" data-target="#addtrainer">Add New Position +</button> </div> <hr> <div class="table-responsive"> <table class="table table-hover"> <thead> <tr> <th>#</th> <th>Title</th> <th>Description</th> <!-- <th>Image</th> --> <th class="text-center">Action</th> </tr> </thead> <tbody> @foreach ($trainers as $trainer) <tr> <td>{{$loop->iteration}}</td> <td>{{$trainer->title}}</td> <td class="description" style="white-space: pre-wrap; padding: 10px; ">{!! $trainer->description !!}</td> <!-- <td><img src="{{ asset('storage/' . $trainer->image) }}" alt=""></td> --> <td class="text-center"> <button class="btn btn-primary my-2" data-toggle="modal" data-target="#updatetrainer{{$trainer->id}}"><i class="fa fa-pen"></i></button> <form method="post" action="{{route('admin-features.destroy', $trainer->id)}}"> @csrf @method('DELETE') <button class="btn btn-danger my-2"><i class="fa fa-trash"></i></button> </form> </td> </tr> <!--update trainer Modal --> <div class="modal fade" id="updatetrainer{{$trainer->id}}" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true"> <div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLongTitle">Update Position</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <div class="card"> <div class="card-body"> <form method="post" action="{{route('admin-features.update', $trainer->id)}}" enctype="multipart/form-data"> @csrf @method('PUT') <div class="form-group"> <label for="exampleInputUsername1">Title</label> <input type="text" name="title" value="{{$trainer->title}}" class="form-control" id="exampleInputUsername1" placeholder="Enter title" required> </div> <div class="form-group"> <label for="exampleInputUsername1">Description</label> <input type="text" name="description" value="{{$trainer->description}}" class="form-control" id="exampleInputUsername1" placeholder="Enter description" required> </div> <!-- <div class="form-group"> <label for="exampleInputUsername1">Image</label> <input type="file" name="image" value="{{$trainer->image}}" class="form-control" id="exampleInputUsername1" placeholder="Enter trainer Image" > </div> --> <!-- @if($trainer->image) <div> <img src="{{ asset('storage/' . $trainer->image) }}" alt="Selected Image" style="max-width: 100px; max-height: 100px;" > </div> @endif --> {{-- <div class="form-group"> <label for="exampleInputDescription">Description</label> <textarea class="form-control" name="description" id="summernote" rows="4" placeholder="Enter description">{{$service->description}}</textarea> </div> --}} <div class="text-center"><button type="submit" class="btn btn-primary w-50">Update</button></div> </form> </div> </div> </div> </div> </div> </div> @endforeach </tbody> </table> </div> </div> </div> </div> </div> </div> <!-- content-wrapper ends --> <!--Add trainer Modal --> <div class="modal fade" id="addtrainer" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true"> <div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLongTitle">Add New Position</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <div class="card"> <div class="card-body"> <form method="post" action="{{ route('admin-features.store') }}" enctype="multipart/form-data"> @csrf <div class="form-group"> <label for="trainerName">Title</label> <input type="text" name="title" class="form-control" id="serviceTitle" placeholder="Enter title" required> </div> <div class="form-group"> <label for="trainerName">Description</label> <input type="text" name="description" class="form-control" id="serviceFee" placeholder="Enter description" required> </div> <!-- <div class="form-group"> <label for="trainerName">Image</label> <input type="file" name="image" class="form-control" id="serviceImage" required> </div> --> <div class="text-center"> <button type="submit" class="btn btn-primary w-50">Submit</button> </div> </form> </div> </div> </div> </div> </div> </div> @endsection