diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2023-01-29 15:40:18 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2023-01-29 15:40:18 +0100 |
commit | 0d7a4542ef0c0114ae9788c83df80993449b18ce (patch) | |
tree | af30ff17f2b0c04181a6c27ec03775affafb9e2d /includes/templates | |
parent | 2d2fe8402a57034f92a44b4be13d3124753e0293 (diff) | |
download | gigologadmin-0d7a4542ef0c0114ae9788c83df80993449b18ce.tar.gz gigologadmin-0d7a4542ef0c0114ae9788c83df80993449b18ce.tar.bz2 gigologadmin-0d7a4542ef0c0114ae9788c83df80993449b18ce.zip |
Add filters to shortcode concert table.
Diffstat (limited to 'includes/templates')
-rw-r--r-- | includes/templates/giglogadmin-concerts-table.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/includes/templates/giglogadmin-concerts-table.php b/includes/templates/giglogadmin-concerts-table.php index f5ca911..93f5366 100644 --- a/includes/templates/giglogadmin-concerts-table.php +++ b/includes/templates/giglogadmin-concerts-table.php @@ -26,6 +26,32 @@ } </style> <div class="giglogadmin-concerts-table"> + <details class="giglogadmin-concerts-filter"> + <summary class="giglogadmin-concerts-filter-label"> + Filters + </summary> + <form name="giglogadmin-filter-city" action="" method="GET"> + <?php + // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped + echo EternalTerror\ViewHelpers\select_field( + 'city', + array_map( fn( $c ) => array( $c, $c ), GiglogAdmin_Venue::all_cities() ), + $filters['city'] ?? null, + 'City' + ); + + // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped + echo EternalTerror\ViewHelpers\select_field( + 'venue', + array_map( fn( $v ) => array( $v->name(), "{$v->name()}, {$v->city()}" ), GiglogAdmin_Venue::all_venues() ), + $filters['venue'] ?? null, + 'Venue' + ); + ?> + <input type="submit" value="Apply!"> + <a href="<?php echo esc_url( site_url( get_page_uri() ) ); ?>">Clear filters</a> + </form> +</details> <?php foreach ( $concerts as $concert ) { ?> <div class="giglogadmin-concert"> <div class="giglogadmin-concert-title-row"> |