From a6b0725b6f5a2eecbb6cf717275f877f86717cf5 Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 11 Apr 2024 06:11:56 +0200 Subject: [PATCH] Allow for v1 and v2 views. --- config/view.php | 13 +++++++++---- resources/views/{ => v1}/debug-table.twig | 0 resources/views/{ => v1}/debug.twig | 0 .../views/{ => v1}/emails/import/report.blade.php | 0 resources/views/{ => v1}/error.twig | 0 resources/views/{ => v1}/errors/503.twig | 0 resources/views/{ => v1}/errors/exception.twig | 0 .../{ => v1}/import/002-authenticate/index.twig | 0 .../views/{ => v1}/import/003-upload/index.twig | 0 .../views/{ => v1}/import/004-configure/index.twig | 0 .../import/004-configure/partials/account-row.twig | 0 .../partials/account-title-generic.twig | 0 .../004-configure/partials/ff3-account-generic.twig | 0 .../views/{ => v1}/import/005-roles/index-camt.twig | 0 .../views/{ => v1}/import/005-roles/index-csv.twig | 0 .../views/{ => v1}/import/006-mapping/index.twig | 0 .../views/{ => v1}/import/007-convert/index.twig | 0 .../views/{ => v1}/import/008-submit/index.twig | 0 .../views/{ => v1}/import/009-selection/index.twig | 0 .../views/{ => v1}/import/011-connection/index.twig | 0 resources/views/{ => v1}/index.twig | 0 resources/views/{ => v1}/layout/default.twig | 0 resources/views/{ => v1}/roles-macros.twig | 0 resources/views/{ => v1}/token/client_id.twig | 0 resources/views/{ => v1}/token/index.twig | 0 25 files changed, 9 insertions(+), 4 deletions(-) rename resources/views/{ => v1}/debug-table.twig (100%) rename resources/views/{ => v1}/debug.twig (100%) rename resources/views/{ => v1}/emails/import/report.blade.php (100%) rename resources/views/{ => v1}/error.twig (100%) rename resources/views/{ => v1}/errors/503.twig (100%) rename resources/views/{ => v1}/errors/exception.twig (100%) rename resources/views/{ => v1}/import/002-authenticate/index.twig (100%) rename resources/views/{ => v1}/import/003-upload/index.twig (100%) rename resources/views/{ => v1}/import/004-configure/index.twig (100%) rename resources/views/{ => v1}/import/004-configure/partials/account-row.twig (100%) rename resources/views/{ => v1}/import/004-configure/partials/account-title-generic.twig (100%) rename resources/views/{ => v1}/import/004-configure/partials/ff3-account-generic.twig (100%) rename resources/views/{ => v1}/import/005-roles/index-camt.twig (100%) rename resources/views/{ => v1}/import/005-roles/index-csv.twig (100%) rename resources/views/{ => v1}/import/006-mapping/index.twig (100%) rename resources/views/{ => v1}/import/007-convert/index.twig (100%) rename resources/views/{ => v1}/import/008-submit/index.twig (100%) rename resources/views/{ => v1}/import/009-selection/index.twig (100%) rename resources/views/{ => v1}/import/011-connection/index.twig (100%) rename resources/views/{ => v1}/index.twig (100%) rename resources/views/{ => v1}/layout/default.twig (100%) rename resources/views/{ => v1}/roles-macros.twig (100%) rename resources/views/{ => v1}/token/client_id.twig (100%) rename resources/views/{ => v1}/token/index.twig (100%) diff --git a/config/view.php b/config/view.php index 8f9b81a1..b2fb6d32 100644 --- a/config/view.php +++ b/config/view.php @@ -22,6 +22,13 @@ declare(strict_types=1); +$paths = [realpath(base_path('resources/views/v1'))]; +if ('v2' === env('DATA_IMPORTER_LAYOUT')) { + $paths = [ + realpath(base_path('resources/views/v2')), + realpath(base_path('resources/views'))]; +} + return [ /* |-------------------------------------------------------------------------- @@ -33,10 +40,8 @@ return [ | the usual Laravel view path has already been registered for you. | */ - - 'paths' => [ - resource_path('views'), - ], + 'layout' => env('DATA_IMPORTER_LAYOUT', 'v1'), + 'paths' => $paths, /* |-------------------------------------------------------------------------- diff --git a/resources/views/debug-table.twig b/resources/views/v1/debug-table.twig similarity index 100% rename from resources/views/debug-table.twig rename to resources/views/v1/debug-table.twig diff --git a/resources/views/debug.twig b/resources/views/v1/debug.twig similarity index 100% rename from resources/views/debug.twig rename to resources/views/v1/debug.twig diff --git a/resources/views/emails/import/report.blade.php b/resources/views/v1/emails/import/report.blade.php similarity index 100% rename from resources/views/emails/import/report.blade.php rename to resources/views/v1/emails/import/report.blade.php diff --git a/resources/views/error.twig b/resources/views/v1/error.twig similarity index 100% rename from resources/views/error.twig rename to resources/views/v1/error.twig diff --git a/resources/views/errors/503.twig b/resources/views/v1/errors/503.twig similarity index 100% rename from resources/views/errors/503.twig rename to resources/views/v1/errors/503.twig diff --git a/resources/views/errors/exception.twig b/resources/views/v1/errors/exception.twig similarity index 100% rename from resources/views/errors/exception.twig rename to resources/views/v1/errors/exception.twig diff --git a/resources/views/import/002-authenticate/index.twig b/resources/views/v1/import/002-authenticate/index.twig similarity index 100% rename from resources/views/import/002-authenticate/index.twig rename to resources/views/v1/import/002-authenticate/index.twig diff --git a/resources/views/import/003-upload/index.twig b/resources/views/v1/import/003-upload/index.twig similarity index 100% rename from resources/views/import/003-upload/index.twig rename to resources/views/v1/import/003-upload/index.twig diff --git a/resources/views/import/004-configure/index.twig b/resources/views/v1/import/004-configure/index.twig similarity index 100% rename from resources/views/import/004-configure/index.twig rename to resources/views/v1/import/004-configure/index.twig diff --git a/resources/views/import/004-configure/partials/account-row.twig b/resources/views/v1/import/004-configure/partials/account-row.twig similarity index 100% rename from resources/views/import/004-configure/partials/account-row.twig rename to resources/views/v1/import/004-configure/partials/account-row.twig diff --git a/resources/views/import/004-configure/partials/account-title-generic.twig b/resources/views/v1/import/004-configure/partials/account-title-generic.twig similarity index 100% rename from resources/views/import/004-configure/partials/account-title-generic.twig rename to resources/views/v1/import/004-configure/partials/account-title-generic.twig diff --git a/resources/views/import/004-configure/partials/ff3-account-generic.twig b/resources/views/v1/import/004-configure/partials/ff3-account-generic.twig similarity index 100% rename from resources/views/import/004-configure/partials/ff3-account-generic.twig rename to resources/views/v1/import/004-configure/partials/ff3-account-generic.twig diff --git a/resources/views/import/005-roles/index-camt.twig b/resources/views/v1/import/005-roles/index-camt.twig similarity index 100% rename from resources/views/import/005-roles/index-camt.twig rename to resources/views/v1/import/005-roles/index-camt.twig diff --git a/resources/views/import/005-roles/index-csv.twig b/resources/views/v1/import/005-roles/index-csv.twig similarity index 100% rename from resources/views/import/005-roles/index-csv.twig rename to resources/views/v1/import/005-roles/index-csv.twig diff --git a/resources/views/import/006-mapping/index.twig b/resources/views/v1/import/006-mapping/index.twig similarity index 100% rename from resources/views/import/006-mapping/index.twig rename to resources/views/v1/import/006-mapping/index.twig diff --git a/resources/views/import/007-convert/index.twig b/resources/views/v1/import/007-convert/index.twig similarity index 100% rename from resources/views/import/007-convert/index.twig rename to resources/views/v1/import/007-convert/index.twig diff --git a/resources/views/import/008-submit/index.twig b/resources/views/v1/import/008-submit/index.twig similarity index 100% rename from resources/views/import/008-submit/index.twig rename to resources/views/v1/import/008-submit/index.twig diff --git a/resources/views/import/009-selection/index.twig b/resources/views/v1/import/009-selection/index.twig similarity index 100% rename from resources/views/import/009-selection/index.twig rename to resources/views/v1/import/009-selection/index.twig diff --git a/resources/views/import/011-connection/index.twig b/resources/views/v1/import/011-connection/index.twig similarity index 100% rename from resources/views/import/011-connection/index.twig rename to resources/views/v1/import/011-connection/index.twig diff --git a/resources/views/index.twig b/resources/views/v1/index.twig similarity index 100% rename from resources/views/index.twig rename to resources/views/v1/index.twig diff --git a/resources/views/layout/default.twig b/resources/views/v1/layout/default.twig similarity index 100% rename from resources/views/layout/default.twig rename to resources/views/v1/layout/default.twig diff --git a/resources/views/roles-macros.twig b/resources/views/v1/roles-macros.twig similarity index 100% rename from resources/views/roles-macros.twig rename to resources/views/v1/roles-macros.twig diff --git a/resources/views/token/client_id.twig b/resources/views/v1/token/client_id.twig similarity index 100% rename from resources/views/token/client_id.twig rename to resources/views/v1/token/client_id.twig diff --git a/resources/views/token/index.twig b/resources/views/v1/token/index.twig similarity index 100% rename from resources/views/token/index.twig rename to resources/views/v1/token/index.twig