Skip to content

Commit d716fff

Browse files
author
Kátia Nakamura
authored
Merge pull request #5 from PythonBalkan/midhat/favicon
Midhat/favicon
2 parents a3d5306 + d8c385f commit d716fff

File tree

13 files changed

+106
-43
lines changed

13 files changed

+106
-43
lines changed

pyconbalkan/core/admin.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
from django.apps import AppConfig
2+
from django.contrib import admin
3+
4+
from pyconbalkan.core.models import Speaker, SpeakerPhoto
25

36

47
class CoreConfig(AppConfig):
58
name = 'core'
9+
10+
11+
class SpeakerImageInline(admin.TabularInline):
12+
model = SpeakerPhoto
13+
14+
15+
class SpeakerAdmin(admin.ModelAdmin):
16+
inlines = [SpeakerImageInline]
17+
18+
19+
admin.site.register(Speaker, SpeakerAdmin)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.11.11 on 2018-04-23 11:11
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations, models
6+
import django.db.models.deletion
7+
8+
9+
class Migration(migrations.Migration):
10+
11+
initial = True
12+
13+
dependencies = [
14+
]
15+
16+
operations = [
17+
migrations.CreateModel(
18+
name='Speaker',
19+
fields=[
20+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
21+
('name', models.CharField(max_length=50)),
22+
('job', models.CharField(max_length=100)),
23+
],
24+
),
25+
migrations.CreateModel(
26+
name='SpeakerPhoto',
27+
fields=[
28+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
29+
('profile_picture', models.ImageField(upload_to='static/img')),
30+
('speaker', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='images', to='core.Speaker')),
31+
],
32+
),
33+
]

pyconbalkan/core/models.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
11
from django.db import models
22

33
# Create your models here.
4+
5+
6+
class Speaker(models.Model):
7+
name = models.CharField(max_length=50)
8+
job = models.CharField(max_length=100)
9+
10+
def __str__(self):
11+
return self.name
12+
13+
14+
class SpeakerPhoto(models.Model):
15+
speaker = models.ForeignKey('Speaker', related_name='images')
16+
profile_picture = models.ImageField(upload_to="static/img")

