Skip to content

Commit 8905f77

Browse files
Added category variable to chapters (used as a foreign key to find events matching this category).
Created event_layout.html - include used to generate event list item. Modified events_array_generator.html's signature to use category as one of the parameters. Used category selection for creating a list of events for chapters (category based). Moved unused pages html files into temp. Used event_layout.html in index.html to simplify code.
1 parent c3b4e79 commit 8905f77

File tree

12 files changed

+254
-168
lines changed

12 files changed

+254
-168
lines changed

_chapters/london_python_sprints.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ address: London, United Kingdom
66
country_code: gb
77
lat: 51.512344
88
lng: -0.090985
9+
category: "london"
910
---
1011
<div class="chapter__background-img-container">
1112
<picture>

_chapters/madrid_test_sprints.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,56 @@
11
---
2-
layout: default
32
obj_id: madrid_test_sprints
43
title: "Madrid Test Sprints"
54
meetup_link: https://www.meetup.com/Python-Sprints/
65
address: Madrid, Spain
76
country_code: es
87
lat: 40.416775
98
lng: -3.703790
9+
category: "madrid"
1010
---
11+
<div class="chapter__background-img-container">
12+
<picture>
13+
<source srcset="../static/images/about/date-util-evening-session_480x150px.jpg 480w,
14+
../static/images/about/date-util-evening-session_960x300px.jpg 960w,
15+
../static/images/about/date-util-evening-session_1920x600px.jpg 1920w,
16+
../static/images/about/date-util-evening-session_3840x1200px.jpg 3840w"
17+
media="(orientation: landscape)"
18+
sizes="100vw">
19+
<source srcset="../static/images/about/date-util-evening-session_750x650px.jpg 750w,
20+
../static/images/about/date-util-evening-session_1650X1100px.jpg 1650w"
21+
media="(orientation: portrait)"
22+
sizes="100vw">
23+
<img class="chapter__background-img"
24+
src="../static/images/about/date-util-evening-session_960x300px.jpg"
25+
alt="About Us">
26+
</picture>
27+
<div class="chapter__page-title-container row container-fluid">
28+
<div class="col-sm-12">
29+
<h1 class="chapter__page-title">{{ page.title }}</h1>
30+
</div>
31+
</div>
32+
</div>
33+
<div class="chapter__container container-fluid">
34+
<div class="row">
35+
<div class="col-12 no-padding-x">
36+
<h2 class="chapter__section-title-left">Who We Are</h2>
37+
<div class="row">
38+
<div class="col-md-8 offset-md-2">
39+
<img class="chapter__paragraph-img-main rounded" src="../static/images/about/python_sprints_decoded_673x411px.JPG" alt="Focused on quality">
40+
<h2 class="chapter__paragraph-title-dark">Python Sprints Decoded</h2>
41+
<hr class="chapter__divider-right">
42+
<p class="chapter__paragraph-dark">
43+
Python Sprints is a non for profit group of like minded programmers who care chapter making open source projects better.
44+
We believe in sharing our skills for free to earn our good karma. If you are devoted to a particular open source project, please let us know, we could make a sprint dedicated to it!
45+
Inclusion is in the nature of our group and we want to make sure that no one is underrepresented. All people are welcome.
46+
</p>
47+
<h2 class="chapter__paragraph-title-dark-left">How It Started</h2>
48+
<hr class="chapter__divider-left">
49+
<p class="chapter__paragraph-dark">
50+
Our group was founded in October 2017. As all things in life the beginnings were humble with only a handful of people collaborating but the word quickly spread and now we have nearly 600 members and counting.
51+
</p>
52+
</div>
53+
</div>
54+
</div>
55+
</div>
56+
</div>

