-
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
10 changed files
with
181 additions
and
1,542 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Model\Constant; | ||
|
||
/** | ||
* Resources. | ||
* | ||
* @package App\Model\Constant | ||
* @author Robert Durica <[email protected]> | ||
* @copyright Copyright (c) 2023, Robert Durica | ||
*/ | ||
final class Resource | ||
{ | ||
/** Edit game rules. */ | ||
public const RULES = 'rules'; | ||
} |
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,37 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Model\Manager; | ||
|
||
use Nette\Database\Table\ActiveRow; | ||
use Rdurica\Core\Model\Manager\Manager; | ||
|
||
/** | ||
* RulesManager. | ||
* | ||
* @package App\Model\Manager | ||
* @author Robert Durica <[email protected]> | ||
* @copyright Copyright (c) 2023, Robert Durica | ||
*/ | ||
final class RulesManager extends Manager | ||
{ | ||
/** @var string Table name. */ | ||
private const TABLE = 'rules'; | ||
|
||
/** @inheritDoc */ | ||
protected function getTableName(): string | ||
{ | ||
return self::TABLE; | ||
} | ||
|
||
/** | ||
* Get rules. | ||
* | ||
* @return ActiveRow|null | ||
*/ | ||
public function findRules(): ?ActiveRow | ||
{ | ||
return $this->find()->fetch(); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -4,13 +4,41 @@ | |
|
||
namespace App\Presenter; | ||
|
||
use App\Model\Constant\Resource; | ||
use App\Model\Manager\RulesManager; | ||
use Nepada\SecurityAnnotations\Annotations\Allowed; | ||
use Nepada\SecurityAnnotations\SecurityAnnotations; | ||
use Nette\DI\Attributes\Inject; | ||
use Rdurica\Core\Constant\Privileges; | ||
use Rdurica\Core\Presenter\Presenter; | ||
use Rdurica\Core\Presenter\RequireLoggedUser; | ||
use Rdurica\Core\Presenter\SetMdbTemplateLayout; | ||
|
||
|
||
/** | ||
* HomePresenter. | ||
* | ||
* @package App\Presenter | ||
* @author Robert Durica <[email protected]> | ||
* @copyright Copyright (c) 2023, Robert Durica | ||
*/ | ||
final class HomePresenter extends Presenter | ||
{ | ||
use SetMdbTemplateLayout; | ||
use RequireLoggedUser; | ||
use SecurityAnnotations; | ||
|
||
#[Inject] | ||
public RulesManager $rulesManager; | ||
|
||
/** | ||
* Rules page. | ||
* | ||
* @return void | ||
*/ | ||
#[Allowed(resource: Resource::RULES, privilege: Privileges::VIEW)] | ||
public function renderRules(): void | ||
{ | ||
$data = $this->rulesManager->findRules(); | ||
$this->getTemplate()->data = $data; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -35,6 +35,4 @@ public function createComponentLoginForm(): LoginForm | |
{ | ||
return $this->loginForm->create(); | ||
} | ||
|
||
|
||
} | ||
} |
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,11 +1,62 @@ | ||
{block navbar}{include './../navbar.latte'}{/block} | ||
{block content} | ||
<div class="align-items-center text-white bg-primary border-0" role="alert" aria-live="assertive" aria-atomic="true"> | ||
<div class="d-flex"> | ||
<div class="toast-body"> | ||
Hello, world! This is a toast message. | ||
<div class="row"> | ||
<div class="col-md-5 offset-md-2"> | ||
Actual Challenges | ||
<div class="card text-center mt-2"> | ||
<div class="card-header">Featured</div> | ||
<div class="card-body"> | ||
<h5 class="card-title">Special title treatment</h5> | ||
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p> | ||
<a href="#" class="btn btn-primary ">Go somewhere</a> | ||
</div> | ||
<div class="card-footer text-muted">2 days ago</div> | ||
</div> | ||
|
||
<div class="card text-center mt-2"> | ||
<div class="card-header">Featured</div> | ||
<div class="card-body"> | ||
<h5 class="card-title">Special title treatment</h5> | ||
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p> | ||
<a href="#" class="btn btn-primary">Go somewhere</a> | ||
</div> | ||
<div class="card-footer text-muted">2 days ago</div> | ||
</div> | ||
|
||
<div class="card text-center mt-2"> | ||
<div class="card-header">Featured</div> | ||
<div class="card-body"> | ||
<h5 class="card-title">Special title treatment</h5> | ||
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p> | ||
<a href="#" class="btn btn-primary">Go somewhere</a> | ||
</div> | ||
<div class="card-footer text-muted">2 days ago</div> | ||
</div> | ||
</div> | ||
<div class="col-md-3 offset-md-2"> | ||
Completed | ||
<div class="card border border-success shadow-0 mt-2" style="max-width: 18rem;"> | ||
<div class="card-body text-success"> | ||
<h5 class="card-title">Success card title</h5> | ||
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the | ||
card's content.</p> | ||
</div> | ||
</div> | ||
|
||
<div class="card border border-success shadow-0 mt-2" style="max-width: 18rem;"> | ||
<div class="card-body text-success"> | ||
<h5 class="card-title">Success card title</h5> | ||
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the | ||
card's content.</p> | ||
</div> | ||
</div> | ||
|
||
<div class="card border border-success shadow-0 mt-2" style="max-width: 18rem;"> | ||
<div class="card-body text-success"> | ||
<h5 class="card-title">Success card title</h5> | ||
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the | ||
card's content.</p> | ||
</div> | ||
<button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button> | ||
</div> | ||
</div> | ||
{/block} | ||
</div> |
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,14 @@ | ||
{block navbar}{include './../navbar.latte'}{/block} | ||
{block content} | ||
<div class="row"> | ||
<div class="col-md-10 offset-md-1"> | ||
<div class="card mt-2"> | ||
<div class="card-body"> | ||
{$data->message|noescape} | ||
<br> | ||
<a n:if="$user->isAllowed(App\Model\Constant\Resource::RULES, Rdurica\Core\Constant\Privileges::EDIT)" | ||
href="#" class="btn btn-primary">Upravit</a> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
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,4 +1,10 @@ | ||
<!-- Navbar --> | ||
{block css} | ||
<link rel="stylesheet" | ||
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap-datepicker.css"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/assets/datagrid.css"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/assets/datagrid-spinners.css"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap-select.css"> | ||
{/block} | ||
<nav class="navbar navbar-expand-lg navbar-light bg-light"> | ||
<!-- Container wrapper --> | ||
<div class="container-fluid"> | ||
|
@@ -24,14 +30,20 @@ | |
/> B-day challenge | ||
</a> | ||
<!-- Left links --> | ||
{* <ul class="navbar-nav me-auto mb-2 mb-lg-0">*} | ||
{* <ul class="navbar-nav me-auto mb-2 mb-lg-0">*} | ||
{* <li class="nav-item">*} | ||
{* <a class="nav-link" href="#">Pridat ukol</a>*} | ||
{* </li>*} | ||
{* </ul>*} | ||
</div> | ||
<!-- Right elements --> | ||
<div class="d-flex align-items-center"> | ||
<a n:if="$user->isAllowed(App\Model\Constant\Resource::RULES, Rdurica\Core\Constant\Privileges::VIEW)" | ||
n:href=":rules" | ||
class="link-secondary me-3 "> | ||
<i class="fas fa-circle-info"></i> | ||
</a> | ||
|
||
<!-- Avatar --> | ||
<div class="dropdown"> | ||
<a class="dropdown-toggle d-flex align-items-center hidden-arrow" | ||
|
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
Oops, something went wrong.