<%@ page contentType="text/html; charset=UTF-8"%><%@ include file="/WEB-INF/jspf/include/taglibs.jsp"%>

<div class="tile">
	<bg:blockTitle title="Список карт"/>
	<c:choose>
		<c:when test="${not empty userCards}">
		<c:forEach var="item" varStatus="status" items="${userCards}">
			<div class="flexRow" style="font-size: 0.9rem; padding-top: 10px;">
				<div>
					<div class="titleFont2">${item.guiTitle}</div>
					<div class="" style="margin-left: 10px; margin-top: 5px; line-height: 1.2rem;">
					<!--  <div class="paramColor">Период: <span><fmt:formatDate type="DATE" dateStyle="SHORT" value="${item.date1}"/>-<fmt:formatDate type="DATE" dateStyle="SHORT" value="${item.date2}"/></span></div>  -->
						<c:if test="${not empty item.comment}"><div class="paramComment" style="margin-top: 0.5rem;">${item.comment}</div></c:if>
					</div>
				</div>
				<div class="flexRow" style="align-content: center;">
					<div onclick="showBlock( 'cerbercryptRoot', 'subscription', { ...cerbercryptQuery, cardId: ${item.id} } );"><img src="img/database.png" title="Управление подписками" class="iconButton"></div>
					<!-- 
					<div onclick="showBlock( 'cerbercryptRoot', 'virtualCinema', { ...cerbercryptQuery, cardId: ${item.id} } );"><img src="img/database.png" title="Виртуальный кинотеатр" class="iconButton"></div>
					<div onclick="showBlock( 'cerbercryptRoot', 'password', { ...cerbercryptQuery, cardId: ${item.id} } );"><img src="img/security.png" title="Смена пароля" class="iconButton"></div>
					 -->
				</div>
			</div>
			<c:if test="${not status.last}"><div class="line" style="margin-top: 5px;"></div></c:if>
		</c:forEach>
		</c:when>
		<c:otherwise><div class="alert alert-primary mt-3" role="alert">Данные не найдены</div></c:otherwise>
	</c:choose>
</div>

<!-- 

<xsl:template name="Card">
<xsl:when test="data/@action = 'Card'">Добавление карт CerberCrypt</xsl:when>
	
	<form method='post' action='{$WEBEXECUTER}'>
		<xsl:call-template name="action"/>
				
		<table border='0' cellspacing='3'>
	 		<tr><td>Номер карты</td><td><input type="text" name="cardNumber" size="20"><xsl:attribute name="value"><xsl:value-of select="//data/request/@cardNumber[//data/request/@cardNumber!='0']"/></xsl:attribute></input></td></tr>
			<tr><td>Пароль карты</td><td><input type="password" name="password" size="20"/></td></tr>
			<tr><td colspan="2"><input type="submit" value="Добавить"/></td></tr>
		</table>
	</form>
</xsl:template>

<xsl:if test="/data/card_list/@cardisactive != 1">Карта неактивна!<br/><br/></xsl:if>
<xsl:if test="slavecard_list/item">К этой карте привязаны карты:
<ul>
<xsl:for-each select="slavecard_list/item">
	<li><xsl:value-of select="@number"/> ( <xsl:value-of select="@basecardTitle"/> )</li>
</xsl:for-each>
</ul>
</xsl:if>

 -->