Skip to content

Commit 8f05d66

Browse files
committed
Components and Themes wip
1 parent 89f06c7 commit 8f05d66

File tree

27 files changed

+497
-24
lines changed

27 files changed

+497
-24
lines changed

app/Providers/Filament/AdminPanelProvider.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ public function panel(Panel $panel): Panel
6464
// ->authGuard('admin')
6565
->brandLogo(asset('img/logo.png'))
6666
->brandLogoHeight('1.6rem')
67+
->font('Exo 2')
68+
->favicon(asset('img/moox-icon.png'))
6769
->colors([
68-
'primary' => Color::Indigo,
70+
'primary' => Color::Violet,
6971
'secondary' => Color::Neutral,
7072
])
7173
->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')

app/Providers/Filament/DevopsPanelProvider.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,11 @@ public function panel(Panel $panel): Panel
5151
->login(Login::class)
5252
->brandLogo(asset('img/logo.png'))
5353
->brandLogoHeight('1.6rem')
54+
->font('Exo 2')
55+
->favicon(asset('img/moox-icon.png'))
5456
->colors([
55-
'primary' => Color::Indigo,
56-
'secondary' => Color::Neutral,
57+
'primary' => Color::Violet,
58+
'secondary' => Color::Indigo,
5759
])
5860
->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')
5961
->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages')

app/Providers/Filament/PressPanelProvider.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,13 @@ public function panel(Panel $panel): Panel
3030
->authGuard('press')
3131
->passwordReset(RequestPasswordReset::class, ResetPassword::class)
3232
->login(Login::class)
33-
->authPasswordBroker('wpusers')
33+
->brandLogo(asset('img/logo.png'))
34+
->brandLogoHeight('1.6rem')
35+
->font('Exo 2')
36+
->favicon(asset('img/moox-icon.png'))
3437
->colors([
35-
'primary' => Color::Amber,
38+
'primary' => Color::Violet,
39+
'secondary' => Color::Indigo,
3640
])
3741
->discoverResources(in: app_path('Filament/Press/Resources'), for: 'App\\Filament\\Press\\Resources')
3842
->discoverPages(in: app_path('Filament/Press/Pages'), for: 'App\\Filament\\Press\\Pages')
@@ -109,7 +113,7 @@ public function panel(Panel $panel): Panel
109113
\Moox\Training\TrainingDatePlugin::make(),
110114
\Moox\Training\TrainingTypePlugin::make(),
111115

112-
// Musste kurz raus, sorry ;-)
116+
// Wiki plugins
113117
\Moox\PressWiki\WpWikiPlugin::make(),
114118
\Moox\PressWiki\WpWikiTopicPlugin::make(),
115119
\Moox\PressWiki\WpWikiLetterTopicPlugin::make(),

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"moox/backup-server": "*",
2828
"moox/build": "*",
2929
"moox/category": "*",
30+
"moox/components": "*",
3031
"moox/devops": "*",
3132
"moox/draft": "*",
3233
"moox/expiry": "*",

config/press.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@
10071007
|
10081008
*/
10091009

1010-
'press_navigation_sort' => 2000,
1010+
'press_navigation_sort' => 200,
10111011
'system_navigation_sort' => 7000,
10121012
'meta_navigation_sort' => 8000,
10131013
'user_navigation_sort' => 6015,

docs/Frontend/IDEA.md

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,30 @@ Moox Frontend is a modular system designed to provide a frontend for existing Mo
44

55
## Tooling
66

