Skip to content

Commit 5210e78

Browse files
committed
Schedule Test
1 parent e27895e commit 5210e78

File tree

13 files changed

+447
-3
lines changed

13 files changed

+447
-3
lines changed

config/urls.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from django.urls import include, path
55
from django.views import defaults as default_views
66

7-
from pycon_portugal_2023.site.views import default_view
7+
from pycon_portugal_2023.site.views import ScheduleView, default_view
88

99
urlpatterns = [
1010
# Django Admin, use {% url 'admin:index' %}
@@ -14,6 +14,8 @@
1414
path("accounts/", include("allauth.urls")),
1515
# Your stuff: custom urls includes go here
1616
path("", default_view, name="home"),
17+
path("schedule/<int:day>/", ScheduleView.as_view(), name="schedule"),
18+
path("schedule/<int:day>/<slug:room>/", ScheduleView.as_view(), name="schedule"),
1719
path("<slug:menu>/", default_view, name="menu-view"),
1820
path("<slug:menu>/<slug:submenu>/", default_view, name="submenu-view"),
1921
]

pycon_portugal_2023/site/events.py

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
events = [
2+
{
3+
"day": 7,
4+
"start_time": "09:00",
5+
"duration": 30,
6+
"title": "Welcoming Session",
7+
"room": "Auditorium",
8+
"speaker": "",
9+
"description": "Welcoming Session",
10+
},
11+
{
12+
"day": 7,
13+
"start_time": "09:15",
14+
"duration": 60,
15+
"title": "Optimising for joy",
16+
"room": "Auditorium",
17+
"speaker": "Tom Forbes",
18+
"description": "The good feeling new developers get when they begin to program for the first time fades as we get more experience and learn more. Is it possible to recapture that feeling?", # noqa
19+
},
20+
{
21+
"day": 7,
22+
"start_time": "10:15",
23+
"duration": 35,
24+
"title": "Amazon CodeWhisperer, ChatGPT, and GitHub Copilot: Choosing the Best Python AI Code Assistant ",
25+
"room": "Auditorium",
26+
"speaker": "Darya Petrashka",
27+
"description": "Discover the right helper for your Python coding needs. Explore security, code readability, cut-off limitations, creativity, ability to generate tests, and troubleshooting capabilities. Find survey results for programmers.", # noqa
28+
},
29+
{
30+
"day": 7,
31+
"start_time": "11:20",
32+
"duration": 35,
33+
"title": "A simples serverless data pipeline",
34+
"room": "Auditorium",
35+
"speaker": "Riccardo Magliocchetti",
36+
"description": "Building and maintaining data pipelines when it’s not your full time job is a pain! So better keep things simple without the need to manage the system yourself. In this talk I’ll show a data pipeline architecture built leveraging some cloud offerings by AWS and Preset.", # noqa
37+
},
38+
{
39+
"day": 7,
40+
"start_time": "11:55",
41+
"duration": 35,
42+
"title": "Building Dainty Dashboards in Plotly Dash for health data science.",
43+
"room": "Auditorium",
44+
"speaker": "Avneet Kaur",
45+
"description": "Data science projects are often characterized by visualizations which enhances the creative storytelling process and allow us to derive actionable insights from data. ", # noqa
46+
},
47+
{
48+
"day": 7,
49+
"start_time": "12:30",
50+
"duration": 35,
51+
"title": "Tools to setup great python projects",
52+
"room": "Auditorium",
53+
"speaker": "Duarte Pompeu",
54+
"description": "In a professional python project, there are many steps one can take to improve its quality. In this talk, I will review some tools that have been useful to me:", # noqa
55+
},
56+
{
57+
"day": 7,
58+
"start_time": "13:05",
59+
"duration": 25,
60+
"title": "Lunch break",
61+
"room": "Auditorium",
62+
"speaker": "",
63+
"description": "",
64+
},
65+
{
66+
"day": 7,
67+
"start_time": "13:30",
68+
"duration": 35,
69+
"title": "Tools to setup great python projects",
70+
"room": "Auditorium",
71+
"speaker": "Duarte Pompeu",
72+
"description": "In a professional python project, there are many steps one can take to improve its quality. In this talk, I will review some tools that have been useful to me:", # noqa
73+
},
74+
{
75+
"day": 9,
76+
"start_time": "09:00",
77+
"duration": 120,
78+
"title": "Beyond the basics",
79+
"room": "1",
80+
"speaker": "Stefanie Molin",
81+
"description": "In a professional python project, there are many steps one can take to improve its quality. In this talk, I will review some tools that have been useful to me", # noqa
82+
},
83+
{
84+
"day": 9,
85+
"start_time": "09:00",
86+
"duration": 120,
87+
"title": "Django and ReportLab: Create PDF",
88+
"room": "2",
89+
"speaker": "Maxin Danilov",
90+
"description": "In a professional python project, there are many steps one can take to improve its quality. In this talk, I will review some tools that have been useful to me", # noqa
91+
},
92+
{
93+
"day": 9,
94+
"start_time": "11:30",
95+
"duration": 120,
96+
"title": "MicroPython and the time series",
97+
"room": "1",
98+
"speaker": "Olaniyan Adeweale, Sulaiman Adisa",
99+
"description": "In a professional python project, there are many steps one can take to improve its quality. In this talk, I will review some tools that have been useful to me", # noqa
100+
},
101+
{
102+
"day": 9,
103+
"start_time": "11:30",
104+
"duration": 120,
105+
"title": "Django and ReportLab: Create PDF",
106+
"room": "2",
107+
"speaker": "Maxin Danilov",
108+
"description": "In a professional python project, there are many steps one can take to improve its quality. In this talk, I will review some tools that have been useful to me", # noqa
109+
},
110+
{
111+
"day": 9,
112+
"start_time": "14:30",
113+
"duration": 120,
114+
"title": "MicroPython and the time series",
115+
"room": "1",
116+
"speaker": "Olaniyan Adeweale, Sulaiman Adisa",
117+
"description": "In a professional python project, there are many steps one can take to improve its quality. In this talk, I will review some tools that have been useful to me", # noqa
118+
},
119+
{
120+
"day": 9,
121+
"start_time": "14:30",
122+
"duration": 120,
123+
"title": "Django and ReportLab: Create PDF",
124+
"room": "2",
125+
"speaker": "Maxin Danilov",
126+
"description": "In a professional python project, there are many steps one can take to improve its quality. In this talk, I will review some tools that have been useful to me", # noqa
127+
},
128+
]

