Skip to content

Commit 6461b1d

Browse files
author
Kátia Nakamura
committed
template: fix template to use base.html
1 parent 66a3170 commit 6461b1d

File tree

4 files changed

+30
-247
lines changed

4 files changed

+30
-247
lines changed

pyconbalkan/cfp/templates/cfp.html

Lines changed: 5 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -1,138 +1,11 @@
1-
{% load static %}
2-
<!DOCTYPE html>
3-
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
4-
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
5-
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
6-
<head>
7-
<title>PyCon Balkan 2018</title>
8-
<!-- Meta -->
9-
<meta charset="utf-8">
10-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
11-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
12-
<meta name="description" content="PyCon Balkan description">
13-
<meta name="author" content="Python Balkan community">
14-
<link rel="icon" type="image/png" sizes="32x32" href="{% static 'img/favicon-32x32.png' %}">
15-
<link rel="icon" type="image/png" sizes="16x16" href="{% static 'img/favicon-16x16.png' %}">
16-
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
17-
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.9/css/all.css" integrity="sha384-5SOiIsAziJl6AWe0HWRKTXlfcSHKmYV4RBF18PPJ173Kzn7jzMyFuTtk8JA7QQG1" crossorigin="anonymous">
18-
<!-- Bootstrap 4 -->
19-
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
20-
<link rel="stylesheet" href="{% static 'css/style.css' %}">
1+
{% extends "base.html" %}
212

22-
<!-- Timer JS -->
23-
<script src="{% static 'js/timer.js' %}" type="text/javascript"></script>
24-
<script src="{% static 'js/index.js' %}" type="text/javascript"></script>
3+
{% block main_content %}
254

26-
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
27-
<!--[if lt IE 9]>
28-
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
29-
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
30-
<![endif]-->
31-
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700,900"
32-
rel="stylesheet">
33-
<style>
34-
body {
35-
font-family: Montserrat, sans-serif;
36-
}
37-
.blue {
38-
font-weight: 900;
39-
color: #53A8DC;
40-
}
41-
.yellow {
42-
font-weight: 900;
43-
color: #F9D768;
44-
}
45-
.black {
46-
font-size: 48px;
47-
font-weight: bold;
48-
}
49-
.white {
50-
color: #FFFFFF;
51-
font-size: 36px;
52-
font-weight: bold;
53-
}
54-
</style>
55-
</head>
5+
<!-- Main Content -->
566

57-
<body>
587

59-
<!-- Navigation Bar -->
608

61-
<div class="row">
62-
<div class="col-md-11 offset-0">
63-
<nav class="navbar navbar-light navbar-expand-md bg-faded justify-content-center">
64-
<div class="navbar navbar-header mr-auto">
65-
<a class="navbar-brand" href="#"><img src="{% static 'img/logo.jpg' %}"></a>
66-
</div>
67-
<ul class="nav navbar-nav ml-auto w-100 justify-content-end mb-5 pb-3">
68-
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">News</a></li>#}
69-
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">CFP</a></li>#}
70-
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">Sponsoring</a></li>#}
71-
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">Timetable</a></li>#}
72-
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">Travel</a></li>#}
73-
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">Tickets</a></li>#}
74-
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">Events</a></li>#}
75-
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">FAQ</a></li>#}
76-
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">About</a></li>#}
77-
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">Contact</a></li>#}
78-
<li><a class="btn btn-light btn-sm round" href="/coc" role="button">CoC</a></li>
79-
</ul>
80-
</nav>
81-
</div>
82-
</div>
9+
<!-- END of Main Content -->
8310

