<html><head></head><body>

<t:switch prioritized="true">

<div class="contentblock">
<dl>
  <dt>Bibliographische Angaben</dt>
  <dd>

      <p class="coverimg" t:optional="true">
        <t:s>
          book.amazon-url:=a/@href,
          book.image-url:=.//img/@src
        </t:s>
      </p>
    
         
      <table class="datarows"><t:loop><t:switch>
        <tr><th>Sonstiges:</th>
          <td>
          <ul><li>{if (contains(., ":")) then $book(substring-before(., ":")||"!") := substring-after(., ":") 
                   else $book("Sonstiges!")[] := string() }</li>+</ul>
          </td>
        </tr>
        <tr>{vl:set-book-property(th, td)}</tr>
      </t:switch></t:loop></table>
   </dd>

 
   <t:s>hasBestand:=false()</t:s>
   <dt >Bestand<t:s>hasBestand:=true()</t:s></dt>?
   <dd t:test="$hasBestand">
    <t:switch prioritized="on">
    <table class="datagrid2">
      <thead><tr>
       <t:siblings-header>
         <th>Status</th>?
         <th>In Zweigstelle</th>?
         <th>Signatur</th>?
         <th>Mediennummer</th>?
       </t:siblings-header>
      </tr></thead>
      <tbody>
      <tr>{$holding := {}}<t:siblings>
        <td>{$holding.status}</td>
        <td>{$holding.libraryBranch}</td>
        <td>{$holding.id}</td>
        <td>{$holding("Mediennummer!")}</td>
      </t:siblings>{$book.holdings[] := $holding}</tr>+
      </tbody>
    </table>
    <table class="datarows">
      <t:switch prioritized="on">
        <form>{
          $book.home-url := form(.),
          $book.holdings[] := ..//text()[normalize-space()]!{"title": ., "orderable": false()}
        }</form>
        <ul>
          <li><ul><li>Ausleihstatus:</li></ul></li>
          {$book.holdings[] := ./li/ul/{| ./li/{
            let $key := substring-before(., ":")
            return
              switch ($key) 
              (:  case "Ausleihstatus" return "status":)
                case "Signatur" return "id"
                case "Standort" return "libraryLocation"
                default return $key||"!"
                : substring-after(., ":")} |} 
          }
        </ul>
        <ul>{$book.holdings[] := .//li/{"libraryBranch": ., "Bibliothek-Info!": .//a/@href}, $book.home-url:=(.//a/@href)[1]}</ul>
        <a>{$book.home-url:=@href}</a>
      </t:switch>
     </table>
    </t:switch></dd>
  </dl>
</div>

         <div class="contentpadding">
           <p class="warning">{vl:raise(.)}</p>  
         </div>

</t:switch>

</body>
</html>
    

