Skip to content

Commit

Permalink
Exporty (#903)
Browse files Browse the repository at this point in the history
* Exporty přes DataGrid

* lokalizace Export tlačítek a nápovědy

Co-authored-by: bojovyletoun <>
  • Loading branch information
bojovyletoun authored Nov 10, 2022
1 parent 9eb65ce commit a27edae
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/AdminModule/Components/GroupsGridControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use Ublaboo\DataGrid\Exception\DataGridException;

use function count;
use function date;

/**
* Komponenta pro zobrazení datagridu družin.
Expand Down Expand Up @@ -66,6 +67,10 @@ public function createComponentPatrolsGrid(string $name): DataGrid
$grid->setItemsPerPageList([25, 50, 100, 250, 500]);
$grid->setStrictSessionFilterValues(false);

$stamp = date('Y-m-d H.m.s');
$grid->addExportCsv('admin.common.export_all', 'NSJ2023 Skupiny ' . $stamp . 'csv');
$grid->addExportCsvFiltered('admin.common.export_filter', 'NSJ2023 Skupiny fi ' . $stamp . 'csv');

$grid->addGroupAction('Export seznamu skupin')
->onSelect[] = [$this, 'groupExportUsers'];

Expand Down
5 changes: 5 additions & 0 deletions app/AdminModule/Components/PatrolsGridControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use Ublaboo\DataGrid\Exception\DataGridException;

use function count;
use function date;

/**
* Komponenta pro zobrazení datagridu družin.
Expand Down Expand Up @@ -65,6 +66,10 @@ public function createComponentPatrolsGrid(string $name): DataGrid
$grid->setItemsPerPageList([25, 50, 100, 250, 500]);
$grid->setStrictSessionFilterValues(false);

$stamp = date('Y-m-d H.m.s');
$grid->addExportCsv('admin.common.export_all', 'NSJ2023 Druziny ' . $stamp . 'csv');
$grid->addExportCsvFiltered('admin.common.export_filter', 'NSJ2023 Druziny fi ' . $stamp . 'csv');

$grid->addGroupAction('Export seznamu družin')
->onSelect[] = [$this, 'groupExportUsers'];

Expand Down
4 changes: 4 additions & 0 deletions app/AdminModule/Presenters/templates/Users/groups.latte
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{block main}

<h2>Skupiny</h2>
<style>
.datagrid-exports::before { content: "{_admin.common.export_note}"}
</style>
{control groupsGrid}
{/block}
3 changes: 3 additions & 0 deletions app/AdminModule/Presenters/templates/Users/patrols.latte
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{block main}
<h2>Družiny</h2>
<style>
.datagrid-exports::before { content: "{_admin.common.export_note}"}
</style>
{control patrolsGrid}
{/block}
4 changes: 4 additions & 0 deletions app/lang/admin.cs_CZ.neon
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ common:
role_option: "{0} %role% (%count% uživatelů)|{1} %role% (%count% uživatel)|[2,4] %role% (%count% uživatelé)|[5,Inf[ %role% (%count% uživatelů)"
subevent_option: "{0} %subevent% (%count% uživatelů)|{1} %subevent% (%count% uživatel)|[2,4] %subevent% (%count% uživatelé)|[5,Inf[ %subevent% (%count% uživatelů)"

export_note: "Exportují se všechny řádky nebo ty právě zobrazené. Sloupce viz tlačítko vpravo."
export_all: "Export všech"
export_filter: "Export zobrazených"

menu:
dashboard: "Úvod"
cms: "Web"
Expand Down

0 comments on commit a27edae

Please sign in to comment.