feat: Add Hungarian translations for event type management, introduce max_slot_count column, and adjust post-submission navigation.

This commit is contained in:
Schneider Roland
2026-01-02 17:12:49 +01:00
parent be029ee054
commit e6ecefb8d9
5 changed files with 35 additions and 29 deletions

View File

@@ -1,6 +1,7 @@
<form [formGroup]="filterForm" class="p-4 bg-base-200 rounded-lg shadow"> <form [formGroup]="filterForm" class="p-4 bg-base-200 rounded-lg shadow">
<div class="grid grid-cols-1 md:grid-cols-4 gap-4 items-end"> <div class="grid grid-cols-1 md:grid-cols-4 gap-4 items-end">
<div class="form-control"><label class="label"><span class="label-text">SearchTerm</span></label> <div class="form-control"><label class="label"><span class="label-text">Keresés</span></label>
<input type="text" formControlName="term" class="input input-bordered w-full" placeholder="Search term" /></div> <input type="text" formControlName="term" class="input input-bordered w-full" placeholder="Keresés" />
</div>
</div> </div>
</form> </form>

View File

@@ -5,7 +5,7 @@
<div class="card bg-base-100 shadow-xl max-w-2xl mx-auto"> <div class="card bg-base-100 shadow-xl max-w-2xl mx-auto">
<div class="card-body"> <div class="card-body">
<h2 class="card-title text-3xl"> <h2 class="card-title text-3xl">
{{ isEditMode ? 'Edit' : 'Create' }} EventType {{ isEditMode ? 'Frissítés' : 'Létrehozás' }} Esemény típus
</h2> </h2>
<form [formGroup]="form" (ngSubmit)="onSubmit()" class="space-y-4 mt-4"> <form [formGroup]="form" (ngSubmit)="onSubmit()" class="space-y-4 mt-4">
@@ -28,9 +28,9 @@
</div> </div>
<div class="card-actions justify-end mt-6"> <div class="card-actions justify-end mt-6">
<a routerLink="/event-type" class="btn btn-ghost">Cancel</a> <a routerLink="/event-type" class="btn btn-ghost">Vissza</a>
<button type="submit" class="btn btn-primary" [disabled]="form.invalid"> <button type="submit" class="btn btn-primary" [disabled]="form.invalid">
{{ isEditMode ? 'Update' : 'Create' }} {{ isEditMode ? 'Frissítés' : 'Létrehozás' }}
</button> </button>
</div> </div>
</form> </form>

View File

@@ -105,7 +105,7 @@ export class EventTypeFormComponent implements OnInit {
} }
action$.subscribe({ action$.subscribe({
next: () => this.router.navigate(['/event-type']), next: () => this.router.navigate(['/event-type/table']),
error: (err) => console.error('Failed to save event-type', err) error: (err) => console.error('Failed to save event-type', err)
}); });
} }

View File

@@ -13,19 +13,21 @@
<table class="table w-full"> <table class="table w-full">
<thead> <thead>
<tr> <tr>
<th>id</th> <th>Azonosító</th>
<th>name</th> <th>Név</th>
<th>description</th> <th>Leírás</th>
<th>color</th> <th>Szín</th>
<th class="text-right">Actions</th> <th>Férőhelyek</th>
<th class="text-right">Műveletek</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let item of response.data" class="hover"> <tr *ngFor="let item of response.data" class="hover">
<td>{{ item.id }}</td> <td>{{ item.id }}</td>
<td>{{ item.name }}</td> <td>{{ item.name }}</td>
<td>{{ item.description }}</td> <td>{{ item.description }}</td>
<td>{{ item.color }}</td> <td>{{ item.color }}</td>
<td>{{ item.max_slot_count }}</td>
<td class="text-right space-x-2"> <td class="text-right space-x-2">
<a [routerLink]="['/event-type', item.id]" class="btn btn-sm btn-ghost">Részletek</a> <a [routerLink]="['/event-type', item.id]" class="btn btn-sm btn-ghost">Részletek</a>
<a [routerLink]="['/event-type', item.id, 'edit']" class="btn btn-sm btn-ghost">Módosítás</a> <a [routerLink]="['/event-type', item.id, 'edit']" class="btn btn-sm btn-ghost">Módosítás</a>
@@ -33,7 +35,7 @@
</td> </td>
</tr> </tr>
<tr *ngIf="response.data.length === 0"> <tr *ngIf="response.data.length === 0">
<td colspan="5" class="text-center">No event-type found.</td> <td colspan="6" class="text-center">Nem található eseménytípusok.</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@@ -42,14 +44,10 @@
<!-- Pagination Controls --> <!-- Pagination Controls -->
<div *ngIf="response.meta.totalPages > 1" class="flex justify-center mt-4"> <div *ngIf="response.meta.totalPages > 1" class="flex justify-center mt-4">
<div class="join"> <div class="join">
<button <button class="join-item btn" (click)="changePage(response.meta.currentPage - 1)"
class="join-item btn"
(click)="changePage(response.meta.currentPage - 1)"
[disabled]="response.meta.currentPage === 1">«</button> [disabled]="response.meta.currentPage === 1">«</button>
<button class="join-item btn">Page {{ response.meta.currentPage }} of {{ response.meta.totalPages }}</button> <button class="join-item btn">Oldal {{ response.meta.currentPage }} of {{ response.meta.totalPages }}</button>
<button <button class="join-item btn" (click)="changePage(response.meta.currentPage + 1)"
class="join-item btn"
(click)="changePage(response.meta.currentPage + 1)"
[disabled]="response.meta.currentPage === response.meta.totalPages">»</button> [disabled]="response.meta.currentPage === response.meta.totalPages">»</button>
</div> </div>
</div> </div>

View File

@@ -60,7 +60,7 @@ export class EventTypeTableComponent implements OnInit {
columns: [ columns: [
{ {
attribute: 'name', attribute: 'name',
headerCell: true, headerCell: { value: 'Név' },
valueCell: { valueCell: {
styleClass: ctx => 'w-[1%]', styleClass: ctx => 'w-[1%]',
value: item => item?.name, value: item => item?.name,
@@ -68,14 +68,14 @@ export class EventTypeTableComponent implements OnInit {
}, },
{ {
attribute: 'description', attribute: 'description',
headerCell: true, headerCell: { value: 'Leírás' },
valueCell: { valueCell: {
value: item => item?.description, value: item => item?.description,
}, },
}, },
{ {
attribute: 'color', attribute: 'color',
headerCell: true, headerCell: { value: 'Szín' },
valueCell: { valueCell: {
styleClass: ctx => 'w-[1%]', styleClass: ctx => 'w-[1%]',
value: item => item?.color, value: item => item?.color,
@@ -85,9 +85,16 @@ export class EventTypeTableComponent implements OnInit {
} }
}, },
}, },
{
attribute: 'max_slot_count',
headerCell: { value: 'Férőhelyek' },
valueCell: {
value: item => item?.max_slot_count,
},
},
{ {
attribute: 'actions', attribute: 'actions',
headerCell: { value: 'Actions' }, headerCell: { value: 'Műveletek' },
valueCell: { valueCell: {
styleClass: ctx => 'w-[1%]', styleClass: ctx => 'w-[1%]',
component: GenericActionColumn, component: GenericActionColumn,