<%@include file="/WEB-INF/includeTemplate.inc"%>

<div class="container y41e-fade in" id="divConfiguracion">
    <h2><spring:message code="menu.configuracion"/></h2>
    <hr class="mb-2">
    <div id="configuracion_feedback"></div>
        <div id="configuracion_toolbar" class="formulario_legend"></div>
        <form:form id="configuracion_form" method="post"  modelAttribute="listadoConfig">
            <div id="contenFormularios" class="filterForm">
                <fieldset>
	                <div class="form-row">
	                      <div class="col-md-2">
	                          <div class="list-group" id="list-tab" role="tablist">
	                             <a class="list-group-item list-group-item-action" data-toggle="list" href="#texto_${listadoConfig.listConfiguracion[0].idConfig}" role="tab" id="enlace_${listadoConfig.listConfiguracion[0].idConfig}"><spring:message code="config.remitente" /></a>
	                             <a class="list-group-item list-group-item-action" data-toggle="list" href="#texto_${listadoConfig.listConfiguracion[1].idConfig}" role="tab" id="enlace_${listadoConfig.listConfiguracion[1].idConfig}"><spring:message code="config.emailAviso" /></a>
	                             <a class="list-group-item list-group-item-action" data-toggle="list" href="#texto_${listadoConfig.listConfiguracion[2].idConfig}" role="tab" id="enlace_${listadoConfig.listConfiguracion[2].idConfig}"><spring:message code="config.emailEncuesta" /></a>
	                             <a class="list-group-item list-group-item-action" data-toggle="list" href="#texto_${listadoConfig.listConfiguracion[3].idConfig}" role="tab" id="enlace_${listadoConfig.listConfiguracion[3].idConfig}"><spring:message code="config.agradecimiento" /></a>
	                          </div>
	                      </div>
	                      <div class="col-md-10">
                            <div class="tab-content" id="nav-tabContent">
		                      <c:forEach items="${listadoConfig.listConfiguracion}" var="config" varStatus="loop">
		                        <div class="tab-pane fade" id="texto_${config.idConfig}" role="tabpanel" aria-labelledby="list-profile-list">
		                            <form:hidden path="listConfiguracion[${loop.index}].idConfig"/>
		                            <div class="col-xs-8">
			                            <c:if test="${not empty config.email}">
	                                        <label for="email_${config.idConfig}" class="control-label"><i class="fa fa-asterisk" aria-hidden="true"></i><spring:message code="comun.email"/></label>
	                                        <form:input id="email_${config.idConfig}" path="listConfiguracion[${loop.index}].email" class="form-control required validateEmail" maxlength="200"/>
			                            </c:if>
		                            </div>
                                    <div class="col-xs-12 col-md-6 mt-2">
                                        <c:if test="${not empty config.asuntoEu || not empty config.mensajeEu}">
                                            <fieldset>
                                                <legend><spring:message code="comun.euskera"/></legend>
                                                <c:if test="${not empty config.asuntoEs}">
                                                    <div class="form-group form-group-sm">
                                                        <label for="asuntoEu_${config.idConfig}" class="control-label"><i class="fa fa-asterisk" aria-hidden="true"></i><spring:message code="comun.asunto"/></label>
                                                        <form:input id="asuntoEu_${config.idConfig}" path="listConfiguracion[${loop.index}].asuntoEu" class="form-control required" maxlength="100"/>
                                                    </div>
                                                </c:if>
                                                <c:if test="${not empty config.mensajeEs}">
                                                <div class="form-group form-group-sm mt-2">
                                                    <label for="textoEu_${config.idConfig}" class="control-label"><i class="fa fa-asterisk" aria-hidden="true"></i><spring:message code="comun.mensaje"/></label>
                                                    <form:textarea id="textoEu_${config.idConfig}" path="listConfiguracion[${loop.index}].mensajeEu" class="form-control required"/>
                                                </div>
                                                </c:if>
                                            </fieldset>
                                        </c:if>
                                    </div>
                                    <div class="col-xs-12 col-md-6 mt-2">
                                        <c:if test="${not empty config.asuntoEs || not empty config.mensajeEs}">
                                            <fieldset>
                                                <legend><spring:message code="comun.castellano"/></legend>
                                                <c:if test="${not empty config.asuntoEs}">
                                                    <div class="form-group form-group-sm">
                                                        <label for="asuntoEs_${config.idConfig}" class="control-label"><i class="fa fa-asterisk" aria-hidden="true"></i><spring:message code="comun.asunto"/></label>
                                                        <form:input id="asuntoEs_${config.idConfig}" path="listConfiguracion[${loop.index}].asuntoEs" class="form-control required" maxlength="100"/>
                                                    </div>
                                                </c:if>
                                                <c:if test="${not empty config.mensajeEs}">
                                                <div class="form-group form-group-sm mt-2">
                                                    <label for="textoEs_${config.idConfig}" class="control-label"><i class="fa fa-asterisk" aria-hidden="true"></i><spring:message code="comun.mensaje"/></label>
                                                    <form:textarea id="textoEs_${config.idConfig}" path="listConfiguracion[${loop.index}].mensajeEs" class="form-control required"/>
                                                </div>
                                                </c:if>
                                            </fieldset>
                                        </c:if>
                                    </div>
		                        </div>
		                      </c:forEach>
                            </div>
	                      </div>
	                 </div>
                 </fieldset>
             </div>
        </form:form>
</div>
