diff --git a/datacenterlight/cms_models.py b/datacenterlight/cms_models.py index 20e39fde..a424c27c 100644 --- a/datacenterlight/cms_models.py +++ b/datacenterlight/cms_models.py @@ -120,6 +120,26 @@ class DCLLinkPluginModel(CMSPlugin): ) +class DCLNavbarPluginModel(CMSPlugin): + logo_light = FilerImageField( + on_delete=models.CASCADE, null=True, blank=True, + help_text='Logo to be used on transparent navbar' + ) + logo_dark = FilerImageField( + on_delete=models.CASCADE, null=True, blank=True, + help_text='Logo to be used on white navbar' + ) + logo_url = models.URLField(max_length=300, null=True, blank=True) + + def get_logo_dark(self): + # used only if atleast one logo exists + return self.logo_dark.url if self.logo_dark else self.logo_white.url + + def get_logo_light(self): + # used only if atleast one logo exists + return self.logo_light.url if self.logo_light else self.logo_dark.url + + class DCLNavbarDropdownPluginModel(CMSPlugin): target = models.CharField( max_length=100, null=True, blank=True, diff --git a/datacenterlight/cms_plugins.py b/datacenterlight/cms_plugins.py index 70ecfaa2..60992889 100644 --- a/datacenterlight/cms_plugins.py +++ b/datacenterlight/cms_plugins.py @@ -1,12 +1,11 @@ from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool -from cms.models.pluginmodel import CMSPlugin from .cms_models import ( DCLBannerItemPluginModel, DCLBannerListPluginModel, DCLContactPluginModel, DCLFooterPluginModel, DCLLinkPluginModel, DCLNavbarDropdownPluginModel, DCLSectionIconPluginModel, DCLSectionImagePluginModel, - DCLSectionPluginModel, + DCLSectionPluginModel, DCLNavbarPluginModel ) from .models import VMTemplate @@ -84,7 +83,7 @@ class DCLBannerItemPlugin(CMSPluginBase): class DCLNavbarPlugin(CMSPluginBase): module = "Datacenterlight" name = "DCL Navbar Plugin" - model = CMSPlugin + model = DCLNavbarPluginModel render_template = "datacenterlight/cms/navbar.html" cache = False allow_children = True diff --git a/datacenterlight/migrations/0013_dclnavbarpluginmodel.py b/datacenterlight/migrations/0013_dclnavbarpluginmodel.py new file mode 100644 index 00000000..b02c2503 --- /dev/null +++ b/datacenterlight/migrations/0013_dclnavbarpluginmodel.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2018-03-16 09:53 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import filer.fields.image + + +class Migration(migrations.Migration): + + dependencies = [ + ('cms', '0014_auto_20160404_1908'), + ('datacenterlight', '0012_dclcalculatorpluginmodel'), + ] + + operations = [ + migrations.CreateModel( + name='DCLNavbarPluginModel', + fields=[ + ('cmsplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, + parent_link=True, primary_key=True, serialize=False, to='cms.CMSPlugin')), + ('logo_url', models.URLField(blank=True, max_length=300, null=True)), + ('logo_dark', filer.fields.image.FilerImageField(blank=True, help_text='Logo to be used on white navbar', + null=True, on_delete=django.db.models.deletion.CASCADE, to='filer.Image')), + ('logo_light', filer.fields.image.FilerImageField(blank=True, help_text='Logo to be used on transparent navbar', + null=True, on_delete=django.db.models.deletion.CASCADE, to='filer.Image')), + ], + options={ + 'abstract': False, + }, + bases=('cms.cmsplugin',), + ), + ] diff --git a/datacenterlight/static/datacenterlight/css/header-slider.css b/datacenterlight/static/datacenterlight/css/header-slider.css index 9f5161d7..e21e2b49 100644 --- a/datacenterlight/static/datacenterlight/css/header-slider.css +++ b/datacenterlight/static/datacenterlight/css/header-slider.css @@ -1,3 +1,18 @@ +.btn-trans { + color: #fff; + border: 2px solid #fff; + padding: 4px 18px; + letter-spacing: 0.6px; + background: rgba(0,0,0,0.35); +} + +.btn-trans:focus, +.btn-trans:active, +.btn-trans:hover { + background: #fff; + color: #333; +} + .header_slider > .carousel .carousel-inner { min-height: 95vh; display: flex; @@ -168,12 +183,4 @@ /* width: auto; */ height: 100%; } -} - -.btn-trans { - color: #fff; - border: 2px solid #fff; - padding: 4px 18px; - letter-spacing: 0.6px; - background: rgba(0,0,0,0.35); } \ No newline at end of file diff --git a/datacenterlight/static/datacenterlight/css/landing-page.css b/datacenterlight/static/datacenterlight/css/landing-page.css index 2f44613b..6361ea21 100755 --- a/datacenterlight/static/datacenterlight/css/landing-page.css +++ b/datacenterlight/static/datacenterlight/css/landing-page.css @@ -79,6 +79,10 @@ textarea { border-radius: 6px; } +.navbar-brand > img { + max-height: 30px; +} + @media (max-width: 767px) { .navbar-default .navbar-nav>li>a{ font-weight: 400; diff --git a/datacenterlight/static/datacenterlight/img/logo_black.svg b/datacenterlight/static/datacenterlight/img/logo_black.svg index 8c245f9c..7845f7b5 100644 --- a/datacenterlight/static/datacenterlight/img/logo_black.svg +++ b/datacenterlight/static/datacenterlight/img/logo_black.svg @@ -2,32 +2,32 @@ + width="156.5px" height="30.5px" viewBox="0 0 156.5 30.5" enable-background="new 0 0 156.5 30.5" xml:space="preserve"> - + c0.581,0,1.111-0.144,1.593-0.426c0.48-0.283,0.998-0.763,1.547-1.434v-7.678h2.269V24.24z"/> - + c0.321-0.298,0.727-0.446,1.215-0.446c0.488,0,0.896,0.148,1.215,0.446c0.32,0.298,0.482,0.691,0.482,1.18 + c0,0.489-0.162,0.879-0.482,1.17C73.049,10.221,72.641,10.368,72.152,10.368z"/> - + @@ -65,117 +65,120 @@ + c0.295,0,0.599-0.037,0.909-0.11c0.31-0.074,0.658-0.193,1.042-0.355l0.532,1.644c-0.252,0.086-0.492,0.166-0.721,0.242 + c-0.231,0.073-0.461,0.135-0.698,0.187c-0.237,0.055-0.483,0.099-0.741,0.135c-0.26,0.035-0.543,0.058-0.853,0.058 + c-1.212,0-2.131-0.349-2.76-1.043c-0.627-0.692-0.941-1.696-0.941-3.014V5.711h-3.544l5.737-4.043"/> - + s1.179,0.591,1.583,1.078c0.404,0.486,0.7,1.101,0.887,1.842c0.187,0.74,0.281,1.62,0.281,2.639v5.637H25.84v-1.189h-0.067 + c-0.285,0.464-0.715,0.822-1.291,1.078c-0.577,0.254-1.202,0.382-1.875,0.382c-0.449,0-0.913-0.062-1.393-0.181 + c-0.479-0.119-0.917-0.313-1.313-0.584c-0.397-0.27-0.723-0.629-0.977-1.078c-0.255-0.448-0.382-1.002-0.382-1.662 + c0-0.809,0.221-1.459,0.663-1.953c0.442-0.494,1.011-0.876,1.707-1.146c0.696-0.27,1.471-0.449,2.324-0.539 + c0.853-0.09,1.685-0.135,2.493-0.135v-0.18c0-0.554-0.195-0.962-0.584-1.225c-0.389-0.262-0.868-0.393-1.437-0.393 + c-0.524,0-1.03,0.112-1.516,0.337c-0.487,0.225-0.902,0.494-1.247,0.809L19.08,13.355z M25.84,18.139h-0.472 + c-0.404,0-0.812,0.02-1.224,0.057c-0.412,0.037-0.779,0.108-1.101,0.213c-0.322,0.105-0.588,0.259-0.797,0.461 + c-0.21,0.202-0.314,0.468-0.314,0.797c0,0.21,0.049,0.39,0.146,0.539c0.097,0.15,0.221,0.27,0.371,0.358 + c0.149,0.091,0.322,0.153,0.517,0.191c0.194,0.037,0.382,0.057,0.562,0.057c0.749,0,1.321-0.205,1.718-0.618 + c0.396-0.412,0.595-0.97,0.595-1.673L25.84,18.139L25.84,18.139z"/> + c0.18,0,0.371-0.015,0.573-0.045c0.202-0.029,0.371-0.074,0.505-0.135l0.045,2.695c-0.255,0.09-0.577,0.169-0.966,0.234 + c-0.389,0.067-0.779,0.103-1.168,0.103c-0.749,0-1.377-0.095-1.886-0.281c-0.509-0.188-0.917-0.458-1.224-0.812 + s-0.528-0.772-0.662-1.26c-0.135-0.489-0.202-1.033-0.202-1.634v-4.729h-1.797v-2.74h1.774v-2.94h3.616v2.942h2.627v2.74 + L36.067,14.568L36.067,14.568z"/> + s1.179,0.591,1.583,1.078c0.404,0.486,0.7,1.101,0.887,1.842c0.188,0.74,0.281,1.62,0.281,2.639v5.637h-3.369v-1.189H47.65 + c-0.285,0.464-0.715,0.822-1.291,1.078c-0.577,0.254-1.202,0.382-1.875,0.382c-0.449,0-0.913-0.062-1.392-0.181 + s-0.917-0.313-1.314-0.584c-0.397-0.27-0.723-0.629-0.977-1.078c-0.254-0.448-0.382-1.002-0.382-1.662 + c0-0.809,0.221-1.459,0.663-1.953c0.442-0.494,1.011-0.876,1.707-1.146c0.696-0.27,1.471-0.449,2.324-0.539 + c0.853-0.09,1.685-0.135,2.493-0.135v-0.18c0-0.554-0.195-0.962-0.584-1.225c-0.389-0.262-0.868-0.393-1.437-0.393 + c-0.524,0-1.03,0.112-1.516,0.337c-0.486,0.225-0.902,0.494-1.247,0.809L40.957,13.355z M47.717,18.139h-0.471 + c-0.404,0-0.812,0.02-1.224,0.057c-0.412,0.037-0.779,0.108-1.101,0.213c-0.322,0.105-0.587,0.259-0.797,0.461 + c-0.209,0.202-0.314,0.468-0.314,0.797c0,0.21,0.049,0.39,0.146,0.539c0.097,0.15,0.22,0.27,0.37,0.358 + c0.149,0.091,0.322,0.153,0.517,0.191c0.194,0.037,0.382,0.057,0.562,0.057c0.749,0,1.321-0.205,1.718-0.618 + c0.396-0.412,0.595-0.97,0.595-1.673L47.717,18.139L47.717,18.139z"/> + c0.329,0.271,0.711,0.479,1.145,0.629c0.435,0.15,0.884,0.226,1.348,0.226c0.629,0,1.176-0.146,1.64-0.438 + c0.464-0.292,0.891-0.678,1.28-1.157l1.527,1.168c-1.123,1.451-2.695,2.179-4.717,2.179c-0.838,0-1.598-0.144-2.279-0.427 + c-0.681-0.284-1.258-0.678-1.729-1.18c-0.473-0.502-0.836-1.093-1.09-1.774c-0.254-0.681-0.382-1.418-0.382-2.212 + s0.139-1.531,0.416-2.213c0.276-0.681,0.658-1.271,1.146-1.773c0.486-0.501,1.066-0.895,1.74-1.18 + c0.674-0.284,1.406-0.426,2.201-0.426c0.942,0,1.74,0.165,2.391,0.494c0.652,0.33,1.187,0.76,1.605,1.292 + c0.42,0.531,0.723,1.13,0.91,1.796c0.188,0.667,0.281,1.345,0.281,2.033v0.719h-8.534V18.432z M72.99,16.814 + c-0.016-0.449-0.086-0.861-0.213-1.235c-0.128-0.374-0.318-0.7-0.573-0.978c-0.255-0.276-0.573-0.493-0.954-0.65 + c-0.383-0.157-0.828-0.236-1.337-0.236c-0.493,0-0.946,0.094-1.358,0.281c-0.412,0.187-0.76,0.43-1.044,0.729 + c-0.284,0.299-0.505,0.633-0.663,0.999c-0.156,0.367-0.235,0.73-0.235,1.09H72.99z"/> - - - - - - - - - + c0.51,0,1,0.079,1.473,0.236c0.472,0.157,0.883,0.4,1.234,0.73c0.353,0.329,0.633,0.752,0.842,1.269 + c0.209,0.516,0.314,1.126,0.314,1.83v6.851h-2.021v-6.289c0-0.494-0.065-0.917-0.2-1.269c-0.136-0.353-0.314-0.637-0.539-0.854 + c-0.226-0.216-0.483-0.373-0.775-0.471c-0.292-0.098-0.596-0.146-0.909-0.146c-0.418,0-0.809,0.067-1.168,0.202 + c-0.358,0.135-0.674,0.349-0.943,0.641c-0.27,0.291-0.479,0.662-0.629,1.111c-0.149,0.449-0.225,0.98-0.225,1.595v5.479h-2.021 + L77.572,12.368L77.572,12.368z"/> + + + + + + + + + diff --git a/datacenterlight/templates/datacenterlight/cms/navbar.html b/datacenterlight/templates/datacenterlight/cms/navbar.html index 30624525..7be5e575 100644 --- a/datacenterlight/templates/datacenterlight/cms/navbar.html +++ b/datacenterlight/templates/datacenterlight/cms/navbar.html @@ -10,8 +10,14 @@ - - + {% url 'datacenterlight:index' as default_logo_url %} + {% if instance.logo_dark or instance.logo_white %} + + + {% else %} + + + {% endif %}