Commit 6ebdb52c authored by gijs's avatar gijs

A description field for the event.

parent 882dae7f
......@@ -105,6 +105,10 @@ class EventInline(nested_admin.NestedStackedInline):
(None, {
'fields': (('published', 'continuous'), ('event_type', 'venue', 'show_hours'), (('start'), ('end')))
}),
('Description', {
'classes': ('collapse',),
'fields': ('description_nl', 'description_en')
}),
('Tickets', {
'classes': ('collapse',),
'fields': (('show_ticket_link'), ('ticket_link', 'sold_out'))
......
# Generated by Django 2.1.1 on 2019-04-25 09:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contour', '0053_auto_20190408_1033'),
]
operations = [
migrations.AddField(
model_name='event',
name='description_en',
field=models.TextField(blank=True, null=True, verbose_name='Description (English)'),
),
migrations.AddField(
model_name='event',
name='description_nl',
field=models.TextField(blank=True, null=True, verbose_name='Description'),
),
]
......@@ -156,6 +156,8 @@ class Event(models.Model):
project = models.ForeignKey(Project, on_delete=models.CASCADE)
event_type = models.ForeignKey(EventType, on_delete=models.SET_NULL, null=True)
venue = models.ForeignKey(Venue, on_delete=models.SET_NULL, null=True)
description_nl = models.TextField(null=True, blank=True, verbose_name="Description")
description_en = models.TextField(null=True, blank=True, verbose_name="Description (English)")
notes_nl = models.TextField(null=True, blank=True)
notes_en = models.TextField(verbose_name="Notes (English)", null=True, blank=True)
start = models.DateTimeField(null=True, blank=True)
......@@ -195,7 +197,7 @@ class Event(models.Model):
return str(self.start)
def __getattr__ (self, attrname):
if attrname in ['notes']:
if attrname in ['notes', 'description']:
return getattr(self, attrname + '_' + get_language())
return super().__getattr__(attrname)
......
......@@ -249,12 +249,16 @@
border-right: 2px solid black;
overflow-y: auto;
}
.exerpt {
.event-description, .exerpt {
font-family: "Syne";
font-weight: 700;
font-size: 1em;
}
.event-description {
margin-bottom: 2em;
}
.description p {
line-height: 1.15em;
margin-bottom: 1.15em;
......
......@@ -126,7 +126,13 @@
</div>
</div>
<div class="scroll-wrapper">
<div class="description" {% if event.project.summary %}data-toggleable{% endif %}>
{% if event.description %}
<section class="event-description">
{{ event.description|markdown }}
</section>
{% endif %}
{% if event.project.summary %}<section class="exerpt">{{ event.project.summary|markdown }}</section>{% endif %}
<section class="expanded">
{{ event.project.description|markdown }}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment