Skip to content

Commit

Permalink
Tambah tombol filter berdasarkan tanggal (#449)
Browse files Browse the repository at this point in the history
* Tambah tombol filter berdasarkan tanggal

* Fix styling

* Sesuaikan value

* Perbaiki tidak ada kepala keluarga di kk

* [ci skip] memutakhirkan catatan rilis

* u

* Fix styling

Co-authored-by: yogiperdana <[email protected]>
Co-authored-by: vickyrolanda <[email protected]>
Co-authored-by: Vicky Rolanda <[email protected]>
Co-authored-by: firlianif <[email protected]>
Co-authored-by: FirlianiF <[email protected]>
  • Loading branch information
6 people authored Aug 1, 2022
1 parent 9865d43 commit efe84e4
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 19 deletions.
1 change: 1 addition & 0 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
namespace App\Console;

use function base_path;

use Illuminate\Console\Scheduling\Schedule;

use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
Expand Down
2 changes: 2 additions & 0 deletions app/Helpers/Counter.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@
use App\Models\CounterPage;
use App\Models\CounterVisitor;
use Carbon\Carbon;

use function config;
use function env;
use function hash;

use Illuminate\Support\Facades\Cookie;
use Illuminate\Support\Facades\DB;
use Jaybizzle\CrawlerDetect\CrawlerDetect;

use function number_format;

class Counter
Expand Down
7 changes: 7 additions & 0 deletions app/Http/Controllers/Page/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ public function filterFeeds(Request $request)
}

$feeds = $feeds->sortByDesc('date')->take(config('setting.jumlah_artikel_desa') ?? 30)->paginate(config('setting.artikel_desa_perhalaman') ?? 10);

// Tanggal
$tanggal = $request->tanggal;
if ($tanggal != 'Terlama') {
$feeds = $feeds->sortBy('date')->take(config('setting.jumlah_artikel_desa') ?? 30)->paginate(config('setting.artikel_desa_perhalaman') ?? 10);
}

$feeds->all();

$html = view('pages.berita.feeds', [
Expand Down
2 changes: 2 additions & 0 deletions app/Http/Middleware/CustomForms.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@
namespace App\Http\Middleware;

use function array_diff_key;

use Closure;
use Form;

use Illuminate\Http\Request;

use function session;
use function sprintf;

Expand Down
2 changes: 2 additions & 0 deletions app/Http/Middleware/KDInstalled.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@
namespace App\Http\Middleware;

use Closure;

use function file_exists;

use Illuminate\Http\Request;

use function redirect;
use function storage_path;

Expand Down
1 change: 1 addition & 0 deletions app/Providers/BroadcastServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
namespace App\Providers;

use function base_path;

use Illuminate\Support\Facades\Broadcast;

use Illuminate\Support\ServiceProvider;
Expand Down
1 change: 1 addition & 0 deletions app/Providers/RouteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
namespace App\Providers;

use function base_path;

use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;

use Illuminate\Support\Facades\Route;
Expand Down
5 changes: 3 additions & 2 deletions catatan_rilis.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#### [v22.07.01]
#### [v22.08.01]

Di rilis v22.07.01, menyediakan Widget Sidebar Foto Camat Rilis ini juga berisi perbaikan lain yang diminta Komunitas OpenDK.
Di rilis v22.08.01, menyediakan Widget Sidebar Foto Camat Rilis ini juga berisi perbaikan lain yang diminta Komunitas OpenDK.

Terima kasih pada totoprayogo1916 yang terus berkontribusi. Terima kasih pula pada vickyrolanda yang baru mulai berkontribusi.


#### Penambahan Fitur

1. [#142](https://github.com/OpenSID/OpenDK/issues/142) Sediakan Widget Sidebar Foto Camat.
2. [#360](https://github.com/OpenSID/OpenDK/issues/360) Tampilkan berita desa yang berurutan berdasarkan tanggal penerbitan artikel.

#### Perbaikan BUG

Expand Down
38 changes: 21 additions & 17 deletions resources/views/pages/berita/desa.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,24 +113,28 @@
</div>
<form class="form-horizontal" id="form_filter" method="get" action="{{ route('filter-berita-desa') }}">
<input type="hidden" value="1" name="page">
<div class="page-header" style="margin:0px 0px;">
<span style="display: inline-flex; vertical-align: middle;"><strong class="">Berita Desa</strong></span>
</div>
<div class="page-header" style="margin:0px 0px; padding: 0px;">
<select class="form-control" id="list_desa" name="desa" style="width: auto;">
<option value="Semua">Semua Desa</option>
@foreach($list_desa as $desa)
<option value="{{ $desa->desa_id }}" <?php $cari_desa == $desa->desa_id && print('selected') ?>>{{$desa->nama}} </option>
@endforeach
</select>
<div class="input-group input-group-sm" style="display: inline-flex; float: right; padding: 5px;">
<input class="form-control" style="height: auto;" type="text" name="cari" placeholder="Cari berita" value="{{$cari}}"/>
<button type="submit" class="btn btn-info btn-block" style="width: auto;">
<i class="fa fa-search"></i>
</button>
<div class="page-header" style="margin:0px 0px;">
<span style="display: inline-flex; vertical-align: middle;"><strong class="">Berita Desa</strong></span>
</div>
</div>
</form>
<div class="page-header" style="margin:0px 0px; padding: 0px;">
<select class="form-control" id="list_desa" name="desa" style="width: auto;">
<option value="Semua">Semua Desa</option>
@foreach($list_desa as $desa)
<option value="{{ $desa->desa_id }}" <?php $cari_desa == $desa->desa_id && print('selected') ?>>{{$desa->nama}} </option>
@endforeach
</select>
<select class="form-control" id="tanggal" name="tanggal" style="display: inline-flex; width: auto;">
<option value="Terlama">Terbaru</option>
<option value="Terbaru">Terlama</option>
</select>
<div class="input-group input-group-sm" style="display: inline-flex; float: right; padding: 5px;">
<input class="form-control" style="height: auto;" type="text" name="cari" placeholder="Cari berita" value="{{$cari}}"/>
<button type="submit" class="btn btn-info btn-block" style="width: auto;">
<i class="fa fa-search"></i>
</button>
</div>
</div>
</form>
@include('pages.berita.feeds')

</div>
Expand Down
3 changes: 3 additions & 0 deletions resources/views/pages/berita/feeds.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
$( "#list_desa" ).change(function() {
$( "#form_filter" ).submit();
});
$( "#tanggal" ).change(function() {
$( "#form_filter" ).submit();
});
$(document).on('click', '.pagination a', function(event){
event.preventDefault();
Expand Down

0 comments on commit efe84e4

Please sign in to comment.