_chapters/szczecin_test_sprints.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,56 @@
11
---
2-
layout: default
32
obj_id: szczecin_test_sprints
43
title: "Szczecin Test Sprints"
54
meetup_link: https://www.meetup.com/Python-Sprints/
65
address: Szczecin, Poland
76
country_code: pl
87
lat: 53.428544
98
lng: 14.552812
9+
category: "szczecin"
1010
---
11+
<div class="chapter__background-img-container">
12+
<picture>
13+
<source srcset="../static/images/about/date-util-evening-session_480x150px.jpg 480w,
14+
../static/images/about/date-util-evening-session_960x300px.jpg 960w,
15+
../static/images/about/date-util-evening-session_1920x600px.jpg 1920w,
16+
../static/images/about/date-util-evening-session_3840x1200px.jpg 3840w"
17+
media="(orientation: landscape)"
18+
sizes="100vw">
19+
<source srcset="../static/images/about/date-util-evening-session_750x650px.jpg 750w,
20+
../static/images/about/date-util-evening-session_1650X1100px.jpg 1650w"
21+
media="(orientation: portrait)"
22+
sizes="100vw">
23+
<img class="chapter__background-img"
24+
src="../static/images/about/date-util-evening-session_960x300px.jpg"
25+
alt="About Us">
26+
</picture>
27+
<div class="chapter__page-title-container row container-fluid">
28+
<div class="col-sm-12">
29+
<h1 class="chapter__page-title">{{ page.title }}</h1>
30+
</div>
31+
</div>
32+
</div>
33+
<div class="chapter__container container-fluid">
34+
<div class="row">
35+
<div class="col-12 no-padding-x">
36+
<h2 class="chapter__section-title-left">Who We Are</h2>
37+
<div class="row">
38+
<div class="col-md-8 offset-md-2">
39+
<img class="chapter__paragraph-img-main rounded" src="../static/images/about/python_sprints_decoded_673x411px.JPG" alt="Focused on quality">
40+
<h2 class="chapter__paragraph-title-dark">Python Sprints Decoded</h2>
41+
<hr class="chapter__divider-right">
42+
<p class="chapter__paragraph-dark">
43+
Python Sprints is a non for profit group of like minded programmers who care chapter making open source projects better.
44+
We believe in sharing our skills for free to earn our good karma. If you are devoted to a particular open source project, please let us know, we could make a sprint dedicated to it!
45+
Inclusion is in the nature of our group and we want to make sure that no one is underrepresented. All people are welcome.
46+
</p>
47+
<h2 class="chapter__paragraph-title-dark-left">How It Started</h2>
48+
<hr class="chapter__divider-left">
49+
<p class="chapter__paragraph-dark">
50+
Our group was founded in October 2017. As all things in life the beginnings were humble with only a handful of people collaborating but the word quickly spread and now we have nearly 600 members and counting.
51+
</p>
52+
</div>
53+
</div>
54+
</div>
55+
</div>
56+
</div>

_includes/event_layout.html

Lines changed: 52 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,63 @@
11
{% comment %}
2-
To create a unique html element's id we have to slugify the jekyll's post.id.
3-
Then this unique id is used to set a post dependent background image on it.
4-
{% endcomment %}
2+
event_layout.html (event):
53

6-
{% assign post_id = include.post.id | slugify | prepend: "_" %}
7-
{% assign post_id_selector = post_id | prepend: "#" %}
8-
{% if include.post.image %}
9-
{% assign image = include.post.image %}
10-
{% else %}
11-
{% assign image = "static/images/events/default_image_800x800px.jpeg" %}
12-
{% endif %}
13-
{% include get_host_sponsor.html event = include.post %}
14-
<style>
15-
{{ post_id_selector }} {
16-
background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url("{{ site.baseurl }}/{{ image }}");
17-
}
18-
@media (min-width: 769px) {
19-
{{ post_id_selector }} {
20-
background-image: linear-gradient(75deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6) 80%, rgba(0, 0, 0, 0.6) 80%, black 87%, black 100%), url("{{ site.baseurl }}/{{ image }}");
21-
}
22-
}
23-
</style>
24-
<div class="row">
25-
<div class="no-gutters__col col-md-12 container-fluid">
26-
<div class="events-page__event-container row">
27-
<div id="{{ post_id }}" class="events-page__img-container col-md-7 col-sm-12">
28-
<h1 class="post__title">{{ include.post.title }}</h1>
29-
<h2 class="post__subtitle">{{ include.post.subtitle }}</h2>
30-
</div>
31-
<div class="events-page__event-col col-md-5 col-12">
32-
<div class="row">
33-
<div class="no-gutters__col col-6">
34-
<h2 class="post__label">Project</h2>
35-
</div>
36-
</div>
37-
<div class="row">
38-
<div class="post__event-title col-12">
39-
{{ include.post.project }}
40-
</div>
41-
</div>
4+
Generate a layout for an event.
425

