<?xml version="1.0" encoding="UTF-8"?>
<t:switch-prioritized>
<html>

<template:read var="templateError" source="false()"/>

<template:switch>
<!--alt<TD>Ausgeliehene Medien:<template:read var="delete-current-books()"/><template:read var="bookCount" source="filter(text(),'\d+')"/></TD>-->
<TD>Entliehen<template:read var="delete-current-books()"/><template:read var="bookCount" source="filter(text(),'\d+')"/></TD><!--neu-->
<TD>keine Medien entliehen<template:read var="delete-current-books()"/><template:read var="bookCount" source="'0'"/></TD><!--??-->
<TD>Sie haben keine Medien entliehen<template:read var="delete-current-books()"/><template:read var="bookCount" source="'0'"/></TD><!--??-->
<TD>Sie haben keine Medien ausgeliehen<template:read var="delete-current-books()"/><template:read var="bookCount" source="'0'"/></TD><!--??-->
</template:switch>

<template:if test="$bookCount!='0'">
<template:read var="templateError" source="'true'"/>
<TABLE>
<TR>
<!--<TH></TH>--><TH>Fällig</TH><TH>V</TH><TH>M</TH><TH>Signatur</TH><!--<TH></TH>--><TH>Status</TH>
</TR>

<template:loop>
<TR>
{book:=object(), book.stabikatFound := false()}
<input type="checkbox" template:optional="true"><template:read var="book.extendId" source="@name"/></input>
 <TD align="center"><template:read var="book.duedate" source="parse-date(.,'dd.mm.yyyy')"/></TD>
 <TD><template:read var="V" source="."/><t:s test="$V = ''">V:=0</t:s></TD>
 <TD></TD> 
 <TD>{book.id := translate(.,' ',''), book.shortId := filter($book.id, '[^-]*') }</TD>
<!-- <TD></TD>-->
 <TD><template:read var="status" source="../td[last()]/deep-text()"/></TD>
 <template:if test="$book.extendId!=''">
   <template:read var="book.status:curious" source="concat($V, '-mal verlängert, ', $status)"/>
 </template:if>
 <template:if test="empty($book.extendId)">
   <template:read var="book.status:problematic" source="concat($status, ', ', $V, '-mal verlängert')"/>
 </template:if>
 <template:read var="templateError" source="false()"/>
</tr>
</template:loop>
</table>
</template:if>

<template:if test="$templateError">Template Fehler! Vielleicht hat die Bücherei ihr System geändert.</template:if>
</html>

<html>
<title>Status</title>
<font color="red"><b><t:read var="raise()" source="deep-text()"/></b></font>
</html>

<html>
<title>Bibliothekskonto</title>
<font color="black"><b>Sie haben keine Medien ausgeliehen.</b></font>
</html>

<FONT COLOR="red"><b>Ausweisnummer oder Passwort sind falsch.<t:s>vl:raise-login(.)</t:s></b></font>

</t:switch-prioritized>
