Skip to content

Commit

Permalink
remove useless subroute home
Browse files Browse the repository at this point in the history
  • Loading branch information
Neofox committed Mar 22, 2019
1 parent 60be9ea commit 2bddf26
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Controller/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class HomeController extends AbstractController
{
/**
* @Route("/home", name="home")
* @Route("/", name="home")
*/
public function index()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/SecurityController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class SecurityController extends AbstractController
public function login(AuthenticationUtils $authenticationUtils): Response
{
if ($this->isGranted(['ROLE_GUARDIAN', 'ROLE_NURSE'])){
return $this->redirectToRoute('home');
return $this->redirectToRoute('index');
}
// get the login error if there is one
$error = $authenticationUtils->getLastAuthenticationError();
Expand Down
2 changes: 1 addition & 1 deletion src/Security/LoginFormAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function onAuthenticationSuccess(Request $request, TokenInterface $token,
return new RedirectResponse($targetPath);
}

return new RedirectResponse($this->router->generate('home'));
return new RedirectResponse($this->router->generate('index'));
}

protected function getLoginUrl()
Expand Down
6 changes: 3 additions & 3 deletions templates/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
{% block header %}
<div class="page-header" style="z-index: 10">
<div class="page-wrapper">
{% if app.request.get('_route') == 'home' or app.request.get('_route') == 'index' %}
{% if app.request.get('_route') == 'index' %}
<button type="button" disabled style="pointer-events: none;" class="btn-icon disabled"><i class="fas fa-fw" aria-label="hidden"></i></button>
{% elseif app.request.get('_route') == 'sheet_view' %}
<a href="{{ path('child_list') }}"><button type="button" class="btn-icon"><i class="fas fa-chevron-left" aria-label="hidden"></i></button></a>
{% elseif app.request.get('_route') == 'child_list' %}
<a href="{{ path('home') }}"><button type="button" class="btn-icon"><i class="fas fa-chevron-left" aria-label="hidden"></i></button></a>
<a href="{{ path('index') }}"><button type="button" class="btn-icon"><i class="fas fa-chevron-left" aria-label="hidden"></i></button></a>
{% else %}
<button type="button" class="btn-icon" onclick="history.back()"><i class="fas fa-chevron-left" aria-label="hidden"></i></button>
{% endif %}
Expand All @@ -51,7 +51,7 @@
<button type="button" data-modal="modalNav" class="btn-icon"><i class="fas fa-times" aria-label="hidden"></i></button>
<nav class="nav-primary">
<ul>
<li><a href="{{ path('home') }}">{% trans %}page.home{% endtrans %}</a></li>
<li><a href="{{ path('index') }}">{% trans %}page.home{% endtrans %}</a></li>
<li><a href="{{ path('child_list') }}">{% trans %}page.child_list{% endtrans %}</a></li>
<li><a href="{{ path('user_profile') }}">{% trans %}page.profile{% endtrans %}</a></li>
</ul>
Expand Down

0 comments on commit 2bddf26

Please sign in to comment.