From 33d3403995a9eff14befdce1accf3ae88de8103e Mon Sep 17 00:00:00 2001 From: purple Date: Sun, 19 Feb 2023 19:30:47 +0100 Subject: [PATCH] Replaced placeholder and added "global variables" The replacement of the placeholder is just a work in progress. I've also discovered a few more things about PHP now, including how to do variables and stuff. --- .../BlueprintExtensionController.php | 9 +++-- .../Admin/ExtensionsController.php | 6 ++-- .../Helpers/BlueprintVariableService.php | 13 +++++++ .../extensions/blueprint/blueprint.style.css | 5 ++- resources/views/admin/extensions.blade.php | 2 +- .../extensions/blueprint/index.blade.php | 35 ++++++++++++------- 6 files changed, 50 insertions(+), 20 deletions(-) create mode 100644 app/Services/Helpers/BlueprintVariableService.php diff --git a/app/Http/Controllers/Admin/Extensions/Blueprint/BlueprintExtensionController.php b/app/Http/Controllers/Admin/Extensions/Blueprint/BlueprintExtensionController.php index dfd67a8..36246d9 100644 --- a/app/Http/Controllers/Admin/Extensions/Blueprint/BlueprintExtensionController.php +++ b/app/Http/Controllers/Admin/Extensions/Blueprint/BlueprintExtensionController.php @@ -6,13 +6,15 @@ use Illuminate\View\View; use Illuminate\View\Factory as ViewFactory; use Pterodactyl\Http\Controllers\Controller; use Pterodactyl\Services\Helpers\SoftwareVersionService; +use Pterodactyl\Services\Helpers\BlueprintVariableService; class BlueprintExtensionController extends Controller { + /** - * ExtensionsController constructor. + * BlueprintExtensionController constructor. */ - public function __construct(private SoftwareVersionService $version, private ViewFactory $view) + public function __construct(private SoftwareVersionService $version, private ViewFactory $view, private BlueprintVariableService $bp) { } @@ -21,6 +23,7 @@ class BlueprintExtensionController extends Controller */ public function index(): View { - return $this->view->make('admin.extensions.blueprint.index', ['version' => $this->version]); + $rootPath = "/admin/extensions/blueprint"; + return $this->view->make('admin.extensions.blueprint.index', ['version' => $this->version, 'bp' => $this->bp, 'root' => $rootPath]); } } diff --git a/app/Http/Controllers/Admin/ExtensionsController.php b/app/Http/Controllers/Admin/ExtensionsController.php index b6c5155..cb30322 100644 --- a/app/Http/Controllers/Admin/ExtensionsController.php +++ b/app/Http/Controllers/Admin/ExtensionsController.php @@ -6,13 +6,14 @@ use Illuminate\View\View; use Illuminate\View\Factory as ViewFactory; use Pterodactyl\Http\Controllers\Controller; use Pterodactyl\Services\Helpers\SoftwareVersionService; +use Pterodactyl\Services\Helpers\BlueprintVariableService; class ExtensionsController extends Controller { /** * ExtensionsController constructor. */ - public function __construct(private SoftwareVersionService $version, private ViewFactory $view) + public function __construct(private SoftwareVersionService $version, private ViewFactory $view, private BlueprintVariableService $bp) { } @@ -21,6 +22,7 @@ class ExtensionsController extends Controller */ public function index(): View { - return $this->view->make('admin.extensions', ['version' => $this->version]); + $rootPath = "/admin/extensions"; + return $this->view->make('admin.extensions', ['version' => $this->version, 'bp' => $this->bp, 'root' => $rootPath]); } } diff --git a/app/Services/Helpers/BlueprintVariableService.php b/app/Services/Helpers/BlueprintVariableService.php new file mode 100644 index 0000000..319e464 --- /dev/null +++ b/app/Services/Helpers/BlueprintVariableService.php @@ -0,0 +1,13 @@ +licenseIsValid() + public function licenseIsValid(): bool{return true;} +} diff --git a/public/assets/extensions/blueprint/blueprint.style.css b/public/assets/extensions/blueprint/blueprint.style.css index 60e5356..de8d02b 100644 --- a/public/assets/extensions/blueprint/blueprint.style.css +++ b/public/assets/extensions/blueprint/blueprint.style.css @@ -19,4 +19,7 @@ tag[blue] {background-color:#288afb;} [ext-title]{display:flex; flex-direction:row; align-items:center;} .btn-gray {background-color:#33404d;color:#cad1d8;border-color:#606d7b;} -.btn-gray:hover {background-color:#29343e;color:#cad1d8;border-color:#606d7b;} \ No newline at end of file +.btn-gray:hover {background-color:#29343e;color:#cad1d8;border-color:#606d7b;} + +.btn-gray-alt {background-color:#4d5b69;color:#cad1d8;border-color:#4d5b69;} +.btn-gray-alt:hover {background-color:#3f4d5a;color:#cad1d8;border-color:#4d5b69;} \ No newline at end of file diff --git a/resources/views/admin/extensions.blade.php b/resources/views/admin/extensions.blade.php index d0a8ed5..f20c9a7 100644 --- a/resources/views/admin/extensions.blade.php +++ b/resources/views/admin/extensions.blade.php @@ -1,7 +1,7 @@ @extends('layouts.admin') @section('title') - Administration + Extensions @endsection @section('content-header') diff --git a/resources/views/admin/extensions/blueprint/index.blade.php b/resources/views/admin/extensions/blueprint/index.blade.php index b2f6051..70f9320 100644 --- a/resources/views/admin/extensions/blueprint/index.blade.php +++ b/resources/views/admin/extensions/blueprint/index.blade.php @@ -1,7 +1,7 @@ @extends('layouts.admin') @section('title') - Administration + Blueprint @endsection @section('content-header') @@ -15,19 +15,28 @@ @endsection @section('content') +

Blueprint is the framework that drives all Blueprint-compatible extensions and allows multiple extensions to be installed at the same time.

- - - -
- +
+
+
+

License

+
+
+ @if ($bp->licenseIsValid()) + Your attached license key is valid. You can manage your license key below. + @else + You have not attached a (valid) license key. Blueprint is limited until you attach a valid license key. + @endif +
+ +
-

placeholder

@endsection \ No newline at end of file