mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2025-12-14 06:36:46 +00:00
🎉 feat(table): add new export columns for email, status, npub, and payment details in PlebTable.
This commit is contained in:
@@ -27,7 +27,6 @@ final class EinundzwanzigPlebTable extends PowerGridComponent
|
|||||||
|
|
||||||
public string $sortDirection = 'desc';
|
public string $sortDirection = 'desc';
|
||||||
|
|
||||||
|
|
||||||
public function setUp(): array
|
public function setUp(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
@@ -90,6 +89,7 @@ final class EinundzwanzigPlebTable extends PowerGridComponent
|
|||||||
'.',
|
'.',
|
||||||
) . '</span>' : 'keine Zahlung vorhanden',
|
) . '</span>' : 'keine Zahlung vorhanden',
|
||||||
)
|
)
|
||||||
|
->add('npub_export', fn(EinundzwanzigPleb $model) => $model->npub)
|
||||||
->add(
|
->add(
|
||||||
'npub',
|
'npub',
|
||||||
fn(EinundzwanzigPleb $model)
|
fn(EinundzwanzigPleb $model)
|
||||||
@@ -98,6 +98,8 @@ final class EinundzwanzigPlebTable extends PowerGridComponent
|
|||||||
) . '">Nostr Profile</a>',
|
) . '">Nostr Profile</a>',
|
||||||
)
|
)
|
||||||
->add('association_status')
|
->add('association_status')
|
||||||
|
->add('association_status_name', fn(EinundzwanzigPleb $model) => $model->association_status->name)
|
||||||
|
->add('paid_export', fn(EinundzwanzigPleb $model) => $model->paymentEvents->first()?->amount)
|
||||||
->add(
|
->add(
|
||||||
'association_status_formatted',
|
'association_status_formatted',
|
||||||
function (EinundzwanzigPleb $model) {
|
function (EinundzwanzigPleb $model) {
|
||||||
@@ -126,19 +128,36 @@ final class EinundzwanzigPlebTable extends PowerGridComponent
|
|||||||
Column::make('Avatar', 'avatar')
|
Column::make('Avatar', 'avatar')
|
||||||
->visibleInExport(visible: false),
|
->visibleInExport(visible: false),
|
||||||
|
|
||||||
|
Column::make('Email', 'email')
|
||||||
|
->hidden()
|
||||||
|
->visibleInExport(visible: true),
|
||||||
|
|
||||||
|
Column::make('Status', 'association_status_name')
|
||||||
|
->hidden()
|
||||||
|
->visibleInExport(visible: true),
|
||||||
|
|
||||||
|
Column::make('Npub', 'npub_export')
|
||||||
|
->hidden()
|
||||||
|
->visibleInExport(visible: true),
|
||||||
|
|
||||||
|
Column::make('Bezahlt', 'paid_export')
|
||||||
|
->hidden()
|
||||||
|
->visibleInExport(visible: true),
|
||||||
|
|
||||||
Column::make('Npub', 'npub')
|
Column::make('Npub', 'npub')
|
||||||
->visibleInExport(visible: false)
|
->visibleInExport(visible: false)
|
||||||
->sortable(),
|
->sortable(),
|
||||||
|
|
||||||
Column::make('Name', 'name_lower')
|
Column::make('Name', 'name_lower')
|
||||||
->sortable(),
|
|
||||||
|
|
||||||
Column::make('Aktueller Status', 'association_status_formatted', 'association_status')
|
|
||||||
->visibleInExport(visible: true)
|
->visibleInExport(visible: true)
|
||||||
->sortable(),
|
->sortable(),
|
||||||
|
|
||||||
|
Column::make('Aktueller Status', 'association_status_formatted', 'association_status')
|
||||||
|
->visibleInExport(visible: false)
|
||||||
|
->sortable(),
|
||||||
|
|
||||||
Column::make('Beitrag ' . date('Y'), 'payment')
|
Column::make('Beitrag ' . date('Y'), 'payment')
|
||||||
->visibleInExport(visible: true),
|
->visibleInExport(visible: false),
|
||||||
|
|
||||||
Column::make('Bewirbt sich für', 'for', 'application_for')
|
Column::make('Bewirbt sich für', 'for', 'application_for')
|
||||||
->visibleInExport(visible: false)
|
->visibleInExport(visible: false)
|
||||||
|
|||||||
Reference in New Issue
Block a user