|
5 | 5 | {% assign collection = site[page.collection] %}
|
6 | 6 | {% include group-by-array.html collection=collection field="category" %}
|
7 | 7 |
|
| 8 | +{% capture nowunix %}{{'now' | date: '%s'}}{% endcapture %} |
| 9 | + |
8 | 10 | <ul class="taxonomy__index">
|
9 | 11 | {% for category in group_names %}
|
10 |
| - {% assign category_name = site.data.events.names[category].name | default: category %} |
11 |
| - <li style="list-style:none"> |
12 |
| - <a href="#{{ category | slugify | downcase }}"> |
13 |
| - <strong>{{ category_name }}</strong> <span class="badge badge-warning" style="margin:auto; margin-right:0px">{{ group_items[forloop.index0] | size }}</span> |
14 |
| - </a> |
15 |
| - </li> |
| 12 | + {% assign category_name = site.data.events.names[category].name | default: category %} |
| 13 | + {% assign all_posts = group_items[forloop.index0] %} |
| 14 | + {% assign posts = '' | split: '' %} |
| 15 | + {% for event in all_posts %} |
| 16 | + {% capture event_time %}{{ event.expires | date: '%s' }}{% endcapture %} |
| 17 | + {% if event_time >= nowunix %} |
| 18 | + {% assign posts = posts | push: event %} |
| 19 | + {% endif %} |
| 20 | + {% endfor %} |
| 21 | + {% unless posts == empty %} |
| 22 | + <li style="list-style:none"> |
| 23 | + <a href="#{{ category | slugify | downcase }}"> |
| 24 | + <strong>{{ category_name }}</strong> |
| 25 | + <span class="badge badge-warning" style="margin:auto; margin-right:0px"> |
| 26 | + {{ posts.size }} |
| 27 | + </span> |
| 28 | + </a> |
| 29 | + </li> |
| 30 | + {% endunless %} |
16 | 31 | {% endfor %}
|
17 | 32 | </ul>
|
18 | 33 |
|
| 34 | +<div class="row"> |
| 35 | + <div class="col-md-12"> |
| 36 | + <a type="button" style="float: right" class="btn btn-small btn-warning" href="{{ site.baseurl }}/events/archive/"> |
| 37 | + <small>Events Archive</small> |
| 38 | + </a> |
| 39 | + </div> |
| 40 | +</div> |
| 41 | + |
19 | 42 | {{ content }}
|
20 | 43 |
|
21 | 44 | {% for category in group_names %}
|
22 | 45 | {% assign category_name = site.data.events.names[category].name | default: category %}
|
23 |
| - {% assign posts = group_items[forloop.index0] %} |
24 |
| - {% include events/events-subcollection.html collection=posts sort_by=page.sort_by sort_order=page.sort_order type=page.entries_layout category=category category_name=category_name %} |
| 46 | + {% assign all_posts = group_items[forloop.index0] %} |
| 47 | + {% assign posts = '' | split: '' %} |
| 48 | + {% for event in all_posts %} |
| 49 | + {% capture event_time %}{{ event.expires | date: '%s' }}{% endcapture %} |
| 50 | + {% if event_time >= nowunix %} |
| 51 | + {% assign posts = posts | push: event %} |
| 52 | + {% endif %} |
| 53 | + {% endfor %} |
| 54 | + {% unless posts == empty %} |
| 55 | + {% include events/events-subcollection.html collection=posts sort_by=page.sort_by sort_order=page.sort_order type=page.entries_layout category=category category_name=category_name %} |
| 56 | + {% endunless %} |
25 | 57 | {% endfor %}
|
26 | 58 |
|
27 | 59 | <div class="row">
|
28 |
| - <div class="col-md-12"> |
29 |
| - <a type="button" class="btn btn-warning" href="{{ site.baseurl }}/events/archive/">Events Archive</a> |
30 |
| - </div> |
| 60 | + <div class="col-md-12"> |
| 61 | + <a type="button" class="btn btn-warning" href="{{ site.baseurl }}/events/archive/"> |
| 62 | + Events Archive |
| 63 | + </a> |
| 64 | + </div> |
31 | 65 | </div>
|
32 | 66 |
|
33 | 67 | {% include scrolltop.html %}
|
0 commit comments