-
-
- {!disableFeatured &&
}
+
+
-
- {isMounted.current && isFiltersPanelEnabled && isFilterForm &&
-
-
-
- }
-
-
-
- }
- isCardActive={res => res.pk === pk}
- page={params.page ? parseFloat(params.page) : 1}
- formatHref={handleFormatHref}
- onLoad={(value) => {
- handleUpdate({
- page: value
- });
- }}
- >
-
- 0)}
- />
-
-
-
-
-
+
+
+ {
+ handleUpdate({
+ page: value
+ });
+ }}
+ >
+ 0)}
+ />
+
+
+
);
}
Home.propTypes = {
- dispatch: PropTypes.func,
- history: PropTypes.object,
location: PropTypes.object,
- match: PropTypes.object,
- plugins: PropTypes.object,
- pluginsConfig: PropTypes.array,
- background: PropTypes.object,
- logo: PropTypes.array,
- jumbotron: PropTypes.object
+ params: PropTypes.object,
+ onSearch: PropTypes.func,
+ config: PropTypes.object,
+ user: PropTypes.object,
+ width: PropTypes.number,
+ totalResources: PropTypes.object,
+ fetchFeaturedResources: PropTypes.func
};
Home.defaultProps = {
- background: {},
- logo: [],
- jumbotron: {},
- isFilterForm: false
+ onSearch: () => {},
+ fetchFeaturedResources: () => {}
};
const DEFAULT_PARAMS = {};
-
const ConnectedHome = connect(
-
createSelector([
state => state?.gnsearch?.params || DEFAULT_PARAMS,
userSelector,
- state => state?.gnresource?.data || null,
- state => state?.controls?.gnFiltersPanel?.enabled || null,
getParsedGeoNodeConfiguration,
- state => state?.gnsearch?.total || 0,
- state => state?.localConfig?.siteName || "Geonode"
- ], (params, user, resource, isFiltersPanelEnabled, config, totalResources, siteName) => ({
+ state => state?.gnsearch?.total || 0
+ ], (params, user, config, totalResources) => ({
params,
user,
- resource,
- isFiltersPanelEnabled,
config,
- totalResources,
- siteName
+ totalResources
})),
{
onSearch: searchResources,
- onSelect: requestResource,
- onEnableFiltersPanel: setControlProperty.bind(null, 'gnFiltersPanel', 'enabled'),
fetchFeaturedResources: loadFeaturedResources
}
)(withResizeDetector(Home));
diff --git a/geonode_mapstore_client/client/js/routes/Search.jsx b/geonode_mapstore_client/client/js/routes/Search.jsx
index 5f985733c0..948e59a17f 100644
--- a/geonode_mapstore_client/client/js/routes/Search.jsx
+++ b/geonode_mapstore_client/client/js/routes/Search.jsx
@@ -1,8 +1,364 @@
+/*
+ * Copyright 2020, GeoSolutions Sas.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree.
+*/
+import React, { useRef, useEffect, useState} from 'react';
+import PropTypes from 'prop-types';
import { connect } from 'react-redux';
-import Home from '@js/routes/Home';
+import url from 'url';
+import { createSelector } from 'reselect';
+import castArray from 'lodash/castArray';
+import CardGrid from '@js/components/CardGrid';
+import FiltersMenu from '@js/components/FiltersMenu';
+import FiltersForm from '@js/components/FiltersForm';
+import { getParsedGeoNodeConfiguration } from "@js/selectors/config";
+import { userSelector } from '@mapstore/framework/selectors/security';
+import { buildHrefByTemplate } from '@js/utils/MenuUtils';
+import { setControlProperty } from '@mapstore/framework/actions/controls';
+import {
+ searchResources,
+ requestResource,
+ loadFeaturedResources
+} from '@js/actions/gnsearch';
-const SearchRoute = connect(() => ({ hideHero: true, isFilterForm: true, disableFeatured: true })
-)((Home));
+import {
+ hashLocationToHref,
+ getFilterById
+} from '@js/utils/GNSearchUtils';
+import { withResizeDetector } from 'react-resize-detector';
-export default SearchRoute;
+import { getResourceTypes, getCategories, getRegions, getOwners, getKeywords } from '@js/api/geonode/v2';
+import MetaTags from "@js/components/MetaTags";
+
+import {
+ getThemeLayoutSize
+} from '@js/utils/AppUtils';
+
+const DEFAULT_RESOURCES = [];
+
+const CardGridWithMessageId = ({ query, user, isFirstRequest, ...props }) => {
+ const hasResources = props.resources?.length > 0;
+ const hasFilter = Object.keys(query || {}).filter(key => key !== 'sort').length > 0;
+ const isLoggedIn = !!user;
+ const messageId = !hasResources && !isFirstRequest && !props.loading
+ ? hasFilter && 'noResultsWithFilter'
+ || isLoggedIn && 'noContentYet'
+ || 'noPublicContent'
+ : undefined;
+ return
;
+};
+
+const ConnectedCardGrid = connect(
+ createSelector([
+ state => state?.gnsearch?.resources || DEFAULT_RESOURCES,
+ state => state?.gnsearch?.loading || false,
+ state => state?.gnsearch?.isNextPageAvailable || false,
+ state => state?.gnsearch?.isFirstRequest
+ ], (resources, loading, isNextPageAvailable, isFirstRequest) => ({
+ resources,
+ loading,
+ isNextPageAvailable,
+ isFirstRequest
+ }))
+)(CardGridWithMessageId);
+
+const suggestionsRequestTypes = {
+ resourceTypes: {
+ filterKey: 'filter{resource_type.in}',
+ loadOptions: (q, params) => getResourceTypes({ ...params, q }, 'filter{resource_type.in}')
+ .then(results => ({
+ options: results
+ .map(({ selectOption }) => selectOption)
+ }))
+ .catch(() => null)
+ },
+ categories: {
+ filterKey: 'filter{category.identifier.in}',
+ loadOptions: (q, params) => getCategories({ ...params, q }, 'filter{category.identifier.in}')
+ .then(results => ({
+ options: results
+ .map(({ selectOption }) => selectOption)
+ }))
+ .catch(() => null)
+ },
+ keywords: {
+ filterKey: 'filter{keywords.slug.in}',
+ loadOptions: (q, params) => getKeywords({ ...params, q }, 'filter{keywords.slug.in}')
+ .then(results => ({
+ options: results
+ .map(({ selectOption }) => selectOption)
+ }))
+ .catch(() => null)
+ },
+ regions: {
+ filterKey: 'filter{regions.name.in}',
+ loadOptions: (q, params) => getRegions({ ...params, q }, 'filter{regions.name.in}')
+ .then(results => ({
+ options: results
+ .map(({ selectOption }) => selectOption)
+ }))
+ .catch(() => null)
+ },
+ owners: {
+ filterKey: 'filter{owner.username.in}',
+ loadOptions: (q, params) => getOwners({ ...params, q }, 'filter{owner.username.in}')
+ .then(results => ({
+ options: results
+ .map(({ selectOption }) => selectOption)
+ }))
+ .catch(() => null)
+ }
+};
+
+function Search({
+ location,
+ params,
+ onSearch,
+ onEnableFiltersPanel,
+ isFiltersPanelEnabled,
+ config,
+ onSelect,
+ match,
+ user,
+ width,
+ totalResources,
+ resource,
+ siteName
+}) {
+
+ const {
+ filterMenuItemsAllowed,
+ cardOptionsItemsAllowed,
+ filtersFormItemsAllowed,
+ filters
+ } = config;
+ const themeLayoutSize = getThemeLayoutSize(width);
+ const isMounted = useRef();
+
+ useEffect(() => {
+ isMounted.current = true;
+ return () => {
+ isMounted.current = false;
+ };
+ }, []);
+
+ useEffect(() => {
+ if (match.url === '/search/filter/') {
+ onEnableFiltersPanel(true);
+ }
+ }, [match.url]);
+
+ const filtersMenuNode = useRef();
+
+ const [isSmallDevice, setIsSmallDevice] = useState(false);
+ useEffect(() => {
+ setIsSmallDevice((themeLayoutSize === 'sm') ? true : false);
+ }, [themeLayoutSize]);
+
+ const handleShowFilterForm = () => {
+ onEnableFiltersPanel(!isFiltersPanelEnabled);
+ };
+
+ function handleUpdate(newParams, pathname) {
+ const { query } = url.parse(location.search, true);
+ onSearch({
+ ...query,
+ ...params,
+ ...newParams
+ }, pathname);
+
+ }
+ // to update the overlay form in mobile device, after apply,
+ // the form has to close
+ const handleUpdateSmallDevice = (newParams, pathname) => {
+ handleUpdate(newParams, pathname);
+ handleShowFilterForm();
+ };
+ const [formParams, setFormParams] = useState({});
+
+ function handleClear() {
+ const { query } = url.parse(location.search, true);
+ const newParams = Object.keys(query)
+ .reduce((acc, key) =>
+ key.indexOf('filter') === 0
+ || key === 'f'
+ || key === 'q'
+ ? {
+ ...acc,
+ [key]: []
+ }
+ : acc, { extent: undefined });
+
+ setFormParams(newParams);
+ handleUpdate(newParams);
+ }
+
+ function handleFormatHref(options) {
+ return hashLocationToHref({
+ location,
+ ...options
+ });
+ }
+
+ const { query } = url.parse(location.search, true);
+ const queryFilters = Object.keys(query).reduce((acc, key) => key.indexOf('sort') === 0
+ ? acc
+ : [...acc, ...castArray(query[key]).map((value) => ({ key, value }))], []);
+
+ const pk = match.params.pk;
+ const ctype = match.params.ctype;
+
+ useEffect(() => {
+ onSelect(pk, ctype);
+ }, [pk, ctype]);
+
+ // update all the information of filter in use on mount
+ // to display the correct labels
+ const [reRender, setReRender] = useState(0);
+
+ const state = useRef(false);
+ state.current = {
+ query
+
+ };
+
+ useEffect(() => {
+ const suggestionsRequestTypesArray = Object.keys(suggestionsRequestTypes)
+ .map((key) => suggestionsRequestTypes[key]);
+ const queryKeys = Object.keys(state.current.query);
+ let updateRequests = [];
+ queryKeys.forEach(queryKey => {
+ const suggestionRequest = suggestionsRequestTypesArray.find(({ filterKey }) => queryKey === filterKey);
+ if (suggestionRequest) {
+ const filtersToUpdate = castArray(state.current.query[queryKey]).filter((value) => !getFilterById(queryKey, value));
+ if (filtersToUpdate?.length > 0) {
+ const request = suggestionRequest.loadOptions.bind(null, '', { idIn: filtersToUpdate });
+ updateRequests.push(request);
+ }
+ }
+ });
+ Promise.all(updateRequests.map((request) => request()))
+ .then(() => {
+ if (isMounted.current) {
+ setReRender(reRender + 1);
+ }
+ });
+
+
+ }, []);
+
+ const scrollContainer = useRef();
+
+ return (
+ <>
+
+
+ {isFiltersPanelEnabled &&
}
+
+ res.pk === pk}
+ page={params.page ? parseFloat(params.page) : 1}
+ formatHref={handleFormatHref}
+ scrollContainer={scrollContainer.current}
+ onLoad={(value) => {
+ handleUpdate({
+ page: value
+ });
+ }}
+ >
+ 0)}
+ />
+
+
+
+ >
+ );
+}
+
+Search.propTypes = {
+ dispatch: PropTypes.func,
+ history: PropTypes.object,
+ location: PropTypes.object,
+ match: PropTypes.object,
+ plugins: PropTypes.object,
+ pluginsConfig: PropTypes.array,
+ background: PropTypes.object,
+ logo: PropTypes.array,
+ jumbotron: PropTypes.object
+};
+
+Search.defaultProps = {
+ background: {},
+ logo: [],
+ jumbotron: {},
+ isFilterForm: false
+};
+
+const DEFAULT_PARAMS = {};
+
+
+const ConnectedSearch = connect(
+
+ createSelector([
+ state => state?.gnsearch?.params || DEFAULT_PARAMS,
+ userSelector,
+ state => state?.gnresource?.data || null,
+ state => state?.controls?.gnFiltersPanel?.enabled || null,
+ getParsedGeoNodeConfiguration,
+ state => state?.gnsearch?.total || 0,
+ state => state?.localConfig?.siteName || "Geonode"
+ ], (params, user, resource, isFiltersPanelEnabled, config, totalResources, siteName) => ({
+ params,
+ user,
+ resource,
+ isFiltersPanelEnabled,
+ config,
+ totalResources,
+ siteName
+ })),
+ {
+ onSearch: searchResources,
+ onSelect: requestResource,
+ onEnableFiltersPanel: setControlProperty.bind(null, 'gnFiltersPanel', 'enabled'),
+ fetchFeaturedResources: loadFeaturedResources
+ }
+)(withResizeDetector(Search));
+
+export default ConnectedSearch;
diff --git a/geonode_mapstore_client/client/js/utils/AppUtils.js b/geonode_mapstore_client/client/js/utils/AppUtils.js
index ad5cbc81b5..9299c889c2 100644
--- a/geonode_mapstore_client/client/js/utils/AppUtils.js
+++ b/geonode_mapstore_client/client/js/utils/AppUtils.js
@@ -179,7 +179,7 @@ export function setupConfiguration({
};
}
-export function getPageSize(width) {
+export function getThemeLayoutSize(width) {
if (width < 968) {
return 'sm';
}
diff --git a/geonode_mapstore_client/client/js/utils/GNSearchUtils.js b/geonode_mapstore_client/client/js/utils/GNSearchUtils.js
index dcc07b60a8..e35b9e2673 100644
--- a/geonode_mapstore_client/client/js/utils/GNSearchUtils.js
+++ b/geonode_mapstore_client/client/js/utils/GNSearchUtils.js
@@ -83,7 +83,7 @@ export const getResourceTypesInfo = () => ({
config: 'layer_preview',
theme: 'preview'
}),
- formatDetailUrl: (resource) => (`/viewer/#/layer/${resource.pk}`),
+ formatDetailUrl: (resource) => (`/catalogue/#/layer/${resource.pk}`),
name: 'Layer'
},
'map': {
@@ -92,28 +92,28 @@ export const getResourceTypesInfo = () => ({
config: 'map_preview',
theme: 'preview'
}),
- formatDetailUrl: (resource) => (`/viewer/#/map/${resource.pk}`),
+ formatDetailUrl: (resource) => (`/catalogue/#/map/${resource.pk}`),
name: 'Map'
},
'document': {
icon: 'file',
name: 'Document',
- formatDetailUrl: (resource) => (`/viewer/#/document/${resource.pk}`)
+ formatDetailUrl: (resource) => (`/catalogue/#/document/${resource.pk}`)
},
'geostory': {
icon: 'book-open',
name: 'GeoStory',
- formatDetailUrl: (resource) => (`/viewer/#/geostory/${resource.pk}`)
+ formatDetailUrl: (resource) => (`/catalogue/#/geostory/${resource.pk}`)
},
'image': {
icon: 'file-image',
name: 'Image',
- formatDetailUrl: (resource) => (`/viewer/#/document/${resource.pk}`)
+ formatDetailUrl: (resource) => (`/catalogue/#/document/${resource.pk}`)
},
'video': {
icon: 'file-video',
name: 'Video',
- formatDetailUrl: (resource) => (`/viewer/#/document/${resource.pk}`)
+ formatDetailUrl: (resource) => (`/catalogue/#/document/${resource.pk}`)
}
});
diff --git a/geonode_mapstore_client/client/static/mapstore/configs/localConfig.json b/geonode_mapstore_client/client/static/mapstore/configs/localConfig.json
index 288f7e8da0..34f0b3a16b 100644
--- a/geonode_mapstore_client/client/static/mapstore/configs/localConfig.json
+++ b/geonode_mapstore_client/client/static/mapstore/configs/localConfig.json
@@ -350,7 +350,7 @@
"labelId": "gnhome.map",
"value": "map",
"type": "link",
- "href": "/viewer/#/map/new",
+ "href": "/catalogue/#/map/new",
"authenticated": true,
"perms": [{ "type": "user", "value": "add_resource" }]
},
@@ -358,7 +358,7 @@
"labelId": "gnhome.geostory",
"value": "geostory",
"type": "link",
- "href": "/viewer/#/geostory/new",
+ "href": "/catalogue/#/geostory/new",
"authenticated": true,
"perms": [{ "type": "user", "value": "add_resource" }]
}
@@ -543,7 +543,7 @@
},
{
"type": "link",
- "href": "/viewer/#/map/new",
+ "href": "/catalogue/#/map/new",
"labelId": "gnhome.createMap",
"authenticated": true,
"permissions": [],
@@ -571,7 +571,7 @@
},
{
"type": "link",
- "href": "/viewer/#/geostory/new",
+ "href": "/catalogue/#/geostory/new",
"labelId": "gnhome.createGeostory",
"authenticated": true,
"permissions": [],
@@ -2617,7 +2617,7 @@
},
{
"type": "plugin",
- "name": "ButtonViewer"
+ "name": "DetailViewerButton"
},
{
"labelId": "gnviewer.edit",
@@ -2667,9 +2667,6 @@
]
}
},
- {
- "name": "Print"
- },
{
"name": "SaveAs",
"cfg": {
@@ -2688,9 +2685,6 @@
"pathTemplate": "/maps/{id}/embed"
}
},
- {
- "name": "BrandNavbar"
- },
{
"name": "DetailViewer"
},
@@ -2949,9 +2943,6 @@
]
}
},
- {
- "name": "BrandNavbar"
- },
{
"name": "FeatureEditor",
"override": {
@@ -3068,9 +3059,6 @@
]
}
},
- {
- "name": "BrandNavbar"
- },
{
"name": "StyleEditor",
"cfg": {
@@ -3176,7 +3164,7 @@
},
{
"type": "plugin",
- "name": "ButtonViewer"
+ "name": "DetailViewerButton"
},
{
"labelId": "gnviewer.edit",
@@ -3213,8 +3201,6 @@
}
},
{ "name": "DetailViewer"},
- { "name": "ButtonViewer"},
- { "name": "BrandNavbar" },
{
"name": "Map",
"cfg": {
@@ -3598,7 +3584,7 @@
},
{
"type": "plugin",
- "name": "ButtonViewer"
+ "name": "DetailViewerButton"
},
{
"labelId": "gnviewer.edit",
@@ -3625,8 +3611,6 @@
]
}
},
- { "name": "BrandNavbar" },
- { "name": "ButtonViewer" },
{ "name": "DetailViewer"},
{
"name": "GeoStory",
@@ -3756,7 +3740,7 @@
},
{
"type": "plugin",
- "name": "ButtonViewer"
+ "name": "DetailViewerButton"
},
{
"labelId": "gnviewer.edit",
@@ -3784,9 +3768,7 @@
]
}
},
- { "name": "BrandNavbar" },
{ "name": "DetailViewer"},
- { "name": "ButtonViewer"},
{ "name": "Save" },
{ "name": "SaveAs" },
{ "name": "Share" },
diff --git a/geonode_mapstore_client/client/themes/geonode/less/_action-navbar.less b/geonode_mapstore_client/client/themes/geonode/less/_action-navbar.less
deleted file mode 100644
index 5fc8eddd64..0000000000
--- a/geonode_mapstore_client/client/themes/geonode/less/_action-navbar.less
+++ /dev/null
@@ -1,158 +0,0 @@
-//
-// Copyright 2021, GeoSolutions Sas.
-// All rights reserved.
-//
-// This source code is licensed under the BSD-style license found in the
-// LICENSE file in the root directory of this source tree.
-//
-
-// **************
-// Theme
-// **************
-
-#gn-components-theme(@theme-vars) {
- .gn-action-navbar {
- .color-var(@theme-vars[primary-contrast]);
- .background-color-var(@theme-vars[primary]);
- .badge {
- .color-var(@theme-vars[primary]);
- .background-color-var(@theme-vars[primary-contrast]);
- }
- .dropdown-menu .badge {
- .color-var(@theme-vars[primary-contrast]);
- .background-color-var(@theme-vars[primary]);
- }
- }
-}
-
-// **************
-// Layout
-// **************
-
-.gn-action-navbar {
- position: sticky;
- min-height: 3rem;
- width: 100%;
- padding: 0.5rem 0;
- z-index: 15;
- display: flex;
- flex-direction: row;
- align-items: center;
- .badge {
- display: inline;
- margin-left: 0.5rem;
- padding: 0.2rem;
- font-size: 0.6rem;
- border-radius: 0.2rem;
- }
- .gn-action-navbar-container {
- display: flex;
- flex-direction: row;
- align-items: center;
- margin: auto;
- width: 100%;
- .gn-action-navbar-content {
- display: flex;
- flex-direction: row;
- flex: 1;
- padding: 0 0.8rem;
- ul:not(.dropdown-menu) {
- display: inline-flex;
- align-items: center;
- flex-direction: row;
- list-style-type: none;
- padding: 0;
- margin: 0;
- min-width: 360px;
- > li{
- display: inline-block;
- align-items: center;
- vertical-align: middle;
- }
- > li + li {
- margin-left: 0.1rem;
- }
- }
- .gn-action-navbar-content-left {
- display: flex;
- flex: 1;
- flex-direction: row;
- .gn-menu-index-divider {
- width: 1px;
- height: 1.2rem;
- }
- }
-
- .gn-action-navbar-content-right {
- display: flex;
- flex: 1;
- flex-direction: row-reverse;
- > ul:not(.dropdown-menu) {
- display: flex;
- flex: 1;
- flex-direction: row-reverse;
- > li{
- display: flex;
- }
- > li + li {
- margin-right: 0.4rem;
- }
- }
- }
- .gn-action-navbar-content-tools {
- margin-left: 0.4rem;
- }
- }
- .gn-action-navbar-tools > * {
- margin: 0 0.8rem;
- }
- .gn-action-navbar-divider {
- width: 1px;
- height: 1.2rem;
- }
- .gn-action-navbar-tools {
- display: flex;
- align-items: center;
- /* remove this inline style of dropdown because they cause issue with overflow x*/
- .dropdown-menu {
- transform: none !important;
- inset: unset !important;
- }
- .dropdown-menu-right {
- right: 0 !important;
- }
- .gn-action-navbar-right-items {
- display: flex;
- align-items: center;
- list-style-type: none;
- padding: 0;
- margin: 0;
- li + li {
- margin-left: 0.4rem;
- }
- }
- }
-
- .btn-default,
- .gn-tag {
- font-size: @font-size-base;
- border: none;
- padding: 0.25rem 0.5rem;
- border-radius: 0.25rem;
- }
- .gn-language-selector.inline {
- padding: 0.5rem;
- }
- .gn-language-selector {
- &> .btn-default {
- &.active {
- color: inherit;
- background-color: inherit;
- font-weight: bold;
- text-decoration: underline;
- box-shadow: none;
- }
- }
- }
- }
-}
diff --git a/geonode_mapstore_client/client/themes/geonode/less/_base.less b/geonode_mapstore_client/client/themes/geonode/less/_base.less
index ae0d3a27bc..1c8f0dab3b 100644
--- a/geonode_mapstore_client/client/themes/geonode/less/_base.less
+++ b/geonode_mapstore_client/client/themes/geonode/less/_base.less
@@ -5,6 +5,7 @@
#gn-base-components-theme(@theme-vars) {
[data-ms2-container],
+ body,
.gn-theme {
.color-var(@theme-vars[main-color]);
.background-color-var(@theme-vars[main-bg]);
@@ -51,6 +52,20 @@
.color-var(@theme-vars[badge-color]);
.background-color-var(@theme-vars[badge-bg]);
}
+
+ .label {
+ .color-var(@theme-vars[main-color]);
+ .background-color-var(@theme-vars[main-bg]);
+ }
+
+ .label-default {
+ .color-var(@theme-vars[primary-contrast]);
+ .background-color-var(@theme-vars[primary]);
+ }
+
+ .page-header {
+ .border-color-var(@theme-vars[main-border-color]);
+ }
}
// **************
@@ -65,3 +80,37 @@
line-height: 1.5;
text-align: left;
}
+
+.gn-catalogue {
+ display: flex;
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 99999;
+ flex-direction: column;
+ .gn-footer {
+ position: relative;
+ }
+ .gn-main-header {
+ z-index: 150;
+ }
+ #ms-container {
+ flex: 1;
+ position: relative;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 0;
+ overflow: hidden;
+ transform: translate(0, 0);
+ }
+}
+
+.gn-homepage {
+ .app-router {
+ position: relative !important;
+ }
+}
diff --git a/geonode_mapstore_client/client/themes/geonode/less/_brand-navbar.less b/geonode_mapstore_client/client/themes/geonode/less/_brand-navbar.less
deleted file mode 100644
index d10d36c7ba..0000000000
--- a/geonode_mapstore_client/client/themes/geonode/less/_brand-navbar.less
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright 2020, GeoSolutions Sas.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-// **************
-// Theme
-// **************
-
-#gn-components-theme(@theme-vars) {
- .gn-brand-navbar {
- .color-var(@theme-vars[main-color]);
- .background-color-var(@theme-vars[main-bg]);
- }
-}
-
-// **************
-// Layout
-// **************
-
-.gn-brand-navbar {
- position: fixed;
- top: 0;
- left: 0;
- z-index: 30;
- padding: 0.5rem 0;
- min-height: 4rem;
- width: 100%;
-
- .gn-brand-navbar-container {
- display: flex;
- flex-direction: row;
- align-items: center;
- width: 100%;
- margin: auto;
- .gn-brand-navbar-left-side,
- .gn-brand-navbar-right-side {
- flex: 1;
- white-space: nowrap;
- padding: 0 0.4rem;
- list-style-type: none;
- margin: 0;
- margin: 0 0.4rem;
- }
- .gn-brand-navbar-left-side img,
- .gn-brand-navbar-right-side img {
- width: auto;
- height: 2.5rem;
- }
- .gn-brand-navbar-left-side img {
- padding: 0 0.5rem;
- }
- .gn-brand-navbar-center {
- width: 100%;
- max-width: 716px;
- position: relative;
- }
- .gn-brand-navbar-right-side {
- display: flex;
- flex-direction: row-reverse;
- }
- }
- .gn-user-dropdown {
- .btn {
- padding: 0 0.4rem;
- }
- .dropdown-toggle > img {
- width: auto;
- height: 2.5rem;
- border-radius: 50%;
- }
- .dropdown-item .fa {
- margin-right: 0.5rem;
- }
- }
-}
diff --git a/geonode_mapstore_client/client/themes/geonode/less/_card-grid.less b/geonode_mapstore_client/client/themes/geonode/less/_card-grid.less
index 915337d6e5..0ba0cc955d 100644
--- a/geonode_mapstore_client/client/themes/geonode/less/_card-grid.less
+++ b/geonode_mapstore_client/client/themes/geonode/less/_card-grid.less
@@ -72,6 +72,7 @@
.gn-card-grid-pagination {
padding: 1rem;
text-align: center;
+ padding-bottom: 3rem;
}
.gn-card-grid-pagination.featured-list {
display: flex;
@@ -96,3 +97,17 @@
}
}
}
+
+.gn-fixed-card-grid {
+ display: flex;
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ .gn-grid-container {
+ flex: 1;
+ position: relative;
+ width: 100%;
+ height: 100%;
+ overflow: auto;
+ }
+}
diff --git a/geonode_mapstore_client/client/themes/geonode/less/_details-panel.less b/geonode_mapstore_client/client/themes/geonode/less/_details-panel.less
index 7012fb8910..c885ad8999 100644
--- a/geonode_mapstore_client/client/themes/geonode/less/_details-panel.less
+++ b/geonode_mapstore_client/client/themes/geonode/less/_details-panel.less
@@ -60,7 +60,7 @@
position: absolute;
width: 100%;
height: 100%;
- overflow-y: scroll;
+ overflow-y: auto;
}
&.loading .gn-details-panel-content {
h1,
@@ -175,3 +175,27 @@
display: inline-block;
}
}
+
+.gn-fixed-card-grid {
+ .gn-details-panel {
+ position: relative;
+ width: 100%;
+ height: 100%;
+ max-width: 600px;
+ }
+ &.gn-size-md {
+ .gn-details-panel {
+ max-width: 500px;
+ }
+ }
+ &.gn-size-sm {
+ .gn-details-panel {
+ position: absolute;
+ left: 0;
+ width: 100%;
+ max-width: 100%;
+ height: 100%;
+ z-index: 100;
+ }
+ }
+}
diff --git a/geonode_mapstore_client/client/themes/geonode/less/_filter-form.less b/geonode_mapstore_client/client/themes/geonode/less/_filter-form.less
index 4a27658d3a..7153b23d14 100644
--- a/geonode_mapstore_client/client/themes/geonode/less/_filter-form.less
+++ b/geonode_mapstore_client/client/themes/geonode/less/_filter-form.less
@@ -29,7 +29,7 @@
background-color: @gn-main-bg;
display: flex;
flex-direction: column;
- position: sticky;
+ position: relative;
width: 100%;
height: 100%;
.gn-filter-form-header {
@@ -67,17 +67,6 @@
position: sticky;
bottom: 0;
padding: 0.5rem;
-
- @media only screen and (max-width : 768px) {
- width: 100%;
- }
- }
- @media only screen and (max-width : 768px) {
- max-height:100% !important;
- height: 100%;
- top: 0 !important;
- margin-top: 0 !important;
-
}
.gn-filter-form-divider {
width: calc(100% - 0.5rem);
@@ -96,3 +85,24 @@
margin-right: auto;
margin-left: auto;
}
+
+.gn-fixed-card-grid {
+ .gn-filter-form {
+ max-width: 500px;
+ }
+ &.gn-size-md {
+ .gn-filter-form {
+ max-width: 400px;
+ }
+ }
+ &.gn-size-sm {
+ .gn-filter-form {
+ position: absolute;
+ left: 0;
+ width: 100%;
+ max-width: 100%;
+ height: 100%;
+ z-index: 100;
+ }
+ }
+}
diff --git a/geonode_mapstore_client/client/themes/geonode/less/_filter-menu.less b/geonode_mapstore_client/client/themes/geonode/less/_filter-menu.less
deleted file mode 100644
index a7fd19990f..0000000000
--- a/geonode_mapstore_client/client/themes/geonode/less/_filter-menu.less
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright 2020, GeoSolutions Sas.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-// **************
-// Theme
-// **************
-
-#gn-components-theme(@theme-vars) {
- .gn-filters-menu {
- .color-var(@theme-vars[main-variant-color]);
- .background-color-var(@theme-vars[main-variant-bg]);
- .btn-default {
- background: transparent;
- border-color: transparent;
- }
- .gn-menu-index-divider {
- .background-color-var(@theme-vars[main-border-color]);
- }
- }
-}
-
-// **************
-// Layout
-// **************
-
-.gn-filters-menu {
- position: sticky;
- min-height: 3rem;
- width: 100%;
- background-color: inherit;
- display: flex;
- flex-direction: row;
- align-items: center;
- padding: 0.5rem 0;
- z-index: 10;
- .gn-filters-menu-container {
- display: flex;
- flex-direction: row;
- align-items: center;
- max-width: @gn-page-max-width;
- margin: auto;
- width: 100%;
- padding: 0 0.8rem;
- .gn-filters-menu-main {
- flex: 1;
- }
- .gn-cards-menu {
- margin: 0;
- display: flex;
- align-items: center;
- list-style-type: none;
- padding: 0;
- .gn-menu-index-divider {
- width: 1px;
- height: 1.2rem;
- margin: 0.25rem;
- }
- }
- .gn-filters-menu-tools > * {
- margin: 0 0 0 0.8rem;
- }
- }
-}
diff --git a/geonode_mapstore_client/client/themes/geonode/less/_home-container.less b/geonode_mapstore_client/client/themes/geonode/less/_home-container.less
index ea809102b5..22d181fc31 100644
--- a/geonode_mapstore_client/client/themes/geonode/less/_home-container.less
+++ b/geonode_mapstore_client/client/themes/geonode/less/_home-container.less
@@ -20,7 +20,12 @@
// **************
// Layout
// **************
-
+.gn-content {
+ position: relative;
+ max-width: 1440px;
+ margin: auto;
+ width: 100%;
+}
.gn-main-home {
.gn-container{
display: flex;
@@ -31,6 +36,7 @@
flex-wrap: wrap;
margin: 0;
}
+
}
.gn-grid-container{
diff --git a/geonode_mapstore_client/client/themes/geonode/less/_menu-index.less b/geonode_mapstore_client/client/themes/geonode/less/_menu-index.less
deleted file mode 100644
index 5c3a2e453a..0000000000
--- a/geonode_mapstore_client/client/themes/geonode/less/_menu-index.less
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright 2020, GeoSolutions Sas.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-// **************
-// Theme
-// **************
-
-#gn-components-theme(@theme-vars) {
- .gn-menu-index-divider {
- .background-color-var(@theme-vars[primary-contrast]);
- }
-}
-
-// **************
-// Layout
-// **************
-
-.gn-menu-index {
- position: sticky;
- min-height: 3rem;
- width: 100%;
- padding: 0.5rem 0;
- z-index: 15;
- display: flex;
- flex-direction: row;
- align-items: center;
- .badge {
- margin-left: 0.5rem;
- padding: 0.2rem;
- font-size: 0.6rem;
- border-radius: 0.2rem;
- }
- .gn-menu-index-container {
- display: flex;
- flex-direction: row;
- align-items: center;
- margin: auto;
- width: 100%;
- .gn-menu-index-content {
- flex: 1;
- margin: 0 0 0 0.4rem;
- }
- .gn-menu-index-tools > * {
- margin: 0 0.8rem;
- }
- .gn-menu-index-divider {
- width: 1px;
- height: 1.2rem;
- }
- .gn-menu-index-tools {
- display: flex;
- align-items: center;
- /* remove this inline style of dropdown because they cause issue with overflow x*/
- .dropdown-menu {
- transform: none !important;
- inset: unset !important;
- }
- .dropdown-menu-right {
- right: 0 !important;
- }
- .gn-menu-index-right-items {
- display: flex;
- align-items: center;
- list-style-type: none;
- padding: 0;
- margin: 0;
- li + li {
- margin-left: 0.4rem;
- }
- }
- }
-
- .btn-default,
- .gn-tag {
- font-size: @font-size-base;
- border: none;
- padding: 0.25rem 0.5rem;
- border-radius: 0.25rem;
- }
- .gn-language-selector {
- &> .btn-default {
- &.active {
- color: inherit;
- background-color: inherit;
- font-weight: bold;
- text-decoration: underline;
- }
- }
- }
- }
-}
diff --git a/geonode_mapstore_client/client/themes/geonode/less/_menu.less b/geonode_mapstore_client/client/themes/geonode/less/_menu.less
index 08cc5bb9be..8a5903e627 100644
--- a/geonode_mapstore_client/client/themes/geonode/less/_menu.less
+++ b/geonode_mapstore_client/client/themes/geonode/less/_menu.less
@@ -3,9 +3,36 @@
// **************
#gn-components-theme(@theme-vars) {
- .gn-menu-index-divider {
+ .gn-menu-divider {
.background-color-var(@theme-vars[primary-contrast]);
}
+ .gn-menu {
+ .color-var(@theme-vars[main-color]);
+ .background-color-var(@theme-vars[main-bg]);
+ &.gn-primary {
+ .color-var(@theme-vars[primary-contrast]);
+ .background-color-var(@theme-vars[primary]);
+ }
+ &.gn-default {
+ .color-var(@theme-vars[main-variant-color]);
+ .background-color-var(@theme-vars[main-variant-bg]);
+ .btn-default {
+ background: transparent;
+ border-color: transparent;
+ &:hover {
+ .color-var(@theme-vars[main-hover-color]);
+ .background-color-var(@theme-vars[main-hover-bg]);
+ }
+ &.active {
+ .color-var(@theme-vars[primary-contrast]);
+ .background-color-var(@theme-vars[primary]);
+ }
+ }
+ .gn-menu-divider {
+ .background-color-var(@theme-vars[main-border-color]);
+ }
+ }
+ }
}
// **************
@@ -20,3 +47,139 @@
.dropdown-menu .divider {
margin: 0.5rem 0;
}
+
+.gn-main-header {
+ position: fixed;
+ top: 0;
+ width: 100%;
+ z-index: 150;
+}
+
+.gn-main-header-placeholder {
+ position: relative;
+ width: 100%;
+}
+
+#gn-topbar {
+ position: sticky;
+ top: 0;
+ z-index: 100;
+}
+
+.gn-language-selector {
+ .dropdown-menu {
+ height: auto;
+ max-height: 400px;
+ overflow: auto;
+ }
+ &.inline {
+ padding: 0.5rem;
+ }
+ .btn.active {
+ font-weight: bold;
+ text-decoration: underline;
+ }
+}
+
+.gn-menu {
+ display: flex;
+ width: 100%;
+ position: relative;
+ padding: 0.5rem 0;
+ min-height: 3rem;
+
+ &.gn-default {
+ padding: 0.25rem 0;
+ font-size: @font-size-sm;
+ min-height: 2rem;
+ .nav-link {
+ font-size: @font-size-sm;
+ }
+ }
+ .dropdown-menu li button {
+ width: 100%;
+ text-align: left;
+ padding: 3px 20px;
+ }
+
+ &.gn-menu-symmetric {
+ .gn-menu-content-left,
+ .gn-menu-content-right {
+ display: flex;
+ flex: 1;
+ flex-direction: row;
+ min-width: 0;
+ }
+ .gn-menu-content-right {
+ flex-direction: row-reverse;
+ }
+ }
+ .gn-menu-container {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ margin: auto;
+ width: 100%;
+ }
+ .gn-menu-content {
+ display: flex;
+ flex-direction: row;
+ flex: 1;
+ padding: 0 0.8rem;
+ align-items: center;
+ }
+
+ .gn-menu-content-left {
+ display: flex;
+ flex: 1;
+ flex-direction: row;
+ min-width: 0;
+ }
+
+ .gn-menu-list {
+ display: inline-flex;
+ align-items: center;
+ flex-direction: row;
+ list-style-type: none;
+ padding: 0;
+ margin: 0;
+ >li+li {
+ margin-left: 0.4rem;
+ }
+ img {
+ width: auto;
+ height: 2.5rem;
+ }
+ }
+ .gn-menu-content-side {
+ position: relative;
+ }
+ >.dropdown {
+ visibility: hidden;
+ }
+
+ .gn-user-menu-dropdown {
+ > button {
+ padding: 0;
+ background-color: transparent;
+ border-color: transparent;
+ border-radius: 50%;
+ img {
+ border-radius: 50%;
+ }
+ }
+ }
+ .gn-menu-divider {
+ width: 1px;
+ height: 1.2rem;
+ }
+ .gn-menu-fill {
+ flex: 1;
+ }
+}
+
+.gn-filters-menu {
+ position: sticky;
+ top: 0px;
+ z-index: 10;
+}
diff --git a/geonode_mapstore_client/client/themes/geonode/less/_search-bar.less b/geonode_mapstore_client/client/themes/geonode/less/_search-bar.less
index 45ed7185ad..30b1407882 100644
--- a/geonode_mapstore_client/client/themes/geonode/less/_search-bar.less
+++ b/geonode_mapstore_client/client/themes/geonode/less/_search-bar.less
@@ -36,6 +36,18 @@
z-index: 20;
border-width: 2px;
border-style: solid;
+ min-width: 500px;
+ .input-group {
+ display: flex;
+ }
+ .input-group-append,
+ .input-group-prepend {
+ display: flex;
+ align-items: center;
+ }
+ .input-group-append {
+ padding: 0 0.25rem;
+ }
&.focus {
outline-width: 3px;
outline-style: solid;
diff --git a/geonode_mapstore_client/client/themes/geonode/less/geonode-legacy.less b/geonode_mapstore_client/client/themes/geonode/less/geonode-legacy.less
index 894490faed..b7e20a250c 100644
--- a/geonode_mapstore_client/client/themes/geonode/less/geonode-legacy.less
+++ b/geonode_mapstore_client/client/themes/geonode/less/geonode-legacy.less
@@ -1,5 +1,591 @@
+// **************
+// Theme
+// **************
+
+#gn-components-theme(@theme-vars) {
+
+ .gn-legacy {
+
+ select {
+ .background-color-var(@theme-vars[main-bg]);
+ .border-color-var(@theme-vars[main-border-color]);
+ }
+
+ code {
+ .color-var(@theme-vars[main-variant-color]);
+ .background-color-var(@theme-vars[main-variant-bg]);
+ }
+
+ form {
+ input {
+ .border-color-var(@theme-vars[main-border-color]);
+ }
+ }
+
+ .help-tip {
+ background-color: #BCDBEA;
+
+ &:before {
+ color: #fff;
+ }
+
+ p {
+ background-color: #1E2021;
+ box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
+ color: #FFF;
+
+ &:before {
+ border: 6px solid transparent;
+ border-bottom-color: #1E2021;
+ }
+ }
+ }
+
+ .button-tip {
+
+ p {
+ background-color: #1E2021;
+ box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
+ color: #FFF;
+
+ &:before {
+ border: 6px solid transparent;
+ border-bottom-color: #1E2021;
+ }
+ }
+ }
+
+ .panel-heading {
+ [data-toggle="collapse"] {
+ &:after {
+ .color-var(@theme-vars[primary]);
+ }
+ }
+
+ [data-toggle="collapse"].collapsed {
+ &:after {
+ .color-var(@theme-vars[main-color]);
+ }
+ }
+ }
+
+ #wrap {
+ .background-color-var(@theme-vars[main-bg]);
+ }
+
+ .navbar-inverse {
+ background-color: @gray-dark;
+
+ .navbar-nav>li>a {
+ color: white;
+
+ &:hover {
+ .background-color-var(@theme-vars[primary]);
+ }
+ }
+ }
+
+ .navbar-inverse .navbar-nav>.open>a,
+ .navbar-inverse .navbar-nav>.open>a:focus,
+ .navbar-inverse .navbar-nav>.open>a:hover {
+ .background-color-var(@theme-vars[primary]);
+ }
+
+ .navbar-nav {
+ .dropdown-menu {
+ .background-color-var(@theme-vars[primary]);
+ border-top: 1px solid @brand-primary;
+
+ a {
+ color: white;
+ }
+
+ li a {
+ &:hover {
+ background-color: darken(@brand-primary, 10%);
+ color: white;
+ }
+ }
+
+ .divider {
+ background-color: darken(@brand-primary, 10%);
+ }
+ }
+
+ .search {
+ color: #444;
+ }
+
+ .search input {
+ border: 1px solid @gray-dark;
+ }
+
+ }
+
+ .navbar-header {
+ i {
+ color: white;
+ }
+ }
+
+ .home {
+ .navbar-inverse {
+ background-color: rgba(0, 0, 0, 0.5);
+ }
+
+ .jumbotron {
+ background: @brand-primary;
+ color: white;
+ text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.4);
+
+ a {
+ color: @brand-warning;
+ }
+
+ .btn-default {
+ background: rgba(0, 0, 0, 0.2);
+ border: 2px solid white;
+ color: white;
+
+ &:hover {
+ background: rgba(0, 0, 0, 0.4);
+ }
+ }
+ }
+
+ .big-search {
+ background: @gray-dark;
+ color: white;
+
+ a {
+ .color-var(@theme-vars[primary]);
+ }
+
+ .search {
+ color: #444;
+ }
+
+ .search input {
+ border: 1px solid @gray-dark;
+ }
+
+ .btn-default {
+ color: @brand-warning;
+ }
+ }
+
+ #datasets {
+
+ a {
+ color: @gray-dark;
+
+ .category {
+ &:hover {
+ .color-var(@theme-vars[primary]);
+ }
+ }
+
+ span {
+ font-size: 4em;
+ }
+ }
+ }
+
+ #showcase {
+ background: @gray-lighter;
+ }
+ }
+
+ .jumbotron {
+ background: @brand-primary;
+ color: white;
+ text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.4);
+
+ a {
+ color: @brand-warning;
+ }
+ }
+
+ .home-facets {
+ a {
+ color: black;
+
+ &:hover {
+ color: @link-color;
+ }
+ }
+ }
+
+ .items-list {
+
+ .item-info {
+ border-top: 1px solid @gray-lighter;
+ }
+
+ h4 {
+ a {
+ color: @text-color;
+
+ &:hover {
+ color: @brand-danger;
+ }
+ }
+ }
+
+ .owner {
+ color: @text-color;
+
+ a {
+ color: @text-color;
+
+ &:hover {
+ color: @brand-danger;
+ }
+ }
+ }
+
+ .thumb {
+ img {
+ border: 1px solid @gray-lighter;
+ }
+ }
+
+ .abstract {
+ color: @gray-light;
+ }
+
+ .actions {
+ color: @gray-light;
+
+ a {
+ color: @gray-light;
+
+ &:hover {
+ color: @gray;
+ }
+ }
+ }
+ }
+
+ .profile-avatar {
+ background: white;
+ border: 1px solid @gray-light;
+
+ h5 a {
+ color: @text-color;
+
+ &:hover {
+ color: @brand-danger;
+ }
+
+ i {
+ &:hover {
+ color: @brand-danger;
+ }
+ }
+ }
+ }
+
+ .item-details {
+ .color-var(@theme-vars[main-color]);
+ .background-color-var(@theme-vars[main-bg]);
+
+ .item-items {
+ .border-top-color-var(@theme-vars[main-border-color]);
+ }
+ }
+
+ .profile-avatar {
+ background: white;
+ border: 1px solid @gray-lighter;
+
+ h5 a {
+ color: @text-color;
+
+ &:hover {
+ color: @brand-danger;
+ }
+
+ i {
+ margin-left: 0.75em;
+
+ &:hover {
+ color: @brand-danger;
+ }
+ }
+ }
+
+ .profile-items {
+ border-top: 1px solid @gray-lighter;
+ color: @gray;
+
+ i {
+ a {
+ &:hover {
+ color: @brand-danger;
+ }
+ }
+ }
+ }
+
+ li a {
+ color: @gray;
+
+ &:hover {
+ color: @brand-danger;
+ }
+ }
+ }
+
+ .profile-details {
+ .color-var(@theme-vars[main-color]);
+ .background-color-var(@theme-vars[main-bg]);
+ }
+
+ nav.filter {
+ h4 {
+ background: @gray;
+
+ a {
+ color: white;
+ }
+ }
+
+ .active {
+ .color-var(@theme-vars[primary]);
+
+ .badge {
+ background: @brand-primary;
+ }
+ }
+
+ li a {
+ border-bottom: 1px solid @gray-lighter;
+ }
+ }
+
+ #sort {
+ a {
+ color: @gray-light;
+ }
+
+ .selected {
+ .color-var(@theme-vars[primary]);
+ }
+ }
+
+ .group-avatar {
+ border: 1px solid @gray-lighter;
+
+ h5 a {
+ color: @text-color;
+
+ &:hover {
+ color: @brand-danger;
+ }
+
+ i {
+ &:hover {
+ color: @brand-danger;
+ }
+ }
+ }
+ }
+
+ .group-items {
+ border-top: 1px solid @gray-lighter;
+ color: @gray;
+
+ i {
+ a {
+ &:hover {
+ color: @brand-danger;
+ }
+ }
+ }
+ }
+
+ #drop-zone {
+ .color-var(@theme-vars[main-variant-color]);
+ .background-color-var(@theme-vars[main-variant-bg]);
+ .border-color-var(@theme-vars[main-border-color]);
+ h3 {
+ .color-var(@theme-vars[main-color]);
+ }
+ }
+
+ #upload_form {
+ input[type="text"]:focus {
+ border: solid 1px #707070;
+ box-shadow: 0 0 5px 1px #969696;
+ }
+ }
+
+ .comment-author {
+ color: #777;
+ }
+
+ .activity-item {
+ border-bottom: 1px solid @gray-light;
+ border-left: 1px solid @gray-light;
+ color: @gray-light;
+ }
+
+ .icon-activity {
+ border: 2px solid white;
+ color: white;
+ }
+
+ .thumb-activity {
+ img {
+ border: 1px solid @gray;
+ }
+ }
+
+ .modal-body .list-unstyled a {
+ color: @text-color;
+
+ &:hover {
+ .color-var(@theme-vars[primary]);
+ }
+ }
+
+ .modal-divider {
+ border-bottom: 1px solid #e1e8ed;
+ }
+
+ @media (max-width: 991px) {
+
+ .navbar-collapse {
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
+ }
+
+ .home .navbar-inverse {
+ background-color: @gray-dark;
+ }
+ }
+
+ #wrong-data-type {
+ .color-var(@theme-vars[danger]);
+ }
+
+ #hr_filter_layer {
+ .color-var(@theme-vars[main-color]);
+ }
+
+ #missing-values {
+ .color-var(@theme-vars[danger]);
+ }
+
+ .has-error {
+ .color-var(@theme-vars[danger], true);
+ }
+
+ .has-error .select2-selection {
+ .border-color-var(@theme-vars[danger], true);
+ }
+
+ .autocomplete-input .ac-results {
+ border: 1px solid #eeeeee;
+ }
+
+ .autocomplete-input .ac-results .result-wrapper {
+ border-bottom: 1px solid #eeeeee;
+ .background-color-var(@theme-vars[main-bg]);
+ }
+
+ .autocomplete-input .ac-results .result-wrapper:hover {
+ background-color: #eeeeee;
+ }
+
+ .autocomplete-input .ac-results .result-wrapper .ac-result {
+ color: black;
+ }
+
+ .inbox-checkbox {
+
+ label::before {
+ border-color: @gray-light;
+ }
+
+ label::after {
+ border-color: @gray-light;
+ }
+ }
+
+ .inbox-icons {
+ button {
+ color: white;
+ }
+
+ color: #636363;
+ }
+
+ .create-msg-form-control {
+ .background-color-var(@theme-vars[main-bg]);
+ border: 1px solid #ccc;
+ }
+
+ .home .geonode-slide-show .jumbotron {
+ .container {
+ .carousel-control span {
+ color: #000;
+ }
+
+ .carousel-caption {
+ background: rgba(0, 0, 0, 0.4);
+ }
+ }
+ }
+
+ .iso-categories .row {
+ span {
+ background-color: #2d689c;
+ }
+
+ a:hover span {
+ background-color: black;
+ }
+ }
+
+ .lmask {
+ background-color: #000;
+
+
+ &:before {
+ background-color: rgba(0, 0, 0, 0);
+ border: 5px solid rgba(0, 183, 229, 0.9);
+ border-right: 5px solid rgba(0, 0, 0, 0);
+ border-left: 5px solid rgba(0, 0, 0, 0);
+ box-shadow: 0 0 35px #2187e7;
+ }
+
+ &:after {
+ background-color: rgba(0, 0, 0, 0);
+ border: 5px solid rgba(0, 183, 229, 0.9);
+ border-left: 5px solid rgba(0, 0, 0, 0);
+ border-right: 5px solid rgba(0, 0, 0, 0);
+ box-shadow: 0 0 15px #2187e7;
+ }
+ }
+ }
+
+ .wizard--progress > li.is-complete a {
+ .color-var(@theme-vars[main-color]);
+ }
+}
+
+// **************
+// Layout
+// **************
+
.gn-legacy {
+ padding: 0;
.modal {
display: none;
}
-}
+ .gn-main-header,
+ #gn-topbar {
+ z-index: 1100;
+ }
+}
\ No newline at end of file
diff --git a/geonode_mapstore_client/client/themes/geonode/less/geonode.less b/geonode_mapstore_client/client/themes/geonode/less/geonode.less
index 86c9948934..975933dd10 100644
--- a/geonode_mapstore_client/client/themes/geonode/less/geonode.less
+++ b/geonode_mapstore_client/client/themes/geonode/less/geonode.less
@@ -3,18 +3,14 @@
@import 'ms-theme.less';
@import '_base.less';
-@import '_action-navbar.less';
-@import '_brand-navbar.less';
@import '_card-grid.less';
@import '_details-panel.less';
@import '_filter-by-extent.less';
@import '_filter-form.less';
-@import '_filter-menu.less';
@import '_footer.less';
@import '_hero.less';
@import '_loader.less';
@import '_main-loader.less';
-@import '_menu-index.less';
@import '_menu.less';
@import '_resource-card.less';
@import '_search-bar.less';
diff --git a/geonode_mapstore_client/hooksets.py b/geonode_mapstore_client/hooksets.py
index 3d7efaec99..e63b129516 100644
--- a/geonode_mapstore_client/hooksets.py
+++ b/geonode_mapstore_client/hooksets.py
@@ -21,10 +21,10 @@
def resource_list_url(resource_type):
- return '/#/search/?filter{resource_type.in}' + '={}'.format(resource_type)
+ return '/catalogue/#/search/?filter{resource_type.in}' + '={}'.format(resource_type)
def resource_detail_url(resource_type, resource_id):
- return '/viewer/#/{}/{}'.format(resource_type, resource_id)
+ return '/catalogue/#/{}/{}'.format(resource_type, resource_id)
class MapStoreHookSet(BaseHookSet):
diff --git a/geonode_mapstore_client/templates/base.html b/geonode_mapstore_client/templates/base.html
new file mode 100644
index 0000000000..6a867a8b14
--- /dev/null
+++ b/geonode_mapstore_client/templates/base.html
@@ -0,0 +1,28 @@
+{% extends "base.html" %}
+
+{% load static %}
+
+{% block html_class %}msgapi{% endblock %}
+
+{% block extra_head %}
+
+
+{% endblock %}
+
+
+{% block body_extra_class %}gn-legacy gn-theme gn-theme-light{% endblock %}
+
+{% block header %}
+{% include './geonode-mapstore-client/snippets/header.html' %}
+{% endblock %}
+
+{% block footer %}
+{% include './geonode-mapstore-client/snippets/footer.html' %}
+{% endblock %}
+
+{% block extra_script %}
+
+{% endblock extra_script %}
diff --git a/geonode_mapstore_client/templates/geonode-mapstore-client/catalogue.html b/geonode_mapstore_client/templates/geonode-mapstore-client/catalogue.html
new file mode 100644
index 0000000000..6883ffd333
--- /dev/null
+++ b/geonode_mapstore_client/templates/geonode-mapstore-client/catalogue.html
@@ -0,0 +1,59 @@
+{% load static %}
+{% load client_lib_tags %}
+{% load client_version %}
+
+
+
+
+
+
+
+
+
+
{{ SITE_NAME }}
+
+ {% include './snippets/loader_style.html' %}
+ {% block extra_style %}
+ {% endblock %}
+
+
+
+
+ {% block gn_config %}
+ {% include './_geonode_config.html' %}
+ {% endblock %}
+
+ {% block header %}
+ {% include './snippets/header.html' %}
+ {% endblock %}
+
+ {% block container %}
+
+ {% endblock %}
+
+ {% block ms_scripts %}
+
+ {% endblock %}
+
+ {% block footer %}
+ {% include './snippets/footer.html' %}
+ {% endblock %}
+
+ {% block scripts %}
+
+
+
+ {% endblock %}
+
+
+
diff --git a/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/brand_navbar.html b/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/brand_navbar.html
new file mode 100644
index 0000000000..503cef3a62
--- /dev/null
+++ b/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/brand_navbar.html
@@ -0,0 +1,34 @@
+{% load get_menu_json %}
+{% get_user_menu as USER_MENU %}
+
+
diff --git a/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/footer.html b/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/footer.html
new file mode 100644
index 0000000000..b84287ccfc
--- /dev/null
+++ b/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/footer.html
@@ -0,0 +1,21 @@
+
+
+
diff --git a/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/header.html b/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/header.html
new file mode 100644
index 0000000000..afe8d2427b
--- /dev/null
+++ b/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/header.html
@@ -0,0 +1,29 @@
+{% load static %}
+
+ {% include './brand_navbar.html' with id='gn-brand-navbar' %}
+
+
+{% if show_hero %}
+ {% include './hero.html' %}
+{% endif %}
+
+{% include './topbar.html' with id='gn-topbar' %}
+
+
diff --git a/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/hero.html b/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/hero.html
new file mode 100644
index 0000000000..66531b026c
--- /dev/null
+++ b/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/hero.html
@@ -0,0 +1,11 @@
+{% load i18n %}
+
+
+
+
{% trans 'GeoNode' %}
+
{% trans 'sharing geospatial data and maps.' %}
+
+
+
+
+
diff --git a/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/language_selector.html b/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/language_selector.html
new file mode 100644
index 0000000000..204c23c744
--- /dev/null
+++ b/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/language_selector.html
@@ -0,0 +1,90 @@
+{% load i18n %}
+{% if csrf_token != "NOTPROVIDED" %}
+{% get_current_language as LANGUAGE %}
+{% get_language_info for LANGUAGE as lang_info %}
+
+
+
+ {% if inline %}
+
+ {% for lang in LANGUAGES %}
+
+ {% endfor %}
+
+
+ {% else %}
+
+
+
+
+
+
+
+
+
+ {% endif %}
+{% endif %}
\ No newline at end of file
diff --git a/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/loader.html b/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/loader.html
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/loader_style.html b/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/loader_style.html
new file mode 100644
index 0000000000..b1e696637c
--- /dev/null
+++ b/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/loader_style.html
@@ -0,0 +1,57 @@
+
diff --git a/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/menu_item.html b/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/menu_item.html
new file mode 100644
index 0000000000..11d3ffc3a3
--- /dev/null
+++ b/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/menu_item.html
@@ -0,0 +1,59 @@
+{% load i18n %}
+{% if menu_item %}
+ {% if menu_item.type == 'link' %}
+
+
+ {% trans menu_item.label %}
+
+
+ {% endif %}
+ {% if menu_item.type == 'divider' %}
+
+ {% endif %}
+ {% if menu_item.type == 'dropdown' %}
+
+
+
+ {% endif %}
+{% endif %}
diff --git a/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/menu_item_compact.html b/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/menu_item_compact.html
new file mode 100644
index 0000000000..fce10bf326
--- /dev/null
+++ b/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/menu_item_compact.html
@@ -0,0 +1,34 @@
+{% load i18n %}
+{% if menu_item %}
+ {% if menu_item.type == 'link' %}
+
+
+ {% trans menu_item.label %}
+
+
+ {% endif %}
+ {% if menu_item.type == 'dropdown' %}
+
+ {% for child_item in menu_item.items %}
+ {% if child_item.type == 'link' %}
+
+
+ {% trans child_item.label %}
+ {% if menu_item.badge %}
+ {{ menu_item.badge }}
+ {% endif %}
+
+
+ {% endif %}
+ {% endfor %}
+ {% if not forloop.last %}
+
+ {% endif %}
+ {% endif %}
+{% endif %}
diff --git a/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/search_bar.html b/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/search_bar.html
new file mode 100644
index 0000000000..fd105fe326
--- /dev/null
+++ b/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/search_bar.html
@@ -0,0 +1,238 @@
+
+
+
+
diff --git a/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/topbar.html b/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/topbar.html
new file mode 100644
index 0000000000..7d9300c19a
--- /dev/null
+++ b/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/topbar.html
@@ -0,0 +1,107 @@
+{% load get_menu_json %}
+{% get_base_left_topbar_menu as BASE_LEFT_TOPBAR_MENU %}
+{% get_menu_json 'TOPBAR_MENU' as TOPBAR_MENU %}
+{% get_menu_json 'TOP_MENUBAR_LEFT' as TOP_MENUBAR_LEFT %}
+{% get_menu_json 'TOP_MENUBAR_RIGHT' as TOP_MENUBAR_RIGHT %}
+
+
+
diff --git a/geonode_mapstore_client/templates/geonode-mapstore-client/viewer.html b/geonode_mapstore_client/templates/geonode-mapstore-client/viewer.html
deleted file mode 100644
index 311d152f96..0000000000
--- a/geonode_mapstore_client/templates/geonode-mapstore-client/viewer.html
+++ /dev/null
@@ -1,96 +0,0 @@
-{% load static %}
-{% load client_lib_tags %}
-{% load client_version %}
-
-
-
-
-
-
-
-
-
{{ SITE_NAME }}
-
-
-
-
-
-
- {% include './_geonode_config.html' %}
-
-
-
-
diff --git a/geonode_mapstore_client/templates/index.html b/geonode_mapstore_client/templates/index.html
index 475f1efee5..13e795709d 100644
--- a/geonode_mapstore_client/templates/index.html
+++ b/geonode_mapstore_client/templates/index.html
@@ -1,82 +1,62 @@
{% load static %}
{% load client_version %}
-
+
+
{{ SITE_NAME }}
-
+ {% include './geonode-mapstore-client/snippets/loader_style.html' %}
+ {% block extra_style %}
+ {% endblock %}
-
+
{% include './geonode-mapstore-client/_geonode_config.html' %}
-
-
-
-
-
+ {% block header %}
+ {% include './geonode-mapstore-client/snippets/header.html' with show_hero=True %}
+ {% endblock %}
+
+ {% block content %}
+ {% comment %}
+
+
-
-
+ {% endcomment %}
+ {% endblock %}
+
+ {% block container %}
+
+ {% endblock %}
+
+ {% block ms_scripts %}
+
+ {% endblock %}
+
+ {% block footer %}
+ {% include './geonode-mapstore-client/snippets/footer.html' %}
+ {% endblock %}
+
+ {% block scripts %}
+
+
+
+ {% endblock %}
diff --git a/geonode_mapstore_client/templatetags/get_menu_json.py b/geonode_mapstore_client/templatetags/get_menu_json.py
index bd745a40ac..294d0e0784 100644
--- a/geonode_mapstore_client/templatetags/get_menu_json.py
+++ b/geonode_mapstore_client/templatetags/get_menu_json.py
@@ -12,6 +12,217 @@ def _handle_single_item(menu_item):
m_item['target'] = '_blank'
return m_item
+@register.simple_tag
+def get_base_left_topbar_menu():
+
+ return [
+ {
+ "label": "Datasets",
+ "type": "dropdown",
+ "items": [
+ {
+ "type": "link",
+ "href": "/catalogue/#/search/?filter{resource_type.in}=layer",
+ "label": "Datasets"
+ },
+ {
+ "type": "divider"
+ },
+ {
+ "type": "link",
+ "href": "/layers/upload",
+ "label": "Upload dataset"
+ }
+ ]
+ },
+ {
+ "label": "Documents",
+ "type": "dropdown",
+ "items": [
+ {
+ "type": "link",
+ "href": "/catalogue/#/search/?filter{resource_type.in}=document",
+ "label": "Documents"
+ },
+ {
+ "type": "divider"
+ },
+ {
+ "type": "link",
+ "href": "/documents/upload",
+ "label": "Upload document"
+ }
+ ]
+ },
+ {
+ "type": "divider"
+ },
+ {
+ "label": "Maps",
+ "type": "dropdown",
+ "items": [
+ {
+ "type": "link",
+ "href": "/catalogue/#/search/?filter{resource_type.in}=map",
+ "label": "Explore maps"
+ },
+ {
+ "type": "divider"
+ },
+ {
+ "type": "link",
+ "href": "/catalogue/#/map/new",
+ "label": "Create Map"
+ }
+ ]
+ },
+ {
+ "label": "GeoStories",
+ "type": "dropdown",
+ "items": [
+ {
+ "type": "link",
+ "href": "/catalogue/#/search/?filter{resource_type.in}=geostory",
+ "label": "GeoStories"
+ },
+ {
+ "type": "divider"
+ },
+ {
+ "type": "link",
+ "href": "/catalogue/#/geostory/new",
+ "label": "Create GeoStory"
+ }
+ ]
+ },
+ {
+ "label": "About",
+ "type": "dropdown",
+ "items": [
+ {
+ "type": "link",
+ "href": "/people/",
+ "label": "People"
+ },
+ {
+ "type": "link",
+ "href": "/groups/",
+ "label": "Groups"
+ },
+ {
+ "type": "link",
+ "href": "/groups/categories/",
+ "label": "Groups categories"
+ },
+ {
+ "type": "link",
+ "href": "/announcements/",
+ "label": "Announcements"
+ },
+ {
+ "type": "divider"
+ },
+ {
+ "type": "link",
+ "href": "/invitations/geonode-send-invite/",
+ "label": "Invite users"
+ },
+ {
+ "type": "link",
+ "href": "/admin/people/profile/add/",
+ "label": "Add user"
+ },
+ {
+ "type": "link",
+ "href": "/groups/create/",
+ "label": "Create group"
+ }
+ ]
+ }
+ ]
+
+@register.simple_tag
+def get_user_menu():
+
+ '''
+ if user is not authenticated
+ {
+ "label": "Register",
+ "type": "link",
+ "href": "/account/signup/?next=/"
+ },
+ {
+ "label": "Sign in",
+ "type": "link",
+ "href": "/account/login/?next=/"
+ }
+ '''
+
+ '''
+ if user is authenticated
+ '''
+ return [
+
+ {
+ # get src of user avatar
+ "image": "https://www.gravatar.com/avatar/7a68c67c8d409ff07e42aa5d5ab7b765/?s=240",
+ "type": "dropdown",
+ "className": "gn-user-menu-dropdown",
+ "items": [
+ {
+ "type": "link",
+ # get href of user profile
+ "href": "{state('user') && state('user').hrefProfile}",
+ "label": "Profile"
+ },
+ {
+ "type": "link",
+ "href": "/social/recent-activity",
+ "label": "Recent activity"
+ },
+ {
+ "type": "link",
+ "href": "/favourite/list/",
+ "label": "Favorites"
+ },
+ {
+ "type": "link",
+ "href": "/messages/inbox/",
+ "label": "Inbox"
+ },
+ {
+ "type": "divider"
+ },
+ {
+ "type": "link",
+ "href": "/admin/",
+ "label": "Admin"
+ },
+ {
+ "type": "link",
+ "href": "/geoserver/",
+ "label": "GeoServer"
+ },
+ {
+ "type": "divider"
+ },
+ {
+ "type": "link",
+ "href": "/help/",
+ "label": "Help"
+ },
+ {
+ "type": "divider"
+ },
+ {
+ "type": "link",
+ "href": "/account/logout/?next=/",
+ "label": "Log out"
+ }
+ ]
+ }
+ ]
+
@register.simple_tag
def get_menu_json(placeholder_name):
menus = {
diff --git a/geonode_mapstore_client/templatetags/local_config.py b/geonode_mapstore_client/templatetags/local_config.py
new file mode 100644
index 0000000000..1a472d594f
--- /dev/null
+++ b/geonode_mapstore_client/templatetags/local_config.py
@@ -0,0 +1,29 @@
+import os
+import logging
+import json
+
+from django import template
+from django.conf import settings
+from django.contrib.staticfiles.finders import find
+
+logger = logging.getLogger(__name__)
+register = template.Library()
+
+@register.simple_tag
+def get_local_config():
+ local_config_path = 'mapstore/configs/localConfig.json'
+ if settings.DEBUG:
+ file_path = find(local_config_path)
+ else:
+ file_path = os.path.join(
+ settings.STATIC_ROOT,
+ local_config_path
+ )
+ try:
+ with open(file_path, 'r') as f:
+ data = json.load(f)
+ print(file_path)
+ return data
+ except Exception as e:
+ logger.error(e)
+ return {}