summaryrefslogtreecommitdiffstats
path: root/includes/templates/giglogadmin-concerts-table.php
blob: 93f5366d0dbe96b40ff069b6ba8c655cd0366400 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
/**
 * Template for public concerts table.
 *
 * @package giglogadmin
 */

?>
<style>
.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">
    <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">
            <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="">
                    Add to calendar
                </a>
            </span>
        </div>
    </div>
<?php } ?>
</div>