43-
<div class="row">
44-
<div class="no-gutters__col col-6">
45-
<h2 class="post__label">Venue</h2>
46-
</div>
47-
</div>
48-
<div class="row">
49-
<div class="post__event-title col-12">
50-
{{ host_sponsor.name }}
51-
</div>
52-
</div>
6+
Creates a basic layout for an event object. For every unique date on which
7+
an event happens the date will be displayed. Events with same dates get the
8+
date displayed only once. This include is to be used inside a for loop in
9+
association with events_arrary_generator.html.
10+
Before the for loop: current_date = "" must be set in the outer scope!
11+
See index.html, line 57 for example of usage.
5312

54-
<div class="row">
55-
<div class="no-gutters__col col-6">
56-
<h2 class="post__label">Date</h2>
57-
</div>
58-
</div>
59-
<div class="row">
60-
<div class="post__event-title col-12">
61-
{{ include.post.date | date: "%e %B %Y" }}
13+
Parameters:
14+
event: event object
15+
Event object containing yml variables and content.
16+
17+
Returns:
18+
{% endcomment %}
19+
{% assign post = include.event %}
20+
{% include get_host_sponsor.html event = post %}
21+
<div class="upcoming__col col-md-12 no-padding-x">
22+
<div class="row">
23+
<div class="col-12">
24+
{% unless post.date == current_date %}
25+
<p class="upcoming__date">
26+
<i class="upcoming__icon far fa-calendar-alt"></i>{{ post.date | date: "%e %B %Y" }}, {{ post.time }}
27+
</p>
28+
{% endunless %}
29+
{% assign current_date = post.date %}
30+
{% include get_project.html event = post %}
31+
<img class="upcoming__project-logo" src="{{ site.baseurl }}/{{ project.logo }}" alt="Project logo">
32+
<h2 class="upcoming__event-title"> {{ post.title }}</h2>
33+
</div>
34+
</div>
35+
<div class="row">
36+
<div class="col-12">
37+
{% if post.level %}
38+
<h2 class="upcoming__event-subtitle">Level: {{ post.level }}</h2>
39+
{% endif %}
40+
</div>
41+
</div>
42+
<div class="row">
43+
<div class="col-12">
44+
<div class="row">
45+
<div class="col-6 no-padding-x">
46+
<div class="col-12 no-padding-x">
47+
<p class="upcoming__paragraph">
48+
<i class="upcoming__icon fas fa-map-marker-alt"></i>{{ sponsor.address }}
49+
</p>
6250
</div>
6351
</div>
64-
<div class="row">
65-
<div class="events-page__button-col col-12 no-padding-x">
66-
<div class="row">
67-
<div class="col-lg-6 text-center">
68-
<a class="post__button btn btn-primary btn-lg text-center" href="{{ include.post.meetup_link }}">
69-
<i class="post__icon fab fa-meetup"></i>
70-
</a>
71-
</div>
72-
<div class="col-lg-6 text-center">
73-
<a class="post__button btn btn-primary btn-lg text-center" href="{{ include.post.url }}">
74-
<i class="post__icon fas fa-info-circle"></i>
75-
</a>
76-
</div>
77-
</div>
78-
</div>
52+
<div class="col-6 no-padding-x text-right my-auto">
53+
<a class="upcoming__button btn" href="{{ post.url }}">
54+
<i class="upcoming__button-icon fas fa-info-circle"></i>
55+
</a>
7956
</div>
8057
</div>
58+
{% unless forloop.last %}
59+
<hr class="upcoming__divider">
60+
{% endunless %}
8161
</div>
8262
</div>
8363
</div>

