Skip to content

Commit 1675b33

Browse files
committed
Improve brand navbar style
1 parent 6bfd086 commit 1675b33

File tree

5 files changed

+64
-11
lines changed

5 files changed

+64
-11
lines changed

geonode_mapstore_client/client/themes/geonode/less/_brand-navbar.less

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,41 @@
2828
margin-bottom: 0;
2929
}
3030

31-
@media (max-width: 748px) {
32-
#gn-brand-navbar .gn-menu-content-center > * {
33-
display: none;
34-
}
31+
@media (max-width: @screen-sm) {
3532
#gn-brand-navbar-bottom {
3633
display: flex;
34+
gap: 0.5rem;
35+
align-items: center;
3736
width: calc(100% - 16px);
3837
margin: 8px;
38+
.gn-search-bar {
39+
max-width: 100%;
40+
}
41+
.gn-brand-navbar-menu {
42+
&.dropdown {
43+
display: none;
44+
}
45+
}
46+
}
47+
}
48+
49+
@media (max-width: @screen-xs) {
50+
#gn-brand-navbar {
51+
.gn-brand-navbar-menu {
52+
visibility: hidden;
53+
}
54+
}
55+
#gn-brand-navbar-bottom {
56+
.gn-brand-navbar-menu {
57+
&.dropdown {
58+
display: block;
59+
.dropdown-menu {
60+
li > a {
61+
text-align: left;
62+
}
63+
}
64+
}
65+
}
3966
}
4067
}
4168

geonode_mapstore_client/client/themes/geonode/less/_search-bar.less

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
border-bottom-width: 1px;
3737
border-bottom-style: solid;
3838
min-width: 100px;
39-
max-width: 200px;
39+
max-width: 300px;
4040
.btn {
4141
border: transparent;
4242
}
@@ -83,8 +83,13 @@
8383

8484
}
8585

86-
@media screen and (min-width: 768px) {
87-
.gn-search-bar {
88-
min-width: 500px;
86+
@media screen and (min-width: @screen-md) {
87+
#gn-search-bar {
88+
display: block;
89+
}
90+
}
91+
@media screen and (max-width: @screen-sm) {
92+
#gn-search-bar {
93+
display: none;
8994
}
9095
}

geonode_mapstore_client/static/mapstore/configs/localConfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3175,7 +3175,7 @@
31753175
"name": "ResourcesFiltersForm",
31763176
"cfg": {
31773177
"resourcesGridId": "catalog",
3178-
"headerNodeSelector": "#gn-brand-navbar",
3178+
"headerNodeSelector": ".gn-main-header",
31793179
"footerNodeSelector": ".gn-footer",
31803180
"fields": [
31813181
{
@@ -3317,6 +3317,7 @@
33173317
{
33183318
"name": "ResourceDetails",
33193319
"cfg": {
3320+
"headerNodeSelector": ".gn-main-header",
33203321
"enableFilters": true,
33213322
"enablePreview": true,
33223323
"editingOverlay": true

geonode_mapstore_client/templates/geonode-mapstore-client/snippets/brand_navbar.html

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
{% endif %}
1717
</a>
1818
{% endblock %}
19-
<ul class="ms-flex-fill ms-flex-box _flex _flex-gap-sm _flex-center-v">
19+
<ul class="ms-flex-fill ms-flex-box _flex _flex-gap-sm _flex-center-v gn-brand-navbar-menu">
2020
{% for menu_item in BRAND_NAVBAR_MENU %}
2121
{% include './menu_item.html' with menu_item=menu_item %}
2222
{% endfor %}
@@ -38,6 +38,26 @@
3838
</nav>
3939
<div id="gn-brand-navbar-bottom">
4040
{% block bottom_menu %}
41+
<div class="gn-brand-navbar-menu dropdown">
42+
<button
43+
class="btn btn-primary dropdown-toggle"
44+
type="button"
45+
id="gn-brand-navbar-menu-btn"
46+
data-toggle="dropdown"
47+
aria-haspopup="true"
48+
aria-expanded="true"
49+
>
50+
<i class="fa fa-bars"> </i>
51+
</button>
52+
<ul
53+
class="dropdown-menu"
54+
aria-labelledby="gn-brand-navbar-dropdown-menu"
55+
>
56+
{% for menu_item in BRAND_NAVBAR_MENU %}
57+
{% include './menu_item.html' with menu_item=menu_item align_right=True %}
58+
{% endfor %}
59+
</ul>
60+
</div>
4161
{% include './search_bar.html' with search_bar_id='gn-search-bar-bottom' %}
4262
{% endblock %}
4363
</div>

geonode_mapstore_client/templates/geonode-mapstore-client/snippets/header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
}
4343
}
4444
}
45-
const menuLinks = document.querySelectorAll('.gn-main-menu > li a');
45+
const menuLinks = document.querySelectorAll('.gn-brand-navbar-menu > li a');
4646
for (var i = 0; i < menuLinks.length; i++) {
4747
const menuLink = menuLinks[i];
4848
const href = menuLink.getAttribute('href');

0 commit comments

Comments
 (0)