pyconbalkan/core/static/css/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ body {
2424
/* Full height */
2525
height: 100%;
2626
/* Center and scale the image nicely */
27-
background: url("{% static img/background.jpg %}") no-repeat no-repeat center center fixed;
27+
background: url('/static/img/background.jpg') no-repeat no-repeat center center fixed;
2828
-webkit-background-size: cover;
2929
-moz-background-size: cover;
3030
-o-background-size: cover;
1.22 KB
Loading
2.61 KB
Loading
File renamed without changes.
429 KB
Binary file not shown.

pyconbalkan/core/templates/index.html

Lines changed: 28 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@
1111
<meta name="viewport" content="width=device-width, initial-scale=1.0">
1212
<meta name="description" content="PyCon Balkan description">
1313
<meta name="author" content="Python Balkan community">
14-
<link rel="shortcut icon" href="favicon.ico">
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' %}">
1516
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
1617
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.9/css/all.css" integrity="sha384-5SOiIsAziJl6AWe0HWRKTXlfcSHKmYV4RBF18PPJ173Kzn7jzMyFuTtk8JA7QQG1" crossorigin="anonymous">
1718
<!-- Bootstrap 4 -->
1819
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
1920
<link rel="stylesheet" href="{% static 'css/style.css' %}">
2021

2122
<!-- Timer JS -->
22-
<script src="{% static js/timer.js %}" type="text/javascript"></script>
23+
<script src="{% static 'js/timer.js' %}" type="text/javascript"></script>
2324

2425
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
2526
<!--[if lt IE 9]>
@@ -36,19 +37,20 @@
3637
<div class="col-md-11 offset-0">
3738
<nav class="navbar navbar-light navbar-expand-md bg-faded justify-content-center">
3839
<div class="navbar navbar-header mr-auto">
39-
<a class="navbar-brand" href="#"><img src="img/logo.jpg"></a>
40+
<a class="navbar-brand" href="#"><img src="{% static 'img/logo.jpg' %}"></a>
4041
</div>
4142
<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">News</a></li>
43-
<li><a class="btn btn-light btn-sm round" href="#" role="button">CFP</a></li>
44-
<li><a class="btn btn-light btn-sm round" href="#" role="button">Sponsoring</a></li>
45-
<li><a class="btn btn-light btn-sm round" href="#" role="button">Timetable</a></li>
46-
<li><a class="btn btn-light btn-sm round" href="#" role="button">Travel</a></li>
47-
<li><a class="btn btn-light btn-sm round" href="#" role="button">Tickets</a></li>
48-
<li><a class="btn btn-light btn-sm round" href="#" role="button">Events</a></li>
49-
<li><a class="btn btn-light btn-sm round" href="#" role="button">FAQ</a></li>
50-
<li><a class="btn btn-light btn-sm round" href="#" role="button">About</a></li>
51-
<li><a class="btn btn-light btn-sm round" href="#" role="button">Contact</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="#" 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="#" 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">About</a></li>#}
52+
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">Contact</a></li>#}
53+
<li><a class="btn btn-light btn-sm round" href="/coc" role="button">CoC</a></li>
5254
</ul>
5355
</nav>
5456
</div>
@@ -77,12 +79,12 @@ <h1 class="font900 font-yellow">#1</h1>
7779
<p><i class="fas fa-globe"></i> International Event</p>
7880
</div>
7981
<div>
80-
<a class="btn btn-primary btn-md round" href="#" role="button"><b>JOIN US</b></a>
82+
{# <a class="btn btn-primary btn-md round" href="#" role="button"><b>JOIN US</b></a>#}
8183
</div>
8284
<div>
83-
<i class="fa-lg fab fa-facebook-f sn-icons"></i>
84-
<i class="fa-lg fab fa-twitter sn-icons"></i>
85-
<i class="fa-lg fab fa-linkedin-in sn-icons"></i>
85+
{# <i class="fa-lg fab fa-facebook-f sn-icons"></i>#}
86+
{# <i class="fa-lg fab fa-twitter sn-icons"></i>#}
87+
{# <i class="fa-lg fab fa-linkedin-in sn-icons"></i>#}
8688
</div>
8789
</div>
8890
</div>
@@ -113,48 +115,33 @@ <h1 class="font900 font-blue">Early bird tickets</h1>
113115
</ul>
114116
</div>
115117
<div class="moveDown">
116-
<a class="btn btn-secondary btn-md round" href="#" role="button" id="btnBuyNow"><b>Buy Now</b></a>
118+
{# <a class="btn btn-secondary btn-md round" href="#" role="button" id="btnBuyNow"><b>Buy Now</b></a>#}
117119
</div>
118120

119121
<div class="moveDown">
120-
<h1 class="font900 font-yellow">Speakers</h1>
122+
{# <h1 class="font900 font-yellow">Speakers</h1>#}
121123
</div>
122124

123125
<div class="card-deck moveDown">
124126
<div class="card">
125127
<div class="row">
128+
{% for speaker in speakerPhoto %}
126129
<div class="col-sm">
127-
<img src="img/user1.png">
130+
<img src="{{ speaker.profile_picture }}">
128131
<ul class="card-body h-100 justify-content-center">
129-
<li><b>Luka Kladarić</b></li>
132+
<li><b>{{ speaker.speaker.name }}</b></li>
130133
<hr>
131-
<li>Senior Software Engineer at Noom Inc.</li>
132-
</ul>
133-
</div>
134-
135-
<div class="col-sm">
136-
<img src="img/user1.png">
137-
<ul class="card-body h-100 justify-content-center">
138-
<li><b>Krzysztof Žuraw</b></li>
139-
<hr>
140-
<li>Python Developer at STX Next</li>
141-
</ul>
142-
</div>
143-
<div class="col-sm">
144-
<img src="img/user1.png">
145-
<ul class="card-body h-100 justify-content-center">
146-
<li><b>Luka Kladarić</b></li>
147-
<hr>
148-
<li>Senior Software Engineer at Noom Inc.</li>
134+
<li>{{ speaker.speaker.job }}</li>
149135
</ul>
150136
</div>
137+
{% endfor %}
151138
</div>
152139
</div>
153140
</div>
154141

155142
<div class="moveDown">
156-
<a class="btn btn-secondary btn-md round" href="#" role="button" id="seeMore"><b>See More</b></a>
157-
<a class="btn btn-primary btn-md round" href="#" role="button" id="attend"><b>Attend</b></a>
143+
{# <a class="btn btn-secondary btn-md round" href="#" role="button" id="seeMore"><b>See More</b></a>#}
144+
{# <a class="btn btn-primary btn-md round" href="#" role="button" id="attend"><b>Attend</b></a>#}
158145
</div>
159146
</div>
160147

pyconbalkan/core/views.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
from django.shortcuts import render
2+
from .models import Speaker, SpeakerPhoto
23

34

45
def home(request):
5-
return render(request, 'index.html')
6+
speaker = Speaker.objects.all()
7+
speakerPh = SpeakerPhoto.objects.all()
8+
context = {'speakers': speaker, 'speakerPhoto': speakerPh}
9+
return render(request, 'index.html', context)
10+
11+

0 commit comments

Comments
 (0)