make the colours more visible on the camp list page, set camp colours in bootstrap script, add a light_text property to Camp model

This commit is contained in:
Thomas Steen Rasmussen 2018-08-18 17:45:33 +02:00
parent 84fff61ddb
commit 7dd52c78ee
4 changed files with 27 additions and 4 deletions

View file

@ -0,0 +1,18 @@
# Generated by Django 2.0.4 on 2018-08-18 15:39
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('camps', '0029_auto_20180815_2018'),
]
operations = [
migrations.AddField(
model_name='camp',
name='light_text',
field=models.BooleanField(default=True, help_text='Check if this camps colour requires white text, uncheck if black text is better'),
),
]

View file

@ -68,6 +68,11 @@ class Camp(CreatedUpdatedModel, UUIDModel):
max_length=7 max_length=7
) )
light_text = models.BooleanField(
default=True,
help_text='Check if this camps colour requires white text, uncheck if black text is better',
)
call_for_participation_open = models.BooleanField( call_for_participation_open = models.BooleanField(
help_text='Check if the Call for Participation is open for this camp', help_text='Check if the Call for Participation is open for this camp',
default=False, default=False,

View file

@ -24,7 +24,7 @@
<td>{{ listcamp.buildup.lower }} to {{ listcamp.buildup.upper }}</td> <td>{{ listcamp.buildup.lower }} to {{ listcamp.buildup.upper }}</td>
<td>{{ listcamp.camp.lower }} to {{ listcamp.camp.upper }}</td> <td>{{ listcamp.camp.lower }} to {{ listcamp.camp.upper }}</td>
<td>{{ listcamp.teardown.lower }} to {{ listcamp.teardown.upper }}</td> <td>{{ listcamp.teardown.lower }} to {{ listcamp.teardown.upper }}</td>
<td><font color="{{ listcamp.colour }}">{{ listcamp.colour }}</font></td> <td style="background: {{ listcamp.colour }}">{% if listcamp.light_text %}<font color="#ffffff">{% else %}<font color="#000000">{% endif %}{{ listcamp.colour }}</font></td>
</tr> </tr>
</a> </a>
{% empty %} {% empty %}

View file

@ -61,7 +61,7 @@ class Command(BaseCommand):
timezone.datetime(2016, 9, 4, 12, 0, tzinfo=timezone.utc), timezone.datetime(2016, 9, 4, 12, 0, tzinfo=timezone.utc),
timezone.datetime(2016, 9, 6, 12, 0, tzinfo=timezone.utc), timezone.datetime(2016, 9, 6, 12, 0, tzinfo=timezone.utc),
), ),
colour='#000000', colour='#004dff',
) )
camp2017 = Camp.objects.create( camp2017 = Camp.objects.create(
@ -81,7 +81,7 @@ class Command(BaseCommand):
timezone.datetime(2017, 9, 4, 12, 0, tzinfo=timezone.utc), timezone.datetime(2017, 9, 4, 12, 0, tzinfo=timezone.utc),
timezone.datetime(2017, 9, 6, 12, 0, tzinfo=timezone.utc), timezone.datetime(2017, 9, 6, 12, 0, tzinfo=timezone.utc),
), ),
colour='#000000', colour='#750787',
) )
camp2018 = Camp.objects.create( camp2018 = Camp.objects.create(
@ -103,7 +103,7 @@ class Command(BaseCommand):
timezone.datetime(2018, 9, 4, 12, 0, tzinfo=timezone.utc), timezone.datetime(2018, 9, 4, 12, 0, tzinfo=timezone.utc),
timezone.datetime(2018, 9, 6, 12, 0, tzinfo=timezone.utc), timezone.datetime(2018, 9, 6, 12, 0, tzinfo=timezone.utc),
), ),
colour='#000000', colour='#008026',
) )
self.output("Creating users...") self.output("Creating users...")