Skip to content

Commit

Permalink
- Rename route "daily-achievement" into "achievement" with its relate…
Browse files Browse the repository at this point in the history
…d file

- Rename route "achievement" into "report" with its related file
  • Loading branch information
ianriizky committed Feb 7, 2022
1 parent 408c054 commit 9da1b4f
Show file tree
Hide file tree
Showing 20 changed files with 221 additions and 212 deletions.
74 changes: 40 additions & 34 deletions app/Http/Controllers/AchievementController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,78 +2,84 @@

namespace App\Http\Controllers;

use App\Http\Requests\Achievement\LaporanPencapaianNewCinChartRequest;
use App\Repositories\AchievementRepository;
use App\Models\Achievement;
use Illuminate\Http\Request;

class AchievementController extends Controller
{
/**
* Create a new instance class.
* Display index page.
*
* @param \App\Repositories\AchievementRepository $achievementRepository
* @return void
* @return \Illuminate\Contracts\Support\Renderable
*/
public function __construct(
protected AchievementRepository $achievementRepository
) {
//
public function index()
{
return view('monitoring.achievement.index');
}

/**
* Display index page.
* Show the form for creating a new resource.
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function index()
public function create()
{
return view('achievement.index');
return view('monitoring.achievement.create');
}

/**
* Display laporan pencapaian new cin page.
* Store a newly created resource in storage.
*
* @return \Illuminate\Contracts\Support\Renderable
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\RedirectResponse
*/
public function laporanPencapaianNewCin()
public function store(Request $request)
{
return view('achievement.laporan-pencapaian-new-cin');
//
}

/**
* Return laporan pencapaian new cin chart data as json response.
* Display the specified resource.
*
* @param \App\Http\Requests\Achievement\LaporanPencapaianNewCinChartRequest $request
* @return \Illuminate\Http\JsonResponse
* @param \App\Models\Achievement $achievement
* @return \Illuminate\Contracts\Support\Renderable
*/
public function laporanPencapaianNewCinChart(LaporanPencapaianNewCinChartRequest $request)
public function show(Achievement $achievement)
{
$data = $this->achievementRepository->chartLaporanPencapaianNewCin(
$request->date('start_date'),
$request->date('end_date'),
$request->periodicity
);

return response()->json($data);
//
}

/**
* Display dashboard growth newcin page.
* Show the form for editing the specified resource.
*
* @param \App\Models\Achievement $achievement
* @return \Illuminate\Contracts\Support\Renderable
*/
public function dashboardGrowthNewCin()
public function edit(Achievement $achievement)
{
return view('achievement.dashboard-growth-new-cin');
//
}

/**
* Display dashboard penutupancin page.
* Update the specified resource in storage.
*
* @return \Illuminate\Contracts\Support\Renderable
* @param \Illuminate\Http\Request $request
* @param \App\Models\Achievement $achievement
* @return \Illuminate\Http\RedirectResponse
*/
public function dashboardPenutupanCin()
public function update(Request $request, Achievement $achievement)
{
return view('achievement.dashboard-penutupan-cin');
//
}

/**
* Remove the specified resource from storage.
*
* @param \App\Models\Achievement $achievement
* @return \Illuminate\Http\RedirectResponse
*/
public function destroy(Achievement $achievement)
{
//
}
}
85 changes: 0 additions & 85 deletions app/Http/Controllers/DailyAchievementController.php

This file was deleted.

68 changes: 68 additions & 0 deletions app/Http/Controllers/ReportController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?php

namespace App\Http\Controllers;

use App\Http\Requests\Achievement\LaporanPencapaianNewCinChartRequest;
use App\Repositories\AchievementRepository;

class ReportController extends Controller
{
/**
* Create a new instance class.
*
* @param \App\Repositories\AchievementRepository $achievementRepository
* @return void
*/
public function __construct(
protected AchievementRepository $achievementRepository
) {
//
}

/**
* Display index page.
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function index()
{
return view('report.index');
}

/**
* Return laporan pencapaian new cin chart data as json response.
*
* @param \App\Http\Requests\Achievement\LaporanPencapaianNewCinChartRequest $request
* @return \Illuminate\Http\JsonResponse
*/
public function laporanPencapaianNewCinChart(LaporanPencapaianNewCinChartRequest $request)
{
$data = $this->achievementRepository->chartLaporanPencapaianNewCin(
$request->date('start_date'),
$request->date('end_date'),
$request->periodicity
);

return response()->json($data);
}

/**
* Display dashboard growth newcin page.
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function dashboardGrowthNewCin()
{
return view('report.dashboard-growth-new-cin');
}

/**
* Display dashboard penutupancin page.
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function dashboardPenutupanCin()
{
return view('report.dashboard-penutupan-cin');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,25 +80,33 @@ $(function() {
display: false,
},
scales: {
xAxes: [
{
gridLines: {
display: false,
},
scaleLabel: {
display: true,
labelString: xAxesLabelString,
},
},
],
yAxes: [
{
gridLines: {
drawBorder: false,
color: "#f2f2f2",
},
scaleLabel: {
display: true,
labelString: yAxesLabelString,
},
ticks: {
beginAtZero: true,
stepSize: 150,
},
},
],
xAxes: [
{
gridLines: {
display: false,
},
},
],
},
elements: {
pointRadius: 4,
Expand Down
1 change: 1 addition & 0 deletions resources/lang/en/icon.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
'education' => 'fa-book-open',
'monitoring' => 'fa-eye',
'achievement' => 'fa-trophy',
'report' => 'fa-chart-bar',
];
1 change: 1 addition & 0 deletions resources/lang/en/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
'education' => 'Education',
'monitoring' => 'Monitoring',
'achievement' => 'Achievement',
'report' => 'Report',
];
1 change: 1 addition & 0 deletions resources/lang/id/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
'education' => 'Edukasi',
'monitoring' => 'Monitoring',
'achievement' => 'Pencapaian',
'report' => 'Laporan',
];
6 changes: 3 additions & 3 deletions resources/views/components/header.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
</a>
</li>

<li class="nav-item @if (Route::is('achievement.*')) active @endif">
<a href="{{ route('achievement.index') }}" class="nav-link">
<span>@lang('menu.achievement')</span>
<li class="nav-item @if (Route::is('report.*')) active @endif">
<a href="{{ route('report.index') }}" class="nav-link">
<span>@lang('menu.report')</span>
</a>
</li>
</ul>
Expand Down
22 changes: 11 additions & 11 deletions resources/views/components/sidebar.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,34 +123,34 @@
</a>

<ul class="dropdown-menu">
<li class="nav-item @if (Route::is('monitoring.daily-achievement.*')) active @endif">
<a href="{{ route('monitoring.daily-achievement.index') }}" class="nav-link">
<li class="nav-item @if (Route::is('monitoring.achievement.*')) active @endif">
<a href="{{ route('monitoring.achievement.index') }}" class="nav-link">
<span class="narrow-line-height">Input Pencapaian Harian</span>
</a>
</li>
</ul>
</li>

<li class="nav-item dropdown @if (Route::is('achievement.*')) active @endif">
<a href="{{ route('achievement.index') }}" data-toggle="dropdown" class="nav-link has-dropdown">
<i class="fas @lang('icon.achievement')"></i> <span>@lang('menu.achievement')</span>
<li class="nav-item dropdown @if (Route::is('report.*')) active @endif">
<a href="{{ route('report.index') }}" data-toggle="dropdown" class="nav-link has-dropdown">
<i class="fas @lang('icon.report')"></i> <span>@lang('menu.report')</span>
</a>

<ul class="dropdown-menu">
<li class="nav-item @if (Route::is('achievement.laporan-pencapaian-new-cin')) active @endif">
<a href="{{ route('achievement.laporan-pencapaian-new-cin') }}" class="nav-link">
<li class="nav-item @if (Route::is('report.laporan-pencapaian-new-cin.*')) active @endif">
<a href="{{ route('report.laporan-pencapaian-new-cin.index') }}" class="nav-link">
<span class="narrow-line-height">Laporan Pencapaian New CiN</span>
</a>
</li>

<li class="nav-item @if (Route::is('achievement.dashboard-growth-new-cin')) active @endif">
<a href="{{ route('achievement.dashboard-growth-new-cin') }}" class="nav-link">
<li class="nav-item @if (Route::is('report.dashboard-growth-new-cin.*')) active @endif">
<a href="{{ route('report.dashboard-growth-new-cin.index') }}" class="nav-link">
<span class="narrow-line-height">Dashboard Growth New CiN</span>
</a>
</li>

<li class="nav-item @if (Route::is('achievement.dashboard-penutupan-cin')) active @endif">
<a href="{{ route('achievement.dashboard-penutupan-cin') }}" class="nav-link">
<li class="nav-item @if (Route::is('report.dashboard-penutupan-cin.*')) active @endif">
<a href="{{ route('report.dashboard-penutupan-cin.index') }}" class="nav-link">
<span class="narrow-line-height">Dashboard Penutupan CiN</span>
</a>
</li>
Expand Down
Loading

0 comments on commit 9da1b4f

Please sign in to comment.