simedkom/resources/views/dashboard/news/show.blade.php
myuqinurrohman 3c1212d2e9 chore: display news data
feat: filter news data
2025-03-25 10:34:23 +07:00

132 lines
11 KiB
PHP

@include('partials.dashboard.head')
@include('partials.dashboard.sidebar', ['page' => 'news'])
@include('partials.dashboard.header')
<!-- content @s -->
<div class="nk-content ">
<div class="container-fluid">
<div class="nk-content-inner">
<div class="nk-content-body">
<div class="nk-block nk-block-lg">
<div class="card">
<div class="card-aside-wrap">
<div class="card-content">
<ul class="nav nav-tabs nav-tabs-mb-icon nav-tabs-card">
<li class="nav-item">
<a class="nav-link text-primary" href="#"><em class="icon ni ni-info"></em><span>Detail Berita</span></a>
</li>
</ul><!-- .nav-tabs -->
<div class="card-inner">
<div class="nk-block">
{{-- <div class="nk-block-head">
<h5 class="title">Personal Information</h5>
<p>Basic info, like your name and address, that you use on Nio Platform.</p>
</div> --}}
<div class="profile-ud-list">
<div class="profile-ud-item">
<div class="profile-ud wider">
<span class="profile-ud-label">Judul</span>
<span class="profile-ud-value">{{$news->title}}</span>
</div>
</div>
<div class="profile-ud-item">
<div class="profile-ud wider">
<span class="profile-ud-label">Kategori</span>
@if ($news->category === '0')
<span class="profile-ud-value"><span class="badge bg-primary">Berita</span></span>
@elseif ($news->category === '1')
<span class="profile-ud-value"><span class="badge bg-info">Pengumuman</span></span>
@else
<span class="profile-ud-value"><span class="badge bg-secondary">Tidak Diketahui</span></span>
@endif
</div>
</div>
<div class="profile-ud-item">
<div class="profile-ud wider">
<span class="profile-ud-label">Link</span>
<span class="profile-ud-value">
@if (filled($news->link))
<a href="{{$news->link}}">{{$news->link}}</a>
@else
{{'-'}}
@endif
</span>
</div>
</div>
<div class="profile-ud-item">
<div class="profile-ud wider">
<span class="profile-ud-label">Gambar</span>
<span class="profile-ud-value">
@if (filled($news->image))
<a href="javascript:void(0);" data-bs-toggle="modal" data-bs-target="#modalDefault" class="btn btn-sm btn-info">Lihat gambar</a>
@else
Tidak ada gambar
@endif
</span>
</div>
</div>
<div class="profile-ud-item">
<div class="profile-ud wider">
<span class="profile-ud-label">Dilihat</span>
<span class="profile-ud-value">
{{$news->viewers ?? '-'}}
</span>
</div>
</div>
<div class="profile-ud-item">
<div class="profile-ud wider">
<span class="profile-ud-label">Dibuat Pada</span>
<span class="profile-ud-value">{{idn_date($news->created_at, 'l, d F Y')}}</span>
</div>
</div>
</div><!-- .profile-ud-list -->
</div><!-- .nk-block -->
{{-- <div class="nk-divider divider md"></div> --}}
<div class="nk-block">
<div class="nk-block-head nk-block-head-sm nk-block-between">
<span class="profile-ud-label">Konten</span>
</div><!-- .nk-block-head -->
<div class="bq-note">
<div class="bq-note-item">
<div class="bq-note-text">
{!!$news->content ?? '-' !!}
</div>
</div><!-- .bq-note-item -->
</div><!-- .bq-note -->
</div><!-- .nk-block -->
<hr>
<div class="nk-block d-flex justify-content-end">
<a href="{{route('dashboard.news.index')}}" class="btn btn-white btn-dim btn-outline-light mx-2"><span>Kembali</span></a>
@if (!filled($news->deleted_at))
<a href="{{route('dashboard.news.edit', ['id' => encrypt_id($news->id), 'show' => true])}}" class="btn btn-warning"><span>Ubah</span></a>
@endif
</div><!-- .nk-block -->
</div><!-- .card-inner -->
</div><!-- .card-content -->
</div><!-- .card-aside-wrap -->
</div>
<div class="modal fade" tabindex="-1" id="modalDefault">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Preview</h5>
<a href="#" class="close" data-bs-dismiss="modal" aria-label="Close">
<em class="icon ni ni-cross"></em>
</a>
</div>
<div class="modal-body">
<img src="{{asset('storage/uploads/news/'. $news->image)}}" alt="preview">
</div>
{{-- <div class="modal-footer bg-light">
<span class="sub-text">Modal Footer Text</span>
</div> --}}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- content @e -->
@include('partials.dashboard.footer', ['rich_editor' => false])