-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
1,286 additions
and
1,433 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
39 changes: 39 additions & 0 deletions
39
src/app/Controllers/DailySchedule/DailyScheduleController.php
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace App\Controllers\DailySchedule; | ||
|
||
use Core\Routines\Domain\Routine; | ||
use DateTime; | ||
use Illuminate\Routing\Controller; | ||
|
||
class DailyScheduleController extends Controller | ||
{ | ||
public function __invoke($date) | ||
{ | ||
$routines = $this->getRoutinesOfDay($date); | ||
return view('pages/dailySchedule', ['date' => $date, 'routines' => $routines]); | ||
} | ||
|
||
public function getRoutinesOfDay(string $date) | ||
{ | ||
$allRoutines = $this->getAllRoutines(); | ||
$routinesOfDay = []; | ||
foreach ($allRoutines as $routine) { | ||
if ($routine->getStart()->format('Y-m-d') == $date) { | ||
array_push($routinesOfDay, $routine); | ||
} | ||
} | ||
return $routinesOfDay; | ||
} | ||
|
||
public function getAllRoutines() | ||
{ | ||
return [ | ||
new Routine("First Routine", new DateTime('2021-05-14'), "#e04f1a"), | ||
new Routine("First Routine 2.0", new DateTime('2021-05-14'), "#82b54b"), | ||
new Routine("Second Routine", new DateTime('2021-05-17'), "#82b54b"), | ||
new Routine("Third Routine", new DateTime('2021-05-20'), "#ffb119"), | ||
new Routine("Final Routine", new DateTime('2021-05-22'), "#e04f1a") | ||
]; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace App\View\Components; | ||
|
||
use Illuminate\View\Component; | ||
|
||
class Footer extends Component | ||
{ | ||
public function render() | ||
{ | ||
return view('components.footer'); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace App\View\Components; | ||
|
||
use Illuminate\View\Component; | ||
|
||
class Head extends Component | ||
{ | ||
public function render() | ||
{ | ||
return view('components.head'); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace App\View\Components; | ||
|
||
use Illuminate\View\Component; | ||
|
||
class Navbar extends Component | ||
{ | ||
public function render() | ||
{ | ||
return view('components.navbar'); | ||
} | ||
} |
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
Empty file.
Oops, something went wrong.