pycon_portugal_2023/site/views.py

+45
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
from datetime import datetime
12
from os import walk
23

34
from django.shortcuts import render
5+
from django.views import View
46

57
from config.settings.base import APPS_DIR
8+
from pycon_portugal_2023.site.events import events
69

710

811
def default_view(request, menu="home", submenu=None):
@@ -28,3 +31,45 @@ def default_view(request, menu="home", submenu=None):
2831
page += "pages/" + "default"
2932

3033
return render(request, page + ".html", ctx)
34+
35+
36+
WORKSHOP_1 = "Workshop I"
37+
WORKSHOP_2 = "Workshop II"
38+
AUDITORIUM = "Auditorium"
39+
40+
41+
class ScheduleView(View):
42+
def get(self, request, *args, **kwargs):
43+
day = kwargs.get("day", 7)
44+
room = kwargs.get("room", None)
45+
if day not in range(7, 10):
46+
return render(request, "404.html")
47+
48+
# Make a copy so we don't mutate the original
49+
selected_events = events.copy()
50+
selected_events = [event for event in events if event["day"] == day]
51+
52+
if room:
53+
if day != 9:
54+
return render(request, "404.html")
55+
56+
if room == "1":
57+
room = WORKSHOP_1
58+
elif room == "2":
59+
room = WORKSHOP_2
60+
else:
61+
room = AUDITORIUM
62+
63+
selected_events = [event for event in selected_events if event["room"] == room]
64+
# Transform start_time to datetime
65+
for event in selected_events:
66+
if type(event["start_time"]) == str:
67+
event["start_time"] = datetime.strptime(event["start_time"], "%H:%M")
68+
69+
context = {
70+
"day": f"September {day}",
71+
"room": room.capitalize() if room else "Auditorium",
72+
"events": selected_events,
73+
}
74+
75+
return render(request, "pages/schedule/schedule_content.html", context)

pycon_portugal_2023/static/css/project.css

