Skip to content

Commit

Permalink
[Themes] Add more nav customization options
Browse files Browse the repository at this point in the history
  • Loading branch information
afabiani committed May 10, 2019
1 parent dc6e1f2 commit da891dd
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 1 deletion.
51 changes: 50 additions & 1 deletion geonode/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,60 @@
{% endif %}

{% if custom_theme.navbar_color %}
.home .navbar-inverse , .navbar-inverse {
.navbar-inverse , .navbar-inverse {
background-color: {{ custom_theme.navbar_color }};
}
{% endif %}

{% if custom_theme.navbar_text_color %}
.navbar-inverse .navbar-nav > li > a {
color: {{ custom_theme.navbar_text_color }};
font-weight: 600;
padding-top: 25px;
padding-bottom: 25px;
}
{% endif

{% if custom_theme.navbar_text_hover %}
.navbar-inverse .navbar-nav > li > a:hover {
background-color: {{ custom_theme.navbar_text_hover }};
}
{% endif %}

{% if custom_theme.navbar_text_hover_focus %}
.navbar-inverse .navbar-nav > .open > a,
.navbar-inverse .navbar-nav > .open > a:hover,
.navbar-inverse .navbar-nav > .open > a:focus {
background-color: {{ custom_theme.navbar_text_hover_focus }};
}
{% endif %}

{% if custom_theme.navbar_dropdown_menu %}
.navbar-nav .dropdown-menu {
background-color: {{ custom_theme.navbar_dropdown_menu }};
border-top: 1px solid {{ custom_theme.navbar_dropdown_menu }};
}
{% endif %}

{% if custom_theme.navbar_dropdown_menu_text %}
.navbar-nav .dropdown-menu a {
color: {{ custom_theme.navbar_dropdown_menu_text }};
}
{% endif %}

{% if custom_theme.navbar_dropdown_menu_hover %}
.navbar-nav .dropdown-menu li a:hover {
background-color: {{ custom_theme.navbar_dropdown_menu_hover }};
color: {{ custom_theme.navbar_dropdown_menu_text }};
}
{% endif %}

{% if custom_theme.navbar_dropdown_menu_divider %}
.navbar-nav .dropdown-menu .divider {
background-color: {{ custom_theme.navbar_dropdown_menu_divider }};
}
{% endif %}

{% if custom_theme.logo %}
.navbar-brand {
background-image: url({{ custom_theme.logo.url }});
Expand Down
7 changes: 7 additions & 0 deletions geonode/themes/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ class Meta:
widgets = {
'body_color': forms.TextInput(attrs={'type': 'color'}),
'navbar_color': forms.TextInput(attrs={'type': 'color'}),
'navbar_text_color': forms.TextInput(attrs={'type': 'color'}),
'navbar_text_hover': forms.TextInput(attrs={'type': 'color'}),
'navbar_text_hover_focus': forms.TextInput(attrs={'type': 'color'}),
'navbar_dropdown_menu': forms.TextInput(attrs={'type': 'color'}),
'navbar_dropdown_menu_text': forms.TextInput(attrs={'type': 'color'}),
'navbar_dropdown_menu_hover': forms.TextInput(attrs={'type': 'color'}),
'navbar_dropdown_menu_divider': forms.TextInput(attrs={'type': 'color'}),
'jumbotron_color': forms.TextInput(attrs={'type': 'color'}),
'copyright_color': forms.TextInput(attrs={'type': 'color'}),
'cookie_law_info_background': forms.TextInput(attrs={'type': 'color'}),
Expand Down
50 changes: 50 additions & 0 deletions geonode/themes/migrations/0005_auto_20190510_1335.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-10 13:35
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('geonode_themes', '0004_auto_20190503_1817'),
]

operations = [
migrations.AddField(
model_name='geonodethemecustomization',
name='navbar_dropdown_menu',
field=models.CharField(default=b'#2c689c', max_length=10),
),
migrations.AddField(
model_name='geonodethemecustomization',
name='navbar_dropdown_menu_divider',
field=models.CharField(default=b'#204d74', max_length=10),
),
migrations.AddField(
model_name='geonodethemecustomization',
name='navbar_dropdown_menu_hover',
field=models.CharField(default=b'#204d74', max_length=10),
),
migrations.AddField(
model_name='geonodethemecustomization',
name='navbar_dropdown_menu_text',
field=models.CharField(default=b'#ffffff', max_length=10),
),
migrations.AddField(
model_name='geonodethemecustomization',
name='navbar_text_color',
field=models.CharField(default=b'#ffffff', max_length=10),
),
migrations.AddField(
model_name='geonodethemecustomization',
name='navbar_text_hover',
field=models.CharField(default=b'#2c689c', max_length=10),
),
migrations.AddField(
model_name='geonodethemecustomization',
name='navbar_text_hover_focus',
field=models.CharField(default=b'#2c689c', max_length=10),
),
]
7 changes: 7 additions & 0 deletions geonode/themes/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ class GeoNodeThemeCustomization(models.Model):
jumbotron_cta_link = models.CharField(max_length=255, null=True, blank=True, verbose_name="Call to action link")
body_color = models.CharField(max_length=10, default="#333333")
navbar_color = models.CharField(max_length=10, default="#333333")
navbar_text_color = models.CharField(max_length=10, default="#ffffff")
navbar_text_hover = models.CharField(max_length=10, default="#2c689c")
navbar_text_hover_focus = models.CharField(max_length=10, default="#2c689c")
navbar_dropdown_menu = models.CharField(max_length=10, default="#2c689c")
navbar_dropdown_menu_text = models.CharField(max_length=10, default="#ffffff")
navbar_dropdown_menu_hover = models.CharField(max_length=10, default="#204d74")
navbar_dropdown_menu_divider = models.CharField(max_length=10, default="#204d74")
jumbotron_color = models.CharField(max_length=10, default="#2c689c")
contactus = models.BooleanField(default=False, verbose_name="Enable contact us box")
contact_name = models.CharField(max_length=255, null=True, blank=True)
Expand Down

0 comments on commit da891dd

Please sign in to comment.