- Timestamp:
- 2020-03-10T21:02:24+13:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/model-interfaces-dev/alt-atea/transform/pages/document.xsl
r34009 r34014 10 10 11 11 12 13 12 <!-- set page title to be collection name instead of document name --> 13 <xsl:template name="pageTitle"><gslib:collectionName/></xsl:template> 14 14 15 <xsl:template name="javascriptForDocumentView"> 16 <script type="text/javascript" src="interfaces/default/js/document_scripts.js"><xsl:text> </xsl:text></script> 17 <script type="text/javascript" src="sites/pei-jones/js/custom-document.js"><xsl:text> </xsl:text></script> 18 </xsl:template> 19 20 <xsl:template name="javascriptForDocumentEditing"> 21 <!--<script type="text/javascript" src="interfaces/default/js/combobox.js"><xsl:text> </xsl:text></script>--> 22 <script type="text/javascript" src="interfaces/default/js/documentedit_scripts.js"><xsl:text> </xsl:text></script> 23 <script type="text/javascript" src="interfaces/default/js/documentedit_scripts_util.js"><xsl:text> </xsl:text></script> 24 <script type="text/javascript" src="interfaces/default/js/hierarchy.js"><xsl:text> </xsl:text></script> 25 <!-- add in the pei-jones customisations --> 26 <script type="text/javascript" src="sites/pei-jones/js/custom-doc-editing.js"><xsl:text> </xsl:text></script> 27 <!-- add in the collection specific customisations --> 28 <script type="text/javascript" src="sites/pei-jones/collect/{$collName}/js/custom-doc-editing.js"><xsl:text> </xsl:text></script> 29 <script type="text/javascript"> 30 <xsl:text disable-output-escaping="yes"> 31 $(window).load(function() 32 { 33 if(gs.cgiParams.docEdit == "1") 34 { 35 readyPageForEditing(); 36 } 37 }); 38 39 </xsl:text> 40 <!-- download and process hierarchy files --> 41 <xsl:text disable-output-escaping="yes">$(document).ready(function(){</xsl:text> 42 <xsl:for-each select="//classifier[@hfile]"> 43 <xsl:text disable-output-escaping="yes">downloadAndProcessHierarchyFile('</xsl:text> 44 <xsl:text>sites/pei-jones/collect/</xsl:text><xsl:value-of select="$collName"/><xsl:text>/etc/</xsl:text><xsl:value-of select="@hfile"/> 45 <xsl:text disable-output-escaping="yes">','</xsl:text><xsl:value-of select="@metadata"/><xsl:text disable-output-escaping="yes">');</xsl:text> 46 </xsl:for-each> 47 <xsl:text disable-output-escaping="yes">});</xsl:text> 48 49 </script> 50 </xsl:template> 51 52 <xsl:template name="editBar" > 53 <div id="editBar"> 54 <div id="editBarRight" stype="width:100%; float:right; margin: 0 0 10px 20px;" > 55 <div style="text-align:center;"> 56 <!-- edit content button --> 57 <div style="margin:5px;" class="ui-state-default ui-corner-all"> 58 <div id="editContentButtonDiv" style="margin:3px" ><a id="editContentButton" style="padding: 3px; text-decoration:none;"> 59 <xsl:attribute name="href"> 60 <xsl:value-of select="$library_name"/> 61 <xsl:text>/collection/</xsl:text> 62 <xsl:value-of select="$collName"/> 63 <xsl:text>/document/</xsl:text> 64 <xsl:choose> 65 <xsl:when test="count(//documentNode) > 0"> 66 <xsl:value-of select="/page/pageResponse/document/documentNode/@nodeID"/> 67 </xsl:when> 68 <xsl:otherwise> 69 <xsl:value-of select="/page/pageResponse/document/@nodeID"/> 70 </xsl:otherwise> 71 </xsl:choose> 72 <xsl:if test="not(/page/pageRequest/paramList/param[@name = 'docEdit']/@value = '1')"> 73 <xsl:text>?ed=1&docEdit=1</xsl:text> 74 </xsl:if> 75 </xsl:attribute> 76 <xsl:choose> 77 <xsl:when test="/page/pageRequest/paramList/param[@name = 'docEdit']/@value = '1'"> 78 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'de.hide_editor')"/> 79 </xsl:when> 80 <xsl:otherwise> 81 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'de.edit_content')"/> 82 </xsl:otherwise> 83 </xsl:choose> 84 </a> 85 </div> 86 <!-- place holder div for editing controls --> 87 <!-- Note, we are putting these underneath instead of to the left --> 88 <div id="editBarLeft"><xsl:text> </xsl:text></div> 89 </div> 90 </div> 91 </div> 92 </div> 93 </xsl:template> 94 95 96 <!-- The default template for displaying the document node text --> 97 <!-- equivalent to gsf:text --> 98 <!-- 99 <xsl:template name="documentNodeTextOld"> 100 < ! - - Hides the "This document has no text." message - - > 101 <xsl:variable name="noText">0</xsl:variable> 102 <xsl:choose> 103 <xsl:when test="not($noText = '1')"> 104 105 < ! - - Section text - - > 106 <xsl:for-each select="nodeContent"> 107 <xsl:for-each select="node()"> 108 <xsl:choose> 109 <xsl:when test="not(name())"> 110 <xsl:value-of select="." disable-output-escaping="yes"/> 111 </xsl:when> 112 <xsl:when test="name() = 'annotation'"> 113 <xsl:call-template name="displayAnnotation"/> 114 </xsl:when> 115 <xsl:otherwise> 116 <xsl:apply-templates/> 117 </xsl:otherwise> 118 </xsl:choose> 119 </xsl:for-each> 120 </xsl:for-each> 121 </xsl:when> 122 <xsl:when test="$noText = '1' and not(metadataList/metadata[@name='Image'])"> 123 <gsf:link type="source"><gsf:metadata name="Source"/></gsf:link> 124 </xsl:when> 125 </xsl:choose> 126 <xsl:text> </xsl:text> 127 </xsl:template> 128 --> 129 130 <!-- Below is the newer version of documentNodeText --> 131 <!-- No longer sure what the purpose of the above definition of the template was for, however 132 as it calls dispayAnnotation, and this no longer exists, now commented out --> 133 134 <xsl:template name="documentNodeTextOld"> 135 <xsl:param name="force">0</xsl:param> 136 <!-- Hides the "This document has no text." message --> 137 <xsl:variable name="noText"><gsf:metadata name="NoText"/></xsl:variable> 138 <xsl:choose> 139 <xsl:when test="$force = '1' or not($noText = '1')"> 140 141 <!-- Section text --> 142 <xsl:for-each select="nodeContent"> 143 <xsl:call-template name="displayMarkedUpTextAndAnnotations"/> 144 </xsl:for-each> 145 </xsl:when> 146 <xsl:when test="$noText = '1' and not(metadataList/metadata[@name='ImageType'])"> 147 <gsf:link type="source"><gsf:metadata name="Source"/></gsf:link> 148 </xsl:when> 149 </xsl:choose> 150 <xsl:text> </xsl:text> 151 </xsl:template> 152 153 154 <xsl:template name="topLevelSectionContent"> 155 <xsl:call-template name="wrappedSectionImage"/> 156 <xsl:call-template name="imageDownloadLink"/> 157 <xsl:call-template name="pjMetadataDisplayTable"/> 158 <xsl:call-template name="wrappedSectionText"/> 159 </xsl:template> 160 161 <xsl:template name="sectionContent"> 162 <xsl:call-template name="wrappedSectionImage"/> 163 <xsl:call-template name="imageDownloadLink"/> 164 <xsl:call-template name="pjMetadataDisplayTable"/> 165 <xsl:call-template name="wrappedSectionText"/> 166 </xsl:template> 167 168 <xsl:template name="sectionContentForEditing"> 169 <xsl:call-template name="wrappedSectionImage"/> 170 <xsl:call-template name="imageDownloadLink"/> 171 <xsl:call-template name="wrappedSectionTextForEditing"/> 172 </xsl:template> 173 174 <xsl:template name="imageDownloadLink"> 175 <xsl:if test="$collName = 'written-works'"> 176 <gsf:if-metadata-exists> 177 <gsf:metadata name="Image" hidden="true"/> 178 <gsf:if> 179 <gsf:link type="source" source_meta="Source">download tif image</gsf:link> 180 </gsf:if> 181 </gsf:if-metadata-exists> 182 </xsl:if> 183 </xsl:template> 184 185 <xsl:template name="pjMetadataDisplayTable"> 186 <table cellpadding="1" cellspacing="0" class="alternating" hspace="5" style="margin-top: 15px; border: 1px solid #000; border-collapse: collapse;" vspace="5"> 187 <gsf:switch> 188 <gsf:metadata name="pj.Title"/> 189 <gsf:when test="exists"> 190 <tr> 191 <td class="heading"> 192 <p rect="norect">Title</p> 193 </td> 194 <td> 195 <p data="Title" rect="norect"> 196 <gsf:metadata name="pj.Title"/> 197 </p> 198 </td> 199 </tr> 200 </gsf:when> 201 </gsf:switch> 202 <gsf:switch> 203 <gsf:metadata name="pj.Date"/> 204 <gsf:when test="exists"> 205 <tr> 206 <td class="heading"> 207 <p rect="norect">Date</p> 208 </td> 209 <td> 210 <p data="Date" rect="norect"> 211 <gsf:metadata name="pj.Date" format="formatDate"/> 212 </p> 213 </td> 214 </tr> 215 </gsf:when> 216 </gsf:switch> 217 <gsf:switch> 218 <gsf:metadata name="pj.Author"/> 219 <gsf:when test="exists"> 220 <tr> 221 <td class="heading"> 222 <p rect="norect">Author</p> 223 </td> 224 <td> 225 <p data="Author" rect="norect"> 226 <gsf:metadata name="pj.Author"/> 227 </p> 228 </td> 229 </tr> 230 </gsf:when> 231 </gsf:switch> 232 <gsf:switch> 233 <gsf:metadata name="pj.Correspondent"/> 234 <gsf:when test="exists"> 235 <tr> 236 <td class="heading"> 237 <p rect="norect">Correspondent</p> 238 </td> 239 <td> 240 <p data="Correspondent" rect="norect"> 241 <gsf:metadata name="pj.Correspondent"/> 242 </p> 243 </td> 244 </tr> 245 </gsf:when> 246 </gsf:switch> 247 <gsf:switch> 248 <gsf:metadata name="pj.Description"/> 249 <gsf:when test="exists"> 250 <tr> 251 <td class="heading"> 252 <p rect="norect" style="font-weight: bold;">Description</p> 253 </td> 254 <td> 255 <p data="Description" rect="norect"> 256 <gsf:metadata name="pj.Description"/> 257 </p> 258 </td> 259 </tr> 260 </gsf:when> 261 </gsf:switch> 262 <gsf:switch> 263 <gsf:metadata name="pj.Subject"/> 264 <gsf:when test="exists"> 265 <tr> 266 <td class="heading"> 267 <p rect="norect" style="font-weight: bold;">Subject</p> 268 </td> 269 <td> 270 <p data="Subject" rect="norect"> 271 <gsf:metadata name="pj.Subject"/> 272 </p> 273 </td> 274 </tr> 275 </gsf:when> 276 </gsf:switch> 277 <gsf:switch> 278 <gsf:metadata name="pj.PersonOfInterest"/> 279 <gsf:when test="exists"> 280 <tr> 281 <td class="heading"> 282 <p rect="norect">Person of Interest</p> 283 </td> 284 <td> 285 <p data="PersonOfInterest" rect="norect"> 286 <gsf:metadata name="pj.PersonOfInterest"/> 287 </p> 288 </td> 289 </tr> 290 </gsf:when> 291 </gsf:switch> 292 <gsf:switch> 293 <gsf:metadata name="pj.Event"/> 294 <gsf:when test="exists"> 295 <tr> 296 <td class="heading"> 297 <p rect="norect">Event</p> 298 </td> 299 <td> 300 <p data="Event" rect="norect"> 301 <gsf:metadata name="pj.Event"/> 302 </p> 303 </td> 304 </tr> 305 </gsf:when> 306 </gsf:switch> 307 <gsf:switch> 308 <gsf:metadata name="pj.Location"/> 309 <gsf:when test="exists"> 310 <tr> 311 <td class="heading"> 312 <p rect="norect">Location</p> 313 </td> 314 <td> 315 <p data="Location" rect="norect"> 316 <gsf:metadata name="pj.Location"/> 317 </p> 318 </td> 319 </tr> 320 </gsf:when> 321 </gsf:switch> 322 <gsf:switch> 323 <gsf:metadata name="pj.Access"/> 324 <gsf:when test="exists"> 325 <tr> 326 <td class="heading"> 327 <p rect="norect" style="font-weight: bold;">Access</p> 328 </td> 329 <td> 330 <p data="MSAccess" rect="norect"> 331 <gsf:metadata name="pj.Access"/> 332 </p> 333 </td> 334 </tr> 335 </gsf:when> 336 </gsf:switch> 337 <gsf:switch> 338 <gsf:metadata name="pj.MSHeading"/> 339 <gsf:when test="exists"> 340 <tr> 341 <td class="heading"> 342 <p rect="norect" style="font-weight: bold;">Maori Subject Heading</p> 343 </td> 344 <td> 345 <p data="MSHeading" rect="norect"> 346 <gsf:metadata name="pj.MSHeading"/> 347 </p> 348 </td> 349 </tr> 350 </gsf:when> 351 </gsf:switch> 352 <gsf:switch> 353 <gsf:metadata name="pj.Document-Type"/> 354 <gsf:when test="exists"> 355 <tr> 356 <td class="heading"> 357 <p rect="norect" style="font-weight: bold;">Document-Type</p> 358 </td> 359 <td> 360 <p data="Document-Type" rect="norect"> 361 <gsf:metadata name="pj.Document-Type"/> 362 </p> 363 </td> 364 </tr> 365 </gsf:when> 366 </gsf:switch> 367 <gsf:switch> 368 <gsf:metadata name="pj.Notes"/> 369 <gsf:when test="exists"> 370 <tr> 371 <td class="heading"> 372 <p rect="norect" style="font-weight: bold;">Notes</p> 373 </td> 374 <td> 375 <p data="Notes" rect="norect"> 376 <gsf:metadata name="pj.Notes"/> 377 </p> 378 </td> 379 </tr> 380 </gsf:when> 381 </gsf:switch> 382 <gsf:switch> 383 <gsf:metadata name="pj.Provenance"/> 384 <gsf:when test="exists"> 385 <tr> 386 <td class="heading"> 387 <p rect="norect" style="font-weight:bold;">Provenance</p> 388 </td> 389 <td> 390 <p data="Provenance" rect="norect"> 391 <gsf:metadata name="pj.Provenance"/> 392 </p> 393 </td> 394 </tr> 395 </gsf:when> 396 </gsf:switch> 397 <gsf:switch> 398 <gsf:metadata name="pj.Tags"/> 399 <gsf:when test="exists"> 400 <tr> 401 <td class="heading"> 402 <p rect="norect" style="font-weight: bold;">Tags</p> 403 </td> 404 <td> 405 <p data="Tags" rect="norect"> 406 <gsf:metadata name="pj.Tags"/> 407 </p> 408 </td> 409 </tr> 410 </gsf:when> 411 </gsf:switch> 412 <gsf:switch> 413 <gsf:metadata name="pj.Catalogue-Number"/> 414 <gsf:when test="exists"> 415 <tr> 416 <td class="heading"> 417 <p rect="norect">Catalogue-Number</p> 418 </td> 419 <td> 420 <p data="Catalogue-Number" rect="norect"> 421 <gsf:metadata name="pj.Catalogue-Number"/> 422 </p> 423 </td> 424 </tr> 425 </gsf:when> 426 </gsf:switch> 427 <!-- <gsf:switch> 428 <gsf:metadata name="pj.Catalogue-Short"/> 429 <gsf:when test="exists"> 430 <tr> 431 <td class="heading"> 432 <p rect="norect">Catalogue-Short</p> 433 </td> 434 <td> 435 <p data="Catalogue-Short" rect="norect"> 436 <gsf:metadata name="pj.Catalogue-Short"/> 437 </p> 438 </td> 439 </tr> 440 </gsf:when> 441 </gsf:switch>--> 442 <gsf:switch> 443 <gsf:metadata name="pj.Physical-Location"/> 444 <gsf:when test="exists"> 445 <tr> 446 <td class="heading"> 447 <p rect="norect">Physical Location</p> 448 </td> 449 <td> 450 <p data="Physical-Location" rect="norect"> 451 <gsf:metadata name="pj.Physical-Location"/> 452 </p> 453 </td> 454 </tr> 455 </gsf:when> 456 </gsf:switch> 457 <gsf:switch> 458 <gsf:metadata name="pj.Physical-Description"/> 459 <gsf:when test="exists"> 460 <tr> 461 <td class="heading"> 462 <p rect="norect">Physical Description</p> 463 </td> 464 <td> 465 <p data="Physical-Location" rect="norect"> 466 <gsf:metadata name="pj.Physical-Description"/> 467 </p> 468 </td> 469 </tr> 470 </gsf:when> 471 </gsf:switch> 472 <gsf:switch> 473 <gsf:metadata name="pj.Year"/> 474 <gsf:when test="exists"> 475 <tr> 476 <td class="heading"> 477 <p rect="norect">Year</p> 478 </td> 479 <td> 480 <p data="Year" rect="norect"> 481 <gsf:metadata name="pj.Year"/> 482 </p> 483 </td> 484 </tr> 485 </gsf:when> 486 </gsf:switch> 487 <gsf:switch> 488 <gsf:metadata name="pj.Format"/> 489 <gsf:when test="exists"> 490 <tr> 491 <td class="heading"> 492 <p rect="norect">Format</p> 493 </td> 494 <td> 495 <p data="Format" rect="norect"> 496 <gsf:metadata name="pj.Format"/> 497 </p> 498 </td> 499 </tr> 500 </gsf:when> 501 </gsf:switch> 502 <tr><td></td></tr> 503 </table> 504 505 </xsl:template> 506 507 <!-- these are some old templates from collectionConfig.xmls --> 508 <xsl:template name="showAssocFilePath"> 509 <xsl:if test="/page/pageRequest/paramList/param[@name='p.showAssocFilePath']/@value='1'"> 510 <span data="gsdl.Metadata: assocfilepath" id="assocfilepath" rect="norect">@assocfilepath<gsf:metadata name="assocfilepath"/></span> 511 </xsl:if> 512 </xsl:template> 513 514 <xsl:template name="showExpediteeAttributes"> 515 <xsl:variable name="ScreenName">Screen</xsl:variable> 516 <xsl:variable name="ThumbName">Thumb</xsl:variable> 517 <xsl:if test="/page/pageRequest/paramList/param[@name='p.showExpediteeAttributes']/@value='1'"> 518 <table attr="norect" cellpadding="1" cellspacing="0" width="100%"> 519 <tr attr="norect"> 520 <td attr="norect" colspan="2"> 521 <span data="gsdl.Metadata: Screen" rect="norect">@Screenview: greenstone3-svn/web/sites/localsite/collect/pj-catalogue/index/assoc/<xsl:value-of disable-output-escaping="yes" select="/page/pageResponse/document/metadataList/metadata[@name = 'assocfilepath']"/>/<xsl:value-of disable-output-escaping="yes" select="(.//metadataList)[last()]/metadata[@name = $ScreenName]"/></span> 522 </td> 523 </tr> 524 <tr attr="norect"> 525 <td attr="norect" colspan="2"> 526 <span data="gsdl.Metadata: Thumb" rect="norect">@Thumbnail: greenstone3-svn/web/sites/localsite/collect/pj-catalogue/index/assoc/<xsl:value-of disable-output-escaping="yes" select="/page/pageResponse/document/metadataList/metadata[@name = 'assocfilepath']"/>/<xsl:value-of disable-output-escaping="yes" select="(.//metadataList)[last()]/metadata[@name = $ThumbName]"/></span> 527 </td> 528 </tr> 529 <tr attr="norect"> 530 <td attr="norect" colspan="2"> 531 <span data="gsdl.Metadata: Catalogue-Number" rect="norect">@Catalogue-Number:<gsf:metadata name="Catalogue-Number"/></span> 532 </td> 533 </tr> 534 </table> 535 </xsl:if> 536 </xsl:template> 537 538 15 <!-- ATEA MOD --> 16 <xsl:template name="documentVideoPlayer"> 17 <div style="padding: 20px;"> 18 <video controls="controls" style="width: 100%"> 19 <source> 20 <xsl:attribute name="src"> 21 <xsl:value-of select="$httpPath"/>/index/assoc/<gsf:metadata name="assocfilepath" pos="1"/>/<gsf:metadata name="srclink_file"/></xsl:attribute> 22 </source> 23 Your web browser does not support the this form of video. 24 </video> 25 </div> 26 </xsl:template> 27 28 539 29 </xsl:stylesheet>
Note:
See TracChangeset
for help on using the changeset viewer.