-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates #376
- Loading branch information
Showing
8 changed files
with
103 additions
and
79 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
/** | ||
* @copyright 2024 City of Bloomington, Indiana | ||
* @license https://www.gnu.org/licenses/agpl.txt GNU/AGPL, see LICENSE | ||
*/ | ||
declare (strict_types=1); | ||
namespace Web\Settings\Index; | ||
|
||
class Controller extends \Web\Controller | ||
{ | ||
public function __invoke(array $params): \Web\View | ||
{ | ||
return new View(); | ||
} | ||
} |
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,49 @@ | ||
<?php | ||
/** | ||
* @copyright 2024 City of Bloomington, Indiana | ||
* @license https://www.gnu.org/licenses/agpl.txt GNU/AGPL, see LICENSE | ||
*/ | ||
declare (strict_types=1); | ||
namespace Web\Settings\Index; | ||
|
||
class View extends \Web\View | ||
{ | ||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
|
||
$this->vars = [ | ||
'links' => $this->links() | ||
]; | ||
} | ||
|
||
public function render(): string | ||
{ | ||
return $this->twig->render('html/settings/index.twig', $this->vars); | ||
} | ||
|
||
private function links(): array | ||
{ | ||
$links = []; | ||
$routes = [ | ||
'applicants' => 'applicant', | ||
'departments'=> 'department', | ||
'appointers' => 'appointer', | ||
'races' => 'race', | ||
'users' => 'user', | ||
'tags' => 'tag', | ||
'legislationTypes' => 'legislationType', | ||
'legislationActionTypes' => 'legislationActionType', | ||
'legislationStatuses' => 'legislationStatus' | ||
]; | ||
foreach ($routes as $plural=>$single) { | ||
if (parent::isAllowed($plural, 'index')) { | ||
$links[] = [ | ||
'url' => parent::generateUri("$plural.index"), | ||
'label' => $this->_([$single, $plural, 10]) | ||
]; | ||
} | ||
} | ||
return $links; | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{# | ||
* @copyright 2024 City of Bloomington, Indiana | ||
* @license http://www.gnu.org/licenses/agpl.txt GNU/AGPL, see LICENSE | ||
* @param array links | ||
#} | ||
{% extends "html/layouts/default.twig" %} | ||
{% block content %} | ||
<section> | ||
<header><h1>{{ _('settings') }}</h1></header> | ||
|
||
<ul>{% for l in links %} | ||
<li><a href="{{ l.url }}">{{ l.label }}</a></li> | ||
{% endfor %} | ||
<ul> | ||
</section> | ||
|
||
{% endblock %} |