Working on GalleryItem Naming

This commit is contained in:
Torsten 2023-11-14 10:30:10 +01:00
parent 11af22215e
commit ded03e22f1
3 changed files with 17 additions and 9 deletions

View file

@ -155,6 +155,11 @@ class GalleryController extends Controller
return redirect("/tour/gallery/$tour_id"); return redirect("/tour/gallery/$tour_id");
} }
public function name_image(Request $request, $tour_id, $image_name) {
$new_image_name = $request->new_image_name;
Log::info("GalleryController::name_image for tour $tour_id , current name=$image_name, new name=$new_image_name");
}
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
private function storeImage($bild, $category, $name) { private function storeImage($bild, $category, $name) {

View file

@ -18,7 +18,17 @@
@if(Auth::user()->role=="ADMIN") @if(Auth::user()->role=="ADMIN")
<p> <p>
<a href="#"><label style="display:inline;">&#128394;</label></a> <a id="edit_{{$tour_id}}_{{$image}}" href="#"><label style="display:inline;">&#128394;</label></a>
<form style="display:inline;background-color: #fff;" class="text-dark" method="post"
action="/tour/gallery/{{$tour_id}}/name_image/{{$image}}.jpg" enctype="multipart/form-data">
@csrf
@method('PUT')
<input type="hidden" name="tour_id" value="{{ $tour_id }}">
<input type="text" name="new_image_name" value="" ">
</form>
<a href="/tour/gallery/{{$tour_id}}/delete_image/{{$image}}.jpg" style="color:red;"><span data-toggle="tooltip" title="Löschen">X</a> <a href="/tour/gallery/{{$tour_id}}/delete_image/{{$image}}.jpg" style="color:red;"><span data-toggle="tooltip" title="Löschen">X</a>
</p> </p>
@endif @endif
@ -35,14 +45,6 @@
</a> </a>
--> -->
<script> <script>
// Open the Modal // Open the Modal
function openModal() { function openModal() {

View file

@ -66,6 +66,7 @@
Route::get('/tour/gallery/{gallery_id}', 'GalleryController@show'); // no middleware auth needed, its checked in Controller Route::get('/tour/gallery/{gallery_id}', 'GalleryController@show'); // no middleware auth needed, its checked in Controller
Route::post('/tour/gallery/{gallery_id}', 'GalleryController@store'); Route::post('/tour/gallery/{gallery_id}', 'GalleryController@store');
Route::get('/tour/gallery/{gallery_id}/delete_image/{imageName}', 'GalleryController@delete_image'); Route::get('/tour/gallery/{gallery_id}/delete_image/{imageName}', 'GalleryController@delete_image');
Route::put('/tour/gallery/{gallery_id}/name_image/{imageName}', 'GalleryController@name_image');
Auth::routes(); Auth::routes();