Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit e51ce08

Browse files
committed
Universal nav initial implementation
1 parent ab0e071 commit e51ce08

File tree

1 file changed

+46
-8
lines changed

1 file changed

+46
-8
lines changed

src/main/com/topcoder/web/tc/view/pacts/client/PaymentHistory.jsp

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
<c:set var="cr" value="<%= request.getAttribute(PaymentHistory.CODER) %>"/>
3939
<c:set var="paymentConfirmationTemplate" value="<%= request.getAttribute(PaymentHistory.PAYMENT_CONFIRMATION_TEMPLATE) %>"/>
4040
<c:set var="userPaymentMethod" value="<%= request.getAttribute(PaymentHistory.USER_PAYMENT_METHOD) %>"/>
41+
<c:set var="userHandle" value="<%= sessionInfo.getHandle() %>"/>
42+
<c:set var="userId" value="<%= sessionInfo.getUserId() %>"/>
43+
<c:set var="userImagePath" value="<%= sessionInfo.getImagePath() %>"/>
44+
<c:set var="userInitials" value="<%= sessionInfo.getHandle() %>"/>
4145

4246
<c:set value="<%=PaymentHistory.DEFAULTS_KEY%>" var="defaults"/>
4347
<c:set value="<%=PaymentHistory.PAYMENT_ID%>" var="PAYMENT_ID"/>
@@ -77,6 +81,47 @@
7781
<jsp:param name="key" value="tc_stats"/>
7882
<jsp:param name="reskin" value="${isReskin ? 'paymentHistory' : ''}"/>
7983
</jsp:include>
84+
<div id="headerNav"></div>
85+
<script>
86+
var currEnv = '<%=ApplicationServer.ENVIRONMENT%>';
87+
var prodEnv = '<%=ApplicationServer.PROD%>'
88+
var scriptURL = '//uni-nav.topcoder-dev.com/v1/tc-universal-nav.js';
89+
90+
if (currEnv === prodEnv) {
91+
scriptURL = '//uni-nav.topcoder.com/v1/tc-universal-nav-1.js';
92+
}
93+
94+
!function(n,t,e,a,c,i,o){n['TcUnivNavConfig']=c,n[c]=n[c]||function(){
95+
(n[c].q=n[c].q??[]).push(arguments)},n[c].l=1*new Date();i=t.createElement(e),
96+
o=t.getElementsByTagName(e)[0];i.async=1;i.type="module";i.src=a;o.parentNode.insertBefore(i,o)
97+
}(window,document,"script",scriptURL,"tcUniNav");
98+
99+
var photoUrl = 'https://<%=ApplicationServer.SERVER_NAME%>' + '${userImagePath}';
100+
var userId = ${userId};
101+
var handle = '${userHandle}';
102+
var initials = handle ? handle.substr(0, 2).toUpperCase() : '';
103+
104+
var user = {
105+
photoUrl,
106+
userId,
107+
initials,
108+
handle
109+
};
110+
111+
tcUniNav('init', 'headerNav', {
112+
type: 'tool',
113+
toolName: 'Topcoder Payments',
114+
user,
115+
signOut() {
116+
window.location.replace("http://<%=ApplicationServer.SERVER_NAME%>/tc?module=Logout")
117+
}
118+
});
119+
120+
tcUniNav('init', 'footerNav', {
121+
type: 'footer',
122+
})
123+
124+
</script>
80125
81126
<script type="text/javascript">
82127
USER_PAYMENT_METHOD = ${userPaymentMethod eq null ? 'null' : userPaymentMethod};
@@ -186,11 +231,6 @@
186231
</head>
187232
<body>
188233
189-
<jsp:include page="../../top.jsp" >
190-
<jsp:param name="level1" value=""/>
191-
<jsp:param name="isReskin" value="${isReskin}"/>
192-
</jsp:include>
193-
194234
<c:if test="${isReskin}">
195235
<div class="page">
196236
</c:if>
@@ -836,9 +876,7 @@
836876
</div><!-- // end .page -->
837877
</c:if>
838878
839-
<jsp:include page="/foot.jsp" >
840-
<jsp:param name="isReskin" value="${isReskin}"/>
841-
</jsp:include>
879+
<div id="footerNav"></div>
842880
843881
<c:if test="${isReskin}">
844882
<div class="modal payment-confirm-modal" id="payment-confirm-modal-id">

0 commit comments

Comments
 (0)