Created
May 14, 2014 03:13
-
-
Save apetro/1c458ef483a159074cfe to your computer and use it in GitHub Desktop.
MyUW sidebar implementation
This file contains hidden or 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
diff --git a/uportal-war/src/main/data/quickstart_entities/fragment-layout/authenticated-lo.fragment-layout.xml b/uportal-war/src/main/data/quickstart_entities/fragment-layout/authenticated-lo.fragment-layout.xml | |
index 401b3e5..6bb31e5 100644 | |
--- a/uportal-war/src/main/data/quickstart_entities/fragment-layout/authenticated-lo.fragment-layout.xml | |
+++ b/uportal-war/src/main/data/quickstart_entities/fragment-layout/authenticated-lo.fragment-layout.xml | |
@@ -49,5 +49,8 @@ | |
<folder ID="s18" hidden="false" immutable="true" name="Side bar left folder" type="sidebar-left" unremovable="true"> | |
<channel fname="side-bar-menu" unremovable="false" hidden="false" immutable="false" ID="n19"/> | |
</folder> | |
+ <folder ID="s20" hidden="false" immutable="true" name="Global Side bar left folder" type="global-sidebar-left" unremovable="true"> | |
+ <channel fname="side-bar-menu" unremovable="false" hidden="false" immutable="false" ID="n21"/> | |
+ </folder> | |
</folder> | |
</layout> | |
diff --git a/uportal-war/src/main/resources/layout/theme/respondr/regions.xsl b/uportal-war/src/main/resources/layout/theme/respondr/regions.xsl | |
index 832d8c3..20c7f53 100644 | |
--- a/uportal-war/src/main/resources/layout/theme/respondr/regions.xsl | |
+++ b/uportal-war/src/main/resources/layout/theme/respondr/regions.xsl | |
@@ -169,6 +169,21 @@ | |
</xsl:if> | |
</xsl:template> | |
+ <!-- ========== TEMPLATE: GLOBAL-SIDEBAR-LEFT ========== --> | |
+ <!-- =========================================== --> | |
+ <!-- | |
+ | This template renders portlets in the area left of the page. | |
+ --> | |
+ <xsl:template name="region.global-sidebar-left"> | |
+ <xsl:if test="//region[@name='global-sidebar-left']/channel"> | |
+ <div id="region-global-sidebar-left" class="col-lg-0 hidden-lg" style="display: none;"> | |
+ <xsl:for-each select="//region[@name='global-sidebar-left']/channel"> | |
+ <xsl:call-template name="regions.portlet.decorator" /> | |
+ </xsl:for-each> | |
+ </div> | |
+ </xsl:if> | |
+ </xsl:template> | |
+ | |
<!-- ========== TEMPLATE: SIDEBAR-LEFT ========== --> | |
<!-- =========================================== --> | |
<!-- | |
@@ -176,7 +191,7 @@ | |
--> | |
<xsl:template name="region.sidebar-left"> | |
<xsl:if test="//region[@name='sidebar-left']/channel"> | |
- <div id="region-sidebar-left" class="col-md-2"> | |
+ <div id="region-sidebar-left" class="col-{$SIDE_BAR_TRANSITION_POINT}-2 {$SIDE_BAR_ADDITIONAL_CLASSES}"> | |
<xsl:for-each select="//region[@name='sidebar-left']/channel"> | |
<xsl:call-template name="regions.portlet.decorator" /> | |
</xsl:for-each> | |
@@ -208,7 +223,7 @@ | |
--> | |
<xsl:template name="region.sidebar-right"> | |
<xsl:if test="//region[@name='sidebar-right']/channel"> | |
- <div id="region-sidebar-right" class="col-md-2"> | |
+ <div id="region-sidebar-right" class="col-{$SIDE_BAR_TRANSITION_POINT}-2 {$SIDE_BAR_ADDITIONAL_CLASSES}"> | |
<xsl:for-each select="//region[@name='sidebar-right']/channel"> | |
<xsl:call-template name="regions.portlet.decorator" /> | |
</xsl:for-each> | |
diff --git a/uportal-war/src/main/resources/layout/theme/respondr/respondr.xsl b/uportal-war/src/main/resources/layout/theme/respondr/respondr.xsl | |
index 81bba37..aac0320 100644 | |
--- a/uportal-war/src/main/resources/layout/theme/respondr/respondr.xsl | |
+++ b/uportal-war/src/main/resources/layout/theme/respondr/respondr.xsl | |
@@ -209,6 +209,9 @@ | |
</xsl:choose> | |
</xsl:param> | |
+<xsl:variable name="SIDE_BAR_TRANSITION_POINT">lg</xsl:variable> | |
+<xsl:variable name="SIDE_BAR_ADDITIONAL_CLASSES">visible-lg</xsl:variable> | |
+ | |
<!-- ****** PORTLET SETTINGS ****** --> | |
<!-- | |
| GREEN | |
@@ -654,13 +657,57 @@ | |
</head> | |
<body class="up dashboard portal fl-theme-mist"> | |
<div id="up-notification"></div> | |
+ <div class="global-container"> | |
+ <div class="row"> | |
+ <xsl:variable name="GLOBAL_SIDEBAR_LEFT_COLUMNS"> | |
+ <xsl:choose> | |
+ <xsl:when test="//region[@name='global-sidebar-left']/channel">4</xsl:when> | |
+ <xsl:otherwise>0</xsl:otherwise> | |
+ </xsl:choose> | |
+ </xsl:variable> | |
+ <xsl:if test="//region[@name='global-sidebar-left']/channel"> | |
+ <xsl:call-template name="region.global-sidebar-left" /> | |
+ </xsl:if> | |
+ <div id="global-side-bar-left-page" class="col-lg-12"> | |
<div id="wrapper"> | |
<xsl:call-template name="region.hidden-top" /> | |
<xsl:call-template name="region.page-top" /> | |
<header class="portal-header" role="banner"> | |
<div class="portal-global"> | |
<div class="container"> | |
- <xsl:call-template name="region.pre-header" /> | |
+ <div class="row"> | |
+ <xsl:if test="//region[@name='global-sidebar-left']/channel"> | |
+ <div class="col-xs-1"> | |
+ <div id="global-sidebar-left-hamburger" class="pull-left hidden-lg"> | |
+ <button class="button" style="background: inherit; border: none; padding: .5em;"> | |
+ <span class="glyphicon glyphicon-align-justify"></span> | |
+ </button> | |
+ </div> | |
+ </div> | |
+ <script type="text/javascript"> | |
+ up.jQuery(document).ready(function(){ | |
+ up.jQuery('div#global-sidebar-left-hamburger').click(function(){ | |
+ | |
+ up.jQuery('div#region-global-sidebar-left').slideToggle(0,function(){ | |
+ | |
+ if(up.jQuery('div#region-global-sidebar-left').hasClass('col-xs-4')) { | |
+ //hide | |
+ up.jQuery('div#region-global-sidebar-left').removeClass('col-xs-4').removeClass('col-sm-3'); | |
+ up.jQuery('div#global-side-bar-left-page').removeClass('col-xs-8').removeClass('col-sm-9'); | |
+ } else { | |
+ //show | |
+ up.jQuery('div#region-global-sidebar-left').addClass('col-xs-4').addClass('col-sm-3'); | |
+ up.jQuery('div#global-side-bar-left-page').addClass('col-xs-8').addClass('col-sm-9'); | |
+ } | |
+ }); | |
+ }); | |
+ }); | |
+ </script> | |
+ </xsl:if> | |
+ <div class="col-xs-11 col-lg-12"> | |
+ <xsl:call-template name="region.pre-header" /> | |
+ </div> | |
+ </div> | |
</div> | |
</div> | |
<div class="container"> | |
@@ -690,7 +737,7 @@ | |
<xsl:otherwise>0</xsl:otherwise> | |
</xsl:choose> | |
</xsl:variable> | |
- <xsl:variable name="WIDTH_CSS_CLASS">col-md-<xsl:value-of select="12 - $SIDEBAR_LEFT_COLUMNS - $SIDEBAR_RIGHT_COLUMNS" /></xsl:variable> | |
+ <xsl:variable name="WIDTH_CSS_CLASS">col-<xsl:value-of select="$SIDE_BAR_TRANSITION_POINT"/>-<xsl:value-of select="12 - $SIDEBAR_LEFT_COLUMNS - $SIDEBAR_RIGHT_COLUMNS" /></xsl:variable> | |
<div class="{$WIDTH_CSS_CLASS}"> | |
<!-- USE FLUID ROWS WITHIN HERE --> | |
<xsl:call-template name="focused-fragment-header" /> | |
@@ -736,7 +783,9 @@ | |
<xsl:call-template name="region.page-bottom" /> | |
<xsl:call-template name="region.hidden-bottom" /> | |
</div> | |
- | |
+ </div> | |
+ </div> | |
+ </div> | |
<xsl:call-template name="page.dialogs" /> | |
<script type="text/javascript"> | |
diff --git a/uportal-war/src/main/webapp/media/skins/respondr/common/less/header.less b/uportal-war/src/main/webapp/media/skins/respondr/common/less/header.less | |
index 753cac7..c7865a0 100644 | |
--- a/uportal-war/src/main/webapp/media/skins/respondr/common/less/header.less | |
+++ b/uportal-war/src/main/webapp/media/skins/respondr/common/less/header.less | |
@@ -29,7 +29,6 @@ | |
} | |
.portal-global { | |
- position: absolute; | |
top: 10px; | |
right: 0; | |
This file contains hidden or 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
From 2af5159c01a839ed925aee972e93e0b83742eef8 Mon Sep 17 00:00:00 2001 | |
From: Tim Levett <[email protected]> | |
Date: Wed, 30 Apr 2014 09:22:58 -0500 | |
Subject: [PATCH] MUMUP-403 : Added global sidebar left region | |
--- | |
.../authenticated-lo.fragment-layout.xml | 3 ++ | |
.../resources/layout/theme/respondr/regions.xsl | 19 +++++++- | |
.../resources/layout/theme/respondr/respondr.xsl | 55 ++++++++++++++++++++-- | |
.../media/skins/respondr/common/less/header.less | 1 - | |
4 files changed, 72 insertions(+), 6 deletions(-) | |
diff --git a/uportal-war/src/main/data/quickstart_entities/fragment-layout/authenticated-lo.fragment-layout.xml b/uportal-war/src/main/data/quickstart_entities/fragment-layout/authenticated-lo.fragment-layout.xml | |
index 401b3e5..6bb31e5 100644 | |
--- a/uportal-war/src/main/data/quickstart_entities/fragment-layout/authenticated-lo.fragment-layout.xml | |
+++ b/uportal-war/src/main/data/quickstart_entities/fragment-layout/authenticated-lo.fragment-layout.xml | |
@@ -49,5 +49,8 @@ | |
<folder ID="s18" hidden="false" immutable="true" name="Side bar left folder" type="sidebar-left" unremovable="true"> | |
<channel fname="side-bar-menu" unremovable="false" hidden="false" immutable="false" ID="n19"/> | |
</folder> | |
+ <folder ID="s20" hidden="false" immutable="true" name="Global Side bar left folder" type="global-sidebar-left" unremovable="true"> | |
+ <channel fname="side-bar-menu" unremovable="false" hidden="false" immutable="false" ID="n21"/> | |
+ </folder> | |
</folder> | |
</layout> | |
diff --git a/uportal-war/src/main/resources/layout/theme/respondr/regions.xsl b/uportal-war/src/main/resources/layout/theme/respondr/regions.xsl | |
index 832d8c3..20c7f53 100644 | |
--- a/uportal-war/src/main/resources/layout/theme/respondr/regions.xsl | |
+++ b/uportal-war/src/main/resources/layout/theme/respondr/regions.xsl | |
@@ -169,6 +169,21 @@ | |
</xsl:if> | |
</xsl:template> | |
+ <!-- ========== TEMPLATE: GLOBAL-SIDEBAR-LEFT ========== --> | |
+ <!-- =========================================== --> | |
+ <!-- | |
+ | This template renders portlets in the area left of the page. | |
+ --> | |
+ <xsl:template name="region.global-sidebar-left"> | |
+ <xsl:if test="//region[@name='global-sidebar-left']/channel"> | |
+ <div id="region-global-sidebar-left" class="col-lg-0 hidden-lg" style="display: none;"> | |
+ <xsl:for-each select="//region[@name='global-sidebar-left']/channel"> | |
+ <xsl:call-template name="regions.portlet.decorator" /> | |
+ </xsl:for-each> | |
+ </div> | |
+ </xsl:if> | |
+ </xsl:template> | |
+ | |
<!-- ========== TEMPLATE: SIDEBAR-LEFT ========== --> | |
<!-- =========================================== --> | |
<!-- | |
@@ -176,7 +191,7 @@ | |
--> | |
<xsl:template name="region.sidebar-left"> | |
<xsl:if test="//region[@name='sidebar-left']/channel"> | |
- <div id="region-sidebar-left" class="col-md-2"> | |
+ <div id="region-sidebar-left" class="col-{$SIDE_BAR_TRANSITION_POINT}-2 {$SIDE_BAR_ADDITIONAL_CLASSES}"> | |
<xsl:for-each select="//region[@name='sidebar-left']/channel"> | |
<xsl:call-template name="regions.portlet.decorator" /> | |
</xsl:for-each> | |
@@ -208,7 +223,7 @@ | |
--> | |
<xsl:template name="region.sidebar-right"> | |
<xsl:if test="//region[@name='sidebar-right']/channel"> | |
- <div id="region-sidebar-right" class="col-md-2"> | |
+ <div id="region-sidebar-right" class="col-{$SIDE_BAR_TRANSITION_POINT}-2 {$SIDE_BAR_ADDITIONAL_CLASSES}"> | |
<xsl:for-each select="//region[@name='sidebar-right']/channel"> | |
<xsl:call-template name="regions.portlet.decorator" /> | |
</xsl:for-each> | |
diff --git a/uportal-war/src/main/resources/layout/theme/respondr/respondr.xsl b/uportal-war/src/main/resources/layout/theme/respondr/respondr.xsl | |
index 81bba37..aac0320 100644 | |
--- a/uportal-war/src/main/resources/layout/theme/respondr/respondr.xsl | |
+++ b/uportal-war/src/main/resources/layout/theme/respondr/respondr.xsl | |
@@ -209,6 +209,9 @@ | |
</xsl:choose> | |
</xsl:param> | |
+<xsl:variable name="SIDE_BAR_TRANSITION_POINT">lg</xsl:variable> | |
+<xsl:variable name="SIDE_BAR_ADDITIONAL_CLASSES">visible-lg</xsl:variable> | |
+ | |
<!-- ****** PORTLET SETTINGS ****** --> | |
<!-- | |
| GREEN | |
@@ -654,13 +657,57 @@ | |
</head> | |
<body class="up dashboard portal fl-theme-mist"> | |
<div id="up-notification"></div> | |
+ <div class="global-container"> | |
+ <div class="row"> | |
+ <xsl:variable name="GLOBAL_SIDEBAR_LEFT_COLUMNS"> | |
+ <xsl:choose> | |
+ <xsl:when test="//region[@name='global-sidebar-left']/channel">4</xsl:when> | |
+ <xsl:otherwise>0</xsl:otherwise> | |
+ </xsl:choose> | |
+ </xsl:variable> | |
+ <xsl:if test="//region[@name='global-sidebar-left']/channel"> | |
+ <xsl:call-template name="region.global-sidebar-left" /> | |
+ </xsl:if> | |
+ <div id="global-side-bar-left-page" class="col-lg-12"> | |
<div id="wrapper"> | |
<xsl:call-template name="region.hidden-top" /> | |
<xsl:call-template name="region.page-top" /> | |
<header class="portal-header" role="banner"> | |
<div class="portal-global"> | |
<div class="container"> | |
- <xsl:call-template name="region.pre-header" /> | |
+ <div class="row"> | |
+ <xsl:if test="//region[@name='global-sidebar-left']/channel"> | |
+ <div class="col-xs-1"> | |
+ <div id="global-sidebar-left-hamburger" class="pull-left hidden-lg"> | |
+ <button class="button" style="background: inherit; border: none; padding: .5em;"> | |
+ <span class="glyphicon glyphicon-align-justify"></span> | |
+ </button> | |
+ </div> | |
+ </div> | |
+ <script type="text/javascript"> | |
+ up.jQuery(document).ready(function(){ | |
+ up.jQuery('div#global-sidebar-left-hamburger').click(function(){ | |
+ | |
+ up.jQuery('div#region-global-sidebar-left').slideToggle(0,function(){ | |
+ | |
+ if(up.jQuery('div#region-global-sidebar-left').hasClass('col-xs-4')) { | |
+ //hide | |
+ up.jQuery('div#region-global-sidebar-left').removeClass('col-xs-4').removeClass('col-sm-3'); | |
+ up.jQuery('div#global-side-bar-left-page').removeClass('col-xs-8').removeClass('col-sm-9'); | |
+ } else { | |
+ //show | |
+ up.jQuery('div#region-global-sidebar-left').addClass('col-xs-4').addClass('col-sm-3'); | |
+ up.jQuery('div#global-side-bar-left-page').addClass('col-xs-8').addClass('col-sm-9'); | |
+ } | |
+ }); | |
+ }); | |
+ }); | |
+ </script> | |
+ </xsl:if> | |
+ <div class="col-xs-11 col-lg-12"> | |
+ <xsl:call-template name="region.pre-header" /> | |
+ </div> | |
+ </div> | |
</div> | |
</div> | |
<div class="container"> | |
@@ -690,7 +737,7 @@ | |
<xsl:otherwise>0</xsl:otherwise> | |
</xsl:choose> | |
</xsl:variable> | |
- <xsl:variable name="WIDTH_CSS_CLASS">col-md-<xsl:value-of select="12 - $SIDEBAR_LEFT_COLUMNS - $SIDEBAR_RIGHT_COLUMNS" /></xsl:variable> | |
+ <xsl:variable name="WIDTH_CSS_CLASS">col-<xsl:value-of select="$SIDE_BAR_TRANSITION_POINT"/>-<xsl:value-of select="12 - $SIDEBAR_LEFT_COLUMNS - $SIDEBAR_RIGHT_COLUMNS" /></xsl:variable> | |
<div class="{$WIDTH_CSS_CLASS}"> | |
<!-- USE FLUID ROWS WITHIN HERE --> | |
<xsl:call-template name="focused-fragment-header" /> | |
@@ -736,7 +783,9 @@ | |
<xsl:call-template name="region.page-bottom" /> | |
<xsl:call-template name="region.hidden-bottom" /> | |
</div> | |
- | |
+ </div> | |
+ </div> | |
+ </div> | |
<xsl:call-template name="page.dialogs" /> | |
<script type="text/javascript"> | |
diff --git a/uportal-war/src/main/webapp/media/skins/respondr/common/less/header.less b/uportal-war/src/main/webapp/media/skins/respondr/common/less/header.less | |
index 753cac7..c7865a0 100644 | |
--- a/uportal-war/src/main/webapp/media/skins/respondr/common/less/header.less | |
+++ b/uportal-war/src/main/webapp/media/skins/respondr/common/less/header.less | |
@@ -29,7 +29,6 @@ | |
} | |
.portal-global { | |
- position: absolute; | |
top: 10px; | |
right: 0; | |
-- | |
1.9.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment