Commit dfcfab7d authored by Matija Obreza's avatar Matija Obreza

Merge branch...

Merge branch '64-menu-item-isn-t-highlighted-when-the-user-is-on-the-corresponding-page' into 'master'

Menu item isn't highlighted when the user is on the corresponding page.

Closes #64

See merge request !30
parents dba73517 18c1927b
......@@ -651,6 +651,14 @@ var GenesysFilter = {
};
$(document).click(function(e) {
if (!$(e.target).is($('#navigation-menu')) && !$(e.target).is($('.humburger-btn'))) {
if ($('#navbar').hasClass('in')) {
$('#navbar').removeClass('in');
}
}
});
$(document).ready(function() {
$('body').on('click', '.get_widget', function() {
var clientId = $(this).val();
......
......@@ -218,8 +218,11 @@ $light-font-family: 'Roboto-Light';
background-color: $dropdown-bg;
padding: 0;
li {
padding: 0 20px;
width: 100%;
@media (min-width: 990px) {
padding: 0 20px;
}
&:last-child {
a {
border-bottom: none;
......@@ -249,12 +252,15 @@ $light-font-family: 'Roboto-Light';
}
}
a {
padding: 15px 33px 13px 0;
color: $light-grey;
background-color: $dropdown-bg;
border-bottom: 1px solid $light-grey;
font-size: 15px;
font-family: $emphasis-font-family;
@media (min-width: 990px) {
padding: 15px 33px 13px 0;
color: $light-grey;
background-color: $dropdown-bg;
border-bottom: 1px solid $light-grey;
font-size: 15px;
font-family: $emphasis-font-family;
}
}
}
}
......@@ -3583,6 +3589,14 @@ table.accessions {
}
@media (max-width: 1919px) {
.genesys-page .nav-menu .active {
background-color: #33322D;
}
.genesys-page .navbar-collapse.collapse .nav.navbar-nav.nav-menu-admin .active,
.genesys-page .nav-menu .active-group {
color: #88ba42 !important;
}
.genesys-page, .admin-page {
.hidden-md {
display: none;
......@@ -3795,7 +3809,9 @@ table.accessions {
a .badge, a .caret {
html[dir="ltr"] & {
left: auto;
right: 0;
@media(min-width: 990px) {
right: 0;
}
}
html[dir="rtl"] & {
left: 0;
......@@ -3806,7 +3822,9 @@ table.accessions {
li.active, li.open, li:hover, li:focus {
a .badge {
html[dir="ltr"] & {
right: 19px;
@media(min-width: 990px) {
right: 19px;
}
}
html[dir="rtl"] & {
left: 19px;
......@@ -3815,7 +3833,9 @@ table.accessions {
}
a .caret {
html[dir="ltr"] & {
right: 19px;
@media(min-width: 990px) {
right: 19px;
}
}
html[dir="rtl"] & {
left: 19px;
......@@ -4391,6 +4411,16 @@ table.accessions {
}
@media (max-width: 989px) {
.genesys-page .nav-menu .active {
background-color: #33322D;
}
.genesys-page .nav-menu .active-group {
color: #88ba42 !important;
}
.menu-link {
//padding-left: 10px !important;
}
.genesys-page, .admin-page {
.navbar-toggle {
display: block;
......@@ -4421,6 +4451,21 @@ table.accessions {
.navbar-collapse.collapse {
display: none !important;
}
.navbar-collapse {
#navigation-menu {
li {
&.pull-left {
float: none !important;
}
a {
line-height: 20px;
}
}
}
}
.navbar-collapse.collapse.in, .navbar-collapse.collapsing {
width: 100%;
position: fixed;
......@@ -4447,10 +4492,16 @@ table.accessions {
float: none;
text-align: left;
a {
padding: 14px 0px;
padding: 14px 10px;
border-bottom: 1px solid #555450;
.badge {
min-width: 26px;
@media (max-width: 989px) {
position: absolute;
top: 13px;
right: 3px;
left: auto;
}
}
.caret {
position: absolute;
......@@ -4468,7 +4519,7 @@ table.accessions {
li {
padding: 0px;
a {
padding: 14px 0px;
padding: 14px 10px;
}
}
}
......@@ -4480,7 +4531,7 @@ table.accessions {
li {
padding: 0px;
a {
padding: 14px 0px;
padding: 14px 10px;
}
}
}
......@@ -4488,7 +4539,7 @@ table.accessions {
li {
&:hover, &:focus, &.active, &.open {
a {
padding: 14px 0;
padding: 14px 10px;
background-color: transparent;
color: #e7e5df;
}
......
......@@ -56,7 +56,7 @@
<nav class="navbar navbar-default navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed pull-left" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<button type="button" class="humburger-btn navbar-toggle collapsed pull-left" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
......@@ -66,9 +66,9 @@
<a class="navbar-brand nav-logo clearfix" href="<c:url value="/admin/" />"><img src="/html/1/images/GENESYS-ICON.svg" /><img src="/html/1/images/GENESYS-LOGO.svg" /></a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<div class="col-md-6 no-space">
<div class="col-md-7 no-space">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed pull-left" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<button type="button" class="humburger-btn navbar-toggle collapsed pull-left" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
......@@ -83,25 +83,27 @@
<a href="<c:url value="/welcome" />" title="<spring:message code="menu.home" />"> <spring:message code="menu.home" />
</a>
</li>
<li>
<li id="cache-menu-item">
<a class="" href="<c:url value="/admin/cache/" />"> <spring:message code="menu.admin.caches" />
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> <spring:message code="menu.admin.usermanagement" /> <span class="caret"></span>
<li class="dropdown" id="user-management-menu-item" >
<a href="<c:url value="/admin/users/" />"> <spring:message code="user.pulldown.users" />
</a>
<ul class="dropdown-menu pull-left">
<li>
<a href="<c:url value="/admin/users/" />"> <spring:message code="user.pulldown.users" />
</a>
</li>
<li>
<a href="<c:url value="/admin/teams/" />"> <spring:message code="user.pulldown.teams" />
</a>
</li>
</ul>
<%--<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> <spring:message code="menu.admin.usermanagement" /> <span class="caret"></span>--%>
<%--</a>--%>
<%--<ul class="dropdown-menu pull-left">--%>
<%--<li>--%>
<%--<a href="<c:url value="/admin/users/" />"> <spring:message code="user.pulldown.users" />--%>
<%--</a>--%>
<%--</li>--%>
<%--<li>--%>
<%--<a href="<c:url value="/admin/teams/" />"> <spring:message code="user.pulldown.teams" />--%>
<%--</a>--%>
<%--</li>--%>
<%--</ul>--%>
</li>
<li class="dropdown">
<li class="dropdown" id="repository-menu-item">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> <spring:message code="menu.admin.repository" /> <span class="caret"></span>
</a>
<ul class="dropdown-menu pull-left">
......@@ -115,25 +117,25 @@
</li>
</ul>
</li>
<li>
<li id="logger-menu-item">
<a class="" href="<c:url value="/admin/logger/" />"> <spring:message code="menu.admin.loggers" />
</a>
</li>
<li>
<li id="hazelcast-menu-item">
<a class="" href="<c:url value="/admin/hazelcast/" />"> <spring:message code="menu.admin.hazelcast" /></a>
</li>
<li>
<li id="ds2-menu-item">
<a class="" href="<c:url value="/admin/ds2/" />"> <spring:message code="menu.admin.ds2" />
</a>
</li>
<li>
<li id="kpi-menu-item">
<a class="" href="<c:url value="/admin/kpi/" />"> <spring:message code="menu.admin.kpi" />
</a>
</li>
</ul>
</div>
<div class="col-md-6 no-space">
<div class="col-md-5 no-space">
<ul class="nav navbar-nav navbar-right">
<%@ include file="languages.jspf" %>
</ul>
......
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> <c:out value="${pageContext.response.locale.displayLanguage}" /> <span class="caret"></span>
<a class="menu-link" href="#" class="dropdown-toggle" data-toggle="dropdown"> <c:out value="${pageContext.response.locale.displayLanguage}" /> <span class="caret"></span>
</a>
<ul class="dropdown-menu pull-left">
<li>
......
......@@ -4,7 +4,7 @@
<nav class="navbar navbar-default navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed pull-left" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<button type="button" class="humburger-btn navbar-toggle collapsed pull-left" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
......@@ -15,7 +15,7 @@
<div id="navbar" class="collapse navbar-collapse">
<div class="col-md-6 no-space">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed pull-left" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<button type="button" class="humburger-btn navbar-toggle collapsed pull-left" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
......@@ -24,13 +24,13 @@
<a class="navbar-brand nav-logo clearfix" href="<c:url value="/welcome" />"><img src="/html/1/images/GENESYS-ICON.svg" /><img src="/html/1/images/GENESYS-LOGO.svg" /></a>
</div>
<ul class="nav navbar-nav nav-menu">
<li class="active pull-left">
<a href="<c:url value="/welcome" />" title="<spring:message code="menu.home" />"> <spring:message code="menu.home" />
<ul class="nav navbar-nav nav-menu" id="navigation-menu">
<li class="pull-left menu-title" id="home-li">
<a class="menu-link" href="<c:url value="/welcome" />" title="<spring:message code="menu.home" />"><spring:message code="menu.home" />
</a>
</li>
<li class="dropdown pull-left">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> <spring:message code="menu.about" /> <span class="caret"></span>
<li class="dropdown pull-left menu-title" id="about-li" >
<a class="menu-link" id="about-a" href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> <spring:message code="menu.about" /> <span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li class="pull-left">
......@@ -85,22 +85,22 @@
</li> --%>
</ul>
</li>
<li class="pull-left">
<a href="<c:url value="/explore" />"> <spring:message code="menu.browse" />
<li class="pull-left menu-title" id="explore-li">
<a class="menu-link" href="<c:url value="/explore" />"> <spring:message code="menu.browse" />
</a>
</li>
<%-- <li><a href="<c:url value="/data/" />"><spring:message code="menu.datasets" /></a></li> --%>
<%-- <li><a href="<c:url value="/descriptors/" />"><spring:message code="menu.descriptors" /></a></li> --%>
<li class="pull-left">
<a href="<c:url value="/geo/" />"> <spring:message code="menu.countries" />
<li class="pull-left menu-title" id="geo-id">
<a class="menu-link" href="<c:url value="/geo/" />"> <spring:message code="menu.countries" />
</a>
</li>
<li class="pull-left">
<a href="<c:url value="/wiews/active" />"> <spring:message code="menu.institutes" />
<li class="pull-left menu-title" id="inst-id">
<a class="menu-link" href="<c:url value="/wiews/active" />"> <spring:message code="menu.institutes" />
</a>
</li>
<li class="pull-left">
<a href="<c:url value="/sel/" />"> <spring:message code="menu.my-list" /> <span class="badge" x-size="${selection.size() gt 0 ? selection.size() : '0'}" id="selcounter"><c:out value="${selection.size() gt 0 ? selection.size() : '0'}" /></span>
<li class="pull-left menu-title" id="list-id">
<a class="menu-link" href="<c:url value="/sel/" />"> <spring:message code="menu.my-list" /> <span class="badge" x-size="${selection.size() gt 0 ? selection.size() : '0'}" id="selcounter"><c:out value="${selection.size() gt 0 ? selection.size() : '0'}" /></span>
</a>
</li>
......@@ -140,7 +140,7 @@
<ul class="nav navbar-nav navbar-right">
<security:authorize access="isAnonymous()">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> <spring:message code="page.login" /> <span class="caret"></span>
<a class="menu-link" href="#" class="dropdown-toggle" data-toggle="dropdown"> <spring:message code="page.login" /> <span class="caret"></span>
</a>
<ul class="dropdown-menu pull-left">
<li>
......@@ -179,7 +179,7 @@
</security:authorize>
<security:authorize access="isAuthenticated()">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> <spring:message code="user.pulldown.heading"
<a class="menu-link" href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> <spring:message code="user.pulldown.heading"
arguments="${user.fullName}" /> <span class="caret"></span>
</a>
<ul class="dropdown-menu pull-left">
......
......@@ -303,6 +303,8 @@
var lastWindowWidth;
$(document).ready(function () {
$('#explore-li').find("a").addClass('active active-group');
$('#explore-li').addClass('active');
if (jsonData.crops != null && jsonData.crops.length > 0) {
$("#panel_additional_id").show();
......
......@@ -193,6 +193,8 @@
var layer = null;
$(document).ready(function () {
$('#explore-li').find("a").addClass('active active-group');
$('#explore-li').addClass('active');
setHeight();
map = L.map('map').setView([30, 0], 3);
......
......@@ -143,6 +143,9 @@
localStorage.setItem("historyStep", 1);
$(document).ready(function () {
$('#explore-li').find("a").addClass('active active-group');
$('#explore-li').addClass('active');
BrowseUtil.applySuggestions(jsonData, messages);
$(document.getElementsByClassName("btn btn-default btn-back")).on('click', function (event) {
......
......@@ -53,5 +53,33 @@
</c:forEach>
</div>
<content tag="javascript">
<script type="text/javascript">
window.onload = function() {
expandGroup ($(document).width());
};
$(document).ready(function () {
$('#about-li').addClass('active');
$('#about-a').addClass('active-group');
$('.humburger-btn').on('click', function () {
setTimeout(function() {
expandGroup ($(document).width());
}, 100);
});
});
function expandGroup (width) {
if (width < 1920) {
if(!$('#about-li').hasClass('open')) {
$('#about-li').addClass('open');
}
} else {
$('#about-li').removeClass('open');
}
}
$(window).resize(function() {
expandGroup ($(document).width());
});
</script>
</content>
</body>
</html>
\ No newline at end of file
......@@ -89,5 +89,13 @@
<c:out value="${cacheOther}" />
</h3>
</c:forEach>
<content tag="javascript">
<script type="text/javascript">
$(document).ready(function() {
$('#cache-menu-item').find("a").first().addClass('active');
$('#cache-menu-item').addClass('active');
});
</script>
</content>
</body>
</html>
\ No newline at end of file
......@@ -22,6 +22,14 @@
<!-- CSRF protection -->
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
</form>
<content tag="javascript">
<script type="text/javascript">
$(document).ready(function() {
$('#ds2-menu-item').addClass('active');
$('#ds2-menu-item').find("a").first().addClass('active');
});
</script>
</content>
</body>
</html>
\ No newline at end of file
......@@ -42,5 +42,13 @@
<h4>Entire configuration</h4> <c:out value="${hzConfig}" />
</small>
<content tag="javascript">
<script type="text/javascript">
$(document).ready(function() {
$('#hazelcast-menu-item').addClass('active');
$('#hazelcast-menu-item').find("a").first().addClass('active');
});
</script>
</content>
</body>
</html>
\ No newline at end of file
......@@ -41,5 +41,13 @@
</c:forEach>
</div>
<content tag="javascript">
<script type="text/javascript">
$(document).ready(function() {
$('#kpi-menu-item').addClass('active');
$('#kpi-menu-item').find("a").first().addClass('active');
});
</script>
</content>
</body>
</html>
\ No newline at end of file
......@@ -59,7 +59,14 @@
<local:paginate2 page="${loggers}" />
<content tag="javascript">
<script type="text/javascript">
$(document).ready(function() {
$('#logger-menu-item').addClass('active');
$('#logger-menu-item').find("a").first().addClass('active');
});
</script>
</content>
</body>
</html>
......@@ -55,7 +55,24 @@
return false;
}
});
});
$('#repository-menu-item').addClass('active');
$('#repository-menu-item').find("a").first().addClass('active');
$('.humburger-btn').on('click', function () {
setTimeout(function() {
expandGroup ($(document).width());
}, 100);
});
});
$(window).resize(function() {
expandGroup ($(document).width());
});
function expandGroup (width) {
if (width < 1920) {
$('#repository-menu-item').addClass('open');
} else {
$('#repository-menu-item').removeClass('open');
}
}
</script> </content>
</body>
......
......@@ -119,7 +119,24 @@
return false;
}
});
});
$('#repository-menu-item').addClass('active');
$('#repository-menu-item').find("a").first().addClass('active');
$('.humburger-btn').on('click', function () {
setTimeout(function() {
expandGroup ($(document).width());
}, 100);
});
});
$(window).resize(function() {
expandGroup ($(document).width());
});
function expandGroup (width) {
if (width < 1920) {
$('#repository-menu-item').addClass('open');
} else {
$('#repository-menu-item').removeClass('open');
}
}
</script> </content>
</body>
......
......@@ -32,5 +32,13 @@
</table>
<local:paginate2 page="${pagedData}" />
<content tag="javascript">
<script type="text/javascript">
$(document).ready(function() {
$('#user-management-menu-item').addClass('active');
$('#user-management-menu-item').find("a").first().addClass('active');
});
</script>
</content>
</body>
</html>
\ No newline at end of file
......@@ -89,9 +89,31 @@
<content tag="javascript">
<script type="text/javascript">
window.onload = function() {
expandGroup ($(document).width());
};
$(document).ready(function () {
$('a[href="' + window.location.pathname + '"]').parent().addClass('active-link');
$('#about-li').addClass('active');
$('#about-a').addClass('active-group');
$('.humburger-btn').on('click', function () {
setTimeout(function() {
expandGroup ($(document).width());
}, 100);
});
});
$(window).resize(function() {
expandGroup ($(document).width());
});
function expandGroup (width) {
if (width < 1920) {
if(!$('#about-li').hasClass('open')) {
$('#about-li').addClass('open');
}
} else {
$('#about-li').removeClass('open');
}
}
</script>
</content>
......
......@@ -35,9 +35,31 @@
<content tag="javascript">
<script type="text/javascript">
window.onload = function() {
expandGroup ($(document).width());
};