Skip to content

Commit 7796125

Browse files
author
Sebastian Fix
committed
wip
1 parent 81f6286 commit 7796125

12 files changed

Lines changed: 114 additions & 44 deletions

File tree

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\News;
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 NewsIndexController 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.news.index')->with([
20+
'page' => (new PageAction(locale: null, routeName: 'news.index'))->default(),
21+
'news' => (new ViewDataAction)->news($locale),
22+
]);
23+
}
24+
}

app/Models/Configuration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class Configuration extends Model
1010
use HasFactory;
1111

1212
protected $casts = [
13+
'section_news' => 'boolean',
1314
'section_services' => 'boolean',
1415
'section_products' => 'boolean',
1516
'section_technologies' => 'boolean',

database/migrations/2025_06_23_225051_create_configurations_table.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public function up(): void
1616

1717
$table->string('company')->nullable();
1818

19+
$table->boolean('section_news')->default(false);
1920
$table->boolean('section_services')->default(false);
2021
$table->boolean('section_products')->default(false);
2122
$table->boolean('section_technologies')->default(false);

database/seeders/Codebar/ConfigurationsTableSeeder.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public function run(): void
1616

1717
'company' => 'codebar Solutions AG',
1818

19+
'section_news' => false,
1920
'section_services' => false,
2021
'section_products' => false,
2122
'section_technologies' => true,

database/seeders/Codebar/ContactsTableSeeder.php

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function run(): void
8686
['id' => 4],
8787
[
8888
'name' => 'Alexander Christoph Boll',
89-
'published' => true,
89+
'published' => false,
9090
'sections' => [
9191
ContactSectionEnum::EMPLOYEES => [
9292
'key' => ContactSectionEnum::EMPLOYEES,
@@ -104,33 +104,11 @@ public function run(): void
104104
]
105105
);
106106

107-
Contact::updateOrCreate(
108-
['id' => 5],
109-
[
110-
'name' => 'Dominique Ernst',
111-
'published' => false,
112-
'sections' => [
113-
ContactSectionEnum::EMPLOYEES => [
114-
'key' => ContactSectionEnum::EMPLOYEES,
115-
'role' => [
116-
'de_CH' => 'Projektleiter',
117-
'en_CH' => 'Project Manager',
118-
],
119-
],
120-
],
121-
'icons' => [
122-
'email' => 'info@paperflakes.ch',
123-
'website' => 'https://www.paperflakes.ch',
124-
],
125-
'image' => 'https://res.cloudinary.com/codebar/image/upload/w_400,h_400,f_auto,q_auto/www-paperflakes-ch/people/codebar.webp',
126-
]
127-
);
128-
129107
Contact::updateOrCreate(
130108
['id' => 6],
131109
[
132110
'name' => 'PST GmbH',
133-
'published' => true,
111+
'published' => false,
134112
'sections' => [
135113
ContactSectionEnum::COLLABORATIONS => [
136114
'key' => ContactSectionEnum::COLLABORATIONS,

database/seeders/Paperflakes/ConfigurationsTableSeeder.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public function run(): void
1515
Configuration::updateOrCreate([], [
1616
'company' => 'paperflakes AG',
1717

18+
'section_news' => true,
1819
'section_services' => true,
1920
'section_products' => true,
2021
'section_technologies' => false,

database/seeders/Paperflakes/ContactsTableSeeder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ public function run(): void
6666
'name' => 'Dominique Ernst',
6767
'published' => true,
6868
'sections' => [
69-
ContactSectionEnum::EMPLOYEES => [
69+
/* ContactSectionEnum::EMPLOYEES => [
7070
'key' => ContactSectionEnum::EMPLOYEES,
7171
'role' => [
7272
'de_CH' => 'DMS/ECM Berater',
7373
'en_CH' => 'DMS/ECM Consultant',
7474
],
75-
],
75+
], */
7676
ContactSectionEnum::BOARD_MEMBERS => [
7777
'key' => ContactSectionEnum::BOARD_MEMBERS,
7878
],
@@ -155,7 +155,7 @@ public function run(): void
155155
['id' => 6],
156156
[
157157
'name' => 'PST GmbH',
158-
'published' => true,
158+
'published' => false,
159159
'sections' => [
160160
ContactSectionEnum::COLLABORATIONS => [
161161
'key' => ContactSectionEnum::COLLABORATIONS,

database/seeders/Paperflakes/PagesTableSeeder.php

Lines changed: 50 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,21 @@ private function enCH()
3131
'title' => 'Your Digital Partner',
3232
'description' => 'We support you with smart digital solutions that move your business forward.',
3333
'image' => 'https://res.cloudinary.com/codebar/image/upload/c_scale,dpr_2.0,f_auto,q_auto,w_1200/www-paperflakes-ch/seo/seo_paperflakes.webp',
34-
]);
34+
]
35+
);
36+
37+
Page::updateOrCreate(
38+
[
39+
'key' => 'news.index',
40+
'locale' => $locale,
41+
],
42+
[
43+
'robots' => 'index,follow',
44+
'title' => '',
45+
'description' => '',
46+
'image' => 'https://res.cloudinary.com/codebar/image/upload/c_scale,dpr_2.0,f_auto,q_auto,w_1200/www-paperflakes-ch/seo/seo_paperflakes.webp',
47+
]
48+
);
3549

3650
Page::updateOrCreate(
3751
[
@@ -43,7 +57,8 @@ private function enCH()
4357
'title' => 'About Us – paperflakes AG',
4458
'description' => 'Get to know paperflakes AG – your Swiss partner for digital transformation and innovative software solutions.',
4559
'image' => 'https://res.cloudinary.com/codebar/image/upload/c_scale,dpr_2.0,f_auto,q_auto,w_1200/www-paperflakes-ch/seo/seo_paperflakes.webp',
46-
]);
60+
]
61+
);
4762

4863
Page::updateOrCreate(
4964
[
@@ -55,7 +70,8 @@ private function enCH()
5570
'title' => 'Services that Support You',
5671
'description' => 'From strategy to implementation - we\'re here to support you all the way.',
5772
'image' => 'https://res.cloudinary.com/codebar/image/upload/c_scale,dpr_2.0,f_auto,q_auto,w_1200/www-paperflakes-ch/seo/seo_paperflakes.webp',
58-
]);
73+
]
74+
);
5975

6076
Page::updateOrCreate(
6177
[
@@ -67,7 +83,8 @@ private function enCH()
6783
'title' => 'Tools That Empower You',
6884
'description' => 'Our products are built to help you work smarter, faster and better.',
6985
'image' => 'https://res.cloudinary.com/codebar/image/upload/c_scale,dpr_2.0,f_auto,q_auto,w_1200/www-paperflakes-ch/seo/seo_paperflakes.webp',
70-
]);
86+
]
87+
);
7188

7289
Page::updateOrCreate(
7390
[
@@ -79,7 +96,8 @@ private function enCH()
7996
'title' => 'Legal Notice',
8097
'description' => 'All legal details about paperflakes AG.',
8198
'image' => 'https://res.cloudinary.com/codebar/image/upload/c_scale,dpr_2.0,f_auto,q_auto,w_1200/www-paperflakes-ch/seo/seo_paperflakes.webp',
82-
]);
99+
]
100+
);
83101

84102
Page::updateOrCreate(
85103
[
@@ -91,7 +109,8 @@ private function enCH()
91109
'title' => 'Let\'s Talk',
92110
'description' => 'Have a question? We\'re here to support you - just reach out.',
93111
'image' => 'https://res.cloudinary.com/codebar/image/upload/c_scale,dpr_2.0,f_auto,q_auto,w_1200/www-paperflakes-ch/seo/seo_paperflakes.webp',
94-
]);
112+
]
113+
);
95114
}
96115

