Skip to content

Commit 0ea6f26

Browse files
committed
fix baseresource
1 parent 4fd773f commit 0ea6f26

File tree

3 files changed

+68
-20
lines changed

3 files changed

+68
-20
lines changed

resources/lang/de/core.php

Lines changed: 47 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
'slug' => 'Slug',
66
'item' => 'Item',
77
'all' => 'Alle',
8+
'cms' => 'CMS',
89
'content' => 'Content',
910
'documents' => 'Documents',
1011
'articles' => 'Artikel',
@@ -49,14 +50,18 @@
4950
'count' => 'Anzahl',
5051
'parent' => 'Parent',
5152
'spam' => 'Spam',
53+
'guid' => 'GUID',
5254
'created_at' => 'Erstellt am',
5355
'updated_at' => 'Aktualisiert am',
5456
'deleted_at' => 'Gelöscht am',
5557
'started_at' => 'Gestartet am',
5658
'finished_at' => 'Abgeschlossen am',
59+
'publish_at' => 'Veröffentlichen am',
60+
'published_at' => 'Veröffentlicht am',
5761
'failed_at' => 'Fehlgeschlagen am',
62+
'canceled' => 'Abgebrochen',
5863
'canceled_at' => 'Abgebrochen am',
59-
'reserved_at' => 'Reserved at',
64+
'reserved_at' => 'Reserviert am',
6065
'expires_at' => 'Läuft ab am',
6166
'used_at' => 'Benutzt am',
6267
'read_at' => 'Gelesen am',
@@ -74,22 +79,55 @@
7479
'term_group' => 'Term Gruppe',
7580
'term_id' => 'Term ID',
7681
'term_order' => 'Term Sortierung',
82+
'wp_term_meta' => 'WP Term Meta',
83+
'wp_term_metas' => 'WP Term Metas',
84+
'wp_term_relationship' => 'WP Term Beziehung',
85+
'wp_term_relationships' => 'WP Term Beziehungen',
86+
'wp_term_taxonomy' => 'WP Term Taxonomie',
87+
'wp_term_taxonomies' => 'WP Term Taxonomien',
88+
'term_taxonomy_id' => 'Term Taxonomy ID',
89+
'taxonomy' => 'Taxonomie',
7790
'menu_order' => 'Menu Sortierung',
7891
'asset' => 'Asset',
7992
'meta_key' => 'Metaschlüssel',
8093
'meta_value' => 'Metawert',
81-
'term_taxonomy_id' => 'Term Taxonomy ID',
82-
'taxonomy' => 'Taxonomie',
83-
'published' => 'Veröffentlicht',
84-
'draft' => 'Entwurf',
85-
'trash' => 'Papierkorb',
86-
'term' => 'Begriff',
87-
'terms' => 'Begriffe',
88-
'tag' => 'Schlagwort',
8994
'option' => 'Option',
9095
'options' => 'Optionen',
9196
'option_name' => 'Optionsname',
9297
'option_value' => 'Optionswert',
9398
'training' => 'Training',
9499
'trainings' => 'Trainings',
100+
'autoload' => 'Autoload',
101+
'drop' => 'Löschen',
102+
'edit' => 'Bearbeiten',
103+
'save' => 'Speichern',
104+
'save_and_create_another' => 'Speichern & weiteren erstellen',
105+
'cancel' => 'Abbrechen',
106+
'restore' => 'Wiederherstellen',
107+
'publish' => 'Veröffentlichen',
108+
'published' => 'Veröffentlicht',
109+
'scheduled' => 'Geplant',
110+
'draft' => 'Entwurf',
111+
'trash' => 'Papierkorb',
112+
'term' => 'Begriff',
113+
'terms' => 'Begriffe',
114+
'tag' => 'Schlagwort',
115+
'image' => 'Bild',
116+
'author' => 'Autor',
117+
'drafted' => 'Entworfen',
118+
'featured_image_url' => 'Beitragsbild',
119+
'gallery_image_urls' => 'Galeriebilder',
120+
'empty_trash' => 'Papierkorb leeren',
121+
'trash_emptied_successfully' => 'Papierkorb erfolgreich geleert',
122+
'items_permanently_deleted' => '{0} Keine Elemente wurden dauerhaft gelöscht.|{1} Ein Element wurde dauerhaft gelöscht.|[2,*] :count Elemente wurden dauerhaft gelöscht.',
123+
'search' => 'Suchen',
124+
'filter' => 'Filtern',
125+
'hard_delete' => 'Endgültig löschen',
126+
'hard_delete_selected' => 'Ausgewählte endgültig löschen',
127+
'hard_delete_bulk_confirmation' => 'Sind Sie sicher, dass Sie diese Elemente endgültig löschen möchten?',
128+
'hard_delete_bulk_description' => 'Diese Aktion wird diese Elemente dauerhaft löschen.',
129+
'hard_delete_confirmation' => 'Sind Sie sicher, dass Sie dieses Element endgültig löschen möchten?',
130+
'hard_delete_description' => 'Diese Aktion wird dieses Element dauerhaft löschen.',
131+
'empty_trash_confirmation' => 'Sind Sie sicher, dass Sie den Papierkorb leeren möchten?',
132+
'empty_trash_description' => 'Diese Aktion wird alle Elemente im Papierkorb dauerhaft löschen.',
95133
];

