From d00cf67dbb9aef01226ad5e1b200d139f37b05e0 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Thu, 8 May 2025 23:13:07 +0200 Subject: [PATCH 1/2] autofocus on open page --- resources/views/livewire/find-rule-component.blade.php | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/views/livewire/find-rule-component.blade.php b/resources/views/livewire/find-rule-component.blade.php index 7f164b755..d4af38028 100644 --- a/resources/views/livewire/find-rule-component.blade.php +++ b/resources/views/livewire/find-rule-component.blade.php @@ -13,6 +13,7 @@ class="form-control d-inline" style="width: 18em" wire:model.live.debounce.300ms="query" + autofocus="true" > From 3b4e7bc3bf374943f623fe16d01287917f9156af Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Fri, 9 May 2025 11:34:49 +0200 Subject: [PATCH 2/2] improve faqs to toggleable --- resources/json-database/faqs.json | 26 ++++ resources/views/homepage/_parts/faq.blade.php | 128 +++++++++++------- src/Controller/HomepageController.php | 23 ++-- 3 files changed, 116 insertions(+), 61 deletions(-) create mode 100644 resources/json-database/faqs.json diff --git a/resources/json-database/faqs.json b/resources/json-database/faqs.json new file mode 100644 index 000000000..d8ae911b6 --- /dev/null +++ b/resources/json-database/faqs.json @@ -0,0 +1,26 @@ +[ + { + "question": "Can you help with upgrade of PHP 5.3 code?", + "answer": "Yes, we handle any code from PHP 5.3 onward. Open-source framework, internal one or spaghetti code." + }, + { + "question": "What's the typical timeframe for an upgrade?", + "answer": "An average project upgrade is completed within 6-12 months. We approach each project individually and deliver the detailed estimate in the intro analysis." + }, + { + "question": "We're in a hurry. Can you start today?", + "answer": "We begin with a 3-week intro analysis, followed by an upgrade work." + }, + { + "question": "Can we continue developing new features during the upgrade?", + "answer": "Absolutely. Our upgrade process runs parallel to your ongoing development, ensuring no slowdown in your business growth." + }, + { + "question": "Will we need to re-hire your team for future upgrades?", + "answer": "No. Part of our work is to make your team self-sufficient. We get your code quality the highest possible level, get Rector to your CI working for you and then, next upgrade will be a matter of days on your own." + }, + { + "question": "We have a custom framework we want get rid off.
Can you migrate it to an open-source one?", + "answer": "Yes. We specialize in framework migration, mostly to Symfony or Laravel frameworks." + } +] diff --git a/resources/views/homepage/_parts/faq.blade.php b/resources/views/homepage/_parts/faq.blade.php index 19c58ba84..bf9510cc1 100644 --- a/resources/views/homepage/_parts/faq.blade.php +++ b/resources/views/homepage/_parts/faq.blade.php @@ -1,52 +1,78 @@ -
-
-

Can you help with upgrade of PHP 5.3 code?

-

Yes, we handle any code from PHP 5.3 onward. Open-source framework, internal one or spaghetti code.

-
- -
- -
-

What's the typical timeframe for an upgrade?

-

- An average project upgrade is completed within 6-12 months. We approach each project individually and deliver the detailed estimate in the intro analysis. -

-
- -
- -
-

We're in a hurry. Can you start today?

-

- We begin with a 3-week intro analysis, followed by an upgrade work. -

-
- -
- -
-

Can we continue developing new features during the upgrade?

-

- Absolutely. Our upgrade process runs parallel to your ongoing development, ensuring no - slowdown in your business growth. -

-
- -
- -
-

Will we need to re-hire your team for future upgrades?

-

- No. Part of our work is to make your team self-sufficient. We get your code quality the - highest possible level, get Rector to your CI working for you and then, next upgrade - will be a matter of days on your own. -

-
- -
- -
-

We have a custom framework. Can you migrate it to an open-source one?

-

Yes. We specialize in framework migration, mostly to Symfony or Laravel frameworks.

-
+ + +
+ @foreach($faqs as $faq) +
+

+ {!! $faq['question'] !!} + +

+

+ {{ $faq['answer'] }} +

+
+ @endforeach
+ + + diff --git a/src/Controller/HomepageController.php b/src/Controller/HomepageController.php index 67e23d0af..e9de4d4fd 100644 --- a/src/Controller/HomepageController.php +++ b/src/Controller/HomepageController.php @@ -23,22 +23,16 @@ public function __invoke(): View 'page_title' => "We'll Speed Up Your Development Process by 300%", 'recentPosts' => $this->postRepository->fetchLast(5), - 'references' => $this->loadReferences(), 'upcomingTalks' => $this->loadUpcomingTalks(), // seo 'metaTitle' => 'Rector: Fast PHP Code Upgrades & Refactoring', 'metaDescription' => 'Automate PHP code upgrades and refactoring with Rector. Save time, reduce errors, and modernize your codebase instantly. Try it now!', - ]); - } - /** - * @return array{string, mixed} - */ - private function loadReferences(): array - { - $fileContents = FileSystem::read(__DIR__ . '/../../resources/json-database/references.json'); - return Json::decode($fileContents, forceArrays: true); + // data + 'references' => $this->loadJsonFileToArray(__DIR__ . '/../../resources/json-database/references.json'), + 'faqs' => $this->loadJsonFileToArray(__DIR__ . '/../../resources/json-database/faqs.json'), + ]); } /** @@ -52,4 +46,13 @@ private function loadUpcomingTalks(): array // remove past talks return array_filter($upcomingTalks, static fn (array $talk): bool => $talk['date'] > date('Y-m-d')); } + + /** + * @return array + */ + private function loadJsonFileToArray(string $filePath): array + { + $fileContents = FileSystem::read($filePath); + return Json::decode($fileContents, forceArrays: true); + } }