Skip to content

Commit

Permalink
Alter Event fields
Browse files Browse the repository at this point in the history
Increase char limit of note_field to 100, add (optional) long description
  • Loading branch information
Compizfox committed Dec 21, 2017
1 parent fd677b3 commit d9a8e8c
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/forms/EventForm.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class Meta:
fields = [
'name',
'description',
'long_description',
'committee',
'start_at',
'end_at',
Expand All @@ -41,6 +42,7 @@ class Meta:
labels = {
'name': _('Naam'),
'description': _("Beschrijving"),
'long_description': _("Lange beschrijving"),
'committee': _("Commissie"),
'start_at': _("Begindatumtijd"),
'end_at': _("Einddatumtijd"),
Expand Down
28 changes: 28 additions & 0 deletions app/migrations/0013_auto_20171221_2234.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 2.0 on 2017-12-21 21:34

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('app', '0012_auto_20171023_1947'),
]

operations = [
migrations.AddField(
model_name='event',
name='long_description',
field=models.TextField(blank=True),
),
migrations.AlterField(
model_name='event',
name='note_field',
field=models.CharField(blank=True, default='', max_length=100),
),
migrations.AlterField(
model_name='user',
name='last_name',
field=models.CharField(blank=True, max_length=150, verbose_name='last name'),
),
]
3 changes: 2 additions & 1 deletion app/models/Event.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
class Event(models.Model):
name = models.CharField(max_length=25)
description = models.TextField(max_length=255)
long_description = models.TextField(blank=True)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
published_at = models.DateTimeField(default=timezone.now, blank=True)
deadline_at = models.DateTimeField()
start_at = models.DateTimeField()
end_at = models.DateTimeField()
note_field = models.CharField(max_length=25, default='', blank=True)
note_field = models.CharField(max_length=100, default='', blank=True)
note_field_options = CommaSeparatedStringsField(max_length=255, default='', blank=True)
note_field_required = models.BooleanField()
note_field_public = models.BooleanField()
Expand Down
2 changes: 1 addition & 1 deletion app/templates/event_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h1>{{ event.name }} <small>{{ event.committee.name }}</small></h1>
<p><strong>{% trans "Kosten:" %} </strong>€{{ event.price }}</p>

<br>
<p>{{ event.description }}</p>
<p>{{ event.long_description|default:event.description }}</p>

{% if event.places != None %}
<div class="progress">
Expand Down
1 change: 1 addition & 0 deletions app/templates/include/event_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ <h1>{{ heading }}</h1>

{% bootstrap_field form.name layout='horizontal' %}
{% bootstrap_field form.description layout='horizontal' %}
{% bootstrap_field form.long_description layout='horizontal' %}
{% bootstrap_field form.committee layout='horizontal' %}
{% bootstrap_field form.location layout='horizontal' %}
{% bootstrap_field form.price layout='horizontal' addon_before='€' %}
Expand Down

0 comments on commit d9a8e8c

Please sign in to comment.