diff --git a/bornhack/static_src/css/bornhack.css b/bornhack/static_src/css/bornhack.css index b9660a9d..62674b9b 100644 --- a/bornhack/static_src/css/bornhack.css +++ b/bornhack/static_src/css/bornhack.css @@ -122,3 +122,9 @@ footer { padding: 5px; flex: 1 1 auto; } + +.event:hover { + background-color: black !important; + color: white !important; + text-decoration: none; +} diff --git a/program/migrations/0005_auto_20160807_1312.py b/program/migrations/0005_auto_20160807_1312.py new file mode 100644 index 00000000..ffe56c25 --- /dev/null +++ b/program/migrations/0005_auto_20160807_1312.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-08-07 13:12 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('program', '0004_auto_20160804_1712'), + ] + + operations = [ + migrations.AddField( + model_name='event', + name='slug', + field=models.SlugField(default='', blank=True), + preserve_default=False, + ), + migrations.AlterField( + model_name='speaker', + name='events', + field=models.ManyToManyField(blank=True, related_name='speakers', related_query_name='speaker', to='program.Event'), + ), + ] diff --git a/program/migrations/0006_auto_20160807_1320.py b/program/migrations/0006_auto_20160807_1320.py new file mode 100644 index 00000000..e26841e8 --- /dev/null +++ b/program/migrations/0006_auto_20160807_1320.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-08-07 13:20 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('program', '0005_auto_20160807_1312'), + ] + + operations = [ + migrations.AlterField( + model_name='event', + name='slug', + field=models.SlugField(blank=True, max_length=255), + ), + ] diff --git a/program/migrations/0007_auto_20160807_1333.py b/program/migrations/0007_auto_20160807_1333.py new file mode 100644 index 00000000..fe9ba2a2 --- /dev/null +++ b/program/migrations/0007_auto_20160807_1333.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-08-07 13:33 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('program', '0006_auto_20160807_1320'), + ] + + operations = [ + migrations.RenameField( + model_name='event', + old_name='description', + new_name='abstract', + ), + ] diff --git a/program/models.py b/program/models.py index 6568acc8..a1b5ba29 100644 --- a/program/models.py +++ b/program/models.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals from django.db import models +from django.utils.text import slugify + from utils.models import CreatedUpdatedModel @@ -18,7 +20,8 @@ class EventType(CreatedUpdatedModel): class Event(CreatedUpdatedModel): """ Something that is on the program. """ title = models.CharField(max_length=255) - description = models.TextField() + slug = models.SlugField(blank=True, max_length=255) + abstract = models.TextField() event_type = models.ForeignKey(EventType) days = models.ManyToManyField('camps.Day') start = models.TimeField() @@ -27,6 +30,11 @@ class Event(CreatedUpdatedModel): def __str__(self): return self.title + def save(self, **kwargs): + if not self.slug: + self.slug = slugify(self.title) + super(Event, self).save(**kwargs) + class Speaker(CreatedUpdatedModel): """ Person anchoring an event. """ diff --git a/program/templates/program_day.html b/program/templates/program_day.html index bbd2eece..fab9de23 100644 --- a/program/templates/program_day.html +++ b/program/templates/program_day.html @@ -9,12 +9,13 @@