|
1 | 1 | {% load namewithnotes from filters %}
|
2 | 2 | {% load markdown_tags %}
|
3 |
| -<div class="table-responsive"> |
4 |
| - <table class="table mb-0" id="event_table"> |
5 |
| - <thead> |
6 |
| - <tr> |
7 |
| - <th scope="col">#</th> |
8 |
| - <th scope="col">Dates & Times</th> |
9 |
| - <th scope="col">Event Details</th> |
10 |
| - <th scope="col">MIC</th> |
11 |
| - </tr> |
12 |
| - </thead> |
13 |
| - <tbody> |
14 |
| - {% for event in events %} |
15 |
| - <tr class="{% if event.cancelled %} |
16 |
| - table-secondary |
17 |
| - {% elif not event.is_rig %} |
18 |
| - table-info |
19 |
| - {% elif not event.mic %} |
20 |
| - table-danger |
21 |
| - {% elif event.confirmed and event.authorised %} |
22 |
| - {% if event.dry_hire or event.riskassessment %} |
23 |
| - table-success |
24 |
| - {% else %} |
25 |
| - table-warning |
26 |
| - {% endif %} |
27 |
| - {% else %} |
28 |
| - table-warning |
29 |
| - {% endif %}" {% if event.cancelled %}style="opacity: 50% !important;"{% endif %} id="event_row"> |
30 |
| - <!---Number--> |
31 |
| - <th scope="row" id="event_number">{{ event.display_id }}</th> |
32 |
| - <!--Dates & Times--> |
33 |
| - <td id="event_dates" style="text-align: justify;"> |
34 |
| - {% if not event.cancelled %} |
35 |
| - {% if event.meet_at %} |
36 |
| - <span class="text-nowrap">Meet: <strong>{{ event.meet_at|date:"D d/m/Y H:i" }}</strong></span> |
37 |
| - {% endif %} |
38 |
| - {% if event.access_at %} |
39 |
| - <br><span class="text-nowrap">Access: <strong>{{ event.access_at|date:"D d/m/Y H:i" }}</strong></span> |
40 |
| - {% endif %} |
41 |
| - {% endif %} |
42 |
| - <span class="text-nowrap">Start: <strong>{{ event.start_date|date:"D d/m/Y" }} |
43 |
| - {% if event.has_start_time %} |
44 |
| - {{ event.start_time|date:"H:i" }} |
45 |
| - {% endif %}</strong> |
46 |
| - </span> |
47 |
| - {% if event.end_date %} |
48 |
| - <br> |
49 |
| - <span class="text-nowrap">End: {% if event.end_date != event.start_date %}<strong>{{ event.end_date|date:"D d/m/Y" }}{% endif %} |
50 |
| - {% if event.has_end_time %} |
51 |
| - {{ event.end_time|date:"H:i" }} |
52 |
| - {% endif %}</strong> |
53 |
| - </span> |
54 |
| - {% endif %} |
55 |
| - </td> |
56 |
| - <!---Details--> |
57 |
| - <td id="event_details" class="w-100"> |
58 |
| - <h4> |
59 |
| - <a href="{% url 'event_detail' event.pk %}"> |
60 |
| - {{ event.name }} |
61 |
| - </a> |
62 |
| - {% if event.venue %} |
63 |
| - <small>at {{ event.venue|namewithnotes:'venue_detail' }}</small> |
64 |
| - {% endif %} |
65 |
| - {% if event.dry_hire %} |
66 |
| - <span class="badge badge-secondary">Dry Hire</span> |
67 |
| - {% endif %} |
68 |
| - </h4> |
69 |
| - {% if event.is_rig and not event.cancelled %} |
70 |
| - <h5> |
71 |
| - <a href="{{ event.person.get_absolute_url }}">{{ event.person.name }}</a> |
72 |
| - {% if event.organisation %} |
73 |
| - for <a href="{{ event.organisation.get_absolute_url }}">{{ event.organisation.name }}</a> |
74 |
| - {% endif %} |
75 |
| - </h5> |
76 |
| - {% endif %} |
77 |
| - {% if not event.cancelled and event.description %} |
78 |
| - <p>{{ event.description|markdown }}</p> |
79 |
| - {% endif %} |
80 |
| - {% include 'partials/event_status.html' %} |
81 |
| - </td> |
82 |
| - <!---MIC--> |
83 |
| - <td id="event_mic" class="text-nowrap"> |
84 |
| - {% if event.mic %} |
85 |
| - {% if perms.RIGS.view_profile %} |
86 |
| - <a href="{% url 'profile_detail' event.mic.pk %}" class="modal-href"> |
87 |
| - {% endif %} |
88 |
| - <img src="{{ event.mic.profile_picture }}" class="event-mic-photo"/> |
89 |
| - {{ event.mic }} |
90 |
| - {% if perms.RIGS.view_profile %} |
91 |
| - </a> |
92 |
| - {% endif %} |
93 |
| - {% elif event.is_rig %} |
94 |
| - <span class="fas fa-user-slash"></span> |
95 |
| - {% endif %} |
96 |
| - </td> |
97 |
| - </tr> |
98 |
| - {% empty %} |
99 |
| - <tr class="bg-warning"> |
100 |
| - <td colspan="4">No events found</td> |
101 |
| - </tr> |
102 |
| - {% endfor %} |
103 |
| - </tbody> |
104 |
| - </table> |
| 3 | +<style> |
| 4 | +#event_table { |
| 5 | + display: grid; |
| 6 | + grid-template-columns: max-content auto; |
| 7 | + column-gap: 1em; |
| 8 | +} |
| 9 | +.eventgrid { |
| 10 | + display: inherit; |
| 11 | + grid-column: 1/5; |
| 12 | + grid-template-columns: subgrid; |
| 13 | + padding: 1em; |
| 14 | +} |
| 15 | +.grid-header { |
| 16 | + border-bottom: 1px solid grey; |
| 17 | + border-top: 1px solid grey; |
| 18 | +} |
| 19 | +#event_status { |
| 20 | + grid-column-start: 3; |
| 21 | +} |
| 22 | +#event_mic { |
| 23 | + grid-row-start: 1; |
| 24 | + grid-column-start: 4; |
| 25 | +} |
| 26 | +@media (max-width: 600px) { |
| 27 | + #event_table { |
| 28 | + grid-template-columns: 1fr !important; |
| 29 | + } |
| 30 | + .eventgrid { |
| 31 | + grid-column: 1/1 !important; |
| 32 | + padding: 0.5em; |
| 33 | + } |
| 34 | + .grid-header { |
| 35 | + display: none; |
| 36 | + } |
| 37 | + #event_dates { |
| 38 | + order: 2; |
| 39 | + } |
| 40 | + #event_status { |
| 41 | + order: 3; |
| 42 | + } |
| 43 | + #event_mic { |
| 44 | + grid-row-start: auto; |
| 45 | + grid-column-start: 4; |
| 46 | +} |
| 47 | +} |
| 48 | +@media (max-width: 900px) { |
| 49 | + #event_table { |
| 50 | + grid-template-columns: max-content; |
| 51 | + column-gap: 0.5em; |
| 52 | + } |
| 53 | + .eventgrid { |
| 54 | + grid-column: 1/3; |
| 55 | + border: 1px solid grey; |
| 56 | + } |
| 57 | + #event_dates { |
| 58 | + grid-row: 2; |
| 59 | + grid-column: 1; |
| 60 | + } |
| 61 | + #event_number { |
| 62 | + grid-row: 1; |
| 63 | + grid-column: 1; |
| 64 | + } |
| 65 | + #event_mic { |
| 66 | + grid-column: 2; |
| 67 | + } |
| 68 | + #event_status { |
| 69 | + grid-column: span 2; |
| 70 | + } |
| 71 | + .grid-header { |
| 72 | + display: none; |
| 73 | + } |
| 74 | +} |
| 75 | +dt { |
| 76 | + float: left; |
| 77 | + clear: left; |
| 78 | + margin-right: 10px; |
| 79 | +} |
| 80 | +dd { |
| 81 | + margin-left: 0px; |
| 82 | +} |
| 83 | +</style> |
| 84 | +<div id="event_table"> |
| 85 | + <div class="eventgrid grid-header font-weight-bold"> |
| 86 | + <div id="event_number">#</div> |
| 87 | + <div id="event_dates">Dates & Times</div> |
| 88 | + <div>Event Details</div> |
| 89 | + <div id="event_mic">MIC</div> |
| 90 | + </div> |
| 91 | + {% for event in events %} |
| 92 | + <div class="eventgrid {% if event.cancelled %} |
| 93 | + table-secondary |
| 94 | + {% elif not event.is_rig %} |
| 95 | + bg-info |
| 96 | + {% elif not event.mic %} |
| 97 | + table-danger |
| 98 | + {% elif event.confirmed and event.authorised %} |
| 99 | + {% if event.dry_hire or event.riskassessment %} |
| 100 | + table-success |
| 101 | + {% else %} |
| 102 | + table-warning |
| 103 | + {% endif %} |
| 104 | + {% else %} |
| 105 | + table-warning |
| 106 | + {% endif %}" {% if event.cancelled %}style="opacity: 50% !important;"{% endif %} id="event_row"> |
| 107 | + <!---Number--> |
| 108 | + <div class="font-weight-bold d-none d-lg-block" id="event_number">{{ event.display_id }}</div> |
| 109 | + <!--Dates & Times--> |
| 110 | + <div id="event_dates" style="min-width: 180px;"> |
| 111 | + <dl> |
| 112 | + {% if not event.cancelled %} |
| 113 | + {% if event.meet_at %} |
| 114 | + <dt class="font-weight-normal">Meet:</dt> |
| 115 | + <dd class="text-nowrap font-weight-bold text-lg-right">{{ event.meet_at|date:"D d/m/Y H:i" }}</dd> |
| 116 | + {% endif %} |
| 117 | + {% if event.access_at %} |
| 118 | + <dt class="font-weight-normal">Access:</dt> |
| 119 | + <dd class="text-nowrap font-weight-bold text-lg-right">{{ event.access_at|date:"D d/m/Y H:i" }}</dd> |
| 120 | + {% endif %} |
| 121 | + {% endif %} |
| 122 | + <dt class="font-weight-normal">Start:</dt> |
| 123 | + <dd class="text-nowrap font-weight-bold text-lg-right">{{ event.start_date|date:"D d/m/Y" }} |
| 124 | + {% if event.has_start_time %} |
| 125 | + {{ event.start_time|date:"H:i" }} |
| 126 | + {% endif %} |
| 127 | + </dd> |
| 128 | + {% if event.end_date %} |
| 129 | + <dt class="font-weight-normal">End:</dt> |
| 130 | + <dd class="text-nowrap font-weight-bold text-lg-right">{{ event.end_date|date:"D d/m/Y" }} |
| 131 | + {% if event.has_end_time %} |
| 132 | + {{ event.end_time|date:"H:i" }} |
| 133 | + {% endif %} |
| 134 | + </dd> |
| 135 | + {% endif %} |
| 136 | + </dl> |
| 137 | + </div> |
| 138 | + <!---Details--> |
| 139 | + <div id="event_details" class="w-100"> |
| 140 | + <h4> |
| 141 | + <a href="{% url 'event_detail' event.pk %}"> |
| 142 | + <span class="d-inline d-lg-none">{{ event }}</span><span class="d-none d-lg-inline">{{ event.name }}</span> |
| 143 | + </a> |
| 144 | + {% if event.dry_hire %} |
| 145 | + <span class="badge badge-secondary">Dry Hire</span> |
| 146 | + {% endif %} |
| 147 | + <br class="d-none d-lg-inline"> |
| 148 | + {% if event.venue %} |
| 149 | + <small>at {{ event.venue|namewithnotes:'venue_detail' }}</small> |
| 150 | + {% endif %} |
| 151 | + </h4> |
| 152 | + {% if event.is_rig and not event.cancelled %} |
| 153 | + <h5> |
| 154 | + <a href="{{ event.person.get_absolute_url }}">{{ event.person.name }}</a> |
| 155 | + {% if event.organisation %} |
| 156 | + for <a href="{{ event.organisation.get_absolute_url }}">{{ event.organisation.name }}</a> |
| 157 | + {% endif %} |
| 158 | + </h5> |
| 159 | + {% endif %} |
| 160 | + {% if not event.cancelled and event.description %} |
| 161 | + <p>{{ event.description|markdown }}</p> |
| 162 | + {% endif %} |
| 163 | + </div> |
| 164 | + {% include 'partials/event_status.html' %} |
| 165 | + <!---MIC--> |
| 166 | + <div id="event_mic" class="text-nowrap"> |
| 167 | + <span class="d-md-none align-middle">MIC:</span> |
| 168 | + {% if event.mic %} |
| 169 | + {% if perms.RIGS.view_profile %} |
| 170 | + <a href="{% url 'profile_detail' event.mic.pk %}" class="modal-href"> |
| 171 | + {% endif %} |
| 172 | + <img src="{{ event.mic.profile_picture }}" class="event-mic-photo"/> |
| 173 | + {{ event.mic }} |
| 174 | + {% if perms.RIGS.view_profile %} |
| 175 | + </a> |
| 176 | + {% endif %} |
| 177 | + {% elif event.is_rig %} |
| 178 | + <span class="fas fa-exclamation"></span> |
| 179 | + {% endif %} |
| 180 | + </div> |
| 181 | +</div> |
| 182 | +{% endfor %} |
105 | 183 | </div>
|
0 commit comments