84-
<!-- END of Navigation Bar -->
85-
86-
<div class="row">
87-
88-
<!-- Left Side -->
89-
90-
91-
<div class="col-xl-3 offset-1">
92-
<div>
93-
{% if conference %}
94-
<h1 class="font900 one">{{ conference.event }}</h1>
95-
<h2 class="one">{{ conference.name }}</h2>
96-
<h3>{{ conference.city }} {{ conference.year }}</h3>
97-
{% endif %}
98-
</div>
99-
<hr>
100-
{% if conference %}
101-
<div class="details">
102-
<h1 class="font900 font-yellow">#{{ conference.number }}</h1>
103-
<p>{{ conference.address }}</p>
104-
<div>
105-
<p><i class="far fa-calendar-alt"></i> {{ conference.from_date }} - {{ conference.to_date }}</p>
106-
<p><i class="fas fa-users"></i> {{ conference.max_attendees }} attendees</p>
107-
<p><i class="fas fa-globe"></i> {{ conference.get_type_display }}</p>
108-
</div>
109-
{# <div>#}
110-
{# <a class="btn btn-primary btn-md round" href="#" role="button"><b>JOIN US</b></a>#}
111-
{# </div>#}
112-
{# <div>#}
113-
{# <i class="fa-lg fab fa-facebook-f sn-icons"></i>#}
114-
{# <i class="fa-lg fab fa-twitter sn-icons"></i>#}
115-
{# <i class="fa-lg fab fa-linkedin-in sn-icons"></i>#}
116-
{# </div>#}
117-
</div>
118-
{% endif %}
119-
</div>
120-
121-
<!-- END of Left Side -->
122-
123-
124-
<!-- Main Content -->
125-
126-
127-
128-
<!-- END of Main Content -->
129-
130-
</div>
131-
132-
<!-- Bootstrap 4 scripts -->
133-
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
134-
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
135-
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
136-
137-
</body>
138-
</html>
11+
{% endblock %}

pyconbalkan/core/views.py

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,38 @@
55
from pyconbalkan.speaker.models import Speaker
66

77

8-
def home(request):
8+
def get_conference_context(context):
99
conference = Conference.objects.filter(active=True)
10+
if conference:
11+
context['conference'] = conference.first()
12+
return context
13+
14+
def home(request):
1015
count_down = CountDown.objects.filter(active=True)
11-
speakers = Speaker.objects.filter(active=True)
1216
context = {
13-
'speakers': speakers,
14-
'conference': conference.first() if conference else None,
17+
'speakers': Speaker.objects.filter(active=True),
1518
'count_down': count_down.first() if count_down else None,
1619
}
20+
get_conference_context(context)
1721
return render(request, 'home.html', context)
1822

1923

2024
def organizers(request):
21-
volunteers = Volunteer.objects.filter(type=Volunteer.VOLUNTEER, active=True)
22-
organizers = Volunteer.objects.filter(type=Volunteer.ORGANIZER, active=True)
23-
conference = Conference.objects.filter(active=True)
2425
context = {
25-
'volunteers': volunteers,
26-
'organizers': organizers,
27-
'conference': conference.first() if conference else None,
26+
'volunteers': Volunteer.objects.filter(type=Volunteer.VOLUNTEER, active=True),
27+
'organizers': Volunteer.objects.filter(type=Volunteer.ORGANIZER, active=True),
2828
}
29+
get_conference_context(context)
2930
return render(request, 'organizers.html', context)
3031

3132

3233
def sponsors(request):
33-
return render(request, 'sponsors.html')
34+
context = {}
35+
get_conference_context(context)
36+
return render(request, 'sponsors.html', context)
37+
38+
39+
def cfp(request):
40+
context = {}
41+
get_conference_context(context)
42+
return render(request, 'cfp.html', context)

pyconbalkan/sponsors/templates/sponsors.html

Lines changed: 3 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,6 @@
1+
{% extends "base.html" %}
12

2-
3-
<!DOCTYPE html>
4-
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
5-
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
6-
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
7-
<head>
8-
<title>PyCon Balkan 2018</title>
9-
<!-- Meta -->
10-
<meta charset="utf-8">
11-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
12-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
13-
<meta name="description" content="PyCon Balkan description">
14-
<meta name="author" content="Python Balkan community">
15-
<link rel="icon" type="image/png" sizes="32x32" href="/static/img/favicon-32x32.png">
16-
<link rel="icon" type="image/png" sizes="16x16" href="/static/img/favicon-16x16.png">
17-
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
18-
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.9/css/all.css" integrity="sha384-5SOiIsAziJl6AWe0HWRKTXlfcSHKmYV4RBF18PPJ173Kzn7jzMyFuTtk8JA7QQG1" crossorigin="anonymous">
19-
<!-- Bootstrap 4 -->
20-
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
21-
<link rel="stylesheet" href="/static/css/style.css">
22-
23-
24-
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
25-
<!--[if lt IE 9]>
26-
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
27-
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
28-
<![endif]-->
29-
</head>
30-
31-
<body>
32-
33-
<!-- Navigation Bar -->
34-
35-
<div class="row">
36-
<div class="col-md-11 offset-0">
37-
<nav class="navbar navbar-light navbar-expand-md bg-faded justify-content-center">
38-
<div class="navbar navbar-header mr-auto">
39-
<a class="navbar-brand" href="#"><img src="/static/img/logo.jpg"></a>
40-
</div>
41-
<ul class="nav navbar-nav ml-auto w-100 justify-content-end mb-5 pb-3">
42-
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">About</a></li>#}
43-
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">News</a></li>#}
44-
<li><a class="btn btn-light btn-sm round" href="/cfp" role="button">CfP</a></li>
45-
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">Sponsoring</a></li>#}
46-
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">Timetable</a></li>#}
47-
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">Travel</a></li>#}
48-
<li><a class="btn btn-light btn-sm round" href="/tickets" role="button">Tickets</a></li>
49-
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">Events</a></li>#}
50-
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">FAQ</a></li>#}
51-
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">Contact</a></li>#}
52-
<li><a class="btn btn-light btn-sm round" href="/coc" role="button">CoC</a></li>
53-
</ul>
54-
</nav>
55-
</div>
56-
</div>
57-
58-
<!-- END of Navigation Bar -->
59-
60-
<div class="row">
61-
62-
<!-- Left Side -->
63-
64-
65-
<div class="col-xl-3 offset-1">
66-
<div>
67-
<h1 class="font900 one">PyCon</h1>
68-
<h2 class="one">Balkan</h2>
69-
<h3>Belgrade 2018</h3>
70-
</div>
71-
<hr>
72-
<div class="details">
73-
<h1 class="font900 font-yellow">#1</h1>
74-
<p>Hilton, Kralja Milana 35, 11000 Belgrade Serbia</p>
75-
<div>
76-
<p><i class="far fa-calendar-alt"></i> 16-18 November</p>
77-
<p><i class="fas fa-users"></i> Over 400 Attendees</p>
78-
<p><i class="fas fa-globe"></i> International Event</p>
79-
</div>
80-
<div>
81-
82-
</div>
83-
<div>
84-
{# <i class="fa-lg fab fa-facebook-f sn-icons"></i>#}
85-
{# <i class="fa-lg fab fa-twitter sn-icons"></i>#}
86-
{# <i class="fa-lg fab fa-linkedin-in sn-icons"></i>#}
87-
</div>
88-
</div>
89-
</div>
90-
91-
<!-- END of Left Side -->
92-
3+
{% block main_content %}
934

945
<!-- Main Content -->
956

@@ -204,15 +115,4 @@ <h2 class="font400"><b>Level of Sponsporship</b></h2>
204115
</div>
205116
<!-- END of Main Content -->
206117

207-
</div>
208-
209-
<!-- Timer JS -->
210-
<script src="/static/js/level.js" type="text/javascript"></script>
211-
212-
<!-- Bootstrap 4 scripts -->
213-
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
214-
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
215-
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
216-
217-
</body>
218-
</html>
118+
{% endblock %}

pyconbalkan/urls.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616

1717
urlpatterns = [
1818
url(r'^$', views.home, name='index'),
19+
url(r'^cfp$', views.cfp, name='cfp'),
20+
url(r'^sponsors$', views.sponsors, name='sponsors'),
1921
url(r'^organizers$', views.organizers, name='organizers'),
2022
url(r'^coc$', serve, {'path': 'coc_pyconbalkan.pdf', 'document_root': PDF_ROOT}),
2123
url(r'^admin/', admin.site.urls),
2224
url(r'^api/', include(router.urls)), # API
23-
url(r'^sponsor$', views.sponsor, name='sponsor'),
2425
]

0 commit comments

Comments
 (0)