summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-BE-os/src/main/webapp/WEB-INF/tags
diff options
context:
space:
mode:
authorst782s <statta@research.att.com>2017-05-04 07:48:42 -0400
committerst782s <statta@research.att.com>2017-05-04 12:28:17 -0400
commitb54df0ddd0c6a0372327c5aa3668e5a6458fcd64 (patch)
treee69cfa9b314a801bd187cf0145d1d4306436229c /ecomp-portal-BE-os/src/main/webapp/WEB-INF/tags
parent39d1e62c84041831bfc52cca73b5ed5efaf57d27 (diff)
[PORTAL-7] Rebase
This rebasing includes common libraries and common overlays projects abstraction of components Change-Id: I9a24a338665c7cd058978e8636bc412d9e2fdce8 Signed-off-by: st782s <statta@research.att.com>
Diffstat (limited to 'ecomp-portal-BE-os/src/main/webapp/WEB-INF/tags')
-rw-r--r--ecomp-portal-BE-os/src/main/webapp/WEB-INF/tags/copyright.tag1
-rw-r--r--ecomp-portal-BE-os/src/main/webapp/WEB-INF/tags/footer.tag12
-rw-r--r--ecomp-portal-BE-os/src/main/webapp/WEB-INF/tags/header.tag59
-rw-r--r--ecomp-portal-BE-os/src/main/webapp/WEB-INF/tags/topbar.tag96
4 files changed, 168 insertions, 0 deletions
diff --git a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/tags/copyright.tag b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/tags/copyright.tag
new file mode 100644
index 00000000..f06786c6
--- /dev/null
+++ b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/tags/copyright.tag
@@ -0,0 +1 @@
+Powered by <a href="https://github.com/mitreid-connect/">MITREid Connect <span class="label">${project.version}</span></a> <span class="pull-right">&copy; 2014 The MITRE Corporation and MIT KIT.</span>
diff --git a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/tags/footer.tag b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/tags/footer.tag
new file mode 100644
index 00000000..8b47824a
--- /dev/null
+++ b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/tags/footer.tag
@@ -0,0 +1,12 @@
+<%@ attribute name="js" required="false"%>
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
+<%@ taglib prefix="o" tagdir="/WEB-INF/tags"%>
+<!-- javascript
+================================================== -->
+<!-- Placed at the end of the document so the pages load faster -->
+<script type="text/javascript" src="static/oid-connect/bootstrap2/js/bootstrap.js"></script>
+<script type="text/javascript" src="static/oid-connect/js/lib/underscore.js"></script>
+<script type="text/javascript" src="static/oid-connect/js/lib/jwt.js"></script>
+</body>
+</html>
diff --git a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/tags/header.tag b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/tags/header.tag
new file mode 100644
index 00000000..6f8c5c3d
--- /dev/null
+++ b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/tags/header.tag
@@ -0,0 +1,59 @@
+<%@attribute name="title" required="false"%>
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
+<%@ tag import="com.google.gson.Gson" %>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+
+ <base href="${config.issuer}">
+
+ <meta charset="utf-8">
+ <title>Simple Web App - ${title}</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="description" content="">
+ <meta name="author" content="">
+
+ <!-- stylesheets -->
+ <link href="static/oid-connect/bootstrap2/css/bootstrap.css" rel="stylesheet">
+ <link href="static/oid-connect/bootstrap2/css/bootstrap-responsive.css" rel="stylesheet">
+
+ <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
+ <!--[if lt IE 9]>
+ <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+
+ <!-- Load jQuery up here so that we can use in-page functions -->
+ <script type="text/javascript" src="static/oid-connect/js/lib/jquery.js"></script>
+ <script type="text/javascript">
+ // safely set the title of the application
+ function setPageTitle(title) {
+ document.title = "${config.topbarTitle} - " + title;
+ }
+
+ // get the info of the current user, if available (null otherwise)
+ function getUserInfo() {
+ return ${userInfoJson};
+ }
+
+ // get the authorities of the current user, if available (null otherwise)
+ function getUserAuthorities() {
+ return ${userAuthorities};
+ }
+
+ // is the current user an admin?
+ // NOTE: this is just for
+ function isAdmin() {
+ var auth = getUserAuthorities();
+ if (auth && _.contains(auth, "ROLE_ADMIN")) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ </script>
+</head>
+
+<body>
+
+<!-- Start body --> \ No newline at end of file
diff --git a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/tags/topbar.tag b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/tags/topbar.tag
new file mode 100644
index 00000000..5109523a
--- /dev/null
+++ b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/tags/topbar.tag
@@ -0,0 +1,96 @@
+<%@attribute name="pageName" required="false"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags"%>
+<%@ taglib prefix="o" tagdir="/WEB-INF/tags"%>
+<c:choose>
+ <c:when test="${ not empty userInfo.preferredUsername }">
+ <c:set var="shortName" value="${ userInfo.preferredUsername }" />
+ </c:when>
+ <c:otherwise>
+ <c:set var="shortName" value="${ userInfo.sub }" />
+ </c:otherwise>
+</c:choose>
+<c:choose>
+ <c:when test="${ not empty userInfo.name }">
+ <c:set var="longName" value="${ userInfo.name }" />
+ </c:when>
+ <c:otherwise>
+ <c:choose>
+ <c:when test="${ not empty userInfo.givenName || not empty userInfo.familyName }">
+ <c:set var="longName" value="${ userInfo.givenName } {$ userInfo.familyName }" />
+ </c:when>
+ <c:otherwise>
+ <c:set var="longName" value="${ shortName }" />
+ </c:otherwise>
+ </c:choose>
+ </c:otherwise>
+</c:choose>
+<div class="navbar navbar-inverse">
+ <div class="navbar-inner">
+ <div class="container">
+ <button class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="brand" href="">MITREid Connect: Simple Web App</a>
+ <c:if test="${ not empty pageName }">
+ <div class="nav-collapse collapse">
+ <ul class="nav">
+ <c:choose>
+ <c:when test="${pageName == 'Home'}">
+ <li class="active"><a href="#">Home</a></li>
+ </c:when>
+ <c:otherwise>
+ <li><a href=".">Home</a></li>
+ </c:otherwise>
+ </c:choose>
+ <c:choose>
+ <c:when test="${pageName == 'User'}">
+ <li class="active"><a href="#">User</a></li>
+ </c:when>
+ <c:otherwise>
+ <li><a href="user">User</a></li>
+ </c:otherwise>
+ </c:choose>
+ <c:choose>
+ <c:when test="${pageName == 'Admin'}">
+ <li class="active"><a href="#">Admin</a></li>
+ </c:when>
+ <c:otherwise>
+ <li><a href="admin">Admin</a></li>
+ </c:otherwise>
+ </c:choose>
+ <c:choose>
+ <c:when test="${pageName == 'Logout'}">
+ <li class="active"><a href="#">Logout</a></li>
+ </c:when>
+ <c:otherwise>
+ <li><a href="j_spring_security_logout">Logout</a></li>
+ </c:otherwise>
+ </c:choose>
+
+ </ul>
+ <ul class="nav pull-right">
+ <security:authorize access="hasRole('ROLE_USER')">
+ <li class="dropdown">
+ <a id="userButton" class="dropdown-toggle" data-toggle="dropdown" href=""><i class="icon-user icon-white"></i> ${ shortName } <span class="caret"></span></a>
+ <ul class="dropdown-menu pull-right">
+ <li><a href="user" data-toggle="collapse" data-target=".nav-collapse">${ longName }</a></li>
+ <li class="divider"></li>
+ <li><a href="j_spring_security_logout" data-toggle="collapse" data-target=".nav-collapse"><i class="icon-remove"></i> Log out</a></li>
+ </ul>
+ </li>
+ </security:authorize>
+ <security:authorize access="!hasRole('ROLE_USER')">
+ <li>
+ <a id="loginButton" href="login" data-toggle="collapse" data-target=".nav-collapse"><i class="icon-lock icon-white"></i> Log in</a>
+ </li>
+ </security:authorize>
+ </ul>
+
+ </div><!--/.nav-collapse -->
+ </c:if>
+ </div>
+ </div>
+</div>