+99
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
@import url("https://fonts.googleapis.com/css?family=Poppins:200,300,400,500,600,700,800,900&display=swap");
88
@import url("https://fonts.googleapis.com/css?family=Poppins:200,300,400,500,600,700,800,900&display=swap");
99
@import url("https://fonts.googleapis.com/css?family=Poppins:200,300,400,500,600,700,800,900&display=swap");
10+
@import url("https://fonts.googleapis.com/css?family=Poppins:200,300,400,500,600,700,800,900&display=swap");
1011
html, body {
1112
overflow-x: hidden;
1213
}
@@ -1353,3 +1354,101 @@ body {
13531354
.home-modal .modal-dialog .modal-content .modal-body .card .card-body .pycon-btn {
13541355
width: 100%;
13551356
}
1357+
1358+
html, body {
1359+
overflow-x: hidden;
1360+
}
1361+
1362+
body {
1363+
font-family: "Poppins", sans-serif;
1364+
}
1365+
1366+
.alert-debug {
1367+
background-color: #F7F7F7;
1368+
border-color: #d6e9c6;
1369+
color: #000;
1370+
}
1371+
1372+
.alert-error {
1373+
background-color: #f2dede;
1374+
border-color: #eed3d7;
1375+
color: #b94a48;
1376+
}
1377+
1378+
#schedule-container {
1379+
font-family: "Poppins", sans-serif;
1380+
}
1381+
#schedule-container.dark-background {
1382+
background: #2C2C2C;
1383+
min-height: 100vh;
1384+
}
1385+
#schedule-container .header-row {
1386+
height: 30vh;
1387+
position: sticky;
1388+
}
1389+
#schedule-container .header-row .left-logo {
1390+
-webkit-filter: brightness(0.6);
1391+
filter: brightness(0.6);
1392+
width: 50%;
1393+
}
1394+
#schedule-container .header-row .right-logo {
1395+
width: 70%;
1396+
}
1397+
#schedule-container .schedule-container {
1398+
background: #F7F7F7;
1399+
min-height: 70vh;
1400+
border-radius: 15px;
1401+
}
1402+
#schedule-container .schedule-container .day, #schedule-container .schedule-container .room {
1403+
text-transform: uppercase;
1404+
color: #8d8d8d;
1405+
}
1406+
#schedule-container .schedule-container .day {
1407+
font-size: 24px;
1408+
}
1409+
#schedule-container .schedule-container .room {
1410+
font-size: 16px;
1411+
}
1412+
#schedule-container .schedule-container .grouped-time {
1413+
font-size: 12px;
1414+
color: #468F1F;
1415+
}
1416+
#schedule-container .schedule-container .event-card {
1417+
width: 100%;
1418+
border-radius: 8px;
1419+
-webkit-box-shadow: 0 0 10px 0 #8d8d8d;
1420+
box-shadow: 0 0 10px 0 #8d8d8d;
1421+
position: relative;
1422+
}
1423+
#schedule-container .schedule-container .event-card .time-details {
1424+
color: white;
1425+
-webkit-box-align: end;
1426+
-ms-flex-align: end;
1427+
align-items: end;
1428+
-webkit-box-pack: justify;
1429+
-ms-flex-pack: justify;
1430+
justify-content: space-between;
1431+
background: #468F1F;
1432+
height: 100%;
1433+
padding: 15px;
1434+
border-top-left-radius: 8px;
1435+
border-bottom-left-radius: 8px;
1436+
}
1437+
#schedule-container .schedule-container .event-card .event-details {
1438+
-webkit-box-flex: 1;
1439+
-ms-flex-positive: 1;
1440+
flex-grow: 1;
1441+
}
1442+
#schedule-container .schedule-container .event-card .event-details .event-title {
1443+
font-size: 18px;
1444+
}
1445+
#schedule-container .schedule-container .event-card .event-details .event-speaker {
1446+
color: #8d8d8d;
1447+
font-size: 16px;
1448+
}
1449+
#schedule-container .schedule-container .event-card .event-details .event-description {
1450+
font-size: 14px;
1451+
}
1452+
#schedule-container .schedule-container .event-card .event-details .event-room {
1453+
color: #8d8d8d;
1454+
}

pycon_portugal_2023/static/css/project.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Loading

pycon_portugal_2023/static/sass/_base.scss

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ $mint-green: #d6e9c6;
3131
$black: #000;
3232
$pink: #f2dede;
3333
$dark-pink: #eed3d7;
34+
$gray: #8d8d8d;
3435
$red: #b94a48;
3536

3637
////////////////////////////////

0 commit comments

Comments
 (0)