<!DOCTYPE html><html xmlns:th="http://www.thymeleaf.org"><head th:replace="~{layout/layout :: head}"></head><body onload='activeNavBar("#idNavProductos")'><header th:replace="~{layout/layout :: header}"></header><div th:replace="~{layout/layout :: modal-pic}"></div><div class="container py-5 mb-5"><div th:replace="~{layout/layout :: mensajes}"></div><div class="card"><div class="card-header text-center producto-card" th:text="${#strings.toUpperCase(titulo)}"></div><div class="card-body"><div class="row py-2" th:if="${showCombo}"><div class="col-lg-4 col-md-12"><label for="id_producto" th:text="#{txt.producto.update.seleccionar}"></label></div><div class="col-lg-8 col-md-12"><a id="comboProductos"><select class="form-control custom-select" id="id_producto" name="id" onchange='chooseEntryFromCombo("id_producto","altaUpdateProductoForm","comboProductos")'><option value="-1" th:text="#{txt.combo.producto}"></option><optgroup th:label="#{txt.productos}"><option th:id="'opt_' + ${productoCombo.id}" th:selected="${productoCombo.id} == ${idSelected}" th:each="productoCombo : ${productos}" th:value="${productoCombo.id}" th:text="|${productoCombo.nombre} - ${productoCombo.id} #{${productoCombo.enabled} ?  txt.enabled.parenthesis : txt.disabled.parenthesis}|"></option></optgroup></select></a></div></div><label class="form-text text-info py-4" th:if="${(productos == null or #lists.isEmpty(productos)) and not showForm}" th:text="#{txt.producto.empty.select}" style="text-align:center"></label><hr id="hrCombo" th:if="${showCombo}"><form id="altaUpdateProductoForm" th:action="@{${action}}" th:method="${method}" th:object="${producto}" th:with="numUrls='5', numFeatures='40', literal=#{accion.img.productos}, accion=${#strings.toLowerCase(literal)}"><div th:if="${showForm}"><input type="hidden" th:field="*{menus}"> <input type="hidden" th:field="*{submenus}"> <input type="hidden" th:field="*{previousEnabled}"><div class="row py-2"><div class="col-lg-4 col-md-12"><label for="brand_id" th:text="#{txt.brand.seleccionar}"></label></div><div class="col-lg-8 col-md-12 pl-3"><a id="comboBrands" th:if="${brands != null and not #lists.isEmpty(brands)}"><select th:field="*{brand}" class="form-control custom-select" id="brand_id" name="brand_id"><option value="-1" th:text="#{txt.combo.brand}"></option><optgroup th:label="#{txt.brands}"><option th:each="brandCombo : ${brands}" th:id="'opt_' + ${brandCombo.id}" th:selected="${brandCombo.id} == ${idSelected}" th:value="${brandCombo.id}" th:text="|${brandCombo.nombre} - ${brandCombo.id} #{${brandCombo.enabled} ? txt.enabled.parenthesis : txt.disabled.parenthesis}|"></option></optgroup></select><small class="form-text text-danger" th:text="${comboError}"></small></a><label class="form-text text-danger" th:if="${brands == null or #lists.isEmpty(brands)}" th:text="#{txt.producto.brands.empty}"></label></div></div><hr><div class="row py-2"><div class="col-lg-4 col-md-12"><label for="nombre" th:text="#{txt.producto.nombre}"></label></div><div class="col-lg-8 col-md-12"><input th:field="*{nombre}" class="input-text" id="nombre" name="nombre" maxlength="50" size="50" style="width:100%"><small class="form-text text-danger" th:if="${errorNombre}">[[${errorNombre}]]</small></div></div><div class="row py-2"><div class="col-lg-4 col-md-12"><label for="precio" th:text="#{txt.producto.precio}"></label></div><div class="col-lg-8 col-md-12"><input type="text" th:field="*{precio}" id="precio" name="precio" maxlength="9" size="15" style="text-align:right" oninput="numberOnlyPrice(this.id)" onkeydown="return allowOnlyNumbersAndPunctuation(event)"><label for="precio" th:text="'€'"></label><small class="form-text text-danger" th:if="${errorPrecio}">[[${errorPrecio}]]</small><small class="form-text text-success" th:text="#{txt.producto.patron.precio}"></small><small class="form-text text-success" th:text="#{txt.producto.patron.precio.ejemplos}"></small></div></div><hr><div class="row py-2"><div class="col-lg-4 col-md-12"><label for="entrada_id" th:utext="#{txt.producto.entrada.seleccionar}"></label></div><div class="col-lg-8 col-md-12"><a id="comboEntradas" th:if="${entradasCombo != null and not #lists.isEmpty(entradasCombo)}"><select multiple="multiple" th:field="*{entradas}" class="form-control custom-select" id="entrada_id" name="entrada" style="height:10rem"><optgroup th:label="#{txt.entradas}"></optgroup><option th:id="'optEntr_' + ${entradaCombo.id}" th:selected="${entradasCombo != null and not #lists.isEmpty(entradasCombo)} ? ${#arrays.contains(entradasCombo, '' + entradaCombo.id + '')} : ''" th:each="entradaCombo : ${entradasCombo}" th:value="${entradaCombo.id}" th:text="|${entradaCombo.titulo_es} - ${entradaCombo.id} #{${entradaCombo.enabled} ? txt.enabled.parenthesis : txt.disabled.parenthesis}|"></option></select><small class="form-text text-danger" th:text="${comboErrorEntrada}"></small></a><label class="form-text text-info" th:if="${entradasCombo == null or #lists.isEmpty(entradasCombo)}" th:text="#{txt.producto.entradas.empty}"></label></div></div><hr><div class="row py-2 mb-4"><div class="col-lg-3 col-md-12"><label for="descripcionEs" th:text="#{txt.producto.descripcion.es}"></label></div><div class="col-lg-9 col-md-12"><div id="descripcionEs" class="px-1 editable-div-box" hidefocus="true" role="textbox" aria-multiline="true" contenteditable="true"></div><input id="input-descripcionEs" type="hidden" th:field="*{descripcion_es}" name="descripcion_es"><small class="form-text text-danger" th:if="${errorDescEs}">[[${errorDescEs}]]</small><div th:replace="~{layout/layout :: editionButtons(indx = 'es-1', name ='descripcionEs')}"></div></div></div><div class="row py-2"><div class="col-lg-3 col-md-12"><label for="descripcionEn" th:text="#{txt.producto.descripcion.en}"></label></div><div class="col-lg-9 col-md-12"><div id="descripcionEn" class="px-1 editable-div-box" hidefocus="true" role="textbox" aria-multiline="true" contenteditable="true"></div><input id="input-descripcionEn" type="hidden" th:field="*{descripcion_en}" name="descripcion_en"><small class="form-text text-danger" th:if="${errorDescEn}" th:text="${errorDescEn}"></small><div th:replace="~{layout/layout :: editionButtons(indx = 'en-1', name ='descripcionEn')}"></div></div></div><script th:inline="javascript">document.getElementById("descripcionEs").innerHTML="",document.getElementById("descripcionEn").innerHTML=""</script><hr><label th:text="#{txt.producto.features}"></label><div id="featuresDiv" class="pt-2"><div class="row feat-url-rows text-center" style="font-weight:700"><div class="col-xl-6 col-lg-12"><label th:text="${#strings.toUpperCase(spanish)}" th:with="spanish=#{txt.spanish}"></label></div><div class="col-xl-6 col-lg-12"><label th:text="${#strings.toUpperCase(english)}" th:with="english=#{txt.english}"></label></div></div><div th:id="'featureRows_' + ${contador}" th:with="indice=${featureModArray eq null or #lists.isEmpty(featureModArray) or #lists.size(featureModArray) eq 0 ? -1 : j}, contador=${featureModArray eq null or #lists.isEmpty(featureModArray) or #lists.size(featureModArray) eq 0 ? 1 : jStat.count}" class="p-lg-2 py-1 px-2 my-2 feature-border" th:each="j : ${#numbers.sequence(0, #lists.size(featureModArray) - 1, 4)}"><span th:id="'contadorFeat-' + ${contador}" class="each-feature" style="text-align:start" th:text="${contador}"></span><span th:id="'label_feature_' + ${contador}" class="delete-url each-email x-email-producto" th:onclick="'javascript: deleteFeature(\'featureRows_' + ${contador} + '\');'" th:text="'&#10060;'"></span><div class="row pt-2"><div class="col-xl-6 col-lg-12 pb-xl-0 pb-4 pt-xl-1 pt-0" th:with="valueEs='value_es_' + ${contador}"><label class="lang-prod-update" th:text="${#strings.toUpperCase(spanish)}" th:with="spanish=#{txt.spanish}" style="font-weight:700"></label><div th:replace="~{layout/layout :: especificaciones(cont = ${contador}, indx = ${indice}, lang = #{txt.lang.es}, value = ${valueEs})}"></div></div><div class="col-xl-6 col-lg-12 pb-xl-0 pb-3 pt-xl-1 pt-0" th:with="valueEn='value_en_' + ${contador}"><label class="lang-prod-update" th:text="${#strings.toUpperCase(english)}" th:with="english=#{txt.english}" style="font-weight:700"></label><div th:replace="~{layout/layout :: especificaciones(cont = ${contador}, indx = ${indice}, lang = #{txt.lang.en}, value = ${valueEn})}"></div></div></div></div></div><div class="py-2" style="text-align:center;color:#fff"><a th:classappend="${featureModArray != null and not #lists.isEmpty(featureModArray) and #lists.size(featureModArray) == numFeatures*4 ? 'disabled' : ''}" id="btnAddFeature" class="btn btn-info btnShadow btn-gestion" onclick="addFeature()" type="button" th:text="'&#127796; ' + #{btn.productos.feature.anadir}"></a></div><small id="msgFeatures" class="form-text text-danger" th:text="#{msg.error.producto.anadir.features(${numFeatures})}" style="display:none;text-align:center"></small><small id="msgFeaturesCampos" class="form-text text-danger" th:text="#{msg.error.producto.anadir.campos.features}" style="display:none;text-align:center"></small><small id="msgFeaturesCamposSubmit" class="form-text text-danger" th:text="#{msg.error.producto.anadir.campos.features.submit}" style="display:none;text-align:center"></small><script th:inline="javascript">var txtEspanol="ESPAÑOL",txtEnglish="ENGLISH",txtPlaceholderIndexEs="Índice en español",txtPlaceholderValueEs="Valor en inglés",txtPlaceholderIndexEn="Índice en inglés",txtPlaceholderValueEn="Valor en inglés",numFeatures="40",valorCampo="Debes añadir un valor a este campo",btnNegrita="Negrita",btnLista="Lista",btnPrev="Previsualización",lang="es",btnClose="Cerrar",txtBold="Negrita",txtItalic="Itálica",txtUnderline="Subrayado",txtList="Lista"</script><hr><div class="row form-group"><div class="col-lg-6 col-12" th:each="pair, iterStat : *{imagenesAMostrarYEnDB}"><div th:switch="${iterStat.count}"><input th:id="|imagen-alta_${iterStat.count}|" type="hidden" th:case="1" th:field="*{imagen1}"> <input th:id="|imagen-alta_${iterStat.count}|" type="hidden" th:case="2" th:field="*{imagen2}"> <input th:id="|imagen-alta_${iterStat.count}|" type="hidden" th:case="3" th:field="*{imagen3}"> <input th:id="|imagen-alta_${iterStat.count}|" type="hidden" th:case="4" th:field="*{imagen4}"> <input th:id="|imagen-alta_${iterStat.count}|" type="hidden" th:case="5" th:field="*{imagen5}"></div><input th:id="|imagenAMostrar_${iterStat.count}|" type="hidden" th:field="*{imagenesAMostrarYEnDB[__${iterStat.index}__][0]}" th:if="${iterStat.index} le 4"> <input th:id="|imagenEnDB_${iterStat.count}|" type="hidden" th:field="*{imagenesAMostrarYEnDB[__${iterStat.index}__][1]}" th:if="${iterStat.index} le 4"><div th:id="|imageAndBtn_${iterStat.count}|" class="form-group" th:styleappend="${iterStat.count} == 1 or not ${#strings.contains(pairString, defaultLtr)} or (${#strings.contains(pairString, defaultLtr)} and ${pairStringAnt} != null and not ${#strings.contains(pairStringAnt, defaultLtr)}) ? 'display: block;' : 'display: none;'" th:with="imgDbLtr = #{txt.image.db} , imgSelLtr = #{txt.image.selected}, defaultLtr = #{txt.image.default}, pairString = *{imagenesAMostrarYEnDB[__${iterStat.index}__][0]}, pairStringAnt = ${iterStat.index} == 0 ? null : *{imagenesAMostrarYEnDB[__${iterStat.index - 1}__][0]}" th:if="${iterStat.index} le 4"><p th:id="|titleImg_${iterStat.count}|" class="d-flex justify-content-center" th:text="'Imagen ' + ${iterStat.count}" style="font-weight:bolder"></p><div th:id="|borderImg_${iterStat.count}|" class="d-flex justify-content-center" th:style="${#strings.contains(pairString, defaultLtr)} ? 'border: 2px solid red;' : 
																																												  												                 (${#strings.contains(pairString, imgDbLtr)} ? 'border: 2px solid #00ff00;' : 
																																								                                                                                 (${#strings.contains(pairString, imgSelLtr)} ? 'border: 2px solid #87CEEB;' : ''))"><img th:id="|default-img_${iterStat.count}|" th:src="@{/images/default_product.svg}" class="rounded img-fix" th:style="${#strings.contains(pairString, defaultLtr)} ? 'display: block;' : 'display: none;'"><div th:replace="~{layout/layout :: image-prodBrow(key = ${pairString}, idImg = 'producto-img-db', index = ${iterStat.count}, ltr = ${imgDbLtr})}"></div><div th:replace="~{layout/layout :: image-prodBrow(key = ${pairString}, idImg = 'selected-img', index = ${iterStat.count}, ltr = ${imgSelLtr})}"></div></div><div class="row mt-2 mb-5 d-flex text-center justify-content-center" th:with="pairBoolean = *{imagenesAMostrarYEnDB[__${iterStat.index}__][1]}"><div class="col-12 col-sm-6 d-flex text-center justify-content-center py-1"><button th:id="|button-choose-file_${iterStat.count}|" class="fixed-button-size btn btn-info btn-sm btnShadow p-1" type="button" th:onclick="javascript: btnFileClick([[${iterStat.count}]]);" th:text="#{txt.btn.upload-img}" style="font-weight:bolder"></button><input type="file" accept="image/svg+xml,image/png,image/jpeg,image/gif" th:id="|choose-file_${iterStat.count}|" th:name="|choose-file_${iterStat.count}|" class="file-input-hidden" th:onchange="javascript: selectedImageSaveUpdateAction(event, [[${iterStat.count}]], null, 'producto', null, [[${pairBoolean}]]);"></div><div th:id="|div-default-file_${iterStat.count}|" class="col-12 col-sm-6 d-flex text-center justify-content-center py-1" th:style="${pairBoolean} ? 'visibility: visible;' : 'visibility: collapse;'"><button type="button" th:id="|default-file_${iterStat.count}|" th:name="|default-file_${iterStat.count}|" class="fixed-button-size btn btn-success btn-sm btnShadow" th:onclick="javascript: setCurrentImageUpdateAction([[${iterStat.count}]], null, 'producto', null);" th:text="#{txt.btn.current-img}" style="font-weight:bolder" th:styleappend="${pairBoolean} ? 'display: block;' : 'display: none;'"></button></div><div th:id="|div-delete-file_${iterStat.count}|" class="col-12 col-sm-6 d-flex text-center justify-content-center py-1" th:style="${iterStat.count} eq 1 and not ${#strings.contains(pairString, defaultLtr)} ? 'visibility: visible;' : 'visibility: collapse;'"><button type="button" th:id="|delete-file_${iterStat.count}|" th:name="|delete-file_${iterStat.count}|" class="fixed-button-size btn btn-danger btn-sm btnShadow" th:onclick="javascript: deleteImageSaveUpdateAction([[${iterStat.count}]], null, 'producto', null);" th:text="#{txt.btn.default-img}" style="font-weight:bolder" th:styleappend="${iterStat.count} eq 1 and not ${#strings.contains(pairString, defaultLtr)} ? 'display: block' : 'display: none;'"></button></div><div th:id="|div-remove-file_${iterStat.count}|" class="col-12 col-sm-6 d-flex text-center justify-content-center pt-1" th:style="not ${#strings.contains(pairString, defaultLtr)} ? 'visibility: visible;' : 'visibility: collapse;'"><button type="button" th:id="|remove-file_${iterStat.count}|" th:name="|remove-file_${iterStat.count}|" class="fixed-button-size btn btn-warning btn-sm btnShadow" th:onclick="javascript: removeImageSaveUpdateProducto([[${iterStat.count}]]);" th:text="#{txt.imagen.delete}" style="font-weight:bolder" th:styleappend="${#strings.contains(pairString, defaultLtr)} ? 'display: none;' : 'display: block;'"></button></div></div></div></div></div><hr><label th:text="#{txt.producto.url}"></label><div id="urls" class="pt-2"><div class="row feat-url-rows text-center" style="font-weight:700"><div class="col-xl-6 col-lg-12"><label th:text="${#strings.toUpperCase(prodLink)}" th:with="prodLink=#{txt.producto.url.link}"></label></div><div class="col-xl-6 col-lg-12"><label th:text="${#strings.toUpperCase(prodProp)}" th:with="prodProp=#{txt.producto.url.properties}"></label></div></div><div id="urlRows_1" class="p-lg-2 py-1 px-2 my-2 url-border" th:if="${urlPropArray == null or #lists.isEmpty(urlPropArray)}"><span id="contadorUrl-1" class="each-url" th:text="#{txt.email.one}" style="text-align:start"></span><span id="label_url_1" class="delete-url each-email x-email-producto" onclick='deleteUrlProp("urlRows_1")' th:text="'&#10060;'"></span><div class="row pt-2"><div class="col-xl-6 col-lg-12 pb-xl-0 pb-4 pt-xl-1 pt-0"><label class="feature-label-show" th:text="${#strings.toUpperCase(prodLink)}" th:with="prodLink=#{txt.producto.url.link}" style="font-weight:700"></label><input type="url" class="input-text" id="url_link_1" name="urlArray[]" size="45" th:placeholder="#{txt.producto.placeholder.url}" style="width:100%"><small id="error_link_1" class="form-text text-danger" th:text="#{msg.error.producto.anadir.field}" style="display:none"></small><small id="error_link_url_1" class="form-text text-danger" th:text="#{msg.error.url.valida}" style="display:none"></small></div><div class="col-xl-6 col-lg-12 pb-xl-0 pb-3"><label class="feature-label-show" th:text="${#strings.toUpperCase(prodProp)}" th:with="prodProp=#{txt.producto.url.properties}" style="font-weight:700"></label><select id="url_prop_1" class="form-control custom-select" name="urlArray[]"><option value="-1" th:text="#{txt.combo.properties}"></option><optgroup th:label="#{txt.properties}"><option th:id="'optProp_' + ${propStat.index}" th:each="prop : ${urlProps}" th:value="${prop[1]}" th:text="${prop[0]}"></option></optgroup></select><small id="error_prop_1" class="form-text text-danger" th:text="#{msg.error.producto.anadir.field}" style="display:none"></small></div></div></div><div th:id="'urlRows_' + ${iStat.count}" class="p-lg-2 py-1 px-2 my-2 url-border" th:if="${urlPropArray} != null and not ${#lists.isEmpty(urlPropArray)} and ${#lists.size(urlPropArray) != null} and ${#lists.size(urlPropArray) > 0}" th:each="i : ${#numbers.sequence(0, #lists.size(urlPropArray) - 1, 2)}"><span th:id="|contadorUrl-${iStat.count}|" class="each-url" th:text="${iStat.count}" style="text-align:start"></span><span th:id="|label_url_${iStat.count}|" class="delete-url each-email x-email-producto" th:onclick="'javascript: deleteUrlProp(\'urlRows_' + ${iStat.count} + '\');'" th:text="'&#10060;'"></span><div class="row pt-2"><div class="col-xl-6 col-lg-12 pb-xl-0 pb-4 pt-xl-1 pt-0"><label class="feature-label-show" th:text="${#strings.toUpperCase(prodLink)}" th:with="prodLink=#{txt.producto.url.link}"></label><input type="url" class="input-text" th:id="'url_link_'+ ${iStat.count}" name="urlArray[]" size="45" th:value="${#strings.replace(#strings.escapeXml(urlPropArray[i]), '\/', '/')}" th:placeholder="#{txt.producto.placeholder.url}" style="width:100%"><small th:id="'error_link_' + ${iStat.count}" class="form-text text-danger" th:text="#{msg.error.producto.anadir.field}" style="display:none"></small><small th:id="'error_link_url_' + ${iStat.count}" class="form-text text-danger" th:text="#{msg.error.url.valida}" style="display:none"></small></div><div class="col-xl-6 col-lg-12 pb-xl-0 pb-3"><label class="feature-label-show" th:text="${#strings.toUpperCase(prodProp)}" th:with="prodProp=#{txt.producto.url.properties}"></label><select th:id="'url_prop_'+ ${iStat.count}" class="form-control custom-select" name="urlArray[]" th:value="${urlPropArray[i+1]}"><option value="-1" th:text="#{txt.combo.properties}"></option><optgroup th:label="#{txt.properties}"><option th:id="'optProp_' + ${propStat.index}" th:selected="${urlPropArray[i+1]} ==  ${prop[1]}" th:each="prop : ${urlProps}" th:value="${prop[1]}" th:text="${prop[0]}"></option></optgroup></select><small th:id="'error_prop_' + ${iStat.count}" class="form-text text-danger" th:text="#{msg.error.producto.anadir.field}" style="display:none"></small></div></div></div></div><div class="py-2" style="text-align:center;color:#fff"><a th:classappend="${urlPropArray != null and not #lists.isEmpty(urlPropArray) and #lists.size(urlPropArray) == numUrls*2 ? 'disabled' : ''}" id="btnAddUrl" class="btn btn-info btnShadow btn-gestion" onclick="addUrlProp()" type="button" th:text="'&#9889; ' + #{btn.productos.url.anadir}"></a></div><small id="msgUrls" class="form-text text-danger" th:text="#{msg.error.producto.anadir.urls(${numUrls})}" th:style="'text-align: center;' + ${urlPropArray != null and not #lists.isEmpty(urlPropArray) and #lists.size(urlPropArray) == 5*2 ? 'display: block;' : 'display: none;'}"></small><small id="msgUrlsCampos" class="form-text text-danger" th:text="#{msg.error.producto.anadir.campos.urls}" style="display:none;text-align:center"></small><small id="msgUrlsCamposSubmit" class="form-text text-danger" th:text="#{msg.error.producto.anadir.campos.urls.submit}" style="display:none;text-align:center"></small><script th:inline="javascript">var txtUrlLink="URL",txtUrlProp="PROPERTIES PARA EL TEXTO",txtPlaceholderUrl="Introduce una URL",txtPlaceholderProp="Introduce el properties",numUrls="5",comboPropTxt="-- Selecciona un properties --",txtProp="Properties",txtManufacturer="Página web del fabricante",txtManufacturerLiteral="text.manufacturer.page",txtOffer="Ver en Amazon.es",txtOfferLiteral="text.offer"</script><hr><div class="row pt-2 align-items-center justify-content-center enabled-date-row"><div class="col-md-6 col-sm-12 pr-3" id="radio"><span th:text="#{txt.enabled} + '&#58;'" class="pr-3"></span><input th:field="*{enabled}" type="radio" id="yes" name="enabled" value="1" checked="checked"><label for="yes" th:text="#{txt.yes}" class="pr-3"></label><input th:field="*{enabled}" type="radio" id="no" name="enabled" value="0"><label for="no" th:text="#{txt.no}"></label></div><div class="col-md-6 col-sm-12 pl-3"><label for="fecha" th:text="#{txt.date} + '&#58;'" class="pr-3"></label><input th:field="*{createAt}" type="date" id="fecha" name="createAt" th:value="${#dates.format(#dates.createNow(), 'yyyy-MM-dd')}"></div></div><div class="row align-items-center justify-content-center enabled-date-row"><div class="col-md-6 col-sm-12 pr-3"></div><div class="col-md-6 col-sm-12 pl-3" style="color:green"><small th:text="#{txt.date.format} + '&#58;'" class="pr-4"></small><small th:text="#{txt.date.pattern}" class="pl-2"></small></div></div><input th:field="*{id}" type="hidden" th:if="*{id} ne null"><hr><div th:replace="~{layout/layout :: modal-format}"></div></div><div class="row mt-4"><div class="col-md-6 col-12 d-flex justify-content-md-start justify-content-center text-left mb-3 mb-md-0 align-items-start"><div th:replace="~{layout/layout :: btnBack(href = '/productos', text = 'btn.volver.productos')}"></div></div><div class="col-md-6 col-sm-12 d-flex justify-content-md-end justify-content-center align-items-start"><a class="btn btn-success btnShadow btn-gestion" style="color:#fff" type="button" th:text="'&#9921; ' + ${btnSaveUpdate}" th:classappend="${showForm and brands != null and not #lists.isEmpty(brands) ? '' : 'disabled'}" onclick="submit()"></a></div></div></form></div></div></div><footer th:replace="~{layout/layout :: footer}"></footer><script th:inline="javascript">/*<![CDATA[*/
							 // El evento DOMContentLoaded asegura que el JavaScript se ejecutará una vez que todo el contenido HTML se haya cargado completamente.
							//document.addEventListener("DOMContentLoaded", function() {
										var accion = /*[[#{accion.img.productos}]]*/ '';
										//var combo = /*[[${showCombo}]]*/ ''; // Combo que se muestra ecuando vamos modificar (update) un producto. En save viene a null, en update viene a true
										var actionForm = /*[[${action}]]*/ ''; // Lo usamos para pintar los botones de la imagen 2 cuando entramos en dar de alta un producto
										var msgNoDeleteFeat = /*[[#{msg.no.delete.feature}]]*/ 'Actualmente sólo hay una característica a rellenar, no puedes eliminarla.';
										var msgNoDeleteUrl = /*[[#{msg.no.delete.url}]]*/ 'Actualmente sólo hay una URL a rellenar, no puedes eliminarla.';
										var nombreUsu = document.getElementById("nombreUsu").innerText;
									
										 // JavaScript para obtener el valor del span donde está el nombre de usuario y asignarlo al campo oculto
										 // Se lo asignamos al campo alta sólo cuando es un alta
										 /*
							        	if(document.getElementById("usuarioAlta") && (combo == null || !combo)) // combo => combo que se muestra ecuando vamos modificar (update) un producto. En save viene a null, en update viene a true
							        			document.getElementById("usuarioAlta").value = nombreUsu;
							        	// Y aquí cuando es una modificación
							        	if(document.getElementById("usuarioModificacion") && combo != null && combo) // combo => combo que se muestra ecuando vamos modificar (update) un producto. En save viene a null, en update viene a true
						        				document.getElementById("usuarioModificacion").value = nombreUsu;
										 */
										 
							        	// Aquí cargamos las imágenes
										for(let i = 1; i <= NUMERO_IMAGENES_PROD; i++) // NUMERO_IMAGENES_PROD está definida en javascript.js como constante, arriba del todo
												loadImg(accion.toLowerCase() + '-' + i, null, '');
												//loadImg(accion.toLowerCase() + '-' + i, null);
										
												// Si entramos para dar de alta tenemos que hacer que cargue la primera hilera de índice-valor para poder introducir los datos de las características porque si no, no carga
												// por culpa del th:each que tenemos ya que el th:each sólo pinta para cuando vengan datos a cargar como en el update => Si es para modificación sí carga, no haría falta ésto
												// Lo ponemos aquí abajo para que pinte todo, que estén todos los elementos del HTML pintados para poder hacer referencia a ellos.
												var fma = /*[[${featureModArray}]]*/ null;
												if(fma == null || fma.length == 0)
												    	document.getElementById('btnAddFeature').click(); // Tenemos que añadir feature si entramos a dar de alta porque de primeras no muestra ninguna
							  //});										 
						/*]]>*/</script></body></html>