Skip to content

Commit

Permalink
feat(UI): Adding web-component alternative nav esco-content-menu
Browse files Browse the repository at this point in the history
  • Loading branch information
jgribonvald committed Jan 28, 2019
1 parent 7cbc2ba commit 9878c54
Show file tree
Hide file tree
Showing 3 changed files with 163 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<channel fname="portal-greeting" unremovable="false" hidden="false" immutable="false" ID="n130"/>
<channel fname="logout-launcher" unremovable="false" hidden="false" immutable="false" ID="n140"/>
<channel fname="session-timeout" unremovable="false" hidden="false" immutable="false" ID="n150"/>
<channel fname="content-menu" unremovable="false" hidden="false" immutable="false" ID="n160"/>
</folder>
<folder ID="s300" hidden="false" immutable="true" name="Customize folder" type="customize" unremovable="true">
<channel fname="personalization-gallery" unremovable="false" hidden="false" immutable="false" ID="n310"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<portlet-definition version="4.0" xsi:schemaLocation="https://source.jasig.org/schemas/uportal/io/portlet-definition https://source.jasig.org/schemas/uportal/io/portlet-definition/portlet-definition-4.0.xsd" xmlns:ns2="https://source.jasig.org/schemas/uportal" xmlns="https://source.jasig.org/schemas/uportal/io/portlet-definition" xmlns:ns4="https://source.jasig.org/schemas/uportal/io/portlet-type" xmlns:ns3="https://source.jasig.org/schemas/uportal/io/subscribed-fragment" xmlns:ns5="https://source.jasig.org/schemas/uportal/io/event-aggregation" xmlns:ns6="https://source.jasig.org/schemas/uportal/io/user" xmlns:ns7="https://source.jasig.org/schemas/uportal/io/stylesheet-descriptor" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns8="https://source.jasig.org/schemas/uportal/io/permission-owner">
<title>Menu Header</title>
<name>Menu Header</name>
<fname>content-menu</fname>
<desc>New kind of header menu</desc>
<type>Portlet</type>
<timeout>12000</timeout>
<portlet-descriptor>
<ns2:isFramework>true</ns2:isFramework>
<ns2:portletName>JspInvoker</ns2:portletName>
</portlet-descriptor>
<group>Everyone</group>
<parameter>
<name>disableDynamicTitle</name>
<value>true</value>
</parameter>
<portlet-preference>
<name>JspInvokerPortletController.viewLocation</name>
<readOnly>false</readOnly>
<value>/jsp/Invoker/content-menu</value>
</portlet-preference>
<portlet-preference>
<name>JspInvokerPortletController.beans</name>
<readOnly>false</readOnly>
<value>personManager</value>
</portlet-preference>
<portlet-preference>
<name>portalLogoutUrl</name>
<readOnly>false</readOnly>
<value>/uPortal/Logout</value>
</portlet-preference>
<portlet-preference>
<name>alternativeBanner</name>
<readOnly>true</readOnly>
<value>https://www.toureiffel.paris/sites/default/files/styles/1440x810/public/2017-10/monument-landing-header-bg_0.jpg?itok=_dSLLBlZ</value>
</portlet-preference>
<portlet-preference>
<name>favoriteApiUrl</name>
<readOnly>true</readOnly>
<value>/uPortal/api/layout</value>
</portlet-preference>
<portlet-preference>
<name>layoutApiUrl</name>
<readOnly>true</readOnly>
<value>/uPortal/api/v4-3/dlm/layout.json</value>
</portlet-preference>
<portlet-preference>
<name>portletApiUrl</name>
<readOnly>true</readOnly>
<value>/uPortal/api/v4-3/dlm/portletRegistry.json?category=All%20categories</value>
</portlet-preference>
<portlet-preference>
<name>userInfoApiUrl</name>
<readOnly>true</readOnly>
<value>/uPortal/api/v5-1/userinfo</value>
</portlet-preference>
<portlet-preference>
<name>favoritesPortletCardSize</name>
<readOnly>true</readOnly>
<value>small</value>
</portlet-preference>
<portlet-preference>
<name>gridPortletCardSize</name>
<readOnly>true</readOnly>
<value>auto</value>
</portlet-preference>
<portlet-preference>
<name>hideActionMode</name>
<readOnly>true</readOnly>
<value>never</value>
</portlet-preference>
<!--
<portlet-preference>
<name>organizationApiUrl</name>
<readOnly>true</readOnly>
<value>/context/rest/orgsInfos/</value>
</portlet-preference>
<portlet-preference>
<name>moreUserInfoUrl</name>
<readOnly>true</readOnly>
<value>/uPortal/p/</value>
</portlet-preference>
<portlet-preference>
<name>orgInfoUrl</name>
<readOnly>true</readOnly>
<value>/uPortal/p/etablissement-swapper</value>
</portlet-preference>
-->
</portlet-definition>
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<%--
Licensed to Apereo under one or more contributor license
agreements. See the NOTICE file distributed with this work
for additional information regarding copyright ownership.
Apereo licenses this file to you under the Apache License,
Version 2.0 (the "License"); you may not use this file
except in compliance with the License. You may obtain a
copy of the License at the following location:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
--%>
<%@ include file="/WEB-INF/jsp/include.jsp" %>

<c:set var="request" value="${pageContext.request}" />
<c:set var="ctxPath" value="${request.contextPath}" />

<script src="/resource-server/webjars/vue/dist/vue.min.js"></script>
<script src="/resource-server/webjars/uportal__esco-content-menu/dist/esco.min.js" defer></script>

<div id="content-menu">
<esco-hamburger-menu
context-api-url="${ctxPath}"
sign-out-url="${portalLogoutUrl[0]}"
default-org-logo="${alternativeBanner[0]}"
favorite-api-url="${favoriteApiUrl[0]}"
layout-api-url="${layoutApiUrl[0]}"
organization-api-url="${organizationApiUrl[0]}"
portlet-api-url="${portletApiUrl[0]}"
user-info-api-url="${userInfoApiUrl[0]}"
user-info-portlet-url="${moreUserInfoUrl[0]}"
switch-org-portlet-url="${orgInfoUrl[0]}"
favorites-portlet-card-size="${favoritesPortletCardSize[0]}"
grid-portlet-card-size="${gridPortletCardSize[0]}"
hide-action-mode="${hideActionMode[0]}"
></esco-hamburger-menu>
</div>

<script type="text/javascript">
/** this part is needed to move the menu on left from uPortal menu. */
if (!Element.prototype.matches)
Element.prototype.matches = Element.prototype.msMatchesSelector ||
Element.prototype.webkitMatchesSelector;
if (!Element.prototype.closest)
Element.prototype.closest = function(s) {
var el = this;
if (!document.documentElement.contains(el)) return null;
do {
if (el.matches(s)) return el;
el = el.parentElement || el.parentNode;
} while (el !== null);
return null;
};
document.querySelector('#content-menu').closest("section").setAttribute("style", "float: left;")
</script>

<style type="text/css">
.portal .row-offcanvas #wrapper .portal-header #up-sticky-nav .portal-global a.menu-toggle, .portal .row-offcanvas #wrapper .portal-header nav.portal-nav {
display: none;
}
.portal .row-offcanvas.active {
transform: none;
}
</style>

0 comments on commit 9878c54

Please sign in to comment.