Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Commit

Permalink
Filter featured talks away from speakers
Browse files Browse the repository at this point in the history
  • Loading branch information
Akshay Bhalotia committed Jul 23, 2018
1 parent b655a2a commit c373d0c
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 3 deletions.
3 changes: 3 additions & 0 deletions _fifthelephant_events/2018.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ featured_speakers:
talk_title: "Building analytics application with Streaming Expressions in Apache Solr"
image_url: https://images.hasgeek.com/embed/file/017e81ca82314a509919b1b01e42e3b0?size=200x200
name: Amrit Sarkar
featured: true
- funnel_url: https://fifthelephant.talkfunnel.com/2018/66-operating-data-pipeline-using-airflow-slack
designation: Senior data engineer at Slack
talk_title: "Operating data pipeline using Airflow @ Slack"
Expand Down Expand Up @@ -116,6 +117,8 @@ featured_speakers:
image_url: https://images.hasgeek.com/embed/file/4ea776dcbefd4030ba2365f55aca2943?size=200x200
name: Vikram Vij

all_speakers: true

related_events:
- title: "Anthill Inside 2018"
datelocation: 25 July 2018, Bangalore
Expand Down
10 changes: 9 additions & 1 deletion _includes/all_speakers.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ <h3 class="title ">Who's speaking?</h3>
{% if include.instructors %}
{% assign speakers = include.instructors %}
{% else %}
{% assign speakers = include.speakers %}
{% assign speakers = "" | split: ',' %}
{% assign all_speakers = include.speakers %}
{% assign featured_speakers = include.speakers | where:'featured', 'true' %}
{% for speaker in all_speakers %}
{% if featured_speakers contains speaker %}
{% else %}
{% assign speakers = speakers | push: speaker %}
{% endif %}
{% endfor %}
{% endif %}
{% for speaker in speakers %}
<div class="column is-one-quarter-tablet is-three-quarters-mobile is-one-quarter-desktop">
Expand Down
2 changes: 1 addition & 1 deletion _includes/featured_speakers_section.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h3 class="title">Featured Talks</h3>
{% if include.instructors %}
{% assign speakers = include.instructors %}
{% else %}
{% assign speakers = include.speakers %}
{% assign speakers = include.speakers | where:'featured', 'true' %}
{% endif %}
{% for speaker in speakers %}
<div class="column is-three-quarters-mobile is-one-third-desktop">
Expand Down
4 changes: 3 additions & 1 deletion _layouts/event.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,20 @@
{% endif %}

{% if page.featured_speakers %}
<section class="section scroll-horizontal bg-light"id="featured_speakers">
<section class="section scroll-horizonta bg-light" id="featured_speakers">
<div class="container">
{% include featured_speakers_section.html speakers=page.featured_speakers %}
</div>
</section><hr>
{% endif %}

{% if page.all_speakers %}
<section class="section scroll-horizontal bg-light"id="featured_speakers">
<div class="container">
{% include all_speakers.html speakers=page.featured_speakers %}
</div>
</section><hr>
{% endif %}

{% if page.discussions %}
<section class="section bg-light scroll-horizontal"id="dicussions">
Expand Down
14 changes: 14 additions & 0 deletions tests/before_build/steps/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ def valid_external_url(field, value, error):
'required': True
}

all_speakers_schema = {
'type': 'boolean',
'required': False
}

featured_speakers_schema = {
'funnel_url': {
'validator': valid_external_url,
Expand Down Expand Up @@ -94,6 +99,10 @@ def valid_external_url(field, value, error):
'type': 'string',
'required': False
},
'featured': {
'type': 'boolean',
'required': False
}
}

proposed_speakers_schema = {
Expand Down Expand Up @@ -558,6 +567,11 @@ def valid_external_url(field, value, error):
'required': False
},

'all_speakers': {
'type': 'boolean',
'required': False
},

'featured_image': {
'type': 'string',
'validator': valid_external_url,
Expand Down

0 comments on commit c373d0c

Please sign in to comment.