Skip to content

Commit fd35691

Browse files
author
Kátia Nakamura
authored
Merge pull request #9 from PythonBalkan/katia/organizers
organizers: add organizers app
2 parents 615f1f4 + 7379333 commit fd35691

File tree

21 files changed

+420
-38
lines changed

21 files changed

+420
-38
lines changed

pyconbalkan/core/models.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,36 @@
11
from django.db import models
22

33

4-
class SingleActiveModel(models.Model):
4+
class Person(models.Model):
5+
full_name = models.CharField(max_length=256, null=True)
6+
name = models.CharField(max_length=256, blank=True, null=True)
7+
8+
date_of_birth = models.DateField(blank=True, null=True)
9+
job = models.CharField(max_length=100, blank=True, null=True)
10+
company = models.CharField(max_length=100, blank=True, null=True)
11+
personal_website = models.URLField(blank=True, null=True)
12+
linkedin = models.URLField(blank=True, null=True)
13+
facebook = models.URLField(blank=True, null=True)
14+
twitter = models.URLField(blank=True, null=True)
15+
16+
class Meta:
17+
abstract = True
18+
19+
def __str__(self):
20+
return self.name
21+
22+
class ActiveModel(models.Model):
523
active = models.BooleanField(default=False)
624

725
class Meta:
826
abstract = True
927

28+
29+
class SingleActiveModel(ActiveModel):
30+
31+
class Meta:
32+
abstract = True
33+
1034
def save(self, *args, **kwargs):
1135
if self.active:
1236
# select all other active items

pyconbalkan/core/static/css/style.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,4 +243,20 @@ ul.countdown li div {
243243

244244
#attend {
245245
width: auto;
246+
}
247+
248+
.blue {
249+
font-weight: 900;
250+
color: #53A8DC;
251+
}
252+
253+
.yellow {
254+
font-weight: 900;
255+
color: #F9D768;
256+
}
257+
258+
.white {
259+
color: #FFFFFF;
260+
font-size: 32px;
261+
font-weight: bold;
246262
}

