-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Penyesuaian modul regulasi menggunakan datatable (#971)
- Loading branch information
1 parent
f0c3670
commit 0b45009
Showing
4 changed files
with
83 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,70 @@ | ||
@extends('layouts.dashboard_template') | ||
|
||
@section('content') | ||
<section class="content-header"> | ||
<h1> | ||
{{ $page_title ?? 'Page Title' }} | ||
<small>{{ $page_description ?? '' }}</small> | ||
</h1> | ||
<ol class="breadcrumb"> | ||
<li><a href="{{ route('dashboard') }}"><i class="fa fa-dashboard"></i> Dashboard</a></li> | ||
<li class="active">{!! $page_title !!}</li> | ||
</ol> | ||
</section> | ||
|
||
<!-- Content Header (Page header) --> | ||
<section class="content-header"> | ||
<h1> | ||
{{ $page_title ?? 'Page Title' }} | ||
<small>{{ $page_description ?? '' }}</small> | ||
</h1> | ||
<ol class="breadcrumb"> | ||
<li><a href="{{ route('dashboard') }}"><i class="fa fa-dashboard"></i> Dashboard</a></li> | ||
<li class="active">{{ $page_title }}</li> | ||
</ol> | ||
</section> | ||
<section class="content container-fluid"> | ||
@include('partials.flash_message') | ||
|
||
<section class="content container-fluid"> | ||
|
||
@include('partials.flash_message') | ||
|
||
<div class="row"> | ||
<div class="col-md-12"> | ||
<div class="box box-primary"> | ||
<div class="box-header with-border"> | ||
<a href="{{ route('informasi.regulasi.create') }}" class="btn btn-success btn-sm {{ auth()->guest() ? 'hidden' : '' }}" title="Tambah"><i class="fa fa-plus"></i>  Tambah</a> | ||
</div> | ||
@if (count($regulasi) > 0) | ||
<div class="box-body"> | ||
<div class="table-responsive"> | ||
<table class="table table-striped"> | ||
<tr> | ||
<th style="width: 150px">Aksi</th> | ||
<th>Judul Regulasi</th> | ||
</tr> | ||
|
||
@foreach ($regulasi as $item) | ||
<tr> | ||
|
||
<td class="text-center text-nowrap"> | ||
@if (!auth()->guest()) | ||
<?php | ||
// TODO : Pindahkan ke controller dan gunakan datatable | ||
$data['show_url'] = route('informasi.regulasi.show', $item->id); | ||
$data['edit_url'] = route('informasi.regulasi.edit', $item->id); | ||
$data['delete_url'] = route('informasi.regulasi.destroy', $item->id); | ||
$data['download_url'] = route('informasi.regulasi.download', $item->id); | ||
echo view('forms.aksi', $data); | ||
?> | ||
@endif | ||
</td> | ||
|
||
<td>{{ $item->judul }}</td> | ||
|
||
</tr> | ||
@endforeach | ||
</table> | ||
</div> | ||
|
||
<div class="box-footer clearfix"> | ||
{!! $regulasi->links() !!} | ||
</div> | ||
</div> | ||
@else | ||
<div class="box-body"> | ||
<h3>Data tidak ditemukan.</h3> | ||
</div> | ||
@endif | ||
</div> | ||
<div class="box box-primary"> | ||
<div class="box-header with-border"> | ||
<a href="{{ route('informasi.regulasi.create') }}" | ||
class="btn btn-success btn-sm btn-social {{ auth()->guest() ? 'hidden' : '' }}" title="Tambah Data"><i | ||
class="fa fa-plus"></i> Tambah</a> | ||
</div> | ||
<!-- /.box-header --> | ||
<div class="box-body"> | ||
<div class="table-responsive"> | ||
<table class="table table-striped table-bordered" id="regulasi-table"> | ||
<thead> | ||
<tr> | ||
<th style="max-width: 150px;">Aksi</th> | ||
<th>Judul </th> | ||
</tr> | ||
</thead> | ||
</table> | ||
</div> | ||
</div> | ||
</section> | ||
</div> | ||
</section> | ||
@endsection | ||
|
||
@include('partials.asset_datatables') | ||
|
||
@push('scripts') | ||
@include('forms.delete-modal') | ||
@endpush | ||
<script type="text/javascript"> | ||
$(document).ready(function() { | ||
var data = $('#regulasi-table').DataTable({ | ||
processing: true, | ||
serverSide: false, | ||
ajax: "{!! route('informasi.regulasi.getdata') !!}", | ||
columns: [{ | ||
data: 'aksi', | ||
name: 'aksi', | ||
class: 'text-center text-nowrap', | ||
searchable: false, | ||
orderable: false | ||
}, | ||
{ | ||
data: 'judul', | ||
name: 'judul', | ||
}, | ||
], | ||
order: [ | ||
[1, 'asc'] | ||
] | ||
}); | ||
}); | ||
</script> | ||
@include('forms.datatable-vertical') | ||
@include('forms.delete-modal') | ||
@endpush |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters