{{-- resources/views/points/search.blade.php --}} @extends('layouts.base') @php $token = $p->serial ?? null; $favoriteIds = []; if (auth()->check()) { // Récupère les IDs de points favoris de l'utilisateur connecté $favoriteIds = auth()->user() ->favoritePoints() ->pluck('points.id') // ou ->pluck('point_id') selon ta relation ->all(); } $photos = $p->photos ?? collect(); @endphp {{-- @section('bottom') --}} @include('partials.bottom_nav', [ 'bottomTabs' => [ [ 'icon' => "map_picto.svg", 'label' => __('Map'), 'href' => lr('startmap'), // ouvre le tiroir "maps" ], [ 'icon' => "addV_picto.svg", 'label' => __('Create a waypoint'), 'href' => lr('map'), 'primary' => true, ], [ 'icon' => "myV_picto.svg", 'label' => __('My waypoints'), 'href' => lr('search'), 'primary' => false, ], ], ]) {{-- @endsection --}} {{-- Tiroir de tri --}} {{-- Tiroir de filtre --}} @section('title','Mes waypoints') @section('content')
@php $sortLabels = [ 'newest' => __('Most recent'), 'oldest' => __('Oldest'), 'nearest' => __('Nearest'), 'farthest' => __('Farthest'), 'alpha' => __('Alphabetical order'), ]; $currentSortLabel = $sortLabels[$currentSort ?? 'alpha'] ?? $sortLabels['alpha']; $filterLabels = [ 'all' => __('All points'), 'mine' => __('My waypoints'), 'shared' => __('Shared points'), 'public' => __('Public points'), ]; $currentFilterLabel = $filterLabels[$currentFilter ?? 'all'] ?? $filterLabels['all']; @endphp
{{-- Nouvelle ligne : filtres de visibilité --}} {{--
--}} {{--
{{ __('Filters') }} :
--}} {{-- --}}
{{--
--}} @if(session('ok'))
{{ session('ok') }}
@endif
    @forelse($points as $p) @include('points._point_item', ['p' => $p, 'user' => $user, 'countryNames' => $countryNames]) @empty
  • {{ __('No waypoint found') }}
  • @endforelse
@if($points->hasMorePages())
@endif
@php // If $points is a paginator, keep only the items. if ($points instanceof \Illuminate\Pagination\AbstractPaginator) { $pointsArray = $points->items(); // plain PHP array } else { // Collection or array -> force a zero-indexed array $pointsArray = is_iterable($points) ? collect($points)->values()->all() : []; } @endphp {{-- CDN scripts only – load in this order --}} @push('scripts') @endpush @endsection