pyconbalkan/core/static/js/timer.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// Set the date we're counting down to
2-
var countDownDate = new Date("May 15, 2018 00:00:01").getTime();
3-
41
// Update the count down every 1 second
52
var x = setInterval(function() {
63

pyconbalkan/core/templates/home.html

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
55
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
66
<head>
7-
<title>PyCon Balkan 2018</title>
7+
<title>{{ conference.event }} {{ conference.name }} {{ conference.year }}</title>
88
<!-- Meta -->
99
<meta charset="utf-8">
1010
<meta http-equiv="X-UA-Compatible" content="IE=edge">
@@ -20,8 +20,9 @@
2020
<link rel="stylesheet" href="{% static 'css/style.css' %}">
2121

2222
<!-- Timer JS -->
23+
<!-- Set the date we're counting down to -->
24+
<script type="text/javascript"> var countDownDate = parseInt("{{ count_down.count_down|date:"U" }}".concat("000"));</script>
2325
<script src="{% static 'js/timer.js' %}" type="text/javascript"></script>
24-
<script src="{% static 'js/index.js' %}" type="text/javascript"></script>
2526

2627
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
2728
<!--[if lt IE 9]>
@@ -39,28 +40,6 @@
3940

4041
gtag('config', 'UA-118269305-1');
4142
</script>
42-
<style>
43-
body {
44-
font-family: Montserrat, sans-serif;
45-
}
46-
.blue {
47-
font-weight: 900;
48-
color: #53A8DC;
49-
}
50-
.yellow {
51-
font-weight: 900;
52-
color: #F9D768;
53-
}
54-
.black {
55-
font-size: 48px;
56-
font-weight: bold;
57-
}
58-
.white {
59-
color: #FFFFFF;
60-
font-size: 36px;
61-
font-weight: bold;
62-
}
63-
</style>
6443
</head>
6544

6645
<body>
@@ -71,9 +50,10 @@
7150
<div class="col-md-11 offset-0">
7251
<nav class="navbar navbar-light navbar-expand-md bg-faded justify-content-center">
7352
<div class="navbar navbar-header mr-auto">
74-
<a class="navbar-brand" href="#"><img src="{% static 'img/logo.jpg' %}"></a>
53+
<a class="navbar-brand" href="/#"><img src="{% static 'img/logo.jpg' %}"></a>
7554
</div>
7655
<ul class="nav navbar-nav ml-auto w-100 justify-content-end mb-5 pb-3">
56+
<li><a class="btn btn-light btn-sm round" href="/#" role="button">Home</a></li>
7757
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">News</a></li>#}
7858
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">CFP</a></li>#}
7959
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">Sponsoring</a></li>#}
@@ -84,6 +64,7 @@
8464
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">FAQ</a></li>#}
8565
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">About</a></li>#}
8666
{# <li><a class="btn btn-light btn-sm round" href="#" role="button">Contact</a></li>#}
67+
<li><a class="btn btn-light btn-sm round" href="/organizers" role="button">Organizers</a></li>
8768
<li><a class="btn btn-light btn-sm round" href="/coc" role="button">CoC</a></li>
8869
</ul>
8970
</nav>

pyconbalkan/core/views.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
from django.shortcuts import render
22

33
from pyconbalkan.conference.models import Conference, CountDown
4-
from pyconbalkan.speaker.models import Speaker, SpeakerPhoto
4+
from pyconbalkan.organizers.models import Volunteer
5+
from pyconbalkan.speaker.models import Speaker
56

67

78
def home(request):
@@ -16,3 +17,13 @@ def home(request):
1617
return render(request, 'home.html', context)
1718

1819

20+
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)
24+
context = {
25+
'volunteers': volunteers,
26+
'organizers': organizers,
27+
'conference': conference.first() if conference else None,
28+
}
29+
return render(request, 'organizers.html', context)

pyconbalkan/organizers/__init__.py

Whitespace-only changes.

pyconbalkan/organizers/admin.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from django.contrib import admin
2+
3+
from pyconbalkan.organizers.models import Volunteer, VolunteerPhoto
4+
5+
6+
class VolunteerImageInline(admin.TabularInline):
7+
model = VolunteerPhoto
8+
9+
class VolunteerAdmin(admin.ModelAdmin):
10+
inlines = [VolunteerImageInline]
11+
12+
13+
admin.site.register(Volunteer, VolunteerAdmin)

pyconbalkan/organizers/api_urls.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from rest_framework import routers
2+
3+
from pyconbalkan.organizers.views import VolunteerViewSet
4+
5+
router = routers.DefaultRouter()
6+
router.register(r'organizers', VolunteerViewSet)

pyconbalkan/organizers/apps.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.apps import AppConfig
2+
3+
4+
class OrganizationConfig(AppConfig):
5+
name = 'organizers'
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.11.11 on 2018-05-06 18:14
3+
from __future__ import unicode_literals
4+
5+
from django.conf import settings
6+
from django.db import migrations, models
7+
import django.db.models.deletion
8+
9+
10+
class Migration(migrations.Migration):
11+
12+
initial = True
13+
14+
dependencies = [
15+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
16+
]
17+
18+
operations = [
19+
migrations.CreateModel(
20+
name='Volunteer',
21+
fields=[
22+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
23+
('full_name', models.CharField(max_length=256, null=True)),
24+
('name', models.CharField(blank=True, max_length=256, null=True)),
25+
('email', models.EmailField(blank=True, max_length=254, null=True)),
26+
('date_of_birth', models.DateField(blank=True, null=True)),
27+
('job', models.CharField(blank=True, max_length=100, null=True)),
28+
('company', models.CharField(blank=True, max_length=100, null=True)),
29+
('personal_website', models.URLField(blank=True, null=True)),
30+
('linkedin', models.URLField(blank=True, null=True)),
31+
('facebook', models.URLField(blank=True, null=True)),
32+
('twitter', models.URLField(blank=True, null=True)),
33+
('active', models.BooleanField(default=False)),
34+
('type', models.IntegerField(choices=[(0, 'Organizer'), (1, 'Volunteer')], default=1)),
35+
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='volunteer', to=settings.AUTH_USER_MODEL)),
36+
],
37+
options={
38+
'abstract': False,
39+
},
40+
),
41+
migrations.CreateModel(
42+
name='VolunteerPhoto',
43+
fields=[
44+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
45+
('profile_picture', models.ImageField(upload_to='static/img')),
46+
('volunteer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='images', to='organizers.Volunteer')),
47+
],
48+
),
49+
]

0 commit comments

Comments
 (0)