Skip to content

Commit

Permalink
LPS-39796 - Fix Stocks portlet after Alloy 2.0 migration
Browse files Browse the repository at this point in the history
  • Loading branch information
ipeychev authored and brianchandotcom committed Sep 13, 2013
1 parent 31fcf11 commit f261de8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<icon>/icon.png</icon>
<preferences-owned-by-group>false</preferences-owned-by-group>
<maximize-edit>true</maximize-edit>
<header-portlet-css>/css/main.css</header-portlet-css>
<css-class-wrapper>stocks-portlet</css-class-wrapper>
</portlet>
<role-mapper>
Expand Down
5 changes: 5 additions & 0 deletions portlets/stocks-portlet/docroot/css/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.stock-options, .stock-options-form {
.alert {
padding: 0;
}
}
14 changes: 7 additions & 7 deletions portlets/stocks-portlet/docroot/view.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

<%@ include file="/init.jsp" %>

<form action="<portlet:renderURL windowState="<%= WindowState.MAXIMIZED.toString() %>" />" method="post" name="<portlet:namespace />fm" onSubmit="submitForm(this); return false;">
<form action="<portlet:renderURL windowState="<%= WindowState.MAXIMIZED.toString() %>" />" class="stock-options-form" method="post" name="<portlet:namespace />fm" onSubmit="submitForm(this); return false;">

<c:choose>
<c:when test="<%= windowState.equals(WindowState.NORMAL) %>">
<table class="lfr-table">
<table class="lfr-table ">

<%
for (int i = 0; i < symbols.length; i++) {
Expand All @@ -38,13 +38,13 @@
</td>
<td align="right">
<c:if test="<%= stocks.getChange() < 0 %>">
<span class="portlet-msg-error">
<span class="alert alert-error">
<%= stocks.isChangeAvailable() ? decimalFormat.format(stocks.getChange()) : LanguageUtil.get(pageContext, "not-available") %>
</span>
</c:if>

<c:if test="<%= stocks.getChange() > 0 %>">
<span class="portlet-msg-success">
<span class="alert alert-success">
+<%= stocks.isChangeAvailable() ? decimalFormat.format(stocks.getChange()) : LanguageUtil.get(pageContext, "not-available") %>
</span>
</c:if>
Expand Down Expand Up @@ -105,7 +105,7 @@

<input maxlength="10" name="<portlet:namespace />symbol" size="10" type="text" value="<%= symbol %>" />

<select name="<portlet:namespace />time" onChange="submitForm(document.<portlet:namespace />fm);">
<select class="stock-options" name="<portlet:namespace />time" onChange="submitForm(document.<portlet:namespace />fm);">
<option <%= (time == 1) ? "selected" : "" %> value="1">1 <liferay-ui:message key="day" /></option>
<option <%= (time == 2) ? "selected" : "" %> value="2">2 <liferay-ui:message key="days" /></option>
<option <%= (time == 3) ? "selected" : "" %> value="3">5 <liferay-ui:message key="days" /></option>
Expand Down Expand Up @@ -141,13 +141,13 @@

<c:if test="<%= stocks.isChangeAvailable() && stocks.isPreviousCloseAvailable() %>">
<c:if test="<%= stocks.getChange() < 0 %>">
<span class="portlet-msg-error">
<span class="alert alert-error">
<strong><%= decimalFormat.format(stocks.getChange()) %> / <%= decimalFormat.format(stocks.getChange() / stocks.getPreviousClose() * 100) %>%</strong>
</span>
</c:if>

<c:if test="<%= stocks.getChange() > 0 %>">
<span class="portlet-msg-success">
<span class="alert alert-success">
<strong>+<%= decimalFormat.format(stocks.getChange()) %> / <%= decimalFormat.format(stocks.getChange() / stocks.getPreviousClose() * 100) %>%</strong>
</span>
</c:if>
Expand Down

0 comments on commit f261de8

Please sign in to comment.