97116
private function deCH()
@@ -108,7 +127,21 @@ private function deCH()
108127
'title' => 'Dein digitaler Partner',
109128
'description' => 'Wir unterstützen dich mit cleveren Lösungen für deinen digitalen Erfolg.',
110129
'image' => 'https://res.cloudinary.com/codebar/image/upload/c_scale,dpr_2.0,f_auto,q_auto,w_1200/www-paperflakes-ch/seo/seo_paperflakes.webp',
111-
]);
130+
]
131+
);
132+
133+
Page::updateOrCreate(
134+
[
135+
'key' => 'news.index',
136+
'locale' => $locale,
137+
],
138+
[
139+
'robots' => 'index,follow',
140+
'title' => '',
141+
'description' => '',
142+
'image' => 'https://res.cloudinary.com/codebar/image/upload/c_scale,dpr_2.0,f_auto,q_auto,w_1200/www-paperflakes-ch/seo/seo_paperflakes.webp',
143+
]
144+
);
112145

113146
Page::updateOrCreate(
114147
[
@@ -120,7 +153,8 @@ private function deCH()
120153
'title' => 'Über uns – paperflakes AG',
121154
'description' => 'Lerne die paperflakes AG kennen – dein Schweizer Partner für digitale Transformation und innovative Softwarelösungen.',
122155
'image' => 'https://res.cloudinary.com/codebar/image/upload/c_scale,dpr_2.0,f_auto,q_auto,w_1200/www-paperflakes-ch/seo/seo_paperflakes.webp',
123-
]);
156+
]
157+
);
124158