_includes/events_array_generator.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% comment %}
2-
events_array_generator.html (future_events, limit, category):
2+
events_array_generator.html (future_events, limit, category):
33

44
Create an array of selected posts (events) for a layout.
55

_layouts/chapter.html

Lines changed: 22 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,13 @@
88
{{ content }}
99
<div class="chapter-container container-fluid">
1010
<div class="row">
11-
{% include events_array_generator.html future_events = true %}
11+
{% include events_array_generator.html future_events=true category=page.category %}
1212
{% if posts.size > 0 %}
1313
{% assign upcoming_event = true %}
14-
{% assign chapters_col = "col-lg-6" %}
1514
{% assign posts = posts | reverse %}
16-
{% else %}
17-
{% assign chapters_col = "col-12" %}
1815
{% endif %}
1916
{% if upcoming_event == true %}
2017
<div class="col-12 no-padding-x">
21-
<!--Upcoming Events section-->
2218
<section class="chapter">
2319
<div class="row container-fluid">
2420
<div class="col-md-12 no-padding-x">
@@ -28,50 +24,27 @@ <h2 class="upcoming__title">Events</h2>
2824
<div class="upcoming__content row">
2925
{% assign current_date = "" %}
3026
{% for post in posts %}
31-
{% include get_host_sponsor.html event = post %}
32-
<div class="upcoming__col col-md-12 no-padding-x">
33-
<div class="row">
34-
<div class="col-12">
35-
{% unless post.date == current_date %}
36-
<p class="upcoming__date">
37-
<i class="upcoming__icon far fa-calendar-alt"></i>{{ post.date | date: "%e %B %Y" }}, {{ post.time }}
38-
</p>
39-
{% endunless %}
40-
{% assign current_date = post.date %}
41-
{% include get_project.html event = post %}
42-
<img class="upcoming__project-logo" src="{{ site.baseurl }}/{{ project.logo }}" alt="Project logo">
43-
<h2 class="upcoming__event-title"> {{ post.title }}</h2>
44-
</div>
45-
</div>
46-
<div class="row">
47-
<div class="col-12">
48-
{% if post.level %}
49-
<h2 class="upcoming__event-subtitle">Level: {{ post.level }}</h2>
50-
{% endif %}
51-
</div>
52-
</div>
53-
<div class="row">
54-
<div class="col-12">
55-
<div class="row">
56-
<div class="col-6 no-padding-x">
57-
<div class="col-12 no-padding-x">
58-
<p class="upcoming__paragraph">
59-
<i class="upcoming__icon fas fa-map-marker-alt"></i>{{ sponsor.address }}
60-
</p>
61-
</div>
62-
</div>
63-
<div class="col-6 no-padding-x text-right my-auto">
64-
<a class="upcoming__button btn" href="{{ post.url }}">
65-
<i class="upcoming__button-icon fas fa-info-circle"></i>
66-
</a>
67-
</div>
68-
</div>
69-
{% unless forloop.last %}
70-
<hr class="upcoming__divider">
71-
{% endunless %}
72-
</div>
73-
</div>
74-
</div>
27+
{% include event_layout.html event=post %}
28+
{% endfor %}
29+
</div>
30+
</section>
31+
</div>
32+
{% endif %}
33+
</div>
34+
<div class="row">
35+
{% include events_array_generator.html category=page.category %}
36+
{% if posts.size > 0 %}
37+
<div class="col-12 no-padding-x">
38+
<section class="chapter">
39+
<div class="row container-fluid">
40+
<div class="col-md-12 no-padding-x">
41+
<h2 class="upcoming__title">Recent Events</h2>
42+
</div>
43+
</div>
44+
<div class="upcoming__content row">
45+
{% assign current_date = "" %}
46+
{% for post in posts %}
47+
{% include event_layout.html event=post %}
7548
{% endfor %}
7649
</div>
7750
</section>

0 commit comments

Comments
 (0)