Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generic search.jsp template to allow item-specific resultSummary/Deta…
…il in results
- Loading branch information
Showing
5 changed files
with
99 additions
and
69 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
sample-webapp/src/main/webapp/WEB-INF/views/mobile/autos/resultDetail.jsp
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<%@ taglib prefix="f" uri="/functions" %> | ||
<%@ taglib prefix="sample" tagdir="/WEB-INF/tags" %> | ||
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %> | ||
|
||
<tiles:importAttribute name="result" /> | ||
|
||
<div style="font-size: 100%; padding-left: 10px"><br/><b>${f:toString(result.item.options)}</b></div> | ||
|
||
<!-- Forward scores --> | ||
<sample:what-matches result="${result}"/> | ||
|
||
<div style="padding: 2px 2px 0px 2px; float:left;"> | ||
<div class="attribute">Combined (mpg): <b>${f:toString(result.item.mpgCombined)}</b></div> | ||
<div class="attribute">Emissions (gCO2/km): <b>${f:toString(result.item.co2emissions)}</b></div> | ||
<div class="attribute">Power (bhp): <b>${f:toString(result.item.horsePower)}</b></div> | ||
<div class="attribute">Distance: ${f:toString(f:forwardsScore(result,'Distance'))} miles</div> | ||
</div> | ||
<div style="float: right; padding-right: 10px; padding-top: 30px"> | ||
<a data-ajax="false" href="?ref=${result.item.ref}&style=${style}">matches</a> | ||
</div> | ||
<div style="clear:left; float:none" ></div> |
15 changes: 15 additions & 0 deletions
15
sample-webapp/src/main/webapp/WEB-INF/views/mobile/autos/resultSummary.jsp
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<%@ taglib prefix="f" uri="/functions" %> | ||
|
||
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %> | ||
|
||
<tiles:importAttribute name="result" /> | ||
|
||
<span style="font-weight: bold; font-size: larger">${f:toString(result.item.colour)} ${result.item.carMake} ${result.item}</span> | ||
<span style="font-size: larger; padding-left: 10px"> £${f:toString(result.item.price)}</span> | ||
<span class="overall-score" style="background-color: ${f:toCssRGBColor(result.score)}"> | ||
${f:toPercent(result.score)}%</span> | ||
|
||
<br/><b>${result.item.postcode}</b> | ||
<c:if test="${!empty f:toString(f:forwardsScore(result,'Distance'))}"> | ||
<span> ${f:toString(f:forwardsScore(result,'Distance'))} miles</span> | ||
</c:if> |
66 changes: 0 additions & 66 deletions
66
sample-webapp/src/main/webapp/WEB-INF/views/mobile/autos/search.jsp
This file was deleted.
Oops, something went wrong.
50 changes: 50 additions & 0 deletions
50
sample-webapp/src/main/webapp/WEB-INF/views/mobile/search.jsp
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
|
||
<jsp:directive.include file="/WEB-INF/includes/includes.jsp"/> | ||
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %> | ||
|
||
<ul data-role="listview"> | ||
|
||
<li> | ||
<h3>Fuzzy Search</h3> | ||
<ul> | ||
<li> | ||
<tiles:insertAttribute name="searchForm" /> | ||
</li> | ||
</ul> | ||
</li> | ||
|
||
<!-- <li> --> | ||
<!-- <h3>Results</h3> --> | ||
<!-- <p>Click on 'matches' link to find matches for that vehicle</p> --> | ||
<!-- </li> --> | ||
|
||
<c:forEach var="result" items="${results}"> | ||
<c:set var="borderwidth" value=" solid #EEE 2px;"></c:set> | ||
<c:if test="${f:toPercent(result.score) eq 100}"> | ||
<c:set var="borderwidth" value="solid #1E1 2px;"></c:set> | ||
</c:if> | ||
|
||
<li style="border: ${borderwidth}"> | ||
|
||
<tiles:insertAttribute name="resultSummary" > | ||
<tiles:putAttribute name="result" value="${result}"></tiles:putAttribute> | ||
</tiles:insertAttribute> | ||
|
||
|
||
<ul> | ||
<li> | ||
<tiles:insertAttribute name="resultDetail" > | ||
<tiles:putAttribute name="result" value="${result}"></tiles:putAttribute> | ||
</tiles:insertAttribute> | ||
</li> | ||
</ul> | ||
|
||
<li> | ||
</c:forEach> | ||
|
||
<c:if test="${startNextPage > 0}"> | ||
<li> | ||
<a accesskey="n" href="?ref=${result.item.ref}&style=${style}&start=${startNextPage}&pageSize=${pageSize}">next page</a> | ||
</li> | ||
</c:if> | ||
</ul> |
This file contains 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