Slide 8
Slide 8 text
Theming
• Example of template snippet to customize the color theme
{% load static %}
{% block content %}
.msgapi .gn-theme {
--gn-primary: #388AC8;
--gn-primary-contrast: #ffffff;
--gn-link-color: #397AAB;
--gn-link-hover-color: #1b4d74;
--gn-focus-color: rgba(57, 122, 171, 0.4);
--gn-footer-color: #ffffff;
--gn-footer-bg: #034f78;
--gn-footer-link-color: #ffffff;
--gn-footer-link-hover-color: #dddddd;
--gn-loader-primary-contrast-color: #ffffff;
--gn-loader-primary-contrast-fade-color: rgba(255, 255, 255, 0.2);
--gn-loader-primary-color: #388AC8;
--gn-loader-primary-fade-color: rgba(56, 138, 200, 0.2);
(….)
{% extends 'geonode-mapstore-client/_geonode_config.html' %}
{% block override_local_config %}
<script>
window.__GEONODE_CONFIG__.overrideLocalConfig =
function(localConfig, _) {
const config = _.mergeWith(localConfig, {
"translationsPath": [
"/static/mapstore/ms-translations",
"/static/mapstore/gn-translations",
"/static/mapstore/translations"
]
}, function(objValue, srcValue, key) {
if (_.isArray(objValue)) {
return srcValue;
}
// supportedLocales is an object so it's merged with the default one
// so to remove the default languages we should take only the
supportedLocales from override
if (key === 'supportedLocales') {
return srcValue;
}
});
return config;
};
</script>
{% endblock %}
• Example of template snippet to
customize translations