Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit the number of events in the OKF past/recent events to 10 #6

Closed
2 tasks done
benhur07b opened this issue Sep 5, 2022 · 1 comment
Closed
2 tasks done
Assignees
Labels
enhancement Broken/wrong links, simple edits, typo errors

Comments

@benhur07b
Copy link
Collaborator

benhur07b commented Sep 5, 2022

Expected behavior

  • Only the 10 most recent events are shown in the OKF past/recent events list.
  • Add a link at the bottom of the list to the events page (see Prototype an events page #7 ).

Current behavior

  • All the past events are shown in the OKF past/recent events list.
  • No button to the events page.

Possible Code in question

okf-events-a/index.html

Lines 7 to 52 in ccd33d9

{% assign eventlist = site.pages | where: "layout", "event" | sort: "date" %}
{% capture now %}{{"now" | date: "%s" | plus: 0 }}{% endcapture %}
<div class="right-pane-title row col-12">
<h3>OKF current and upcoming events</h3>
</div>
{% capture lastdate %}{{eventlist.last.date | date: "%s" | plus: 0 }}{% endcapture %}
{% if lastdate >= now %}
{% for node in eventlist %}
{% capture date %}{{node.date | date: "%s" | plus: 0 }}{% endcapture %}
{% if date >= now %}
{% if node.layout == "event" %}
<div class="row eventlisting-container">
<div class="eventlisting">
<p class="eventlisting-eventdateandtitle" style="margin-top: 0px">
<!-- <span class="eventlisting-eventtitle">{{ node.title }}</span> -->
<span class="eventlisting-eventtitle"><a href="{{ site.baseurl }}{{ node.permalink }}" class="eventlisting-eventtitle">{{ node.title }}</a></span>
<p>
<span class="eventlisting-eventdate" style="font-size: large; color: #4f4f4f">{{ node.date | date: "%d %B %Y" }}</span>
<span class="eventlisting-eventlocation" style="font-size: large; color: #4f4f4f">{{ node.location }}</span>
</p>
</p>
<p class="eventlisting-eventdescription">{{ node.description }}</p>
<a class="btn btn-primary btn-sm active" role="button" aria-pressed="true" href="{{ site.baseurl }}{{ node.permalink }}">Details</a>
<!-- {% if node.series %} -->
<!-- <p class="eventlisting-seriestitle">
An event in the <a href="{{ site.baseurl }}{{ node.serieslink }}">{{ node.series }}</a> series.
</p> -->
{% endif %}
</div>
</div>
{% endif %}
{% endif %}
{% endfor %}
{% else %}
<div class="row eventlisting-container">
<div class="eventlisting">
<p class="eventlisting-eventdateandtitle" style="margin-top: 0px">
<span class="eventlisting-eventtitle">No current or upcoming events.</span></p>
</div>
</div>
{% endif %}

Tests to pass

  • Only the 10 most recent events are shown in the OKF past/recent events list.
  • Button links to the events page (see Prototype an events page #7 ).
@benhur07b benhur07b added the enhancement Broken/wrong links, simple edits, typo errors label Sep 5, 2022
@nikeshbalami
Copy link
Collaborator

Implemented via #10, more enhancement is to be done based on the requirement of #7; currently, just an all-events page has been created.

benhur07b added a commit that referenced this issue Sep 21, 2022
Limit the number of events and all events page created based on #6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Broken/wrong links, simple edits, typo errors
Projects
None yet
Development

No branches or pull requests

2 participants