-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(UI): Adding web-component alternative nav esco-content-menu
- Loading branch information
1 parent
a70474c
commit e0c0220
Showing
3 changed files
with
164 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
data/quickstart/portlet-definition/content-menu.portlet-definition.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
73 changes: 73 additions & 0 deletions
73
overlays/uPortal/src/main/webapp/WEB-INF/jsp/Invoker/content-menu.jsp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<%-- | ||
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]}" | ||
show-favorites-in-slider="true" | ||
></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> |