7-
- Laravel 11 - [https://laravel.com/docs/11.x](https://laravel.com/docs/11.x)
8-
- Alpine JS - [https://alpinejs.dev/](https://alpinejs.dev/)
9-
- Alpine Ajax - [https://alpine-ajax.js.org/](https://alpine-ajax.js.org/)
10-
- TailwindCSS 4 - [https://tailwindcss.com/](https://tailwindcss.com/)
11-
- PenguinUI - [https://www.penguinui.com/](https://www.penguinui.com/) - as inspiration
7+
- [Laravel 11](https://laravel.com/docs/11.x)
8+
- [Alpine JS](https://alpinejs.dev/)
9+
- [Alpine Ajax](https://alpine-ajax.js.org/)
10+
- [TailwindCSS 4](https://tailwindcss.com/)
11+
12+
## Inspiration for components
13+
14+
- [Blade UI Kit](https://blade-ui-kit.com/)
15+
- [PenguinUI](https://www.penguinui.com/)
16+
- [Pines UI](https://www.pinesui.com/)
17+
- [Tailwind Plus](https://tailwindui.com/)
18+
- [Pines UI](https://devdojo.com/pines)
19+
- [Tailkit](https://tailkit.com/)
20+
- [Flowbite](https://flowbite.com/)
21+
- [Shadcn UI](https://ui.shadcn.com/)
22+
- [MUI](https://mui.com/)
23+
- [AlpineJS Components](https://alpinejs.dev/components)
24+
- [Alpine Toolbox](https://www.alpinetoolbox.com/)
25+
- [Daisy UI](https://daisyui.com/)
26+
27+
## Inspiration for themes
28+
29+
- [Envato Elements](https://elements.envato.com/web-templates/tailwind+css)
30+
- [Cruip](https://cruip.com/)
1231

1332
## Moox Components
1433

docs/Media/IDEA.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,89 @@ See also
1414
- https://github.com/tomatophp/filament-media-manager
1515
- https://youtu.be/iehQZSqlduY?si=rikjuhJPzyrZBJRr&t=233 - image editor
1616
- https://github.com/livewire-filemanager/filemanager - file manager, not media
17+
18+
## Write protected media
19+
20+
1. Model-Level Protection
21+
22+
```php
23+
use Spatie\MediaLibrary\MediaCollections\Models\Media;
24+
25+
class CustomMedia extends Media
26+
{
27+
protected $casts = [
28+
'write_protected' => 'boolean',
29+
];
30+
31+
public static function boot()
32+
{
33+
parent::boot();
34+
35+
static::saving(function ($media) {
36+
if ($media->write_protected) {
37+
throw new \Exception("This media item is write-protected.");
38+
}
39+
});
40+
41+
static::deleting(function ($media) {
42+
if ($media->write_protected) {
43+
throw new \Exception("Cannot delete write-protected media.");
44+
}
45+
});
46+
}
47+
}
48+
```
49+
50+
This ensures that even if an API call or backend modification bypasses Filament, the database enforces write protection.
51+
52+
2. Filament Protection via Policies
53+
54+
```php
55+
use App\Models\CustomMedia;
56+
57+
class MediaPolicy
58+
{
59+
public function update(User $user, CustomMedia $media)
60+
{
61+
return !$media->write_protected;
62+
}
63+
64+
public function delete(User $user, CustomMedia $media)
65+
{
66+
return !$media->write_protected;
67+
}
68+
}
69+
```
70+
71+
3 .Register it in AuthServiceProvider:
72+
73+
```php
74+
protected $policies = [
75+
CustomMedia::class => MediaPolicy::class,
76+
];
77+
```
78+
79+
4. Hide Actions for Protected Media
80+
81+
```php
82+
public static function table(Table $table): Table
83+
{
84+
return $table
85+
->actions([
86+
EditAction::make()->visible(fn ($record) => !$record->write_protected),
87+
DeleteAction::make()->visible(fn ($record) => !$record->write_protected),
88+
]);
89+
}
90+
```
91+
92+
5. API-Sourced Media Protection
93+
94+
If media items are synced from an external API, ensure write_protected = true on API-imported media:
95+
96+
```php
97+
$media = CustomMedia::create([
98+
'name' => $apiData['name'],
99+
'path' => $apiData['path'],
100+
'write_protected' => true, // API-defined content
101+
]);
102+
```

docs/Website/IDEA.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ A temporary list of packages to fill in the docs (75 packages):
9191
68. [Website](https://moox.org/docs/website) - [READ-ONLY] Just things we need for moox.org
9292
69. [Wishlist](https://moox.org/docs/wishlist) - [READ-ONLY] Wishlist for Laravel and Filament
9393

94-
## Footer Links
94+
## Links
95+
96+
- https://moox.heco.si/ - Dev stage
9597

9698
- https://moox.org - Website
9799
- https://github.com/mooxphp - GitHub

docs/_devlog/Alf.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@
22

33
## Team
44

5-
- [x] https://moox.heco.si/ - deployed version
5+
- [ ] https://moox.test/components
6+
- [ ] Auto-rendering of all components
7+
- [ ] Theme switcher
8+
- [ ] Where do I get the contents?
9+
- [ ] Playground link, see Pines UI
610
- [ ] Write protected fields, images
711
- [ ] Hierarchy (Collection?)
812
- [ ] Media localization
913
- [ ] Media uploaded by user
10-
- [ ] static-locales:280 - GET https://moox.test/storage/%7B%221%22:%7B%22file_name%22:%22Alf-Hamburg-Profil-High.jpg%22,%22title%22:%22Alf-Hamburg-Profil-High%22,%22description%22:null,%22internal_note%22:null,%22alt%22:%22Alf-Hamburg-Profil-High%22%7D%7D 404 (Not Found)
14+
- [ ] storage/app/livewire-tmp/... check if empty
15+
- [ ] but has nothing to do with the 404 media issue
1116
- [ ] Restore and Expiry are not phpstan'ed
12-
- [ ] Theoretically Laravel 12, but [Translatable](https://github.com/Astrotomic/laravel-translatable) and [Backup-Server](https://github.com/spatie/laravel-backup-server) are not ready
17+
- [ ] Theoretically Laravel 12, but [Translatable](https://github.com/adrolli/laravel-translatable), [Eloquent-Mutators](https://github.com/adrolli/eloquent-mutators) and [Backup-Server](https://github.com/spatie/laravel-backup-server) are not ready
1318

1419
## Todo
1520

@@ -123,8 +128,8 @@
123128
- [ ] moox:scaffold - change fields of an entity by a config or JSON
124129
- [ ] moox:release or UI - auto release, see notes
125130
- [ ] We need to see if we use moox.json, DB or both.
126-
- [ ] Website: add https://creativecommons.org/licenses/by-sa/4.0/ for our graphics, assets, docs, website and themes.
127131
- [ ] Cache Clear, see [this](https://github.com/cms-multi/filament-clear-cache) or Full (paoc), Frontend (views), Static Cache (html)
132+
- [ ] Dashboards, Restore is in platform
128133

129134
## Relations
130135

packages/backup-server/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
}
1818
],
1919
"require": {
20-
"moox/core": "*"
20+
"moox/core": "*",
21+
"adrolli/laravel-backup-server": "*"
2122
},
2223
"autoload": {
2324
"psr-4": {

0 commit comments

Comments
 (0)