Revision 9806
Added by ben leinfelder over 8 years ago
lib/style/common/dcx/onedcx-common.xsl | ||
---|---|---|
193 | 193 |
</div> |
194 | 194 |
</div> |
195 | 195 |
</xsl:template> |
196 |
|
|
197 |
<xsl:template name="extract-period"> |
|
198 |
<xsl:call-template name="show-temporal"> |
|
199 |
<xsl:with-param name="data" select="." /> |
|
200 |
<xsl:with-param name="field" select="'start'" /> |
|
201 |
<xsl:with-param name="label" select="'Begin Date'" /> |
|
202 |
</xsl:call-template> |
|
203 |
<xsl:call-template name="show-temporal"> |
|
204 |
<xsl:with-param name="data" select="." /> |
|
205 |
<xsl:with-param name="field" select="'end'" /> |
|
206 |
<xsl:with-param name="label" select="'End Date'" /> |
|
207 |
</xsl:call-template> |
|
208 |
</xsl:template> |
|
209 |
|
|
210 |
<xsl:template name="show-temporal"> |
|
211 |
<xsl:param name="data" /> |
|
212 |
<xsl:param name="field" /> |
|
213 |
<xsl:param name="label" /> |
|
214 |
<xsl:variable name="date" |
|
215 |
select="substring-before(substring-after($data,concat($field,'=')),';')" /> |
|
216 |
<label class="control-label"> |
|
217 |
<xsl:value-of select="$label" /> |
|
218 |
</label> |
|
219 |
<div class="controls controls-well"> |
|
220 |
<xsl:value-of select="$date" /> |
|
221 |
</div> |
|
222 |
</xsl:template> |
|
196 | 223 |
|
197 | 224 |
<xsl:template name="temporal"> |
198 | 225 |
<div class="row-fluid"> |
199 | 226 |
<div data-content="temporalCoverage" class="row-fluid temporalCoverage"> |
200 | 227 |
<h4>Temporal Coverage</h4> |
201 | 228 |
<div class="control-group"> |
202 |
<label class="control-label">Date Range</label> |
|
203 |
<div class="controls controls-well"> |
|
204 |
<div class="control-group"> |
|
205 |
<label class="control-label">Begin</label> |
|
206 |
<div class="controls"> |
|
207 |
<div class="row-fluid"> |
|
208 |
<xsl:value-of select="dcx:dcTerms/dct:temporal" /> |
|
209 |
</div> |
|
210 |
</div> |
|
211 |
</div> |
|
212 |
<div class="control-group"> |
|
213 |
<label class="control-label">End</label> |
|
214 |
<div class="controls"> |
|
215 |
<div class="row-fluid"> |
|
216 |
<xsl:value-of select="dcx:dcTerms/dct:temporal" /> |
|
217 |
</div> |
|
218 |
</div> |
|
219 |
</div> |
|
220 |
</div> |
|
229 |
<xsl:if test="//dcx:dcTerms/dct:temporal[@xsi:type='Period']/text() != ''"> |
|
230 |
<label class="control-label">Date Range</label> |
|
231 |
<div class="controls controls-well"> |
|
232 |
<xsl:for-each select="//dcx:dcTerms/dct:temporal[@xsi:type='Period']"> |
|
233 |
<xsl:call-template name="extract-period" /> |
|
234 |
</xsl:for-each> |
|
235 |
</div> |
|
236 |
</xsl:if> |
|
237 |
<xsl:if test="//dcx:dcTerms/dct:temporal[not(@xsi:type='Period')]/text() != ''"> |
|
238 |
<label class="control-label">Single Date</label> |
|
239 |
<div class="controls controls-well"> |
|
240 |
<xsl:for-each select="//dcx:dcTerms/dct:temporal[not(@xsi:type='Period')]"> |
|
241 |
<xsl:value-of select="." /> |
|
242 |
</xsl:for-each> |
|
243 |
</div> |
|
244 |
</xsl:if> |
|
221 | 245 |
</div> |
222 | 246 |
</div> |
223 | 247 |
</div> |
Also available in: Unified diff
render temporal periods and single dates. https://redmine.dataone.org/issues/7686