| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
|---|
| 2 |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
|---|
| 3 |
<xsl:template name="searchResult"> |
|---|
| 4 |
<h2 class="bwStatusConfirmed"> |
|---|
| 5 |
<div id="searchFilter"> |
|---|
| 6 |
<form name="searchForm" method="post" action="{$search}"> |
|---|
| 7 |
<xsl:value-of select="$search.search" /> |
|---|
| 8 |
<input type="text" name="query" size="15"> |
|---|
| 9 |
<xsl:attribute name="value"><xsl:value-of select="/bedework/searchResults/query"/></xsl:attribute> |
|---|
| 10 |
</input> |
|---|
| 11 |
<input type="submit" name="submit" value="go"/> |
|---|
| 12 |
<xsl:value-of select="$search.limit" /> |
|---|
| 13 |
<xsl:choose> |
|---|
| 14 |
<xsl:when test="/bedework/searchResults/searchLimits = 'beforeToday'"> |
|---|
| 15 |
<input type="radio" name="searchLimits" value="fromToday"/><xsl:value-of select="$search.today.forward" /> |
|---|
| 16 |
<input type="radio" name="searchLimits" value="beforeToday" checked="checked"/><xsl:value-of select="$search.past.dates" /> |
|---|
| 17 |
<input type="radio" name="searchLimits" value="none"/><xsl:value-of select="$search.all.dates" /> |
|---|
| 18 |
</xsl:when> |
|---|
| 19 |
<xsl:when test="/bedework/searchResults/searchLimits = 'none'"> |
|---|
| 20 |
<input type="radio" name="searchLimits" value="fromToday"/><xsl:value-of select="$search.today.forward" /> |
|---|
| 21 |
<input type="radio" name="searchLimits" value="beforeToday"/><xsl:value-of select="$search.past.dates" /> |
|---|
| 22 |
<input type="radio" name="searchLimits" value="none" checked="checked"/><xsl:value-of select="$search.all.dates" /> |
|---|
| 23 |
</xsl:when> |
|---|
| 24 |
<xsl:otherwise> |
|---|
| 25 |
<input type="radio" name="searchLimits" value="fromToday" checked="checked"/><xsl:value-of select="$search.today.forward" /> |
|---|
| 26 |
<input type="radio" name="searchLimits" value="beforeToday"/><xsl:value-of select="$search.past.dates" /> |
|---|
| 27 |
<input type="radio" name="searchLimits" value="none"/><xsl:value-of select="$search.all.dates" /> |
|---|
| 28 |
</xsl:otherwise> |
|---|
| 29 |
</xsl:choose> |
|---|
| 30 |
</form> |
|---|
| 31 |
</div> |
|---|
| 32 |
<xsl:value-of select="$search.search.result" /> |
|---|
| 33 |
</h2> |
|---|
| 34 |
<table id="searchTable" cellpadding="0" cellspacing="0"> |
|---|
| 35 |
<tr> |
|---|
| 36 |
<th colspan="5"> |
|---|
| 37 |
<xsl:if test="/bedework/searchResults/numPages > 1"> |
|---|
| 38 |
<xsl:variable name="curPage" select="/bedework/searchResults/curPage"/> |
|---|
| 39 |
<div id="searchPageForm"> |
|---|
| 40 |
<xsl:value-of select="$search.page" /> |
|---|
| 41 |
<xsl:if test="/bedework/searchResults/curPage != 1"> |
|---|
| 42 |
<xsl:variable name="prevPage" select="number($curPage) - 1"/> |
|---|
| 43 |
<<a href="{$search-next}&pageNum={$prevPage}"><xsl:value-of select="$search.prev" /></a> |
|---|
| 44 |
</xsl:if> |
|---|
| 45 |
<xsl:text> </xsl:text> |
|---|
| 46 |
|
|---|
| 47 |
<xsl:call-template name="searchResultPageNav"> |
|---|
| 48 |
<xsl:with-param name="page"> |
|---|
| 49 |
<xsl:choose> |
|---|
| 50 |
<xsl:when test="number($curPage) - 6 < 1">1</xsl:when> |
|---|
| 51 |
<xsl:otherwise><xsl:value-of select="number($curPage) - 6"/></xsl:otherwise> |
|---|
| 52 |
</xsl:choose> |
|---|
| 53 |
</xsl:with-param> |
|---|
| 54 |
</xsl:call-template> |
|---|
| 55 |
|
|---|
| 56 |
<xsl:text> </xsl:text> |
|---|
| 57 |
<xsl:choose> |
|---|
| 58 |
<xsl:when test="$curPage != /bedework/searchResults/numPages"> |
|---|
| 59 |
<xsl:variable name="nextPage" select="number($curPage) + 1"/> |
|---|
| 60 |
<a href="{$search-next}&pageNum={$nextPage}"><xsl:value-of select="$search.next" /></a>> |
|---|
| 61 |
</xsl:when> |
|---|
| 62 |
<xsl:otherwise> |
|---|
| 63 |
<span class="hidden"><xsl:value-of select="$search.next" />></span><!-- occupy the space to keep the navigation from moving around --> |
|---|
| 64 |
</xsl:otherwise> |
|---|
| 65 |
</xsl:choose> |
|---|
| 66 |
</div> |
|---|
| 67 |
</xsl:if> |
|---|
| 68 |
<xsl:value-of select="/bedework/searchResults/resultSize"/> |
|---|
| 69 |
<xsl:value-of select="$search.result" /><xsl:if test="/bedework/searchResults/resultSize != 1">s</xsl:if> <xsl:value-of select="$search.returned" /> |
|---|
| 70 |
<xsl:value-of select="$search.for" /> <em><xsl:value-of select="/bedework/searchResults/query"/></em> |
|---|
| 71 |
</th> |
|---|
| 72 |
</tr> |
|---|
| 73 |
<xsl:if test="/bedework/searchResults/searchResult"> |
|---|
| 74 |
<tr class="fieldNames"> |
|---|
| 75 |
<td> |
|---|
| 76 |
<xsl:value-of select="$search.relevance" /> |
|---|
| 77 |
</td> |
|---|
| 78 |
<td> |
|---|
| 79 |
<xsl:value-of select="$search.summary" /> |
|---|
| 80 |
</td> |
|---|
| 81 |
<td> |
|---|
| 82 |
<xsl:value-of select="$search.date.time" /> |
|---|
| 83 |
</td> |
|---|
| 84 |
<td> |
|---|
| 85 |
<xsl:value-of select="$search.calendar" /> |
|---|
| 86 |
</td> |
|---|
| 87 |
<td> |
|---|
| 88 |
<xsl:value-of select="$search.location" /> |
|---|
| 89 |
</td> |
|---|
| 90 |
</tr> |
|---|
| 91 |
</xsl:if> |
|---|
| 92 |
<xsl:for-each select="/bedework/searchResults/searchResult"> |
|---|
| 93 |
<xsl:variable name="subscriptionId" select="event/subscription/id"/> |
|---|
| 94 |
<xsl:variable name="calPath" select="event/calendar/encodedPath"/> |
|---|
| 95 |
<xsl:variable name="guid" select="event/guid"/> |
|---|
| 96 |
<xsl:variable name="recurrenceId" select="event/recurrenceId"/> |
|---|
| 97 |
<tr> |
|---|
| 98 |
<td class="relevance"> |
|---|
| 99 |
<xsl:value-of select="ceiling(number(score)*100)"/>% |
|---|
| 100 |
<img src="{$resourcesRoot}/resources/spacer.gif" height="4" class="searchRelevance"> |
|---|
| 101 |
<xsl:attribute name="width"><xsl:value-of select="ceiling((number(score)*100) div 1.5)"/></xsl:attribute> |
|---|
| 102 |
</img> |
|---|
| 103 |
</td> |
|---|
| 104 |
<td> |
|---|
| 105 |
<a href="{$eventView}&subid={$subscriptionId}&calPath={$calPath}&guid={$guid}&recurrenceId={$recurrenceId}"> |
|---|
| 106 |
<xsl:choose> |
|---|
| 107 |
<xsl:when test="event/summary = ''"> |
|---|
| 108 |
<em><xsl:value-of select="$search.no.title" /></em> |
|---|
| 109 |
</xsl:when> |
|---|
| 110 |
<xsl:otherwise> |
|---|
| 111 |
<xsl:value-of select="event/summary"/> |
|---|
| 112 |
</xsl:otherwise> |
|---|
| 113 |
</xsl:choose> |
|---|
| 114 |
</a> |
|---|
| 115 |
</td> |
|---|
| 116 |
<td> |
|---|
| 117 |
<xsl:value-of select="event/start/longdate"/> |
|---|
| 118 |
<xsl:text> </xsl:text> |
|---|
| 119 |
<xsl:value-of select="event/start/time"/> |
|---|
| 120 |
<xsl:choose> |
|---|
| 121 |
<xsl:when test="event/start/longdate != event/end/longdate"> |
|---|
| 122 |
- <xsl:value-of select="event/start/longdate"/> |
|---|
| 123 |
<xsl:text> </xsl:text> |
|---|
| 124 |
<xsl:value-of select="event/end/time"/> |
|---|
| 125 |
</xsl:when> |
|---|
| 126 |
<xsl:when test="event/start/time != event/end/time"> |
|---|
| 127 |
- <xsl:value-of select="event/end/time"/> |
|---|
| 128 |
</xsl:when> |
|---|
| 129 |
</xsl:choose> |
|---|
| 130 |
</td> |
|---|
| 131 |
<td> |
|---|
| 132 |
<xsl:variable name="calUrl" select="event/calendar/encodedPath"/> |
|---|
| 133 |
<a href="{$setSelection}&calUrl={$calUrl}"> |
|---|
| 134 |
<xsl:value-of select="event/calendar/name"/> |
|---|
| 135 |
</a> |
|---|
| 136 |
</td> |
|---|
| 137 |
<td> |
|---|
| 138 |
<xsl:value-of select="event/location/address"/> |
|---|
| 139 |
</td> |
|---|
| 140 |
</tr> |
|---|
| 141 |
</xsl:for-each> |
|---|
| 142 |
</table> |
|---|
| 143 |
</xsl:template> |
|---|
| 144 |
|
|---|
| 145 |
<xsl:template name="searchResultPageNav"> |
|---|
| 146 |
<xsl:param name="page">1</xsl:param> |
|---|
| 147 |
<xsl:variable name="curPage" select="/bedework/searchResults/curPage"/> |
|---|
| 148 |
<xsl:variable name="numPages" select="/bedework/searchResults/numPages"/> |
|---|
| 149 |
<xsl:variable name="endPage"> |
|---|
| 150 |
<xsl:choose> |
|---|
| 151 |
<xsl:when test="number($curPage) + 6 > number($numPages)"><xsl:value-of select="$numPages"/></xsl:when> |
|---|
| 152 |
<xsl:otherwise><xsl:value-of select="number($curPage) + 6"/></xsl:otherwise> |
|---|
| 153 |
</xsl:choose> |
|---|
| 154 |
</xsl:variable> |
|---|
| 155 |
<xsl:choose> |
|---|
| 156 |
<xsl:when test="$page = $curPage"> |
|---|
| 157 |
<xsl:value-of select="$page"/> |
|---|
| 158 |
</xsl:when> |
|---|
| 159 |
<xsl:otherwise> |
|---|
| 160 |
<a href="{$search-next}&pageNum={$page}"> |
|---|
| 161 |
<xsl:value-of select="$page"/> |
|---|
| 162 |
</a> |
|---|
| 163 |
</xsl:otherwise> |
|---|
| 164 |
</xsl:choose> |
|---|
| 165 |
<xsl:text> </xsl:text> |
|---|
| 166 |
<xsl:if test="$page < $endPage"> |
|---|
| 167 |
<xsl:call-template name="searchResultPageNav"> |
|---|
| 168 |
<xsl:with-param name="page" select="number($page)+1"/> |
|---|
| 169 |
</xsl:call-template> |
|---|
| 170 |
</xsl:if> |
|---|
| 171 |
</xsl:template> |
|---|
| 172 |
|
|---|
| 173 |
|
|---|
| 174 |
<xsl:template name="searchBar"> |
|---|
| 175 |
<table width="100%" border="0" cellpadding="0" cellspacing="0" id="searchBarTable"> |
|---|
| 176 |
<tr> |
|---|
| 177 |
<td class="leftCell"> |
|---|
| 178 |
<xsl:choose> |
|---|
| 179 |
<xsl:when test="/bedework/selectionState/selectionType = 'calendar'"> |
|---|
| 180 |
<xsl:value-of select="$search.calendar2" /> <xsl:value-of select="/bedework/selectionState/subscriptions/subscription/calendar/name"/> |
|---|
| 181 |
<span class="link">[<a href="{$setSelection}"><xsl:value-of select="$search.default.view" /></a>]</span> |
|---|
| 182 |
</xsl:when> |
|---|
| 183 |
<xsl:when test="/bedework/selectionState/selectionType = 'search'"> |
|---|
| 184 |
<xsl:value-of select="$search.current.search" /> <xsl:value-of select="/bedework/search"/> |
|---|
| 185 |
<span class="link">[<a href="{$setSelection}"><xsl:value-of select="$search.default.view" /></a>]</span> |
|---|
| 186 |
</xsl:when> |
|---|
| 187 |
<xsl:when test="/bedework/selectionState/selectionType = 'subscription'"> |
|---|
| 188 |
<xsl:value-of select="$search.subscriptions" /> |
|---|
| 189 |
<span class="link">[<a href="{$setSelection}"><xsl:value-of select="$search.default.view" /></a>]</span> |
|---|
| 190 |
</xsl:when> |
|---|
| 191 |
<xsl:when test="/bedework/selectionState/selectionType = 'filter'"> |
|---|
| 192 |
<xsl:value-of select="$search.filter" /> |
|---|
| 193 |
<span class="link">[<a href="{$setSelection}"><xsl:value-of select="$search.default.view" /></a>]</span> |
|---|
| 194 |
</xsl:when> |
|---|
| 195 |
<xsl:otherwise><!-- view --> |
|---|
| 196 |
<xsl:value-of select="$search.view" /> |
|---|
| 197 |
<form name="selectViewForm" method="post" action="{$setSelection}"> |
|---|
| 198 |
<select name="viewName" onchange="submit()" > |
|---|
| 199 |
<xsl:for-each select="/bedework/views/view"> |
|---|
| 200 |
<xsl:variable name="name" select="name"/> |
|---|
| 201 |
<xsl:choose> |
|---|
| 202 |
<xsl:when test="name=/bedework/selectionState/view/name"> |
|---|
| 203 |
<option value="{$name}" selected="selected"><xsl:value-of select="name"/></option> |
|---|
| 204 |
</xsl:when> |
|---|
| 205 |
<xsl:otherwise> |
|---|
| 206 |
<option value="{$name}"><xsl:value-of select="name"/></option> |
|---|
| 207 |
</xsl:otherwise> |
|---|
| 208 |
</xsl:choose> |
|---|
| 209 |
</xsl:for-each> |
|---|
| 210 |
</select> |
|---|
| 211 |
</form> |
|---|
| 212 |
<span class="link"><a href="{$setSelection}"><xsl:value-of select="$search.default.view" /></a> | <a href="{$fetchPublicCalendars}">available calendars</a></span> |
|---|
| 213 |
</xsl:otherwise> |
|---|
| 214 |
</xsl:choose> |
|---|
| 215 |
</td> |
|---|
| 216 |
<td class="rightCell"> |
|---|
| 217 |
<xsl:if test="/bedework/page!='searchResult'"> |
|---|
| 218 |
<form name="searchForm" id="searchForm" method="post" action="{$search}"> |
|---|
| 219 |
<xsl:value-of select="$search.search" /> |
|---|
| 220 |
<input type="text" name="query" size="15"> |
|---|
| 221 |
<xsl:attribute name="value"><xsl:value-of select="/bedework/searchResults/query"/></xsl:attribute> |
|---|
| 222 |
</input> |
|---|
| 223 |
<input type="submit" name="submit" value="go"/> |
|---|
| 224 |
</form> |
|---|
| 225 |
<xsl:text> </xsl:text> |
|---|
| 226 |
</xsl:if> |
|---|
| 227 |
<xsl:choose> |
|---|
| 228 |
<xsl:when test="/bedework/periodname='Day'"> |
|---|
| 229 |
<img src="{$resourcesRoot}/resources/std-button-listview-off.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/> |
|---|
| 230 |
</xsl:when> |
|---|
| 231 |
<xsl:when test="/bedework/periodname='Year'"> |
|---|
| 232 |
<img src="{$resourcesRoot}/resources/std-button-calview-off.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/> |
|---|
| 233 |
</xsl:when> |
|---|
| 234 |
<xsl:when test="/bedework/periodname='Month'"> |
|---|
| 235 |
<xsl:choose> |
|---|
| 236 |
<xsl:when test="/bedework/appvar[key='monthViewMode']/value='list'"> |
|---|
| 237 |
<a href="{$setup}&setappvar=monthViewMode(cal)" title="toggle list/calendar view"> |
|---|
| 238 |
<img src="{$resourcesRoot}/resources/std-button-calview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/> |
|---|
| 239 |
</a> |
|---|
| 240 |
</xsl:when> |
|---|
| 241 |
<xsl:otherwise> |
|---|
| 242 |
<a href="{$setup}&setappvar=monthViewMode(list)" title="toggle list/calendar view"> |
|---|
| 243 |
<img src="{$resourcesRoot}/resources/std-button-listview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/> |
|---|
| 244 |
</a> |
|---|
| 245 |
</xsl:otherwise> |
|---|
| 246 |
</xsl:choose> |
|---|
| 247 |
</xsl:when> |
|---|
| 248 |
<xsl:otherwise> |
|---|
| 249 |
<xsl:choose> |
|---|
| 250 |
<xsl:when test="/bedework/appvar[key='weekViewMode']/value='list'"> |
|---|
| 251 |
<a href="{$setup}&setappvar=weekViewMode(cal)" title="toggle list/calendar view"> |
|---|
| 252 |
<img src="{$resourcesRoot}/resources/std-button-calview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/> |
|---|
| 253 |
</a> |
|---|
| 254 |
</xsl:when> |
|---|
| 255 |
<xsl:otherwise> |
|---|
| 256 |
<a href="{$setup}&setappvar=weekViewMode(list)" title="toggle list/calendar view"> |
|---|
| 257 |
<img src="{$resourcesRoot}/resources/std-button-listview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/> |
|---|
| 258 |
</a> |
|---|
| 259 |
</xsl:otherwise> |
|---|
| 260 |
</xsl:choose> |
|---|
| 261 |
</xsl:otherwise> |
|---|
| 262 |
</xsl:choose> |
|---|
| 263 |
<xsl:choose> |
|---|
| 264 |
<xsl:when test="/bedework/periodname='Year' or |
|---|
| 265 |
(/bedework/periodname='Month' and |
|---|
| 266 |
(/bedework/appvar[key='monthViewMode']/value='cal' or |
|---|
| 267 |
not(/bedework/appvar[key='monthViewMode']))) or |
|---|
| 268 |
(/bedework/periodname='Week' and |
|---|
| 269 |
(/bedework/appvar[key='weekViewMode']/value='cal' or |
|---|
| 270 |
not(/bedework/appvar[key='weekViewMode'])))"> |
|---|
| 271 |
<xsl:choose> |
|---|
| 272 |
<xsl:when test="/bedework/appvar[key='summaryMode']/value='details'"> |
|---|
| 273 |
<img src="{$resourcesRoot}/resources/std-button-summary-off.gif" width="62" height="21" border="0" alt="only summaries of events supported in this view"/> |
|---|
| 274 |
</xsl:when> |
|---|
| 275 |
<xsl:otherwise> |
|---|
| 276 |
<img src="{$resourcesRoot}/resources/std-button-details-off.gif" width="62" height="21" border="0" alt="only summaries of events supported in this view"/> |
|---|
| 277 |
</xsl:otherwise> |
|---|
| 278 |
</xsl:choose> |
|---|
| 279 |
</xsl:when> |
|---|
| 280 |
<xsl:otherwise> |
|---|
| 281 |
<xsl:choose> |
|---|
| 282 |
<xsl:when test="/bedework/appvar[key='summaryMode']/value='details'"> |
|---|
| 283 |
<a href="{$setup}&setappvar=summaryMode(summary)" title="toggle summary/detailed view"> |
|---|
| 284 |
<img src="{$resourcesRoot}/resources/std-button-summary.gif" width="62" height="21" border="0" alt="toggle summary/detailed view"/> |
|---|
| 285 |
</a> |
|---|
| 286 |
</xsl:when> |
|---|
| 287 |
<xsl:otherwise> |
|---|
| 288 |
<a href="{$setup}&setappvar=summaryMode(details)" title="toggle summary/detailed view"> |
|---|
| 289 |
<img src="{$resourcesRoot}/resources/std-button-details.gif" width="62" height="21" border="0" alt="toggle summary/detailed view"/> |
|---|
| 290 |
</a> |
|---|
| 291 |
</xsl:otherwise> |
|---|
| 292 |
</xsl:choose> |
|---|
| 293 |
</xsl:otherwise> |
|---|
| 294 |
</xsl:choose> |
|---|
| 295 |
<a href="{$setup}"><img src="{$resourcesRoot}/resources/std-button-refresh.gif" width="70" height="21" border="0" alt="refresh view"/></a> |
|---|
| 296 |
</td> |
|---|
| 297 |
</tr> |
|---|
| 298 |
</table> |
|---|
| 299 |
</xsl:template> |
|---|
| 300 |
</xsl:stylesheet> |
|---|