diff --git a/Makefile b/Makefile index c848c6d..04c445c 100644 --- a/Makefile +++ b/Makefile @@ -69,14 +69,18 @@ django-shell: logs: docker-compose logs -f --tail=500 -backup: - docker-compose start postgres +backup-data: docker-compose exec web ./manage.py dumpdata --natural-foreign -e auth.permission -e contenttypes -e wagtailcore.GroupCollectionPermission -e wagtailimages.rendition -e sessions -e feedler.feedlysettings > ~/publichealth.home.json zip ~/publichealth.home.json.`date +"%d%m%Y-%H%M"`.zip ~/publichealth.home.json rm ~/publichealth.home.json + +backup-images: echo "Backing up images ..." + sudo chown -R ansible media zip -ruq ~/media.zip media +backup: backup-data backup-images + django-loaddata: gunzip ~/publichealth.home.json.gz docker-compose exec web ./manage.py loaddata ~/publichealth.home.json diff --git a/ansible/inventories/production/group_vars/webservers/vars.yaml b/ansible/inventories/production/group_vars/webservers/vars.yaml index 9bb422c..ef08c51 100644 --- a/ansible/inventories/production/group_vars/webservers/vars.yaml +++ b/ansible/inventories/production/group_vars/webservers/vars.yaml @@ -21,3 +21,9 @@ django_secret_key: "{{ vault_django_secret_key }}" # Default: postgres://postgres:@postgres:5432/postgres django_postgres_url: "{{ vault_django_postgres_url }}" + +# Default: http://elasticsearch:9200 +django_elasticsearch_url: "{{ vault_django_elasticsearch_url }}" + +# Default: redis://redis:6379 +django_redis_url: "{{ vault_django_redis_url }}" diff --git a/ansible/inventories/production/group_vars/webservers/vault.yaml b/ansible/inventories/production/group_vars/webservers/vault.yaml index aa7ab1e..a7a353e 100644 --- a/ansible/inventories/production/group_vars/webservers/vault.yaml +++ b/ansible/inventories/production/group_vars/webservers/vault.yaml @@ -1,32 +1,46 @@ $ANSIBLE_VAULT;1.1;AES256 -39613133383630663164333437633037383936663266623861313565663964346232643666653332 -6165666665373661643663323337656163373631366135620a663164653335333166333865383139 -34633364623536663564363536333737316638353266316261393530386330633963336233346336 -6336383237646233630a656337626566373165313264386438636230646438353131623663666236 -62633739623431656535383166343862646133396630306264636563643536373562363163316135 -38373966323162653330316135333333643637323732663530336432383066316636303231653534 -37333765313830646662663761376266386262323437373230333231616162393961396162383732 -62633431343062316365316361343432373261623439656533393331383735646639646662653133 -36303039383339353961336664343436653066626561393761383733656664663939333233396134 -63393361396334666330376362643732326266336263393730623464333436336436313639613635 -64646237333739373137356262373666356631356632323466383363356366366366666330646230 -63386232663430386139393864626333326331323031313231346630326133353137373565326538 -36633032653637316531353131653235613331333436316365316661313835373563646534353239 -38623338373365623066613832623836626135326235623538396538366663306365666135633264 -34306464663230616538343539653663326339333437303762323066343933326634633530653565 -34663963353562363132396338623435646165393431303364623834636266373164663933633339 -32346536363330303539373461376631613863656366646437343165633464623064396231346137 -30643261346465303137306161613036336339326530306162393165363766353839316262363263 -38303236633436323830356461653234666534646363336463313064386230663763323632313563 -35396233363933333463326333633737333962353830336135386339613564343237363932306362 -31333535376630363739653433663865366566356132633032666562653234373938633031323139 -61306539376464666664316461303966613231646136623937643965326139303461616366333631 -39323638633661623064623334333864633235646131353237663361343839303537306261656131 -66656331316264636261643165643861376330633035386165626166313133376538656166353136 -31303433633134323532646132386130616431383065363832326533653535663763623733353764 -63383061653062353263383739643366363763363635663165353761623832366139643065396565 -31363435613761623538383237346431613335346437616538643462316665656337343832633937 -33663266663163306461626462626132613961626238333538666233613934346631346231363833 -36633138656563643262393764663331333237386164626230383562396663336564663134356632 -39386137343662666166326131363633353536326130396361376138363132363861313832303262 -326364356331366330393435346330373561 +31623061306338643731643236656264313365323238383734373466653131336263653365396337 +3864346638623236343833646264393366666230396662300a623038333531393836356163623731 +38633239636431653935633763316639383562366332346531316632616666346532326239313933 +6135323639373465300a343438306338653633633465363938363865333530343663383838653738 +62663439333565343565666434646438346566633933333863303361373166616339626630623930 +66646162353034623439653262386130656564613962373234633234346138386132323362323839 +66656533333537303165336634346666306436626236343561343336343135346665666539643232 +65613166373464373035373666646533316365383931623966353939393765343062306230363963 +34306538383064336137313034633764316130653536353035323030326533633431633866646463 +39376234373437313334386465623837613362666337326562396364626332356463313165653661 +32333266396261306565333061323138646531376639666264353366633033646366396634623863 +61653030353061656666326561613736356461363032333937623362363734656466323032303661 +35633635353638613632653639643232313932353232386531353737663436396531396334313837 +63633333393632356166656266643165373238333237363930333132643962636263346466366130 +62343731353939336330316363613238363136366436343732353762626263663736383863356365 +61343361303933346239323165353365626431623938326464396438316332633563663465653337 +63323862393063633965383932393930326266323237643839366231666166636265623637346264 +66326662363735373638343561643239626265643630356239653536623930313564316636303130 +65383661633130323138323330633161386138646564306636643835666333316535636665626464 +37663531646130376564346261363064323434373864663939353835376262346130393338303833 +63626539633332383930373862316237363966363566383735383162396165363662363764366530 +34646135353534306237393233383764376330313234323364363834623438363537386331343934 +63343464353862616339326565626134353661353134306431326666643635383165633964353936 +30646437616436363539346433646463666535303530653533653062376633306332366237373434 +32303964633532336430343662373731356365326366383431616631373132636136653539323037 +64366334386637623436316161613535636130363162363264663033623531633932623462343331 +31343232333064623063326666323038663839643439353166346366663934353565653433366362 +33363432383533663263663761633762366633363563623237636636386337626338653238386533 +33326632646562386134343138663937346464643733616339316162653566323865643633376537 +36343636396263353037316631333933313739316135343766666432373633363166373866333632 +62623734653863303566643331303462363137346233636130333830323333323863356538356139 +37303231663966623034323138666664326236626439383638666664363531303433636662666561 +39626265323136313037383164646636653265373832663931356237343138396638376135346636 +66666536616135386666666464303539616135333064636135346430383431303037393036353435 +65306131333532663038306136303930636661373764343736383364303266356330333661386635 +34666539636239656637353131333330346563386334306535643230353439623762343932303361 +65353163346535396563383862653963326261386531363934356266653461313437633661313035 +33643766613366643065663637663733363563663633393238623633653664386630376637643464 +61316135633961636337303735656365356437653730373965343933333433386132633061363064 +37376337356262613136633431343461333237333063623834616165643637366362393137373339 +37363430393939663734303364343064666533653363656633303966613334356363316436326438 +30336236343731656566656631323737346630363538663361303734613738303462366238386563 +31623135633062666566346561386438663031383232376562623533656437333665376439653932 +66373134303762356238323962343339386161333038353038393936306434643739396464323532 +3236 diff --git a/ansible/roles/web/templates/docker-compose.j2 b/ansible/roles/web/templates/docker-compose.j2 index 20600bf..cc637a9 100644 --- a/ansible/roles/web/templates/docker-compose.j2 +++ b/ansible/roles/web/templates/docker-compose.j2 @@ -5,39 +5,39 @@ web: volumes: - ./:/usr/src/app - {{ django_log_dir }}:/var/log/wagtail - links: - - redis - - postgres - - elasticsearch + #links: + # - redis + # - postgres + # - elasticsearch ports: - "5000:5000" environment: - DJANGO_SETTINGS_MODULE={{ django_project_name }}.settings.production - - ALLOWED_HOSTS=www.{{ allowed_domains|join(',www.') }},{{ allowed_domains }},{{ ipv4_addresses|join(':5000,') }} + - ALLOWED_HOSTS=www.{{ allowed_domains|join(',www.') }},{{ allowed_domains|join(',') }},{{ ipv4_addresses|join(':5000,') }} - SECRET_KEY={{ django_secret_key }} - MAILGUN_KEY={{ django_email_key }} - MAILGUN_DOMAIN={{ django_email_domain }} - MAILGUN_FROM={{ django_email_from }} - DATABASE_URL={{ django_postgres_url }} - - ELASTICSEARCH_URL=http://elasticsearch:9200 - - REDIS_URL=redis://redis:6379 + - REDIS_URL={{ django_redis_url }} + - ELASTICSEARCH_URL={{ django_elasticsearch_url }} - LOG_DIR=/var/log/wagtail -redis: - image: redis - command: ["redis-server", "--appendonly", "yes"] - restart: on-failure - volumes: - - {{ redis_data_dir }}:/data - ports: - - "6379:6379" -postgres: - image: postgres - ports: - - "5432:5432" -elasticsearch: - image: elasticsearch:5 - ports: - - "9200:9200" - environment: - - "ES_JAVA_OPTS=-Xms512m -Xmx512m" - mem_limit: 1g +# elasticsearch: +# image: elasticsearch:5 +# ports: +# - "9200:9200" +# environment: +# - "ES_JAVA_OPTS=-Xms512m -Xmx512m" +# mem_limit: 1g +# redis: +# image: redis +# command: ["redis-server", "--appendonly", "yes"] +# restart: on-failure +# volumes: +# - {{ redis_data_dir }}:/data +# ports: +# - "6379:6379" +# postgres: +# image: postgres +# ports: +# - "5432:5432" diff --git a/ansible/roles/web/templates/nginx.conf.j2 b/ansible/roles/web/templates/nginx.conf.j2 index 1533fc7..4493a4e 100644 --- a/ansible/roles/web/templates/nginx.conf.j2 +++ b/ansible/roles/web/templates/nginx.conf.j2 @@ -6,21 +6,14 @@ upstream wagtail-site { server localhost:5000; } server { - listen 80 default_server; server_name _; - - location / { - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Host $http_host; - proxy_redirect off; - proxy_pass http://wagtail-site; - } + listen 80 default_server; + return 301 https://$host$request_uri; } server { - listen 443 ssl default_server; server_name _; - + listen 443 ssl default_server; + ssl on; ssl_certificate /etc/certs/public-health.ch/cloudflare.pem; ssl_certificate_key /etc/certs/public-health.ch/cloudflare.key; @@ -39,7 +32,7 @@ server { access_log off; expires 36000; alias {{ release_dir }}/static/; add_header Cache-Control "public"; - add_header Access-Control-Allow-Origin https://{{ domain }}; + add_header Access-Control-Allow-Origin *; #https://{{ domain }}; } # Set a longer expiry for CACHE/, because the filenames are unique. @@ -54,18 +47,30 @@ server { alias {{ release_dir }}/static/images/favicon.ico; } - # Only serve /media/images by default, not e.g. original_images/. - location /media/images { - alias {{ release_dir }}/media/images; - access_log off; expires max; + # Directly serve media with max caching + location /media { + root {{ release_dir }}; + autoindex off; + access_log off; + expires max; add_header Cache-Control "public"; } + # Only serve media by default, not e.g. original_images/. + #location ~* ^/media { + # alias {{ release_dir }}/media; + #} + # Disable English home page (for now) - if ($host = 'public-health.ch') { + if ($host !~* 'sphc.ch') { rewrite ^/en/$ $scheme://$host/de/; } + # Redirect French home page as appropriate + if ($host = 'manifestesante.ch') { + rewrite ^/$ $scheme://$host/fr/; + } + location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; diff --git a/feedler/management/commands/invalidpage.py b/feedler/management/commands/invalidpage.py new file mode 100644 index 0000000..474df36 --- /dev/null +++ b/feedler/management/commands/invalidpage.py @@ -0,0 +1,31 @@ +from django.core.management.base import BaseCommand +from django.contrib.auth.models import User +from django.test import Client + +from wagtail.core.models import Page +from wagtail.admin.views.pages import edit + +# Scans for broken editors, via +# https://github.com/wagtail/wagtail/issues/4602 + +class Command(BaseCommand): + + def handle(self, **options): + invalid_page_ids = [] + pages = Page.objects.all() + client = Client() + # use any existing super user account + user = User.objects.get(username='oleg') + client.force_login(user) + + for page in pages: + id = page.id + # print statement to assure the script is running + print(id) + url = f'/cms/pages/{id}/edit/' + try: + response = client.get(url) + except: + invalid_pages.append(id) + + print(invalid_page_ids) diff --git a/publichealth/home/migrations/0027_auto_20191017_1715.py b/publichealth/home/migrations/0027_auto_20191017_1715.py new file mode 100644 index 0000000..dc6e4e2 --- /dev/null +++ b/publichealth/home/migrations/0027_auto_20191017_1715.py @@ -0,0 +1,25 @@ +# Generated by Django 2.1.12 on 2019-10-17 15:15 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailimages', '0001_squashed_0021'), + ('home', '0026_auto_20190625_1521'), + ] + + operations = [ + migrations.AddField( + model_name='contact', + name='color', + field=models.CharField(blank=True, default='', max_length=40), + ), + migrations.AddField( + model_name='contact', + name='logo', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image'), + ), + ] diff --git a/publichealth/home/migrations/0028_contact_style.py b/publichealth/home/migrations/0028_contact_style.py new file mode 100644 index 0000000..58512c3 --- /dev/null +++ b/publichealth/home/migrations/0028_contact_style.py @@ -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=''), + ), + ] diff --git a/publichealth/home/models/snippets.py b/publichealth/home/models/snippets.py index 1cb0037..a18f9ca 100644 --- a/publichealth/home/models/snippets.py +++ b/publichealth/home/models/snippets.py @@ -7,6 +7,7 @@ from django.db import models from wagtail.snippets.models import register_snippet from wagtail.core.models import Page +from wagtail.images.edit_handlers import ImageChooserPanel from wagtail.admin.edit_handlers import FieldPanel, PageChooserPanel from .forms import ContactForm @@ -63,11 +64,21 @@ class Contact(models.Model): 'title_fr', 'title_en', ) + address = models.TextField(default="", blank=True) phone = models.CharField(max_length=40, blank=True, default="") 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', + null=True, blank=True, + on_delete=models.SET_NULL, + related_name='+' + ) + map_url = models.URLField(null=True, blank=True, help_text="Optional link of address to mapping provider") analytics = models.CharField(max_length=60, default="", blank=True, @@ -95,6 +106,9 @@ class Contact(models.Model): FieldPanel('phone'), FieldPanel('email'), FieldPanel('www'), + ImageChooserPanel('logo'), + FieldPanel('color'), + FieldPanel('style'), FieldPanel('map_url'), FieldPanel('analytics'), PageChooserPanel('contact_form', 'home.ContactForm'), diff --git a/publichealth/home/templates/puput/blog_page.html b/publichealth/home/templates/puput/blog_page.html index a7cfd8a..2966d1a 100644 --- a/publichealth/home/templates/puput/blog_page.html +++ b/publichealth/home/templates/puput/blog_page.html @@ -24,9 +24,17 @@ + + + {% endblock social_share %} {% block blog_content %} +
+
+
+ {% with per_page=blog_page.num_entries_page %} {# 'paginate' tag cannot render dotted variables, so we need to create a context var #} {% paginate per_page entries %} @@ -44,44 +52,39 @@ {% endif %} {% endfor %} {% endif %} -
-
- {% if entry.header_image %} - - {% image entry.header_image fill-800x240 as header_image %} - {{ entry.header_image.title }} - - {% endif %} - -
-
-

{{ entry.title }}

- {% if entry.excerpt %} - {{ entry.excerpt|richtext }} - {% else %} - {{ entry.body|richtext|truncatewords_html:70 }} - {% endif %} -
- - -
-
-
+ {% if forloop.counter0|divisibleby:3 %} +
+
+
{% endblock blog_content %} diff --git a/publichealth/home/templates/puput/entry_page.html b/publichealth/home/templates/puput/entry_page.html index a55e172..9c8c111 100644 --- a/publichealth/home/templates/puput/entry_page.html +++ b/publichealth/home/templates/puput/entry_page.html @@ -1,5 +1,5 @@ {% extends "puput/base.html" %} -{% load i18n wagtailcore_tags wagtailimages_tags puput_tags social_share %} +{% load i18n wagtailcore_tags wagtailimages_tags puput_tags wagtailroutablepage_tags social_share %} {% block title %} {{ self.title }} | {{ blog_page.title }} @@ -43,47 +43,70 @@ {% block blog_content %} +
+ {% categories_list self.categories %} +
+ +

{{ self.title }}

+ + + +

+{{ self.excerpt|safe }} +

+ {% if self.header_image %}
{% image self.header_image fill-940x400 class="img-responsive" %}
{% endif %} -

{{ self.title }}

- -
- {% include 'puput/entry_links.html' with entry=self %} -
- {{ self.body|richtext}} -
- - {% entry_url self blog_page as post_url %} - +
+
+ {{ self.body|richtext}} +
+ + {% entry_url self blog_page as post_url %} + +
-
- {% show_comments %} -
+
+ {% show_comments %} +
{% endblock blog_content %} {% block extra_content %} diff --git a/publichealth/home/templates/tags/contact_info.html b/publichealth/home/templates/tags/contact_info.html index 5019feb..3120ba1 100644 --- a/publichealth/home/templates/tags/contact_info.html +++ b/publichealth/home/templates/tags/contact_info.html @@ -1,3 +1,5 @@ +{% load wagtailimages_tags %} +

{% if contact.map_url %} @@ -19,6 +21,25 @@ {% endfor %} + + {% if contact.is_google_analytics %} diff --git a/publichealth/home/templatetags/information.py b/publichealth/home/templatetags/information.py index 01be1e4..133a7ea 100644 --- a/publichealth/home/templatetags/information.py +++ b/publichealth/home/templatetags/information.py @@ -6,23 +6,22 @@ from ..models.snippets import Contact, SocialContact register = template.Library() -def get_contacts(site_root): - if not site_root: return {} - site = site_root.get_site() +def get_contacts(the_site): + if not the_site: return {} # Selected or default contact snippet - top_contact = Contact.objects.filter(home_site=site) + top_contact = Contact.objects.filter(home_site=the_site) if top_contact.exists(): - top_contact = top_contact.last() + top_contact = top_contact.first() else: default_contact = Contact.objects.filter(home_site=None) if default_contact.exists(): - top_contact = default_contact.last() + top_contact = default_contact.first() else: - top_contact = Contact.objects.last() + top_contact = Contact.objects.first() # Selected or default social contact snippet - social_contacts = SocialContact.objects.filter(home_site=site) + social_contacts = SocialContact.objects.filter(home_site=the_site) if social_contacts.exists(): social_contacts = social_contacts.all() else: @@ -38,24 +37,24 @@ def get_contacts(site_root): # Contact information (footer) @register.inclusion_tag('tags/contact_info.html') -def contact_info(site_root): - return get_contacts(site_root) +def contact_info(the_site): + return get_contacts(the_site) # Contact form (footer) @register.inclusion_tag('tags/footer_form.html') -def footer_form(site_root): - cc = get_contacts(site_root) +def footer_form(the_site): + cc = get_contacts(the_site) if cc['contact']: return { 'form': cc['contact'].contact_form } return None # Contact links (header) @register.inclusion_tag('tags/contact_links.html') -def contact_links(site_root): - return get_contacts(site_root) +def contact_links(the_site): + return get_contacts(the_site) # Styled contact name (header) @register.inclusion_tag('tags/contact_name.html') -def contact_name(site_root, html=True): - contactname = get_contacts(site_root)['contact'] +def contact_name(the_site, html=True): + contactname = get_contacts(the_site)['contact'] return { 'contact': contactname, 'html': html } diff --git a/publichealth/home/templatetags/navigation.py b/publichealth/home/templatetags/navigation.py index be2ebce..b94c7df 100644 --- a/publichealth/home/templatetags/navigation.py +++ b/publichealth/home/templatetags/navigation.py @@ -33,11 +33,15 @@ def language_switcher(context): 'request': context['request'], } +@register.simple_tag(takes_context=True) +def get_site(context): + return context['request'].site + @register.simple_tag(takes_context=True) def get_site_root(context): # NB this returns a core.Page, not the implementation-specific model used # so object-comparison to self will return false as objects would differ - return context['request'].site.root_page + return get_site(context).root_page def has_menu_children(page): return page.get_children().live().in_menu().exists() diff --git a/publichealth/settings/base.py b/publichealth/settings/base.py index 7e5470b..01d7518 100644 --- a/publichealth/settings/base.py +++ b/publichealth/settings/base.py @@ -43,7 +43,7 @@ INSTALLED_APPS = [ 'wagtail.contrib.forms', 'wagtail.contrib.redirects', 'wagtail.contrib.search_promotions', - + 'wagtail.embeds', 'wagtail.sites', 'wagtail.users', @@ -198,6 +198,12 @@ COMPRESS_PRECOMPILERS = [ WAGTAIL_SITE_NAME = "Public Health Schweiz" +WAGTAILADMIN_RICH_TEXT_EDITORS = { + 'default': { + 'WIDGET': 'wagtail.admin.rich_text.HalloRichTextArea' + } +} + # Puput settings PUPUT_AS_PLUGIN = True diff --git a/publichealth/static/css/main.scss b/publichealth/static/css/main.scss index 990689d..c1bb80d 100644 --- a/publichealth/static/css/main.scss +++ b/publichealth/static/css/main.scss @@ -56,35 +56,74 @@ $slider-nav: 200px; .language-nav a[lang='en'] { display: none; } // Disable metas and override blog styles -.blog-page .sidebar .meta { display: none; } -.blog-page section { padding: 0; } -.blog-page .blog-tags ul { padding: 0; } -.blog-page ul.sidebar { background: transparent; } -.blog-page .searchTerm { +.blog-page { + padding-top: 1em; + + .sidebar .meta { display: none; } + ul.sidebar { background: transparent; } + + section { padding: 0; } + .blog-tags ul { padding: 0; } + + .searchTerm { + text-transform: uppercase; + font-weight: bold; + // background: #fff; + margin-bottom: 0px; + } + .searchDescription { + // background: #fff; + margin-bottom: 20px; + padding: 0 20px 20px; + line-height: normal; + color: #555; + } + .social-item { + font-size: 70%; + background: #2643A9 !important; + } + + h1.title { + margin-bottom: 0; + } + ul.links { + margin: 0; padding: 0; + display: block; + text-align: center; + } + + .blog-entry { + a { + text-decoration: none; + color: black; + } + .panel img { + width: 100%; height: auto; + } + .entry-category, .entry-meta { + font-size: 80%; + color: #777; + text-transform: uppercase; + } + } +} +.blog-header { + a { + color: white !important; + text-shadow: 1px 1px 2px black; + text-decoration: none; + } + .lead { + color: white; + font-size: 100%; + } +} +.blog .entry-categories { + text-align: center; text-transform: uppercase; - font-weight: bold; - background: #fff; - margin-bottom: 0px; -} -.blog-page .searchDescription { - background: #fff; - margin-bottom: 20px; - padding: 0 20px 20px; - line-height: normal; - color: #555; -} -.blog-page .social-item { - font-size: 70%; - background: #2643A9 !important; -} -.blog-header a { - color: white !important; - text-shadow: 1px 1px 2px black; - text-decoration: none; -} -.blog-header .lead { - color: white; - font-size: 100%; + a { color: #555; font-weight: bold; } + li { list-style: none; margin: 0; padding: 0; } + ul { list-style: none; margin: 0; padding: 1em 0 0; } } @import "subsites"; diff --git a/publichealth/static/css/modules/_news.scss b/publichealth/static/css/modules/_news.scss index 33a54f6..56bc53b 100644 --- a/publichealth/static/css/modules/_news.scss +++ b/publichealth/static/css/modules/_news.scss @@ -149,7 +149,5 @@ padding: 1em; margin: 0em; list-style-type: none; - - li:first-child { display: none; } } } diff --git a/publichealth/static/css/subsites.scss b/publichealth/static/css/subsites.scss index 44e3202..488d854 100644 --- a/publichealth/static/css/subsites.scss +++ b/publichealth/static/css/subsites.scss @@ -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 diff --git a/publichealth/templates/base.html b/publichealth/templates/base.html index 98565b2..f867fba 100644 --- a/publichealth/templates/base.html +++ b/publichealth/templates/base.html @@ -1,11 +1,12 @@ {% load compress static wagtailuserbar navigation information %} {% get_site_root as site_root %} +{% get_site as the_site %} - {% block title %}{% if self.seo_title %}{{ self.seo_title }}{% else %}{% if page.trans_title %}{{ page.trans_title }} - {% endif %}{% contact_name site_root=site_root html=False %}{% endif %}{% endblock %}{% block title_suffix %}{% endblock %} + {% block title %}{% if self.seo_title %}{{ self.seo_title }}{% else %}{% if page.trans_title %}{{ page.trans_title }} - {% endif %}{% contact_name the_site=the_site html=False %}{% endif %}{% endblock %}{% block title_suffix %}{% endblock %} @@ -29,13 +30,13 @@ {% include 'footer.html' %} - {% block extra_js %} - - - - - - {% endblock %} + + + + + + + {% block extra_js %}{% endblock %} {% compress js %} diff --git a/publichealth/templates/footer.html b/publichealth/templates/footer.html index b899709..63adb4e 100644 --- a/publichealth/templates/footer.html +++ b/publichealth/templates/footer.html @@ -1,5 +1,5 @@ {% load static wagtailcore_tags navigation information %} -{% get_site_root as site_root %} +{% get_site as the_site %}

diff --git a/publichealth/templates/header.html b/publichealth/templates/header.html index 2a95ba6..2f4033f 100644 --- a/publichealth/templates/header.html +++ b/publichealth/templates/header.html @@ -1,5 +1,6 @@ {% load static wagtailcore_tags navigation information %} {% get_site_root as site_root %} +{% get_site as the_site %}