Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions pyconbalkan/core/admin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
from django.apps import AppConfig
from django.contrib import admin

from pyconbalkan.core.models import Speaker, SpeakerPhoto


class CoreConfig(AppConfig):
name = 'core'


class SpeakerImageInline(admin.TabularInline):
model = SpeakerPhoto


class SpeakerAdmin(admin.ModelAdmin):
inlines = [SpeakerImageInline]


admin.site.register(Speaker, SpeakerAdmin)
33 changes: 33 additions & 0 deletions pyconbalkan/core/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-04-23 11:11
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Speaker',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=50)),
('job', models.CharField(max_length=100)),
],
),
migrations.CreateModel(
name='SpeakerPhoto',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('profile_picture', models.ImageField(upload_to='static/img')),
('speaker', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='images', to='core.Speaker')),
],
),
]
13 changes: 13 additions & 0 deletions pyconbalkan/core/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
from django.db import models

# Create your models here.


class Speaker(models.Model):
name = models.CharField(max_length=50)
job = models.CharField(max_length=100)

def __str__(self):
return self.name


class SpeakerPhoto(models.Model):
speaker = models.ForeignKey('Speaker', related_name='images')
profile_picture = models.ImageField(upload_to="static/img")
2 changes: 1 addition & 1 deletion pyconbalkan/core/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ body {
/* Full height */
height: 100%;
/* Center and scale the image nicely */
background: url("{% static img/background.jpg %}") no-repeat no-repeat center center fixed;
background: url('/static/img/background.jpg') no-repeat no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
Expand Down
Binary file added pyconbalkan/core/static/img/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pyconbalkan/core/static/img/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pyconbalkan/core/static/pdf/coc_pyconbalkan.pdf
Binary file not shown.
69 changes: 28 additions & 41 deletions pyconbalkan/core/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="PyCon Balkan description">
<meta name="author" content="Python Balkan community">
<link rel="shortcut icon" href="favicon.ico">
<link rel="icon" type="image/png" sizes="32x32" href="{% static 'img/favicon-32x32.png' %}">
<link rel="icon" type="image/png" sizes="16x16" href="{% static 'img/favicon-16x16.png' %}">
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.9/css/all.css" integrity="sha384-5SOiIsAziJl6AWe0HWRKTXlfcSHKmYV4RBF18PPJ173Kzn7jzMyFuTtk8JA7QQG1" crossorigin="anonymous">
<!-- Bootstrap 4 -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="{% static 'css/style.css' %}">

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

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
Expand All @@ -36,19 +37,20 @@
<div class="col-md-11 offset-0">
<nav class="navbar navbar-light navbar-expand-md bg-faded justify-content-center">
<div class="navbar navbar-header mr-auto">
<a class="navbar-brand" href="#"><img src="img/logo.jpg"></a>
<a class="navbar-brand" href="#"><img src="{% static 'img/logo.jpg' %}"></a>
</div>
<ul class="nav navbar-nav ml-auto w-100 justify-content-end mb-5 pb-3">
<li><a class="btn btn-light btn-sm round" href="#" role="button">News</a></li>
<li><a class="btn btn-light btn-sm round" href="#" role="button">CFP</a></li>
<li><a class="btn btn-light btn-sm round" href="#" role="button">Sponsoring</a></li>
<li><a class="btn btn-light btn-sm round" href="#" role="button">Timetable</a></li>
<li><a class="btn btn-light btn-sm round" href="#" role="button">Travel</a></li>
<li><a class="btn btn-light btn-sm round" href="#" role="button">Tickets</a></li>
<li><a class="btn btn-light btn-sm round" href="#" role="button">Events</a></li>
<li><a class="btn btn-light btn-sm round" href="#" role="button">FAQ</a></li>
<li><a class="btn btn-light btn-sm round" href="#" role="button">About</a></li>
<li><a class="btn btn-light btn-sm round" href="#" role="button">Contact</a></li>
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">News</a></li>#}
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">CFP</a></li>#}
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">Sponsoring</a></li>#}
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">Timetable</a></li>#}
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">Travel</a></li>#}
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">Tickets</a></li>#}
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">Events</a></li>#}
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">FAQ</a></li>#}
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">About</a></li>#}
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">Contact</a></li>#}
<li><a class="btn btn-light btn-sm round" href="/coc" role="button">CoC</a></li>
</ul>
</nav>
</div>
Expand Down Expand Up @@ -77,12 +79,12 @@ <h1 class="font900 font-yellow">#1</h1>
<p><i class="fas fa-globe"></i> International Event</p>
</div>
<div>
<a class="btn btn-primary btn-md round" href="#" role="button"><b>JOIN US</b></a>
{# <a class="btn btn-primary btn-md round" href="#" role="button"><b>JOIN US</b></a>#}
</div>
<div>
<i class="fa-lg fab fa-facebook-f sn-icons"></i>
<i class="fa-lg fab fa-twitter sn-icons"></i>
<i class="fa-lg fab fa-linkedin-in sn-icons"></i>
{# <i class="fa-lg fab fa-facebook-f sn-icons"></i>#}
{# <i class="fa-lg fab fa-twitter sn-icons"></i>#}
{# <i class="fa-lg fab fa-linkedin-in sn-icons"></i>#}
</div>
</div>
</div>
Expand Down Expand Up @@ -113,48 +115,33 @@ <h1 class="font900 font-blue">Early bird tickets</h1>
</ul>
</div>
<div class="moveDown">
<a class="btn btn-secondary btn-md round" href="#" role="button" id="btnBuyNow"><b>Buy Now</b></a>
{# <a class="btn btn-secondary btn-md round" href="#" role="button" id="btnBuyNow"><b>Buy Now</b></a>#}
</div>

<div class="moveDown">
<h1 class="font900 font-yellow">Speakers</h1>
{# <h1 class="font900 font-yellow">Speakers</h1>#}
</div>

<div class="card-deck moveDown">
<div class="card">
<div class="row">
{% for speaker in speakerPhoto %}
<div class="col-sm">
<img src="img/user1.png">
<img src="{{ speaker.profile_picture }}">
<ul class="card-body h-100 justify-content-center">
<li><b>Luka Kladarić</b></li>
<li><b>{{ speaker.speaker.name }}</b></li>
<hr>
<li>Senior Software Engineer at Noom Inc.</li>
</ul>
</div>

<div class="col-sm">
<img src="img/user1.png">
<ul class="card-body h-100 justify-content-center">
<li><b>Krzysztof Žuraw</b></li>
<hr>
<li>Python Developer at STX Next</li>
</ul>
</div>
<div class="col-sm">
<img src="img/user1.png">
<ul class="card-body h-100 justify-content-center">
<li><b>Luka Kladarić</b></li>
<hr>
<li>Senior Software Engineer at Noom Inc.</li>
<li>{{ speaker.speaker.job }}</li>
</ul>
</div>
{% endfor %}
</div>
</div>
</div>

<div class="moveDown">
<a class="btn btn-secondary btn-md round" href="#" role="button" id="seeMore"><b>See More</b></a>
<a class="btn btn-primary btn-md round" href="#" role="button" id="attend"><b>Attend</b></a>
{# <a class="btn btn-secondary btn-md round" href="#" role="button" id="seeMore"><b>See More</b></a>#}
{# <a class="btn btn-primary btn-md round" href="#" role="button" id="attend"><b>Attend</b></a>#}
</div>
</div>

Expand Down
8 changes: 7 additions & 1 deletion pyconbalkan/core/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
from django.shortcuts import render
from .models import Speaker, SpeakerPhoto


def home(request):
return render(request, 'index.html')
speaker = Speaker.objects.all()
speakerPh = SpeakerPhoto.objects.all()
context = {'speakers': speaker, 'speakerPhoto': speakerPh}
return render(request, 'index.html', context)


4 changes: 4 additions & 0 deletions pyconbalkan/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,7 @@

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')

PDF_ROOT = os.path.join(BASE_DIR, 'pyconbalkan/core/static/pdf/')
MEDIA_ROOT = os.path.join(BASE_DIR, 'pyconbalkan/core/')
MEDIA_URL = '/img/'
5 changes: 5 additions & 0 deletions pyconbalkan/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
import os

from django.conf.urls import url
from django.contrib import admin
from django.views.static import serve

from pyconbalkan.core import views
from pyconbalkan.settings import PDF_ROOT

urlpatterns = [
url(r'^$', views.home, name='index'),
url(r'^coc$', serve, {'path': 'coc_pyconbalkan.pdf', 'document_root': PDF_ROOT}),
url(r'^admin/', admin.site.urls),
]
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ dj-database-url==0.5.0
dj-static==0.0.6
Django==1.11.11
gunicorn==19.7.1
Pillow==5.1.0
psycopg2==2.7.4
python-decouple==3.1
pytz==2018.3
Expand Down