125159
Page::updateOrCreate(
126160
[
@@ -132,7 +166,8 @@ private function deCH()
132166
'title' => 'Dienstleistungen für dich',
133167
'description' => 'Von der Strategie bis zur Umsetzung - wir stehen dir zur Seite.',
134168
'image' => 'https://res.cloudinary.com/codebar/image/upload/c_scale,dpr_2.0,f_auto,q_auto,w_1200/www-paperflakes-ch/seo/seo_paperflakes.webp',
135-
]);
169+
]
170+
);
136171

137172
Page::updateOrCreate(
138173
[
@@ -144,7 +179,8 @@ private function deCH()
144179
'title' => 'Tools, die dich stärken',
145180
'description' => 'Unsere Produkte helfen dir, effizienter, schneller und einfacher zu arbeiten.',
146181
'image' => 'https://res.cloudinary.com/codebar/image/upload/c_scale,dpr_2.0,f_auto,q_auto,w_1200/www-paperflakes-ch/seo/seo_paperflakes.webp',
147-
]);
182+
]
183+
);
148184

149185
Page::updateOrCreate(
150186
[
@@ -156,7 +192,8 @@ private function deCH()
156192
'title' => 'Rechtliches',
157193
'description' => 'Alle rechtlichen Informationen zur paperflakes AG.',
158194
'image' => 'https://res.cloudinary.com/codebar/image/upload/c_scale,dpr_2.0,f_auto,q_auto,w_1200/www-paperflakes-ch/seo/seo_paperflakes.webp',
159-
]);
195+
]
196+
);
160197

161198
Page::updateOrCreate(
162199
[
@@ -169,6 +206,7 @@ private function deCH()
169206
'title' => 'Lass uns sprechen',
170207
'description' => 'Fragen? Wir sind fürr dich da - melde dich jederzeit bei uns.',
171208
'image' => 'https://res.cloudinary.com/codebar/image/upload/c_scale,dpr_2.0,f_auto,q_auto,w_1200/www-paperflakes-ch/seo/seo_paperflakes.webp',
172-
]);
209+
]
210+
);
173211
}
174212
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<x-app-layout :page="$page">
2+
<x-h1 :title="__('News')"/>
3+
<x-section>
4+
<x-list>
5+
@foreach($news as $entry)
6+
<x-list-card
7+
:url="localized_route('news.show', ['locale' => app()->getLocale(),'news' => $entry])"
8+
:title="$entry->title"
9+
:teaser="$entry->teaser"
10+
:tags="$entry->tags"/>
11+
@endforeach
12+
</x-list>
13+
</x-section>
14+
</x-app-layout>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@props(['classAttributes' => ""])
22

3-
<section class="{{ $classAttributes }} mt-6 text-lg text-gray-800">
3+
<section class="{{ $classAttributes }} mt-6 mb-2 text-lg text-gray-800">
44
{{ $slot }}
5-
</section>
5+
</section>

0 commit comments

Comments
 (0)