src/Entities/BaseResource.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public static function getEditTableAction(): EditAction
8888
{
8989
return EditAction::make('edit')
9090
->color('primary')
91-
->url(fn ($record) => static::getUrl('edit', ['record' => $record, 'lang' => request()->query('lang')]));
91+
->url(fn ($record) => static::getUrl('edit', ['record' => $record]));
9292
}
9393

9494
public static function getViewTableAction(): ViewAction
@@ -137,7 +137,7 @@ public static function getPublishAction(): Action
137137
$livewire->data['status'] = 'published';
138138
$livewire->data['published_at'] = now();
139139
$livewire->save();
140-
$livewire->redirect(static::getUrl('view', ['record' => $livewire->record, 'lang' => $livewire->lang]));
140+
$livewire->redirect(static::getUrl('view', ['record' => $livewire->record]));
141141
})
142142
->visible(fn ($livewire): bool => $livewire instanceof CreateRecord || $livewire instanceof EditRecord);
143143
}
@@ -150,7 +150,7 @@ public static function getSaveAndCreateAnotherAction(): Action
150150
->button()
151151
->action(function ($livewire): void {
152152
$livewire instanceof CreateRecord ? $livewire->create() : $livewire->save();
153-
$livewire->redirect(static::getUrl('create', ['lang' => $livewire->lang]));
153+
$livewire->redirect(static::getUrl('create'));
154154
})
155155
->visible(fn ($livewire): bool => $livewire instanceof CreateRecord);
156156
}
@@ -162,7 +162,7 @@ public static function getCancelAction(): Action
162162
->keyBindings(['escape'])
163163
->color('secondary')
164164
->outlined()
165-
->url(fn () => static::getUrl('index', ['lang' => request()->query('lang')]));
165+
->url(fn () => static::getUrl('index', ));
166166
// ->visible(fn ($livewire): bool => $livewire instanceof CreateRecord);
167167
}
168168

@@ -175,7 +175,7 @@ public static function getDeleteAction(): Action
175175
->extraAttributes(attributes: ['class' => 'w-full'])
176176
->action(function ($livewire): void {
177177
$livewire->record->delete();
178-
$livewire->redirect(static::getUrl('index', ['lang' => request()->query('lang')]));
178+
$livewire->redirect(static::getUrl('index', ));
179179
})
180180
->keyBindings(['delete'])
181181
->visible(fn ($livewire): bool => $livewire instanceof EditRecord)
@@ -189,7 +189,7 @@ public static function getEditAction(): Action
189189
->color('primary')
190190
->extraAttributes(attributes: ['class' => 'w-full'])
191191
->keyBindings(['command+e', 'ctrl+e'])
192-
->url(fn ($record, $livewire) => static::getUrl('edit', ['record' => $record, 'lang' => $livewire->lang]))
192+
->url(fn ($record, $livewire) => static::getUrl('edit', ['record' => $record]))
193193
->visible(fn ($livewire): bool => $livewire instanceof ViewRecord);
194194
}
195195

src/Entities/Items/Draft/BaseDraftResource.php

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ public static function enableEdit(): bool
4040

4141
return true;
4242
}
43+
public static function enablePublish(): bool
44+
{
45+
if (static::getReadonlyConfig()) {
46+
return false;
47+
}
48+
49+
return true;
50+
}
4351

4452
public static function enableView(): bool
4553
{
@@ -91,21 +99,23 @@ public static function getFormActions(): Actions
9199
{
92100
$actions = [
93101
static::getSaveAction()->extraAttributes(attributes: ['class' => 'w-full']),
94-
static::getPublishAction()->extraAttributes(attributes: ['class' => 'w-full']),
95102
static::getCancelAction()->extraAttributes(attributes: ['class' => 'w-full']),
96103
];
97-
104+
98105
if (static::enableCreate()) {
99106
$actions[] = static::getSaveAndCreateAnotherAction()->extraAttributes(attributes: ['class' => 'w-full']);
100107
}
101-
108+
102109
if (static::enableDelete()) {
103-
$actions[] = static::getDeleteAction()->extraAttributes(attributes: ['class' => 'w-full']);
110+
$actions[] = static::getDeleteAction()->extraAttributes(attributes: ['class' => 'w-full']);
104111
}
105-
112+
106113
if (static::enableEdit()) {
107114
$actions[] = static::getEditAction()->extraAttributes(attributes: ['class' => 'w-full']);
108115
}
116+
if(static::enablePublish()) {
117+
$actions[] = static::getPublishAction()->extraAttributes(attributes: ['class' => 'w-full']);
118+
}
109119

110120
return Actions::make($actions);
111121
}

0 commit comments

Comments
 (0)