97 lines
3.8 KiB
PHP
97 lines
3.8 KiB
PHP
@extends('layouts.heading-page')
|
|
|
|
@section('title')
|
|
News -
|
|
@endsection
|
|
|
|
@section('seo_keywords')
|
|
@endsection
|
|
|
|
@section('seo_description')
|
|
@endsection
|
|
|
|
@section('css')
|
|
<link href="/assets/css/page.css" rel="stylesheet"/>
|
|
@endsection
|
|
|
|
@section('breadcrumbs')
|
|
News
|
|
@endsection
|
|
|
|
@section('page-main')
|
|
<!-- 資料內容 -->
|
|
<div class="content-wrap news-wrap">
|
|
<div class="container">
|
|
<h2 class="h2-title">News</h2>
|
|
<div class="row">
|
|
@php
|
|
foreach ($dataRows as $row)
|
|
{
|
|
$img_memo = '';
|
|
$img_src = '/assets/img/news-item-a01.jpg';
|
|
$imgs = $row->photos;
|
|
// $imgs = array_filter($row['photos'], function($v) {
|
|
// return $v['is_selected'] == true;
|
|
// });
|
|
if (count($imgs) > 0)
|
|
{
|
|
foreach($imgs as $img)
|
|
{
|
|
//$img_memo = $img['comment'];
|
|
$img_src = URL::asset('/storage/'.$img['file_path']);
|
|
break;
|
|
}
|
|
}
|
|
@endphp
|
|
<div class="col-xl-4 col-md-6">
|
|
<div class="news-item">
|
|
|
|
<div class="news-item-img">
|
|
<img src="{{ $img_src }}" alt="{{ $img_memo }}" width="100%" height="auto">
|
|
</div>
|
|
|
|
<div class="news-item-info">
|
|
<h4>{{ $row->title }}</h4>
|
|
<time><span>News</span>{{ date('Y-m-d', strtotime($row->post_at)) }}</time>
|
|
<p>{{ Str::limit($row->description, 128) }}</p>
|
|
<div class="news-btn"><a href="news/detail/{{ $row->id }}"><i class="fa-solid fa-magnifying-glass"></i> VIEW DETAIL</a></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@php
|
|
}
|
|
@endphp
|
|
</div>
|
|
|
|
<!-- 分頁 -->
|
|
<nav aria-label="Page navigation" class="page-ex2">
|
|
<ul class="pagination pagination-sm justify-content-center">
|
|
<li class="page-item">
|
|
<a class="page-link prev" href="?p={{ ($dataCurrentPage - 1) < 1 ? 1 : ($dataCurrentPage - 1) }}" aria-label="Previous">
|
|
<span aria-hidden="true">«</span>
|
|
</a>
|
|
</li>
|
|
@php
|
|
for ($i = 1; $i < ($dataTotalCount / $dataPerPageItems + 1); $i++)
|
|
{
|
|
@endphp
|
|
<li class="page-item {{ $dataCurrentPage == $i ? 'active' : '' }}"><a class="page-link" href="?p={{ $i }}">{{ $i }}</a></li>
|
|
@php
|
|
}
|
|
@endphp
|
|
<li class="page-item">
|
|
<a class="page-link next" href="?p={{ ($dataCurrentPage + 1) > floor($dataTotalCount / $dataPerPageItems + 1) ? floor($dataTotalCount / $dataPerPageItems + 1) : ($dataCurrentPage + 1) }}" aria-label="Next">
|
|
<span aria-hidden="true">»</span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
@endsection
|
|
|
|
@section('script')
|
|
<script type="text/javascript">
|
|
|
|
</script>
|
|
@endsection |