diff --git a/bornhack/static_src/css/bornhack.css b/bornhack/static_src/css/bornhack.css index 4653efef..d26e0f8b 100644 --- a/bornhack/static_src/css/bornhack.css +++ b/bornhack/static_src/css/bornhack.css @@ -113,3 +113,10 @@ footer { .nav li a { padding: 30px 7px; } + +.event { + width: 100px; + display: inline-block; + margin: 0 5px; + padding: 5px; +} diff --git a/camps/migrations/0006_auto_20160804_1705.py b/camps/migrations/0006_auto_20160804_1705.py new file mode 100644 index 00000000..8ae75891 --- /dev/null +++ b/camps/migrations/0006_auto_20160804_1705.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-08-04 17:05 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('camps', '0005_auto_20160510_2011'), + ] + + operations = [ + migrations.AlterModelOptions( + name='day', + options={'ordering': ['date'], 'verbose_name': 'Day', 'verbose_name_plural': 'Days'}, + ), + ] diff --git a/program/admin.py b/program/admin.py index f85fec27..5256637a 100644 --- a/program/admin.py +++ b/program/admin.py @@ -8,6 +8,15 @@ class EventTypeAdmin(admin.ModelAdmin): pass +@admin.register(Speaker) +class SpeakerAdmin(admin.ModelAdmin): + pass + + +class SpeakerInline(admin.StackedInline): + model = Speaker.events.through + + @admin.register(Event) class EventAdmin(admin.ModelAdmin): list_display = [ @@ -15,7 +24,7 @@ class EventAdmin(admin.ModelAdmin): 'event_type', 'get_days', 'start', - 'end' + 'end', ] def get_days(self, obj): @@ -24,9 +33,9 @@ class EventAdmin(admin.ModelAdmin): for day in obj.days.all() ]) - -@admin.register(Speaker) -class SpeakerAdmin(admin.ModelAdmin): - pass + inlines = [ + SpeakerInline + ] + diff --git a/program/migrations/0002_eventtype_color.py b/program/migrations/0002_eventtype_color.py new file mode 100644 index 00000000..b7f91fc3 --- /dev/null +++ b/program/migrations/0002_eventtype_color.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-08-04 17:05 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('program', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='eventtype', + name='color', + field=models.CharField(default='#ff0000', max_length=50), + preserve_default=False, + ), + ] diff --git a/program/migrations/0003_eventtype_light_writing.py b/program/migrations/0003_eventtype_light_writing.py new file mode 100644 index 00000000..7d4dac56 --- /dev/null +++ b/program/migrations/0003_eventtype_light_writing.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-08-04 17:11 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('program', '0002_eventtype_color'), + ] + + operations = [ + migrations.AddField( + model_name='eventtype', + name='light_writing', + field=models.BooleanField(default=False), + ), + ] diff --git a/program/migrations/0004_auto_20160804_1712.py b/program/migrations/0004_auto_20160804_1712.py new file mode 100644 index 00000000..e93a05c1 --- /dev/null +++ b/program/migrations/0004_auto_20160804_1712.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-08-04 17:12 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('program', '0003_eventtype_light_writing'), + ] + + operations = [ + migrations.RenameField( + model_name='eventtype', + old_name='light_writing', + new_name='light_text', + ), + ] diff --git a/program/models.py b/program/models.py index d0d379b6..6568acc8 100644 --- a/program/models.py +++ b/program/models.py @@ -8,6 +8,8 @@ class EventType(CreatedUpdatedModel): """ Every event needs to have a type. """ name = models.CharField(max_length=100) slug = models.SlugField() + color = models.CharField(max_length=50) + light_text = models.BooleanField(default=False) def __str__(self): return self.name @@ -34,7 +36,8 @@ class Speaker(CreatedUpdatedModel): events = models.ManyToManyField( Event, related_name='speakers', - related_query_name='speaker' + related_query_name='speaker', + blank=True, ) def __str__(self): diff --git a/program/templates/program.html b/program/templates/program.html deleted file mode 100644 index 0f0890cd..00000000 --- a/program/templates/program.html +++ /dev/null @@ -1,18 +0,0 @@ -{% extends 'base.html' %} - -{% block content %} - - {% for day, events in days.items %} -