Skip to content

Commit d1c0af0

Browse files
author
Sebastian Fix
committed
wip
1 parent 636e552 commit d1c0af0

14 files changed

Lines changed: 266 additions & 84 deletions
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\OpenSource;
4+
5+
use App\Actions\PageAction;
6+
use App\Http\Controllers\Controller;
7+
use App\Models\Product;
8+
use Illuminate\Support\Str;
9+
use Illuminate\View\View;
10+
11+
class OpenSoruceShowController extends Controller
12+
{
13+
/**
14+
* Display the user's profile form.
15+
*/
16+
public function __invoke(string $locale, Product $product): View
17+
{
18+
return view('app.products.show')->with([
19+
'page' => (new PageAction(locale: $locale))->product(product: $product),
20+
'name' => $product->name,
21+
'teaser' => $product->teaser,
22+
'content' => Str::of($product->content)->markdown(),
23+
'tags' => $product->tags,
24+
]);
25+
}
26+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\OpenSource;
4+
5+
use App\Actions\PageAction;
6+
use App\Actions\ViewDataAction;
7+
use App\Http\Controllers\Controller;
8+
use Illuminate\View\View;
9+
10+
class OpenSourceIndexController extends Controller
11+
{
12+
/**
13+
* Display the user's profile form.
14+
*/
15+
public function __invoke(): View
16+
{
17+
$locale = app()->getLocale();
18+
19+
return view('app.products.index')->with([
20+
'page' => (new PageAction(locale: null, routeName: 'products.index'))->default(),
21+
'products' => (new ViewDataAction)->products($locale),
22+
]);
23+
}
24+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Technologies;
4+
5+
use App\Actions\PageAction;
6+
use App\Actions\ViewDataAction;
7+
use App\Http\Controllers\Controller;
8+
use Illuminate\View\View;
9+
10+
class TechnologiesIndexController extends Controller
11+
{
12+
/**
13+
* Display the user's profile form.
14+
*/
15+
public function __invoke(): View
16+
{
17+
$locale = app()->getLocale();
18+
19+
return view('app.products.index')->with([
20+
'page' => (new PageAction(locale: null, routeName: 'products.index'))->default(),
21+
'products' => (new ViewDataAction)->products($locale),
22+
]);
23+
}
24+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Technologies;
4+
5+
use App\Actions\PageAction;
6+
use App\Http\Controllers\Controller;
7+
use App\Models\Product;
8+
use Illuminate\Support\Str;
9+
use Illuminate\View\View;
10+
11+
class TechnologiesShowController extends Controller
12+
{
13+
/**
14+
* Display the user's profile form.
15+
*/
16+
public function __invoke(string $locale, Product $product): View
17+
{
18+
return view('app.products.show')->with([
19+
'page' => (new PageAction(locale: $locale))->product(product: $product),
20+
'name' => $product->name,
21+
'teaser' => $product->teaser,
22+
'content' => Str::of($product->content)->markdown(),
23+
'tags' => $product->tags,
24+
]);
25+
}
26+
}

app/Models/Configuration.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ class Configuration extends Model
2121
];
2222

2323
protected $casts = [
24+
'section_services' => 'boolean',
25+
'section_products' => 'boolean',
26+
'section_technologies' => 'boolean',
27+
'section_open_source' => 'boolean',
28+
2429
'contact' => 'json',
2530
'terms' => 'json',
2631
'imprint' => 'json',

database/migrations/2025_06_23_225051_create_configurations_table.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ public function up(): void
1313
{
1414
Schema::create('configurations', function (Blueprint $table) {
1515
$table->id();
16+
17+
$table->boolean('section_services')->default(false);
18+
$table->boolean('section_products')->default(false);
19+
$table->boolean('section_technologies')->default(false);
20+
$table->boolean('section_open_source')->default(false);
21+
1622
$table->string('logo')->nullable();
1723
$table->json('contact')->nullable();
1824
$table->json('terms')->nullable();

database/seeders/Codebar/ConfigurationsTableSeeder.php

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,27 @@ class ConfigurationsTableSeeder extends Seeder
1414
public function run(): void
1515
{
1616
Configuration::updateOrCreate([], [
17+
'section_services' => false,
18+
'section_products' => false,
19+
'section_technologies' => true,
20+
'section_open_source' => true,
21+
1722
'logo' => 'layouts._logos._codebar',
18-
'footer' => [
19-
LocaleEnum::DE->value => 'codebar Solutions AG',
20-
],
23+
24+
'contact' => null,
25+
'terms' => null,
26+
'imprint' => null,
27+
'privacy' => null,
28+
2129
'links' => [
2230
'linkedin' => 'https://www.linkedin.com/company/codebarag',
2331
'github' => 'https://github.com/orgs/codebar-ag',
2432
],
33+
34+
'footer' => [
35+
LocaleEnum::DE->value => 'codebar Solutions AG',
36+
],
37+
2538
]);
2639
}
2740
}

database/seeders/Paperflakes/ConfigurationsTableSeeder.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,25 @@ class ConfigurationsTableSeeder extends Seeder
1414
public function run(): void
1515
{
1616
Configuration::updateOrCreate([], [
17+
'section_services' => true,
18+
'section_products' => true,
19+
'section_technologies' => false,
20+
'section_open_source' => false,
21+
1722
'logo' => 'layouts._logos._paperflakes',
18-
'footer' => [
19-
LocaleEnum::DE->value => 'paperflakes AG',
20-
],
23+
24+
'contact' => null,
25+
'terms' => null,
26+
'imprint' => null,
27+
'privacy' => null,
28+
2129
'links' => [
2230
'linkedin' => 'https://www.linkedin.com/company/paperflakes',
2331
'github' => 'https://github.com/orgs/paperflakes-ag',
2432
],
33+
'footer' => [
34+
LocaleEnum::DE->value => 'paperflakes AG',
35+
],
2536
]);
2637
}
2738
}

database/seeders/Paperflakes/ContactsTableSeeder.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public function run(): void
5252
'key' => ContactSectionEnum::EMPLOYEE_SERVICES,
5353
'role' => [
5454
'de_CH' => 'zunscan.ch',
55+
'en_CH' => 'zunscan.ch',
5556
],
5657
],
5758
ContactSectionEnum::BOARD_MEMBERS => [
@@ -157,6 +158,7 @@ public function run(): void
157158
'key' => ContactSectionEnum::COLLABORATIONS,
158159
'role' => [
159160
'de_CH' => 'codebar Solutions AG',
161+
'en_CH' => 'codebar Solutions AG',
160162
],
161163
],
162164
],
@@ -178,6 +180,7 @@ public function run(): void
178180
'key' => ContactSectionEnum::COLLABORATIONS,
179181
'role' => [
180182
'de_CH' => 'Wieland Business Solutions GmbH',
183+
'en_CH' => 'Wieland Business Solutions GmbH',
181184
],
182185
],
183186
],

