From 45d5b0d061b7e8e71b045aef002d431d064c477a Mon Sep 17 00:00:00 2001 From: Susinda Perera Date: Wed, 8 Mar 2017 13:18:11 +0530 Subject: [PATCH] Making portal app styles for both cloud and general setup, added isCloud flag in portal/configs/designer.json --- .../cloud/portal/global-navigation.jag | 48 +++++++++++++++++-- .../src/repository/cloud/portal/portal.js | 26 +++++----- .../jaggeryapps/portal/configs/designer.json | 1 + 3 files changed, 58 insertions(+), 17 deletions(-) diff --git a/modules/core/distribution/src/repository/cloud/portal/global-navigation.jag b/modules/core/distribution/src/repository/cloud/portal/global-navigation.jag index e4f22cc2..84e47f93 100644 --- a/modules/core/distribution/src/repository/cloud/portal/global-navigation.jag +++ b/modules/core/distribution/src/repository/cloud/portal/global-navigation.jag @@ -18,16 +18,23 @@ <% var query = request.getQueryString(); var dest = encodeURIComponent(originalURI + (query ? '?' + query : '')); +var configs = require('/configs/portal.js').config(); +var isCloud = configs.isCloud; %>
-
+ <% if (isCloud) { %> +
<% if (user) { %>
- - + <% } else { %> +
+ <% if (user) { %> + +
+ +
+ +
+
+ <% } else { %> + + <%= i18n.localize("login.label")%> + + <% } %> +
+ <% } %>
-
+ \ No newline at end of file diff --git a/modules/core/distribution/src/repository/cloud/portal/portal.js b/modules/core/distribution/src/repository/cloud/portal/portal.js index 0a7386a1..5b09f436 100644 --- a/modules/core/distribution/src/repository/cloud/portal/portal.js +++ b/modules/core/distribution/src/repository/cloud/portal/portal.js @@ -149,7 +149,7 @@ $(function () { var dashboard = findDashboard(id); dashboardEl.html(dashboardThumbnailHbs(dashboard)); }); - + portal.on('click', '.ues-view:not(.disable)', function(e) { e.preventDefault(); window.open($(this).attr('href'), '_blank'); @@ -185,20 +185,20 @@ $(function () { }); }; - $(document).ready(function () { - $('#cloud-menu-popover i.fw-tiles').popover({ - html: true, - trigger:'click', - title: function() { - return $("#popover-head").html(); - }, - content: function() { - return $("#popover-content").html(); - } - }); + if($('#cloud-menu-popover').length) { + $('#cloud-menu-popover i.fw-tiles').popover({ + html: true, + trigger:'click', + title: function() { + return $("#popover-head").html(); + }, + content: function() { + return $("#popover-content").html(); + } + }); + } }); - initUI(); loadDashboards(); }); \ No newline at end of file diff --git a/modules/core/distribution/src/repository/jaggeryapps/portal/configs/designer.json b/modules/core/distribution/src/repository/jaggeryapps/portal/configs/designer.json index 2f049839..86b79ac3 100644 --- a/modules/core/distribution/src/repository/jaggeryapps/portal/configs/designer.json +++ b/modules/core/distribution/src/repository/jaggeryapps/portal/configs/designer.json @@ -1,4 +1,5 @@ { + "isCloud" : false, "store": { "types": ["fs"] },