diff --git a/mockup/assets/libs b/mockup/assets/libs deleted file mode 120000 index 2ce3479..0000000 --- a/mockup/assets/libs +++ /dev/null @@ -1 +0,0 @@ -../../../static/libs \ No newline at end of file diff --git a/mockup/images b/mockup/images deleted file mode 120000 index 5e67573..0000000 --- a/mockup/images +++ /dev/null @@ -1 +0,0 @@ -../images \ No newline at end of file diff --git a/publichealth/static/images/banner_0.jpg b/mockup/images/banner_0.jpg similarity index 100% rename from publichealth/static/images/banner_0.jpg rename to mockup/images/banner_0.jpg diff --git a/publichealth/static/images/banner_1.jpg b/mockup/images/banner_1.jpg similarity index 100% rename from publichealth/static/images/banner_1.jpg rename to mockup/images/banner_1.jpg diff --git a/publichealth/static/images/banner_2.jpg b/mockup/images/banner_2.jpg similarity index 100% rename from publichealth/static/images/banner_2.jpg rename to mockup/images/banner_2.jpg diff --git a/publichealth/static/images/banner_3.jpg b/mockup/images/banner_3.jpg similarity index 100% rename from publichealth/static/images/banner_3.jpg rename to mockup/images/banner_3.jpg diff --git a/publichealth/static/images/banner_4.jpg b/mockup/images/banner_4.jpg similarity index 100% rename from publichealth/static/images/banner_4.jpg rename to mockup/images/banner_4.jpg diff --git a/publichealth/static/images/ipad.jpg b/mockup/images/ipad.jpg similarity index 100% rename from publichealth/static/images/ipad.jpg rename to mockup/images/ipad.jpg diff --git a/publichealth/static/images/konf.jpg b/mockup/images/konf.jpg similarity index 100% rename from publichealth/static/images/konf.jpg rename to mockup/images/konf.jpg diff --git a/publichealth/static/images/lit.jpg b/mockup/images/lit.jpg similarity index 100% rename from publichealth/static/images/lit.jpg rename to mockup/images/lit.jpg diff --git a/publichealth/static/images/news_1.jpg b/mockup/images/news_1.jpg similarity index 100% rename from publichealth/static/images/news_1.jpg rename to mockup/images/news_1.jpg diff --git a/publichealth/static/images/public-health-bg.png b/mockup/images/public-health-bg.png similarity index 100% rename from publichealth/static/images/public-health-bg.png rename to mockup/images/public-health-bg.png diff --git a/publichealth/static/images/public-health-logo.png b/mockup/images/public-health-logo.png similarity index 100% rename from publichealth/static/images/public-health-logo.png rename to mockup/images/public-health-logo.png diff --git a/publichealth/static/images/steth.jpg b/mockup/images/steth.jpg similarity index 100% rename from publichealth/static/images/steth.jpg rename to mockup/images/steth.jpg diff --git a/publichealth/static/images/thumb_news_1.jpg b/mockup/images/thumb_news_1.jpg similarity index 100% rename from publichealth/static/images/thumb_news_1.jpg rename to mockup/images/thumb_news_1.jpg diff --git a/publichealth/static/images/thumb_news_2.jpg b/mockup/images/thumb_news_2.jpg similarity index 100% rename from publichealth/static/images/thumb_news_2.jpg rename to mockup/images/thumb_news_2.jpg diff --git a/publichealth/home/migrations/0016_socialcontact.py b/publichealth/home/migrations/0016_socialcontact.py new file mode 100644 index 0000000..ff5a64c --- /dev/null +++ b/publichealth/home/migrations/0016_socialcontact.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2017-05-05 08:43 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('home', '0015_dataletssettings'), + ] + + operations = [ + migrations.CreateModel( + name='SocialContact', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('network', models.CharField(choices=[('twitter', 'Twitter'), ('facebook', 'Facebook')], default='twitter', max_length=16)), + ('profile', models.CharField(default='', help_text='Name of the account, e.g. @myaccount', max_length=255)), + ], + ), + ] diff --git a/publichealth/home/models/snippets.py b/publichealth/home/models/snippets.py index f9f1255..f8b261b 100644 --- a/publichealth/home/models/snippets.py +++ b/publichealth/home/models/snippets.py @@ -11,8 +11,44 @@ from wagtail.wagtailadmin.edit_handlers import FieldPanel from ..util import TranslatedField +# List of supported social networks +SOCIAL_NETWORK_SUPPORTED = ( + ('twitter', 'Twitter'), + ('facebook', 'Facebook'), +) + +@register_snippet +class SocialContact(models.Model): + """ + Adds contact options through social networks + """ + network = models.CharField(max_length=16, default="twitter", + choices=SOCIAL_NETWORK_SUPPORTED) + profile = models.CharField(max_length=255, default="", + help_text="Name of the account, e.g. @myaccount, or full URL") + panels = [ + FieldPanel('network'), + FieldPanel('profile'), + ] + social_networks = dict(SOCIAL_NETWORK_SUPPORTED) + def network_title(self): + return self.social_networks[self.network] + def network_url(self): + if '://' in self.profile: + return self.profile + if self.network == 'twitter': + return "https://twitter.com/%s" % self.profile + elif self.network == 'facebook': + return "https://facebook.com/%s" % self.profile + return "#" + def __str__(self): + return "%s" % self.network + @register_snippet class Contact(models.Model): + """ + Defines contact options for the organisation, usually shown in footer + """ title = models.CharField(max_length=255, default="") title_fr = models.CharField(max_length=255, default="") trans_title = TranslatedField( diff --git a/publichealth/home/templates/tags/contact_info.html b/publichealth/home/templates/tags/contact_info.html index dbecca3..48af078 100644 --- a/publichealth/home/templates/tags/contact_info.html +++ b/publichealth/home/templates/tags/contact_info.html @@ -6,3 +6,11 @@ {{ contact.email }}
{{ contact.www_domain }}

+ +
+{% for sc in socials %} + + {{ sc.network_title }} +{% endfor %} +
diff --git a/publichealth/home/templates/tags/contact_links.html b/publichealth/home/templates/tags/contact_links.html index 1fbe73f..324ec8a 100644 --- a/publichealth/home/templates/tags/contact_links.html +++ b/publichealth/home/templates/tags/contact_links.html @@ -1,7 +1,15 @@ + +{% for sc in socials %} + + {{ sc.network_title }} +{% endfor %} + + - + diff --git a/publichealth/home/templatetags/information.py b/publichealth/home/templatetags/information.py index 090ce05..564a230 100644 --- a/publichealth/home/templatetags/information.py +++ b/publichealth/home/templatetags/information.py @@ -2,7 +2,7 @@ from django import template from django.utils import translation -from ..models.snippets import Contact +from ..models.snippets import Contact, SocialContact register = template.Library() @@ -11,6 +11,7 @@ register = template.Library() def contact_info(): return { 'contact': Contact.objects.last(), + 'socials': SocialContact.objects.all() } # Contact form (footer) @@ -25,6 +26,7 @@ def contact_form(): def contact_links(): return { 'contact': Contact.objects.last(), + 'socials': SocialContact.objects.all() } # Styled contact name (header) diff --git a/publichealth/static/css/modules/_footer.scss b/publichealth/static/css/modules/_footer.scss index 0ab3683..4af75a3 100644 --- a/publichealth/static/css/modules/_footer.scss +++ b/publichealth/static/css/modules/_footer.scss @@ -23,3 +23,38 @@ footer#footer { article footer .btn { margin-bottom: 1em; } + +// Footer search form +#search-form { + + input { + float: left; + width: auto; + color: white; + } + button { + background: none; border: none; + padding-top: 0.5em; + } + +} + +// Footer contact form +#contact-info { + address { + margin-bottom: 0px; + } + .social-networks > a { + border: 2px solid white; + width: 32px; height: 32px; + } +} + +.social-networks > a { + width: 14px; height: 14px; + font-size: 0px !important; + display: inline-block; + background-size: auto 70%; + background-repeat: no-repeat; + background-position: center; +} diff --git a/publichealth/static/css/modules/_forms.scss b/publichealth/static/css/modules/_forms.scss index 50a9d53..1b90782 100644 --- a/publichealth/static/css/modules/_forms.scss +++ b/publichealth/static/css/modules/_forms.scss @@ -47,6 +47,7 @@ } +// Search result form #search-page { input[type='text'] { font-size: 110%; diff --git a/publichealth/static/images/social/facebook.png b/publichealth/static/images/social/facebook.png new file mode 100644 index 0000000..01837d2 Binary files /dev/null and b/publichealth/static/images/social/facebook.png differ diff --git a/publichealth/static/images/social/twitter.png b/publichealth/static/images/social/twitter.png new file mode 100644 index 0000000..5dfb627 Binary files /dev/null and b/publichealth/static/images/social/twitter.png differ diff --git a/publichealth/templates/header.html b/publichealth/templates/header.html index bf2bb2f..ca961e5 100644 --- a/publichealth/templates/header.html +++ b/publichealth/templates/header.html @@ -1,4 +1,4 @@ -{% load wagtailcore_tags navigation information %} +{% load static wagtailcore_tags navigation information %} {% get_site_root as site_root %}