resources/views/layouts/_partials/_footer.blade.php

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,40 @@
22
<div class="flex flex-col gap-8">
33

44
<div class="hidden md:flex flex-col items-start gap-4 md:gap-18 md:flex-row md:items-start md:justify-start mx-auto md:mx-0">
5-
<div>
6-
<h2 class="text-black font-semibold">{{ __('Services') }}</h2>
7-
<ul class="mt-1 list-none text-base">
8-
@if(!empty($services) && $services->count())
9-
@foreach($services as $service)
10-
<li>
11-
<x-a :href="$service->url ?? localized_route('services.show',['locale' => app()->getLocale(),'service' => $service])"
12-
label="{{ $service->name }}" :target="$service->url ? '_blank' : '_self'"
13-
classAttributes="text-lg"/>
14-
</li>
15-
@endforeach
16-
@endif
17-
</ul>
18-
</div>
5+
@if($configuration->section_services)
6+
<div>
7+
<h2 class="text-black font-semibold">{{ __('Services') }}</h2>
8+
<ul class="mt-1 list-none text-base">
9+
@if(!empty($services) && $services->count())
10+
@foreach($services as $service)
11+
<li>
12+
<x-a :href="$service->url ?? localized_route('services.show',['locale' => app()->getLocale(),'service' => $service])"
13+
label="{{ $service->name }}" :target="$service->url ? '_blank' : '_self'"
14+
classAttributes="text-lg"/>
15+
</li>
16+
@endforeach
17+
@endif
18+
</ul>
19+
</div>
20+
@endif
21+
22+
@if($configuration->section_products)
23+
<div>
24+
<h2 class="text-black font-semibold">{{ __('Products') }}</h2>
25+
<ul class="mt-1 list-none text-base">
26+
@if(!empty($products) && $products->count())
27+
@foreach($products as $product)
28+
<li>
29+
<x-a :href="$product->url ?? localized_route('products.show',['locale' => app()->getLocale(),'product' => $product])"
30+
label="{{ $product->name }}" :target="$product->url ? '_blank' : '_self'"
31+
classAttributes="text-lg"/>
32+
</li>
33+
@endforeach
34+
@endif
35+
</ul>
36+
</div>
37+
@endif
1938

20-
<div>
21-
<h2 class="text-black font-semibold">{{ __('Products') }}</h2>
22-
<ul class="mt-1 list-none text-base">
23-
@if(!empty($products) && $products->count())
24-
@foreach($products as $product)
25-
<li>
26-
<x-a :href="$product->url ?? localized_route('products.show',['locale' => app()->getLocale(),'product' => $product])"
27-
label="{{ $product->name }}" :target="$product->url ? '_blank' : '_self'"
28-
classAttributes="text-lg"/>
29-
</li>
30-
@endforeach
31-
@endif
32-
</ul>
33-
</div>
3439
<div>
3540
<h2 class="text-black font-semibold">{{ __('paperflakes AG') }}</h2>
3641
<ul class="mt-1 list-none text-base">

0 commit comments

Comments
 (0)