Finish flightplan

This commit is contained in:
Sebastian 2017-12-20 13:50:03 +01:00
parent d8259446b6
commit efa73cbfc4
5 changed files with 90 additions and 43 deletions

View File

@ -5,16 +5,17 @@ import sys
import shutil
import requests
from jinja2 import Environment, FileSystemLoader
import dateutil.parser as dt
from staticfiles import copy_dir
WIKI_URL = "https://events.ccc.de/congress/2017/wiki/api.php?action=parse&page=Assembly:CSOC&format=json&prop=text"
WIKI_URL = 'https://events.ccc.de/congress/2017/wiki/api.php?action=parse&page=Assembly:CSOC&format=json&prop=text'
FLIGHTPLAN_URL = "https://fahrplan.events.ccc.de/congress/2017/Fahrplan/schedule.json"
MISSION_CREW = ['Tim Pritlove', 'Charles Stross', 'Mathias Dalheimer', 'ktemkin']
FLIGHTPLAN_URL = 'https://frab.txtfile.eu/en/34c3-ffc/public/schedule.json'
MISSION_CREW = ['VanillaChief', 'TP1024', 'Nikos Roussos', 'Pierros Papadeas', 'ar3itrary']
STATIC_FILES_DIR = "static/"
TEMPLATE_DIR = "templates"
STATIC_FILES_DIR = 'static/'
TEMPLATE_DIR = 'templates'
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
@ -57,10 +58,17 @@ def generate_flightplan(jinja_env, output_dir):
for room in day['rooms'].values():
for lecture in room:
persons = lecture['persons']
if any([person['public_name'] in MISSION_CREW for person in persons]):
if any(person['public_name'] in MISSION_CREW for person in persons):
lecture['day'] = day['index']
lecture['date'] = dt.parse(lecture['date'])
lectures += [lecture]
page = {
'title': 'Flightplan',
'schedule' : lectures
}
render_to_file(jinja_env, 'schedule.html', page, 'schedule.html', output_dir)
print(lectures)
def main():
if len(sys.argv) != 2:

View File

@ -111,3 +111,12 @@ h3 {
font-family: 'Source Code Pro';
margin-bottom: 5px;
}
.lecture .subtitle {
font-weight: bold;
font-family: 'Source Code Pro';
}
.lecture .infos {
font-family: 'Source Code Pro';
}

39
cms/templates/base.html Normal file
View File

@ -0,0 +1,39 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
{% block head %}
<title>Chaos Space Operation Center - {{ title }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta content="Chaos Space Operation Center" property="og:site_name">
<meta content="article" property="og:type">
<meta content="{{ title }}" property="og:title">
<meta content="https://c3space.de" property="og:url">
<meta content="Hacking for the final frontier at the 34th Chaos Communication Congress." property="og:description">
<meta content="https://c3space.de/logo_og.png" property="og:image">
{% endblock %}
<link rel="icon" href="logo_favicon.ico">
<link rel="stylesheet" type="text/css" href="normalize.css">
<link rel="stylesheet" type="text/css" href="source-code-pro/source-code-pro.css">
<link rel="stylesheet" type="text/css" href="source-serif-pro/source-serif-pro.css">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body>
<div class="container">
<div class="content">
<div class="logo">
<img src="logo.png"/>
</div>
{% block content %}
{% endblock %}
</div>
</div>
</body>
</html>

View File

@ -1,37 +1,6 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Chaos Space Operation Center - {{ title }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
{% extends "base.html" %}
<meta content="Chaos Space Operation Center" property="og:site_name">
<meta content="article" property="og:type">
<meta content="{{ title }}" property="og:title">
<meta content="https://c3space.de" property="og:url">
<meta content="Hacking for the final frontier at the 34th Chaos Communication Congress." property="og:description">
<meta content="https://c3space.de/logo_og.png" property="og:image">
<link rel="icon" href="logo_favicon.ico">
<link rel="stylesheet" type="text/css" href="normalize.css">
<link rel="stylesheet" type="text/css" href="source-code-pro/source-code-pro.css">
<link rel="stylesheet" type="text/css" href="source-serif-pro/source-serif-pro.css">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body>
<div class="container">
<div class="content">
<div class="logo">
<img src="logo.png"/>
</div>
<h1>Chaos Space Operation Center</h1>
{{text['*']}}
</div>
</div>
</body>
</html>
{% block content %}
<h1>Chaos Space Operation Center</h1>
{{text['*']}}
{% endblock %}

View File

@ -0,0 +1,22 @@
{% extends "base.html" %}
{% block content %}
<h1>Chaos Space Operation Center</h1>
<h2>Flightplan</h2>
{% for lecture in schedule %}
<div class="lecture">
<h3>{{lecture.title}}</h3>
{% if lecture.subtitle %}
<span class="subtitle">{{lecture.subtitle}}</span><br/>
{% endif %}
<span class="infos">
Day {{lecture.day}} - {{lecture.start}} ({{lecture.duration}}) :: {{lecture.room}}<br/>
{{ lecture.persons | join(', ', attribute='public_name') }}
</span>
{{lecture.description}}
</div>
{% endfor %}
{% endblock %}