summaryrefslogblamecommitdiffstats
path: root/includes/templates/giglogadmin-concerts-table.php
blob: 1a1445a262253a5bc90d133dffa4e3759ac10726 (plain) (tree)
1
2
3
4
5
6
7
8
9








                                      


                              


















                                        
















                                                                                            


































                                                                                             
                                                                                                                           



                                       
              












                                                             
          
      
<?php
/**
 * Template for public concerts table.
 *
 * @package giglogadmin
 */

?>
<style>
.giglogadmin-concerts-filter {
    margin-bottom: 0.5em;
}
.giglogadmin-concert {
    margin-bottom: 1em;
}
.giglogadmin-concert > * {
    padding: 2px;
}
.giglogadmin-concert-meta-row {
    font-size: small;
}
.giglogadmin-concert-title-row {
    background-color: #c17878;
    color: white;
    font-size: larger;
}
.giglogadmin-concert-links {
    font-size: small;
}
</style>
<div class="giglogadmin-concerts-table">
    <div class="giglogadmin-concerts-filter">
        <form name="giglogadmin-filter-city" action="" method="GET">
            <label for="city">
                Filter by city:
            </label>
            <?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
            );
            ?>
            <input type="submit" value="Apply!">
            <a href="<?php echo esc_url( site_url( get_page_uri() ) ); ?>">Clear filters</a>
        </form>
    </div>
    <div class="giglogadmin-concerts-table-list">
    <?php foreach ( $concerts as $concert ) { ?>
        <div class="giglogadmin-concert">
            <div class="giglogadmin-concert-title-row">
                <time datetime="<?php echo esc_attr( $concert->cdate()->format( 'c' ) ); ?>">
                    <?php echo esc_html( $concert->cdate()->format( 'd.m.Y' ) ); ?>
                </time>
                &nbsp;&nbsp;
                <span class="giglogadmin-concert-title">
                    <?php echo esc_html( $concert->cname() ); ?>
                </span>
                &nbsp;&nbsp;
                <span class="giglogadmin-concert-city">
                    <?php echo esc_html( $concert->venue()->city() ); ?>
                </span>
            </div>
            <div class="giglogadmin-concert-meta-row">
                <span class="giglogadmin-concert-venue">
                    <?php echo esc_html( $concert->venue()->name() ); ?>
                </span>
            </div>
            <div class="giglogadmin-concert-links">
                <span class="giglogadmin-event-link">
                    <a href="<?php echo esc_url( $concert->eventlink() ); ?>">
                        Event
                    </a>
                </span>
                &nbsp;|&nbsp;
                <span class="giglogadmin-concert-ticket-link">
                    <a href="<?php echo esc_url( $concert->tickets() ); ?>">
                        Tickets
                    </a>
                </span>
                &nbsp;|&nbsp;
                <span class="giglogadmin-concert-ical-link">
                    <a href="<?php echo admin_url( "admin-ajax.php?action=giglog_export_ical&evid={$concert->id()}" ); ?>">
                        Add to calendar
                    </a>
                </span>
            </div>
        </div>
    <?php } ?>
    </div>
    <div class="giglogadmin-concerts-table-pagination">
    <?php
        echo paginate_links(
            array(
                'base' => site_url( get_page_uri() ) . '%_%',
                'total' => $pages,
                'current' => $page,
                'format' => '?pg=%#%',
            )
        );
    ?>
    </div>
</div>