<%@ 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 accountList}">
		<c:forEach var="voiceAccountItem" varStatus="voiceAccountStatus" items="${accountList}">
			<div class="flexRow" style="font-size: 0.9rem; padding-top: 10px;">
				<div>
					<div class="titleFont2">${voiceAccountItem.title}</div>
					<div class="" style="margin-left: 10px; margin-top: 10px; line-height: 1.2rem;">
						<div class="paramColor">Статус/Состояние: 
							<span><c:choose><c:when test="${voiceAccountItem.status.code == 0}">активный</c:when><c:when test="${voiceAccountItem.status.code == 1}">закрыт</c:when><c:otherwise>заблокирован</c:otherwise></c:choose> /
							<c:choose><c:when test="${voiceAccountItem.deviceState.code == 1}">включен</c:when><c:otherwise>отключен</c:otherwise></c:choose></span>
						</div>
						<div class="paramColor">Период: <span><fmt:formatDate type="DATE" dateStyle="SHORT" value="${voiceAccountItem.dateFrom}"/> - <fmt:formatDate type="DATE" dateStyle="SHORT" value="${voiceAccountItem.dateTo}"/></span></div>
						<c:if test="${not empty voiceAccountItem.login}"><div class="paramColor">Логин: <span>${voiceAccountItem.login}</span></div></c:if>
					</div>
				</div>
				<div class="flexRow" style="align-content: center;">
					<div onclick="showBlock( 'voiceRoot', 'accountSessionDetail', { ...voiceQuery, accountId: ${voiceAccountItem.id} } );"><img src="${pageContext.request.contextPath}/img/database.png" title="Детализация" class="iconButton"></div>
				</div>
			</div>
			<c:if test="${not voiceAccountStatus.last}"><div class="line" style="margin-top: 5px;"></div></c:if>
		</c:forEach>
		</c:when>
		<c:otherwise><bg:dataNotFound/></c:otherwise>
	</c:choose>
</div>