From 393f34f6d662c79d37427a4ce390ee767a991fab Mon Sep 17 00:00:00 2001 From: Louis Charette Date: Sat, 17 Feb 2024 15:21:13 -0500 Subject: [PATCH] Add fallback routes when 'index' is not defined Fix userfrosting/userfrosting#1244 --- app/src/Controller/Group/GroupPageAction.php | 2 +- .../Permission/PermissionPageAction.php | 2 +- app/src/Controller/Role/RolePageAction.php | 2 +- app/src/Controller/User/UserPageAction.php | 2 +- .../Listener/UserRedirectedToDashboard.php | 2 +- app/src/Listener/UserRedirectedToSettings.php | 2 +- .../pages/abstract/dashboard.html.twig | 2 +- develop/App.php | 4 +- develop/Routes.php | 26 --- develop/templates/pages/index.html.twig | 183 ------------------ 10 files changed, 8 insertions(+), 219 deletions(-) delete mode 100644 develop/Routes.php delete mode 100755 develop/templates/pages/index.html.twig diff --git a/app/src/Controller/Group/GroupPageAction.php b/app/src/Controller/Group/GroupPageAction.php index 1686e73..e2daeb1 100644 --- a/app/src/Controller/Group/GroupPageAction.php +++ b/app/src/Controller/Group/GroupPageAction.php @@ -14,12 +14,12 @@ use Psr\Http\Message\ResponseInterface as Response; use Psr\Http\Message\ServerRequestInterface as Request; -use Slim\Interfaces\RouteParserInterface; use Slim\Views\Twig; use UserFrosting\Sprinkle\Account\Authenticate\Authenticator; use UserFrosting\Sprinkle\Account\Database\Models\Interfaces\GroupInterface; use UserFrosting\Sprinkle\Account\Exceptions\ForbiddenException; use UserFrosting\Sprinkle\Core\I18n\SiteLocaleInterface; +use UserFrosting\Sprinkle\Core\Util\RouteParserInterface; /** * Renders a page displaying a group's information, in read-only mode. diff --git a/app/src/Controller/Permission/PermissionPageAction.php b/app/src/Controller/Permission/PermissionPageAction.php index c1aa6eb..787f381 100644 --- a/app/src/Controller/Permission/PermissionPageAction.php +++ b/app/src/Controller/Permission/PermissionPageAction.php @@ -14,11 +14,11 @@ use Psr\Http\Message\ResponseInterface as Response; use Psr\Http\Message\ServerRequestInterface as Request; -use Slim\Interfaces\RouteParserInterface; use Slim\Views\Twig; use UserFrosting\Sprinkle\Account\Authenticate\Authenticator; use UserFrosting\Sprinkle\Account\Database\Models\Interfaces\PermissionInterface; use UserFrosting\Sprinkle\Account\Exceptions\ForbiddenException; +use UserFrosting\Sprinkle\Core\Util\RouteParserInterface; /** * Renders a page displaying a permission's information, in read-only mode. diff --git a/app/src/Controller/Role/RolePageAction.php b/app/src/Controller/Role/RolePageAction.php index 502b1a4..85725df 100644 --- a/app/src/Controller/Role/RolePageAction.php +++ b/app/src/Controller/Role/RolePageAction.php @@ -14,11 +14,11 @@ use Psr\Http\Message\ResponseInterface as Response; use Psr\Http\Message\ServerRequestInterface as Request; -use Slim\Interfaces\RouteParserInterface; use Slim\Views\Twig; use UserFrosting\Sprinkle\Account\Authenticate\Authenticator; use UserFrosting\Sprinkle\Account\Database\Models\Interfaces\RoleInterface; use UserFrosting\Sprinkle\Account\Exceptions\ForbiddenException; +use UserFrosting\Sprinkle\Core\Util\RouteParserInterface; /** * Renders a page displaying a role's information, in read-only mode. diff --git a/app/src/Controller/User/UserPageAction.php b/app/src/Controller/User/UserPageAction.php index 75de29e..fe1671a 100644 --- a/app/src/Controller/User/UserPageAction.php +++ b/app/src/Controller/User/UserPageAction.php @@ -14,12 +14,12 @@ use Psr\Http\Message\ResponseInterface as Response; use Psr\Http\Message\ServerRequestInterface as Request; -use Slim\Interfaces\RouteParserInterface; use Slim\Views\Twig; use UserFrosting\Sprinkle\Account\Authenticate\Authenticator; use UserFrosting\Sprinkle\Account\Database\Models\Interfaces\UserInterface; use UserFrosting\Sprinkle\Account\Exceptions\ForbiddenException; use UserFrosting\Sprinkle\Core\I18n\SiteLocaleInterface; +use UserFrosting\Sprinkle\Core\Util\RouteParserInterface; /** * Renders a page displaying a user's information, in read-only mode. diff --git a/app/src/Listener/UserRedirectedToDashboard.php b/app/src/Listener/UserRedirectedToDashboard.php index 2d037af..a10138a 100644 --- a/app/src/Listener/UserRedirectedToDashboard.php +++ b/app/src/Listener/UserRedirectedToDashboard.php @@ -13,9 +13,9 @@ namespace UserFrosting\Sprinkle\Admin\Listener; use Psr\EventDispatcher\StoppableEventInterface; -use Slim\Interfaces\RouteParserInterface; use UserFrosting\Sprinkle\Account\Authenticate\Authenticator; use UserFrosting\Sprinkle\Core\Event\Contract\RedirectingEventInterface; +use UserFrosting\Sprinkle\Core\Util\RouteParserInterface; /** * Set redirect to dashboard. diff --git a/app/src/Listener/UserRedirectedToSettings.php b/app/src/Listener/UserRedirectedToSettings.php index 485fe0f..6f588a0 100644 --- a/app/src/Listener/UserRedirectedToSettings.php +++ b/app/src/Listener/UserRedirectedToSettings.php @@ -13,9 +13,9 @@ namespace UserFrosting\Sprinkle\Admin\Listener; use Psr\EventDispatcher\StoppableEventInterface; -use Slim\Interfaces\RouteParserInterface; use UserFrosting\Sprinkle\Account\Authenticate\Authenticator; use UserFrosting\Sprinkle\Core\Event\Contract\RedirectingEventInterface; +use UserFrosting\Sprinkle\Core\Util\RouteParserInterface; /** * Set redirect to dashboard. diff --git a/app/templates/pages/abstract/dashboard.html.twig b/app/templates/pages/abstract/dashboard.html.twig index 0ad97f9..fc123bb 100644 --- a/app/templates/pages/abstract/dashboard.html.twig +++ b/app/templates/pages/abstract/dashboard.html.twig @@ -28,7 +28,7 @@
{% block navbar_logo %} - diff --git a/develop/App.php b/develop/App.php index e069632..b4616be 100644 --- a/develop/App.php +++ b/develop/App.php @@ -54,9 +54,7 @@ public function getSprinkles(): array */ public function getRoutes(): array { - return [ - Routes::class, - ]; + return []; } /** diff --git a/develop/Routes.php b/develop/Routes.php deleted file mode 100644 index 9a5fd6e..0000000 --- a/develop/Routes.php +++ /dev/null @@ -1,26 +0,0 @@ -get('/', function (Response $response, Twig $view) { - return $view->render($response, 'pages/index.html.twig'); - })->setName('index'); - } -} diff --git a/develop/templates/pages/index.html.twig b/develop/templates/pages/index.html.twig deleted file mode 100755 index c37108c..0000000 --- a/develop/templates/pages/index.html.twig +++ /dev/null @@ -1,183 +0,0 @@ -{% extends "pages/abstract/default.html.twig" %} - -{% set page_active = "home" %} - -{# Overrides blocks in head of base template #} -{% block page_title %}{{translate("HOME")}}{% endblock %} - -{% block page_description %}{{translate("WELCOME_TO", {'title': site.title})}}{% endblock %} - -{% block body_matter %} - - -
-
- - -
- -
- - - -
-
-

- Welcome to AdminLTE -

-
-
-
-
-

Bootstrap v3.2.0

-
-
-

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Itaque, optio corporis quae nulla aspernatur in alias at numquam rerum ea excepturi expedita tenetur assumenda voluptatibus eveniet incidunt dicta nostrum quod?

- Learn More -
-
-
-
-
-
-

Free & Open Source

-
-
-

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Itaque, optio corporis quae nulla aspernatur in alias at numquam rerum ea excepturi expedita tenetur assumenda voluptatibus eveniet incidunt dicta nostrum quod?

- Learn More -
-
-
-
-
-
-

Easy to Use

-
-
-

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Itaque, optio corporis quae nulla aspernatur in alias at numquam rerum ea excepturi expedita tenetur assumenda voluptatibus eveniet incidunt dicta nostrum quod?

- Learn More -
-
-
-
- - - -
-
- -
-
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- -
-
-

The Modern Business template by Start Bootstrap includes:

-
    -
  • Bootstrap v3.2.0 -
  • -
  • jQuery v1.11.0
  • -
  • Font Awesome v4.1.0
  • -
  • Unstyled page elements for easy customization
  • -
  • 17 HTML pages
  • -
-

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corporis, omnis doloremque non cum id reprehenderit, quisquam totam aspernatur tempora minima unde aliquid ea culpa sunt. Reiciendis quia dolorum ducimus unde.

-
-
- -
-
- - -
- - -
-
-
-

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestias, expedita, saepe, vero rerum deleniti beatae veniam harum neque nemo praesentium cum alias asperiores commodi.

-
- -
-
-{% endblock %} - -{% block scripts_page %} - - -{% endblock %}