Commit d5757adc authored by Maxym Borodenko's avatar Maxym Borodenko

JSP menu bug

parent 4d3dc0a2
......@@ -80,81 +80,17 @@
<ul class="nav navbar-nav navbar-right">
<security:authorize access="isAnonymous()">
<li class="dropdown">
<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>
<form id="loginForm" role="form" method="post" action="<c:url value="/login-attempt" />">
<div class="form-group">
<label class="pull-left" for="username">
<spring:message code="login.username" />
</label>
<input type="email" class="form-control" id="username" name="username" placeholder="<spring:message code="login.username"/>" />
</div>
<div class="form-group">
<label class="pull-left" for="password">
<spring:message code="login.password" />
</label>
<input type="password" class="form-control" id="password" name="password" placeholder="<spring:message code="login.password"/>" />
</div>
<div class="checkbox">
<label class="pull-left">
<input type="checkbox" name="_spring_security_remember_me" id="_spring_security_remember_me" />
<spring:message code="login.remember-me" />
</label>
</div>
<button type="submit" class="btn btn-primary">
<spring:message code="login.login-button" />
</button>
<span class="or">-</span>
<a href="<c:url value="/google/login" />" class="btn btn-default google-signin"> <spring:message code="login.with-google-sign-in" />
</a> <a href="<c:url value="/registration" />" class="btn btn-default"> <spring:message code="login.register-now" />
</a>
<!-- CSRF protection -->
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" />
</form>
</li>
</ul>
</li>
<menu:anonymous-menu />
</security:authorize>
<security:authorize access="isAuthenticated()">
<li class="dropdown">
<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">
<li>
<a href="<c:url value="/profile/${user.uuid}" />"> <spring:message code="user.pulldown.profile" />
</a>
</li>
<li>
<a id="logout1" onclick="document.getElementById('logoutForm').submit();"> <spring:message code="user.pulldown.logout" />
</a>
</li>
<security:authorize access="hasRole('ADMINISTRATOR')">
<li role="separator" class="divider"></li>
<li>
<a href="<c:url value="/admin/" />"> <spring:message code="user.pulldown.administration" />
</a>
</li>
<li>
<a href="<c:url value="/admin/users/" />"> <spring:message code="user.pulldown.users" />
</a>
</li>
<li>
<a href="<c:url value="/team" />"> <spring:message code="user.pulldown.teams" />
</a>
</li>
<li>
<a href="<c:url value="/admin/oauth-clients/" />"> <spring:message code="user.pulldown.oauth-clients" />
</a>
</li>
</security:authorize>
</ul>
</li>
<c:choose>
<c:when test="${user ne null and user['class'].name eq 'org.genesys2.server.model.impl.User'}">
<menu:user-menu user="${user}"/>
</c:when>
<c:otherwise>
<menu:anonymous-menu />
</c:otherwise>
</c:choose>
</security:authorize>
</ul>
......
......@@ -6,6 +6,7 @@
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="local" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="cms" tagdir="/WEB-INF/tags/cms" %>
<%@ taglib prefix="menu" tagdir="/WEB-INF/tags/menu" %>
<%@ taglib prefix="gui" tagdir="/WEB-INF/tags/gui" %>
<%@ taglib prefix="filters" tagdir="/WEB-INF/tags/filters"%>
<%@ taglib prefix="overview" tagdir="/WEB-INF/tags/overview"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<li class="dropdown">
<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>
<form id="loginForm" role="form" method="post" action="<c:url value="/login-attempt" />">
<div class="form-group">
<label class="pull-left" for="username"><spring:message code="login.username" /></label>
<input type="email" class="form-control" id="username" name="username" placeholder="<spring:message code="login.username"/>" />
</div>
<div class="form-group">
<label class="pull-left" for="password"><spring:message code="login.password" /></label>
<input type="password" class="form-control" id="password" name="password" placeholder="<spring:message code="login.password"/>" />
</div>
<div class="checkbox">
<label class="pull-left">
<input type="checkbox" name="_spring_security_remember_me" id="_spring_security_remember_me" />
<spring:message code="login.remember-me" />
</label>
</div>
<button type="submit" class="btn btn-primary"><spring:message code="login.login-button" /></button>
<span class="or">-</span>
<a href="<c:url value="/google/login" />" class="btn btn-default google-signin">
<spring:message code="login.with-google-sign-in" />
</a>
<a href="<c:url value="/registration" />" class="btn btn-default">
<spring:message code="login.register-now" />
</a>
<!-- CSRF protection -->
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" />
</form>
</li>
</ul>
</li>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ attribute name="user" required="true" description="User" rtexprvalue="true" type="java.lang.Object" %>
<security:authorize access="isAuthenticated()">
<li class="dropdown">
<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">
<li>
<a href="<c:url value="/profile/${user.uuid}" />"><spring:message code="user.pulldown.profile" /></a>
</li>
<li>
<a id="logout1" onclick="document.getElementById('logoutForm').submit();"><spring:message code="user.pulldown.logout" /></a>
</li>
<security:authorize access="hasRole('ADMINISTRATOR')">
<li role="separator" class="divider"></li>
<li>
<a href="<c:url value="/admin/" />"><spring:message code="user.pulldown.administration" /></a>
</li>
<li>
<a href="<c:url value="/admin/users/" />"><spring:message code="user.pulldown.users" /></a>
</li>
<li>
<a href="<c:url value="/team" />"><spring:message code="user.pulldown.teams" /></a>
</li>
<li>
<a href="<c:url value="/admin/oauth-clients/" />"><spring:message code="user.pulldown.oauth-clients" /></a>
</li>
</security:authorize>
</ul>
</li>
</security:authorize>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment