Added style field to contact

This commit is contained in:
Oleg Lavrovsky 2019-10-21 20:24:16 +02:00
parent 4efbdecdfc
commit d1c2b145b9
4 changed files with 23 additions and 19 deletions

View File

@ -0,0 +1,18 @@
# Generated by Django 2.1.13 on 2019-10-21 18:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('home', '0027_auto_20191017_1715'),
]
operations = [
migrations.AddField(
model_name='contact',
name='style',
field=models.TextField(blank=True, default=''),
),
]

View File

@ -70,6 +70,7 @@ class Contact(models.Model):
email = models.EmailField(max_length=100, blank=True, default="")
www = models.URLField(null=True, blank=True)
style = models.TextField(default="", blank=True)
color = models.CharField(max_length=40, blank=True, default="")
logo = models.ForeignKey(
'wagtailimages.Image',
@ -107,6 +108,7 @@ class Contact(models.Model):
FieldPanel('www'),
ImageChooserPanel('logo'),
FieldPanel('color'),
FieldPanel('style'),
FieldPanel('map_url'),
FieldPanel('analytics'),
PageChooserPanel('contact_form', 'home.ContactForm'),

View File

@ -22,6 +22,7 @@
</div>
<style type="text/css">
{{ contact.style }}
{% if contact.color %}
footer#footer, .navbar-pre {
background-color: {{ contact.color }};

View File

@ -1,3 +1,5 @@
// TODO: delete this file and references to it once styles are migrated.
// Only show news on the main home page
#news { display: none; }
.site-home #news { display: block; }
@ -20,25 +22,6 @@
#carousel-banner .carousel-caption > * { display: none; }
#carousel-banner .carousel-caption { display: none; }
/*
#carousel-banner .carousel-caption {
width: 13em;
background: rgba(0,0,50,0.4);
border: 6px solid white;
font-size: 155%;
padding: 1em 1em;
left: 50%;
margin-left: -6.5em;
bottom: 2em;
}
#carousel-banner .carousel-caption:before {
content: 'SPHC 2018'; display: block;
}
#carousel-banner .carousel-caption:after {
content: 'Better Health Faster';
}
*/
}
// -site-sphc