File tree Expand file tree Collapse file tree 7 files changed +33
-18
lines changed Expand file tree Collapse file tree 7 files changed +33
-18
lines changed Original file line number Diff line number Diff line change 2
2
layout: inner-page-parent
3
3
---
4
4
5
- {% include events-training-list-top.html collection=paginator.events %}
5
+ {% capture now %}{{site.time | date: '%s' | plus: 0}}{% endcapture %}
6
+ {% assign upcomingEvents = '' | split: ',' %}
7
+ {% for event in paginator.events %}
8
+ {% capture date %}{{event.end|date: '%s'|plus: 86400}}{% endcapture %}
9
+ {% if now < = date %}
10
+ {% assign upcomingEvents = upcomingEvents | push: event %}
11
+ {% endif %}
12
+ {% endfor %}
13
+
14
+ {% include events-training-list-top.html collection=upcomingEvents %}
6
15
7
16
{{content}}
8
17
</ div>
Original file line number Diff line number Diff line change 2
2
layout: inner-page-parent
3
3
---
4
4
5
- {% include events-training-list-top.html collection=paginator.events %}
5
+ {% capture now %}{{site.time | date: '%s' | plus: 0}}{% endcapture %}
6
+ {% assign pastEvents = '' | split: ',' %}
7
+ {% for event in paginator.events %}
8
+ {% capture date %}{{event.end|date: '%s'|plus: 86400}}{% endcapture %}
9
+ {% if now > date %}
10
+ {% assign pastEvents = pastEvents | push: event %}
11
+ {% endif %}
12
+ {% endfor %}
13
+
14
+ {% include events-training-list-top.html collection=pastEvents %}
6
15
7
16
{{content}}
8
17
</ div>
Original file line number Diff line number Diff line change 2
2
layout: inner-page-parent
3
3
---
4
4
5
- {% include events-training-list-top.html collection=paginator.trainings %}
5
+ {% capture now %}{{site.time | date: '%s' | plus: 0}}{% endcapture %}
6
+ {% assign upcomingTrainings = '' | split: ',' %}
7
+ {% for training in paginator.trainings %}
8
+ {% capture date %}{{training.when|date: '%s'|plus: 86400}}{% endcapture %}
9
+ {% if now < = date %}
10
+ {% assign upcomingTrainings = upcomingTrainings | push: training %}
11
+ {% endif %}
12
+ {% endfor %}
13
+
14
+ {% include events-training-list-top.html collection=upcomingTrainings %}
6
15
</ div>
7
16
8
17
{% include paginator.html urlPath="training" %}
9
- </ div>
18
+ </ div>
Original file line number Diff line number Diff line change @@ -175,16 +175,6 @@ def collection(page)
175
175
collection = collection . reject { |p | ( p . data [ 'tags' ] & tags ) . empty? }
176
176
end
177
177
178
- # Custom mod: reject all "past" (with date before our current 'tomorrow') elements if "discardPastItems" is set to true:
179
- if page . data [ 'paginate' ] [ 'discardPastItems' ]
180
- collection = collection . reject { |p | ( p . date < ( Date . today . next_day ( 1 ) ) . to_time ) }
181
- end
182
-
183
- # Custom mod: retrieve only "past" (with date before our 'today') elements if "pastItems" is set to true:
184
- if page . data [ 'paginate' ] [ 'pastItems' ]
185
- collection = collection . select { |p | ( p . date < Date . today . to_time ) }
186
- end
187
-
188
178
collection
189
179
end
190
180
Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ paginate:
8
8
per_page : 9999
9
9
collection : events
10
10
permalink : /:num/
11
- discardPastItems : true
12
11
title_suffix : " "
13
12
---
14
13
Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ paginate:
8
8
collection : events
9
9
per_page : 9999
10
10
permalink : /:num/
11
- pastItems : true
12
11
reversed : true
13
12
title_suffix : " "
14
13
---
Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ permalink: /training/
5
5
6
6
# Pagination
7
7
paginate :
8
+ per_page : 9999
8
9
collection : trainings
9
10
permalink : /:num/
10
- discardPastItems : true
11
11
title_suffix : " "
12
- ---
12
+ ---
You can’t perform that action at this time.
0 commit comments