Merge branch 'trunk'

This commit is contained in:
Vincent BRIDIER 2023-04-27 09:48:22 +02:00
commit ad38d3b475
No known key found for this signature in database
GPG key ID: 8571BFA20420D512
2 changed files with 35 additions and 39 deletions

View file

@ -41,9 +41,7 @@ class TopMediaController extends Controller
); );
} //end if } //end if
$this->sortQuery($topMediaList);
$searchFields = trans('Id Instagram, Participant, Lien'); $searchFields = trans('Id Instagram, Participant, Lien');
$topMediaList->orderBy('updated_at', 'DESC');
$topMediaList = $topMediaList->paginate(); $topMediaList = $topMediaList->paginate();
return \view('bo.pages.top-media.index', \compact('topMediaList', 'searchFields', 'ranking')); return \view('bo.pages.top-media.index', \compact('topMediaList', 'searchFields', 'ranking'));

View file

@ -2,48 +2,46 @@
<table class="table fix-action"> <table class="table fix-action">
<thead> <thead>
@php @php
$cols = [ $cols = [
'id' => __('Classement'), 'id' => __('Classement'),
'username' => __('Participant'), 'username' => __('Participant'),
'timestamp' => __('Date de création du post')]; 'timestamp' => __('Date de création du post')];
$routeName = request()->route()->getName(); $routeName = request()->route()->getName();
$rst = !is_null(request()->rst) || !Session::has("$routeName.sorted"); $rst = !is_null(request()->rst) || !Session::has("$routeName.sorted");
$noOrder = Session::get("$routeName.sort_col") !== 'order' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way")); $noOrder = Session::get("$routeName.sort_col") !== 'order' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way"));
$noOrder = Session::get("$routeName.sort_col") !== '' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way")); $noOrder = Session::get("$routeName.sort_col") !== '' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way"));
@endphp @endphp
@include('modules.table-col-sorter', [ <th>Classement</th>
'cols' => $cols, <th>Participant</th>
'ignore' => ['total', 'timeslot_date', 'shop'], <th>Date de création du post</th>
'mobileHide' => ['shop'], <th></th>
])
</thead> </thead>
<tbody> <tbody>
@if ($topMediaList->count()) @if ($topMediaList->count())
@foreach ($topMediaList as $topMediaModel) @foreach ($topMediaList as $topMediaModel)
<tr> <tr>
<td> <td>
<strong class="fs-{{ $ranking->get($topMediaModel->insta_id) + 1 }}">#{{ $ranking->get($topMediaModel->insta_id) + 1 }}</strong> <strong class="fs-{{ $ranking->get($topMediaModel->insta_id) + 1 }}">#{{ $ranking->get($topMediaModel->insta_id) + 1 }}</strong>
</td> </td>
<td>{{ $topMediaModel->username }}</td> <td>{{ $topMediaModel->username }}</td>
<td> <td>
{{ $topMediaModel->timestamp->isoFormat('LLLL') }} {{ $topMediaModel->timestamp->isoFormat('LLLL') }}
</td> </td>
<td> <td>
<a href="{{ $topMediaModel->permalink }}" title="{{ __('Voir le media sur instagram') }}" target="_blank" data-bs-toggle="tooltip"> <a href="{{ $topMediaModel->permalink }}" title="{{ __('Voir le media sur instagram') }}" target="_blank" data-bs-toggle="tooltip">
<i class="fa-solid fa-arrow-up-right-from-square"></i> <i class="fa-solid fa-arrow-up-right-from-square"></i>
</a> </a>
</td> </td>
</tr> </tr>
@endforeach @endforeach
@else @else
<tr> <tr>
<td colspan="11" class="text-center"> <td colspan="11" class="text-center">
<span <span class="h3">{{ __('Aucun résultat pour les :models', ['models' => __('models.classes.insta_media')]) }}
class="h3">{{ __('Aucun résultat pour les :models', ['models' => __('models.classes.insta_media')]) }} </span>
</span> </td>
</td> </tr>
</tr>
@endif @endif
</tbody> </tbody>
</table> </table>
</div> </div>