Making portal app styles for both cloud and general setup, added isCloud flag in portal/configs/designer.json

merge-requests/1/head
Susinda Perera 8 years ago committed by Susinda
parent 3d213cf4c7
commit 45d5b0d061

@ -18,16 +18,23 @@
<% <%
var query = request.getQueryString(); var query = request.getQueryString();
var dest = encodeURIComponent(originalURI + (query ? '?' + query : '')); var dest = encodeURIComponent(originalURI + (query ? '?' + query : ''));
var configs = require('/configs/portal.js').config();
var isCloud = configs.isCloud;
%> %>
<header class="header header-default"> <header class="header header-default">
<div class="container-fluid"> <div class="container-fluid">
<div class="pull-left brand float-remove-xs text-center-xs"> <div class="pull-left brand float-remove-xs text-center-xs">
<a href="<%=tenantedUrlPrefix%>./dashboards"> <a href="<%=tenantedUrlPrefix%>./dashboards">
<img src="<%=urlPrefix%>libs/theme-wso2_1.0/images/logo-inverse.svg" alt="WSO2" title="WSO2" class="logo"> <img src="<%=urlPrefix%>libs/theme-wso2_1.0/images/logo-inverse.svg" alt="WSO2" title="WSO2" class="logo">
<% if (isCloud) { %>
<h1>Cloud</h1> <h1>Cloud</h1>
<% } else { %>
<h1><%=i18n.localize("dashboard.server.label")%></h1>
<% } %>
</a> </a>
</div> </div>
<div class="pull-right auth float-remove-xs text-center-xs"> <% if (isCloud) { %>
<div class="pull-right auth float-remove-xs text-center-xs">
<% if (user) { %> <% if (user) { %>
<ul class="nav navbar-right float-remove-xs text-center-xs"> <ul class="nav navbar-right float-remove-xs text-center-xs">
@ -283,7 +290,40 @@ var dest = encodeURIComponent(originalURI + (query ? '?' + query : ''));
</div> </div>
</div> </div>
<% } else { %>
<div class="pull-right auth float-remove-xs text-center-xs">
<% if (user) { %>
<span class="hidden-xs">
<a href="#" class="dropdown" data-toggle="dropdown">
<span class="add-margin-left-2x add-margin-right-1x"><%=user.username%></span>
<span class="fw fw-user add-margin-right-1x"></span>
<span class="caret add-margin-right-2x"></span>
</a>
<ul class="dropdown-menu dropdown-menu-right" role="menu">
<li class="dropdown-header visible-xs"><%=user.username%> <span class="caret"></span></li>
<li><a href="<%=urlPrefix%>logout?destination=<%=dest%>"><%= i18n.localize("logout.label")%></a></li>
</ul>
</span>
<div class="visible-xs auth-xs">
<a href="#" class="collapsed" data-toggle="collapse" data-target="#auth-menu-items" aria-expanded="false">
<span class="icon fw-stack fw">
<i class="fw fw-user fw-stack-1x"></i>
</span>
<span class="caret"></span>
</a>
<div id="auth-menu-items" class="collapse">
<ul >
<li><%=user.username%></li>
<li><a href="<%=urlPrefix%>logout?destination=<%=dest%>"><%= i18n.localize("logout.label")%></a></li>
</ul>
</div>
</div>
<% } else { %>
<a href="<%=urlPrefix%>login?destination=<%=dest%>" class="dropdown" data-toggle="dropdown">
<%= i18n.localize("login.label")%>
</a>
<% } %>
</div>
<% } %>
</div> </div>
</header> </header>

@ -149,7 +149,7 @@ $(function () {
var dashboard = findDashboard(id); var dashboard = findDashboard(id);
dashboardEl.html(dashboardThumbnailHbs(dashboard)); dashboardEl.html(dashboardThumbnailHbs(dashboard));
}); });
portal.on('click', '.ues-view:not(.disable)', function(e) { portal.on('click', '.ues-view:not(.disable)', function(e) {
e.preventDefault(); e.preventDefault();
window.open($(this).attr('href'), '_blank'); window.open($(this).attr('href'), '_blank');
@ -185,20 +185,20 @@ $(function () {
}); });
}; };
$(document).ready(function () { $(document).ready(function () {
$('#cloud-menu-popover i.fw-tiles').popover({ if($('#cloud-menu-popover').length) {
html: true, $('#cloud-menu-popover i.fw-tiles').popover({
trigger:'click', html: true,
title: function() { trigger:'click',
return $("#popover-head").html(); title: function() {
}, return $("#popover-head").html();
content: function() { },
return $("#popover-content").html(); content: function() {
} return $("#popover-content").html();
}); }
});
}
}); });
initUI(); initUI();
loadDashboards(); loadDashboards();
}); });

@ -1,4 +1,5 @@
{ {
"isCloud" : false,
"store": { "store": {
"types": ["fs"] "types": ["fs"]
}, },

Loading…
Cancel
Save