Added an upcoming flag to optimize lookups of events.

This commit is contained in:
Russell Keith-Magee 2016-07-03 16:33:47 +08:00
parent 9a2df853e8
commit e7b5aace49
16 changed files with 58 additions and 31 deletions

1
TODO
View file

@ -1,7 +1,6 @@
Content needed
==============
* Formatting for Resources
* Media contact data
Feedback needed

View file

@ -125,7 +125,7 @@ h2 {
font-family: 'Cutive', serif;
font-size: 160%;
margin: 1.8rem 0 0.8rem 0;
line-height: 2rem;
line-height: 1.6rem;
}
h2:first-child {
@ -136,7 +136,7 @@ h3 {
font-family: 'Cutive', serif;
font-size: 135%;
margin: 1.8rem 0 0.8rem 0;
line-height: 2rem;
line-height: 1.6rem;
}
h3:first-child {
@ -147,7 +147,7 @@ h4 {
font-family: 'Cutive', serif;
margin: 1.8rem 0 0.8rem 0;
font-size: 120%;
line-height: 2rem;
line-height: 1.6rem;
}
h4:first-child {
@ -159,7 +159,7 @@ h5 {
font-family: 'Cutive', serif;
font-size: 110%;
margin: 1.8rem 0 0.8rem;
line-height: 2rem;
line-height: 1.6rem;
}
h6:first-child {
@ -170,7 +170,7 @@ h6 {
font-family: 'Cutive', serif;
margin: 1.8rem 0 0.8rem 0;
font-size: 100%;
line-height: 2rem;
line-height: 1.6rem;
}
h6:first-child {
@ -332,7 +332,3 @@ body {
/*----------------------------------------------------
Events
--------------------------------------------------- */
.event {
display: none;
}

View file

@ -0,0 +1,20 @@
title: /dev/world/2016
---
date: 2016-08-29
---
event_type: talk
---
speaker: Russell Keith-Magee
---
talk_title: Apple and the Serpent: Writing native applications for Apple platforms in Python
---
upcoming: yes
---
url: http://2016.devworld.com.au/
---
description:
Everyone knows you can write iOS, OS X, tvOS and watchOS apps using Objective C and Swift, Apple's officially blessed technologies. But what if you want to use a different language? What if you've got an existing codebase in a different language, or want to us a language that is more approchable to people without a background in programming?
This talk shows how Python can be used as a viable development language for Apple platforms. It explores the mechanics of how Python can interact with native Apple APIs, and demonstrates some related tools that make the process of creating an iOS, OS X, tvOS or watchOS project in Python relatively easy.

View file

@ -7,3 +7,5 @@ event_type: sprint
speaker: Russell Keith-Magee, Philip James
---
url: https://2016.djangocon.us/sprints/
---
upcoming: yes

View file

@ -9,3 +9,5 @@ event_type: attending
speaker: Russell Keith-Magee, Philip James
---
url: http://djangocon.us
---
upcoming: yes

View file

@ -7,3 +7,5 @@ event_type: sprint
url: https://2016.pycon-au.org/
---
speaker: Russell Keith-Magee, Katie McLaughlin
---
upcoming: yes

View file

@ -7,3 +7,5 @@ event_type: sprint
speaker: Philip James, Katie McLaughlin, Russell Keith-Magee
---
url: https://2016.pycon.us
---
upcoming: no

View file

@ -9,3 +9,5 @@ speaker: Russell Keith-Magee
talk_title: A Tale of Two Cellphones
---
url: https://2016.pycon.us
---
upcoming: no

View file

@ -1,3 +0,0 @@
_model: page
---
title: PyCon US 2016-sprints

View file

@ -13,3 +13,5 @@ event_type: talk
speaker: Russell Keith-Magee
---
talk_title: A Tale Of Two Cellphones
---
upcoming: yes

View file

@ -7,3 +7,5 @@ event_type: sprint
url: http://pyohio.org/sprints/
---
speaker: Russell Keith-Magee
---
upcoming: yes

View file

@ -9,3 +9,5 @@ speaker: Russell Keith-Magee
url: http://pyohio.org/schedule/presentation/249/
---
talk_title: Snakes in a Browser
---
upcoming: yes

View file

@ -13,29 +13,34 @@ label = Event Type
type = select
choices = talk, sprint, booth, attending
choice_labels = Talk, Sprint, Booth, Attending
width = 1/4
width = 1/2
[fields.speaker]
label = Speakers
type = checkboxes
choices = Russell Keith-Magee, Philip James, Katie McLaughlin
choice_labels = Russell Keith-Magee, Philip James, Katie McLaughlin
width = 1/2
[fields.url]
label = Event URL
type = url
[fields.talk_title]
label = Talk Title
type = string
width = 1/2
[fields.date]
label = Event date
type = date
width = 1/4
[fields.upcoming]
label = Upcoming event
type = boolean
width = 1/4
[fields.talk_title]
label = Talk Title
type = string
[fields.description]
label = Description
type = rst

View file

@ -8,13 +8,7 @@
$('.upcoming.event').each(function() {
var event_date = new Date($(this).data('date'));
if (event_date >= today) {
$(this).show();
}
});
$('.past.event').each(function() {
var event_date = new Date($(this).data('date'));
if (event_date < today) {
$(this).show();
// $(this).hide();
}
});
})();
@ -31,11 +25,11 @@
{% endblock %}
{% block main %}
<h2>Upcoming events</h2>
{% for child in this.children %}
{% for child in this.children.filter(F.upcoming == True) %}
<p class="upcoming event" data-date="{{ child.date }}">{{ child.date.strftime("%-d %B %Y") }} <a href="{{ child|url }}">{{ child.title }}</a></p>
{% endfor %}
<h2>Past events</h2>
{% for child in this.children.order_by('-date') %}
{% for child in this.children.filter(F.upcoming == False).order_by('-date') %}
<p class="past event" data-date="{{ child.date }}">{{ child.date.strftime("%-d %B %Y") }} <a href="{{ child|url }}">{{ child.title }}</a></p>
{% endfor %}
{% endblock %}

View file

@ -98,7 +98,7 @@
<hr/>
<h4><a href="/news/events/">Meet the Bee Team @</a></h4>
{% set events = site.query('/news/events').all() %}
{% set events = site.query('/news/events').filter(F.upcoming==True) %}
<div id="carousel-events" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
{% for event in events %}

View file

@ -2,7 +2,7 @@
{% block title %}{{ this.title }}{% endblock %}
{% block body %}
{% set blog = site.query('/news/buzz').all() %}
{% set events = site.query('/news/events').all() %}
{% set events = site.query('/news/events').filter(F.upcoming == True) %}
{% block extra_script %}
<script>
(function() {
@ -34,7 +34,7 @@
<div class="col-md-12 col-lg-4 gutter">
<h2><a href="/news/events/">Upcoming events</a></h2>
<ul>
{% for child in events[:10] %}
{% for child in events %}
<li class="upcoming event" data-date="{{ child.date }}">{{ child.date.strftime("%-d %B %Y") }}: <a href="{{ child|url }}">{{ child.title }}</a></li>
{% endfor %}
</ul>