Nav Bar do usuário deslogado.

Meu Perfil

Nome Completo

E-mail

default@portaldebioeconomia.com

Telefone

Cidade

Estado

País

  • Sobre
  • Organizações
  • Demandas
  • Ofertas
  • Publicações
Sobre drop zone
A sintaxe do FreeMarker é inválida.

String index out of range: The index was 0 (0-based), but the length of the string is only 0.

----
FTL stack trace ("~" means nesting-related):
- Failed at: #if setoresDoUsuario[0].getStringValu... [in template "template_id" at line 41, column 9]
----
Organizações drop zone
Nenhuma organização foi cadastrada neste perfil ainda
Demandas drop zone
An error occurred while processing the template.
Java method "com.sun.proxy.$Proxy890.getLatestArticle(long)" threw an exception when invoked on com.sun.proxy.$Proxy890 object "com.liferay.journal.service.impl.JournalArticleLocalServiceImpl@739dbb4a"; see cause exception in the Java stack trace.

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #assign journalArticle = JournalArtic...  [in template "334468#334509#488827" at line 15, column 41]
----
1<#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")> 
2<#assign UserLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.UserLocalService")> 
3<#assign AssetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")> 
4<#assign  
5mbMessageLocalService = serviceLocator.findService("com.liferay.message.boards.service.MBMessageLocalService") 
6	tagsLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetTagLocalService") 
7	 OrganizationLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.OrganizationLocalService") 
8
9 
10 
11<div class="bioec-profile-demanda-main"> 
12	<div id="demanda-lista-container" class="d-flex flex-column"> 
13			<#if entries?has_content> 
14				<#list entries as entry> 
15					<#assign journalArticle = JournalArticleLocalService.getLatestArticle(entry.getClassPK()) > 
16					<#assign JournalArticleID = journalArticle.getId()> 
17					<#assign JournalArticleFrontId = journalArticle.getArticleId()> 
18					<#assign articleXml = journalArticle.getDocument().getRootElement()  
19									 userIsAdmin = false 
20									 orgId = "" 
21
22					 
23					<#assign nomeParaContato = ""> 
24					 
25					<#if articleXml.selectSingleNode("dynamic-element[@name='Text77253735']")??> 
26					 
27					<#assign nomeParaContato = articleXml.selectSingleNode("dynamic-element[@name='Text77253735']").getStringValue()!"" 
28								 nomeParaContato = nomeParaContato?replace("\n\t\t", "") 
29								 nomeParaContato = nomeParaContato?replace("\n\t", "")					 
30
31					 
32					</#if> 
33					 
34					<#assign telefone = articleXml.selectSingleNode("dynamic-element[@name='Text94974146']").getStringValue()!"" 
35								 telefone = telefone?replace("\n\t\t", "") 
36								 telefone = telefone?replace("\n\t", "")						 
37
38					 
39				<#assign email = articleXml.selectSingleNode("dynamic-element[@name='Text68569631']").getStringValue()!"" 
40								 email = email?replace("\n\t\t", "") 
41								 email = email?replace("\n\t", "")					 
42				>  
43				 
44				 
45					<#assign desc = articleXml.selectSingleNode("dynamic-element[@name='CopyOfCopyOfText18267936']").getStringValue()!"" 
46								 desc = desc?replace("\n\t\t", "") 
47								 desc = desc?replace("\n\t", "")		 
48
49				<#assign imagem = articleXml.selectSingleNode("dynamic-element[@name='Text97565506']").getStringValue()!""				 
50							imagem = imagem?replace("(\r\n)+", "",'r') 
51							imagem = imagem?replace(" ", "",'r') 
52						autorId = articleXml.selectSingleNode("dynamic-element[@name='Text99746569']").getStringValue()!"" 
53						autorId = autorId?replace("\n\t\t", "") 
54						autorId = autorId?replace("\n\t", "")		 
55						autorArticleId = "" 
56						commentsCount = mbMessageLocalService.getDiscussionMessagesCount(entry.getClassName(), entry.getClassPK(), 0)!"0" 
57
58				 
59					<#if autorId != "" && autorId??> 
60					<#assign 
61						autor = UserLocalService.fetchUser(autorId?number)!"" 
62						autorArticleId = autor.getExpandoBridge().getAttribute("journal-article")!"0"  
63				/> 
64				<#if autor != ""> 
65				<#assign autor = autor.getFullName()!""> 
66				<#else> 
67				<#assign autor = "Anônimo" > 
68				</#if> 
69				<#else>  
70				<#assign autor = "Anônimo" > 
71		</#if>		 
72				<#assign 	categorias = AssetCategoryLocalService.getCategoryNames(entry.getClassName(), entry.getClassPK())!"" > 
73				<#assign urlWC = ""> 
74				<#if autorArticleId != "0" && autorArticleId != "" && autor != "Anônimo"> 
75					<#assign autorArticle = JournalArticleLocalService.getLatestArticle(themeDisplay.getLayout().getGroupId(), autorArticleId?string) > 
76					<#assign urlWC = autorArticle.getUrlTitle()!""> 
77				</#if> 
78								 
79				<#assign tags = tagsLocalService.getTagNames("com.liferay.journal.model.JournalArticle", journalArticle.getResourcePrimKey()?number )  
80								 tagName = tags[0]!"" 
81								 orgOrUser = "" 
82
83				  
84				 <#if tagName?contains("organization") && tagName != "" > 
85					 <#assign orgOrUser = "org"> 
86					<#else> 
87					 <#assign orgOrUser = "user"> 
88				 </#if> 
89				  
90				<#if orgOrUser == "org" > 
91 
92					<#assign 
93					orgId = tagName?keep_after("organization-")				 
94					organization =  OrganizationLocalService.fetchOrganization(orgId?number)!"" 
95
96			 
97					 
98					<#if organization != "" && autor != "Anônimo"> 
99					 
100						<#assign	orgArticleId = organization.getExpandoBridge().getAttribute("journal-article") 
101							orgJournalArticle = JournalArticleLocalService.getArticle(themeDisplay.getLayout().getGroupId(),orgArticleId?c)  
102							urlWC = orgJournalArticle.getUrlTitle()!"" 
103							autor = organization.getName()!"" 
104
105 
106					</#if> 
107				</#if> 
108				 
109				<#if themeDisplay.isSignedIn() > 
110							<#if tagName?contains("organization-")> 
111								<#assign userIsAdmin = OrganizationLocalService.hasUserOrganization(themeDisplay.getUserId(), orgId?number)> 
112								<#else> 
113								<#if autorId?number == themeDisplay.getUserId()> 
114								<script>console.log("oi");</script> 
115									<#assign userIsAdmin = true> 
116								</#if> 
117							</#if> 
118							 
119						 
120					</#if> 
121							 
122					 
123 
124				<div class="demanda-lista-item"> 
125				 
126				<div class="lista-checkmark"> 
127								<#if categorias?seq_contains("aprovado") > <i title="Aprovado" style="color: #4ECD66" class="fa-solid fa-circle-check"></i> </#if> 
128								<#if categorias?seq_contains("pendente") >	<i title="Em análise" style="color: #D90000"class="fa-solid fa-spinner"></i> </#if> 
129								<#if categorias?seq_contains("recusado") >	<i title="Recusado" style="color: #D90000"class="fa-solid fa-exclamation-circle"></i> </#if> 
130				</div> 
131	 
132 
133					<div class="lista-titulo"> 
134						<h5>${entry.getHighlightedTitle()}</h5> 
135					</div> 
136 
137					<div class="lista-arrow"> 
138						<button style="padding: 0;" class="btn" type="button" data-toggle="collapse" data-target="#collapseID${entry.getClassPK()}" aria-expanded="false" aria-controls="collapseID${entry.getClassPK()}"> 
139							<i class="fa-solid fa-chevron-down"></i> 
140						</button> 
141					</div> 
142 
143					<div class="lista-desc"> 
144						<p>${desc}</p> 
145					</div> 
146 
147					<div class="lista-collapse collapse" id="collapseID${entry.getClassPK()}"> 
148					<#if nomeParaContato != "" || telefone != "" || email != "" || imagem?trim !=""> 
149					<div class="lista-details"> 
150								<div class="lista-pic"> 
151									<i class="fa-solid fa-image-slash"></i> 
152									<#if imagem?trim !="" > 
153											<img class="bioec_demanda_img" src="${imagem}"> 
154										<#else> 
155											<div class="bioec_demanda_img_placeholder"> 
156												<i class="fa-solid fa-image"></i> 
157													sem imagem 
158											</div> 
159									</#if> 
160								</div> 
161							<#if nomeParaContato != "" || telefone != "" || email != "" > 
162							<div class="lista-contato"> 
163								<p>Contato</p> 
164								<p class="lista-author">${nomeParaContato}</p> 
165								<p class="lista-phone">${telefone}</p> 
166								<p class="lista-email">${email}</p> 
167							</div> 
168							</#if> 
169						</div> 
170						</#if> 
171						 
172							<#if categorias?seq_contains("recusado") > 
173							<div style="border-top: 1px solid #E8ECEF; font-weight: bold; padding-top: 24px;"> 
174							<p>Conteúdo Em Análise Pelo Cetiqt:</p> 
175							<p>Conteúdo recusado pelo CETIQT por violar as políticas de privacidade.</p> 
176							</div> 
177							</#if> 
178						<div class="lista-footnote"> 
179								<div> 
180									<span class="lista-date">${journalArticle.getDisplayDate()?string('dd/MM/yyyy')}</span> | <span class="lista-commentNumber">${commentsCount} cometários</span> <span class="barra-pipe"> | </span> <span class="lista-author">Publicado por <a <#if urlWC != ''>href="/w/${urlWC}</#if>">${autor}</a></span> 
181								</div> 
182								<#if userIsAdmin> 
183									<div class="buttonsActions"> 
184									<div style="cursor: pointer;font-size: 16px;" data-toggle="modal" data-target="#modalDemanda${JournalArticleID}"> 
185											<i class="fa-solid fa-edit"></i> 
186										</div> 
187										<div style="cursor: pointer;font-size: 16px;" data-toggle="modal" data-target="#modal-demanda-${entry.getClassPK()}"> 
188												<i class="fa-solid fa-trash-can"></i> 
189										</div> 
190										 
191									</div> 
192								</#if>		 
193						</div> 
194					</div> 
195				</div> 
196				 
197					<#if userIsAdmin> 
198						<div style="display: none;" id="modal-demanda-${entry.getClassPK()}" class="modal fade" role="dialog"> 
199							<div class="modal-dialog modal-lg" role="document"> 
200								<div class="modal-content"> 
201									<div class="modal-header" > 
202										<h4 class="m-0">Remover Demanda</h4> 
203										<button type="button" class="close" data-dismiss="modal" aria-label="Close"> 
204											<span aria-hidden="true"> 
205												<i class="fa-solid fa-close"></i> 
206											</span> 
207										</button>    
208									</div> 
209									<div class="modal-body"> 
210										<h5>Você tem certeza que deseja remover essa demanda?</h5> 
211										<div> 
212											Ao clicar em continuar, a demanda será removida do seu perfil. 
213										</div> 
214									</div> 
215									<div class="modal-footer justify-content-end"> 
216											<button class="bioec_secondary_button" data-dismiss="modal">CANCELAR</button> 
217											<button class="bioec_primary_button" type="button" onclick="excluirDemanda(${JournalArticleFrontId}, ${orgId})">CONTINUAR</button>  
218									</div> 
219								</div> 
220							</div>			 
221						</div> 
222						 
223						<#-- modal edição --> 
224						 
225						 
226						<div style="display: none;" id="modalDemanda${JournalArticleID}" class="modal fade bioec-profile-demanda-modal modalDemanda" role="dialog"> 
227									<div class="modal-dialog modal-lg" role="document"> 
228										<form id="formularioDemanda${JournalArticleID}" class="form-group modal-content formularioDemanda"> 
229												<div id="demandaModal-l1${JournalArticleID}" class="modal-header demandaModal-l1"> 
230													<h5>Adicionar demanda</h5> 
231														<button type="button" class="close" data-dismiss="modal" aria-label="Close"> 
232															 <span aria-hidden="true">&times;</span> 
233														</button> 
234												</div> 
235												<div id="demandaModal-l2${JournalArticleID}" class="modal-body demandaModal-l2"> 
236														<div id="demandaTitle${JournalArticleID}" class="demandaTitle"> 
237																<label class="ReqLabel" for="demandaInputTitle${JournalArticleID}">Título da demanda</label> 
238																<input id="demandaInputTitle${JournalArticleID}" value="${entry.getHighlightedTitle()}" type="text" placeholder="Inserir um título" required> 
239														</div> 
240														<div id="demandaName${JournalArticleID}" class="demandaName"> 
241																<label class="" for="demandaInputName${JournalArticleID}">Nome para contato</label> 
242																<input value="${nomeParaContato}" id="demandaInputName${JournalArticleID}" placeholder="Inserir nome" type="text"> 
243														</div> 
244														<div id="demandaTelephone${JournalArticleID}" class="demandaTelephone"> 
245																<label class="" for="demandaInputPhone${JournalArticleID}">Telefone para contato</label> 
246																<input value="${telefone}" id="demandaInputPhone${JournalArticleID}" name="demandaInputPhone" type="text" placeholder ='(__)_____-_____' minlength="14"  /> 
247														</div> 
248														<div id="demandaEmail${JournalArticleID}" class="demandaEmail"> 
249																<label class="" for="demandaInputEmail${JournalArticleID}">E-mail para contato</label> 
250																<input value="${email}" id="demandaInputEmail${JournalArticleID}" placeholder="Inserir e-mail" type="text"> 
251														</div> 
252														<div id="demandaDesc${JournalArticleID}" class="demandaDesc"> 
253																<label class="ReqLabel" for="demandaInputDesc${JournalArticleID}">Descrição</label> 
254																<textarea id="demandaInputDesc${JournalArticleID}" style="max-width: 100%;font-size: 16px;height: 80px;border: 1px solid #BEBEBE;" required>${desc}</textarea> 
255														</div> 
256														<div id="demandaImg${JournalArticleID}" class="demandaImg"> 
257																<div style="display: flex; flex-direction: column; gap: 8px"> 
258																		<label>Imagem da demanda (Máx. 10 MB)</label> 
259																		<label class="btn carregarImagem" id="carregarImagem${JournalArticleID}" for="inputCarregarImagemDemanda${JournalArticleID}" style="font-size: 16px; cursor: pointer;">CARREGAR IMAGEM</label> 
260																		<input class="inputCarregarImagemDemanda" id="inputCarregarImagemDemanda${JournalArticleID}" type="file" accept="image/*" onchange="encodeDemandaImageAsURL${JournalArticleID}(this)"> 
261																		<input class="d-none" id="inputDemandaBase64${JournalArticleID}" value="${imagem}" /> 
262																		<div class="imagemCarregadaDemanda imagemCarregadaDemanda${JournalArticleID} d-md-none d-block" style="background-image: url(${imagem})"></div> 
263																		<button type="button" id="removerImagemDemanda${JournalArticleID}" class="<#if imagem == "" || imagem?? == false> d-none </#if> removerImagemDemanda" > 
264																			<i class="fa fa-trash"></i> Remover imagem	 
265																		</button> 
266																	</div> 
267																	<div class="imagemCarregadaDemanda imagemCarregadaDemanda${JournalArticleID} d-md-block d-none" style="background-image: url(${imagem})"></div> 
268														</div> 
269												</div> 
270													<div class="TextImportant"> 
271														<p> 
272															Importante: O conteúdo enviado passará por um processo interno de aprovação. Só então o conteúdo adicionado aparecerá no portal. 
273														</p> 
274													</div> 
275 
276												<div id="demandaModal-l3${JournalArticleID}" class="modal-footer demandaModal-l3"> 
277														<button  class="btn button-empty" onclick="" id="demandas-saveAndClose${JournalArticleID}">SALVAR E FECHAR</button> 
278												</div> 
279										</form> 
280									</div> 
281								</div> 
282						 
283						</#if> 
284						<#--  
285						 
286						 
287						 
288						 
289						<div style="display: none;" id="modalInfra${JournalArticleID}" class="modal fade bioec-profile-infra-modal" role="dialog"> 
290							<div  class="modal-dialog modal-lg" role="document"> 
291 
292								<form class="form-group modal-content" id="formularioInfraestrutura${JournalArticleID}"> 
293									<div id="infraModal-l1-${JournalArticleID}" class="modal-header infraModal-l1" > 
294										<h5>Adicionar Infraestrutura</h5> 
295										<button id="fecharModal${JournalArticleID}" type="button" class="close" data-dismiss="modal" aria-label="Close"> 
296											<span aria-hidden="true">&times;</span> 
297										</button>    
298									</div> 
299									<div id="infraModal-l2-${JournalArticleID}" class="modal-body infraModal-l2"> 
300										<div id="infraName${JournalArticleID}" class="infraName"> 
301											<label class="ReqLabel" for="inputInfraName${JournalArticleID}">Nome da infraestrutura</label> 
302											<input type="text" id="inputInfraName${JournalArticleID}" value="${entry.getHighlightedTitle()}" placeholder="Nome da infraestrutura" required> 
303										</div> 
304									<div id="infraModel${JournalArticleID}" class="infraModel"> 
305										<label class="ReqLabel" for="inputInfraModel${JournalArticleID}">Modelo</label> 
306										<input type="text" id="inputInfraModel${JournalArticleID}" value="${modelo}" placeholder="Modelo" required> 
307									</div> 
308									<div id="infraBrand${JournalArticleID}" class="infraBrand"> 
309										<label class="ReqLabel" for="inputInfraBrand${JournalArticleID}">Marca</label> 
310										<input type="text" id="inputInfraBrand${JournalArticleID}" value="${marca}" placeholder="Marca" required> 
311									</div> 
312 
313									<div id="infraImg${JournalArticleID}" class="infraImg"> 
314										<div style="display: flex; flex-direction: column; gap: 8px"> 
315											<label>Imagem da infraestrutura (Máx. 10 MB)</label> 
316											<label class="bioec_secondary_button" id="carregarImagem${JournalArticleID}" for="inputCarregarImagemInfra${JournalArticleID}" style="font-size: 16px;color: #333244;align-self:start;"> 
317												CARREGAR IMAGEM 
318											</label> 
319											<input id="inputCarregarImagemInfra${JournalArticleID}" class="inputCarregarImagemInfra" type="file" accept="image/*" onchange="encodeInfraImageAsURL${JournalArticleID}(this)"> 
320											<input class="d-none" id="inputInfraBase64${JournalArticleID}" /> 
321											<div class="imagemCarregadaInfra${JournalArticleID} d-md-none d-block"></div> 
322											<button type="button" id="removerImagemInfra${JournalArticleID}" class="d-none removerImagemInfra" > 
323												<i class="fa fa-trash"></i> Remover imagem	 
324											</button> 
325										</div> 
326										<div class="imagemCarregadaInfra${JournalArticleID} d-md-block d-none"></div> 
327									</div> 
328 
329									<div id="infraFunction${JournalArticleID}" class="infraFunction"> 
330										<label class="ReqLabel" for="inputInfraFunction${JournalArticleID}">Função</label> 
331										<input type="text" id="inputInfraFunction${JournalArticleID}" class="inputInfraFunction" value="${funcao}" placeholder="Função" required> 
332									</div> 
333								</div> 
334								<div class="TextImportant"> 
335									<p> 
336									Importante: O conteúdo enviado passará por um processo interno de aprovação. Só então o conteúdo adicionado aparecerá no portal. 
337									</p> 
338								</div> 
339								<div id="infraModal-l3-${JournalArticleID}" class="modal-footer infraModal-l3"> 
340											<button class="bioec_secondary_button" id="demandas-saveAndClose${JournalArticleID}" onclick="">SALVAR E FECHAR</button> 
341								</div> 
342							</form> 
343 
344							</div>			 
345						 
346						 
347						--> 
348						 
349					 
350 
351						<script> 
352						<#if userIsAdmin> 
353						function excluirDemanda(wcId, orgId) { 
354								Liferay.Util.openToast({message: "Enviando requisição",type: "info",title: ""}); 
355								fetch(Liferay.ThemeDisplay.getPortalURL() + "/o/demanda/" + wcId, { 
356									method: 'DELETE', 
357									"headers": { 
358										"x-csrf-token": Liferay.authToken, 
359										"Content-Type": "application/json" 
360
361								}) 
362								.then(res => { 
363									if(res.status == 200) { 
364										Liferay.Util.openToast({ 
365												message: "Infraestrutura excluida com sucesso", 
366												type: "success", 
367												title: "", 
368												toastProps: { 
369														autoClose: 5000 
370
371										}) 
372										setTimeout(function(){ location.reload(); }, 2000) 
373									} else { 
374										Liferay.Util.openToast({ 
375												message: "Erro ao excluir infraestrutura", 
376												type: "danger", 
377												title: "", 
378												toastProps: { 
379														autoClose: 5000 
380
381										}) 
382
383								}); 
384
385							 
386						 
387							 
388							 
389	function validImageSize(base64="") { 
390		const decoded = atob(base64.substring(base64.indexOf(',') + 1)); 
391		const sizeMB = decoded.length / 1e+6; 
392		console.log("MB: " + decoded.length / 1e+6); 
393		if(sizeMB > 10) { 
394			Liferay.Util.openToast({ 
395				message: "O tamanho da imagem não deve ultrapassar 10 MB.", 
396				type: "danger", 
397				title: "", 
398				toastProps: { 
399					autoClose: 5000 
400
401			}) 
402			return false 
403
404		return true 
405
406 
407	function encodeDemandaImageAsURL${JournalArticleID}(element) { 
408  	let file = element.files[0]; 
409    let reader = new FileReader(); 
410    reader.onloadend = () => { 
411			if(reader.result) { 
412				if(!validImageSize(reader.result)) return; 
413				try { 
414					const base64_input = document.getElementById("inputDemandaBase64${JournalArticleID}") 
415					base64_input.value = reader.result 
416					Array.from(document.getElementsByClassName("imagemCarregadaDemanda${JournalArticleID}")).forEach( el => el.style.backgroundImage = 'url(' + reader.result + ')' ) 
417					 
418					const removeImageButton = document.getElementById("removerImagemDemanda${JournalArticleID}") 
419					removeImageButton.classList.remove("d-none") 
420				} catch (error) { 
421					console.error(error) 
422
423
424
425		reader.readAsDataURL(file); 
426
427	 
428	function removeImageDemanda${JournalArticleID}() { 
429	try { 
430		const file_input = document.getElementById("inputCarregarImagemDemanda${JournalArticleID}") 
431		Array.from(document.getElementsByClassName("imagemCarregadaDemanda${JournalArticleID}")).forEach( el => el.style.backgroundImage = "" ) 
432		const base64_input = document.getElementById("inputDemandaBase64${JournalArticleID}") 
433		file_input.value = null 
434		base64_input.value = "" 
435		 
436		const removeImageButton = document.getElementById("removerImagemDemanda${JournalArticleID}") 
437		removeImageButton.classList.add("d-none") 
438	} catch (error) { 
439		console.error(error) 
440
441
442 
443 
444document.getElementById("removerImagemDemanda${JournalArticleID}").addEventListener("click", removeImageDemanda${JournalArticleID}); 
445 
446<#-- Rest da edição de organização --> 
447 
448<#if orgOrUser == "org"> 
449document.querySelector('#formularioDemanda${JournalArticleID}').addEventListener('submit', event => { 
450	event.preventDefault(); 
451	adicionarDemanda${JournalArticleID}();  
452}); 
453 
454function adicionarDemanda${JournalArticleID}() {		 
455		Liferay.Util.openToast({message: "Enviando requisição",type: "info",title: ""}); 
456		$("#demandas-saveAndClose${JournalArticleID}").prop("disabled",true); 
457	 
458		 
459		 
460		const demandaData = { 
461			titulo: document.getElementById("demandaInputTitle${JournalArticleID}").value, 
462			nomeContato: document.getElementById("demandaInputName${JournalArticleID}").value, 
463			telefoneContato: document.getElementById("demandaInputPhone${JournalArticleID}").value, 
464			emailContato: document.getElementById("demandaInputEmail${JournalArticleID}").value, 
465			descricao: document.getElementById("demandaInputDesc${JournalArticleID}").value, 
466			imagem: document.getElementById("inputDemandaBase64${JournalArticleID}").value, 
467
468		 
469		console.log(demandaData); 
470	 
471			fetch(Liferay.ThemeDisplay.getPortalURL() + "/o/demanda/${JournalArticleFrontId}", { 
472				method: 'PUT', 
473				"headers": { 
474					"x-csrf-token": Liferay.authToken, 
475					"Content-Type": "application/json" 
476				}, 
477				body: JSON.stringify(demandaData) 
478			}) 
479			.then(res => { 
480				if(res.status == 200) { 
481					Liferay.Util.openToast({ 
482							message: "Demanda editada com sucesso. Após a submissão, será iniciado o processo interno de aprovação do conteúdo enviado. Só então o conteúdo submetido aparecerá no portal.", 
483							type: "success", 
484							title: "", 
485							toastProps: { 
486									autoClose: 5000 
487
488					}) 
489					 setTimeout(function(){ location.reload(); }, 2000); 
490				} else { 
491				 $("#demandas-saveAndClose${JournalArticleID}").prop("disabled",false); 
492					Liferay.Util.openToast({ 
493							message: "Erro ao editada demanda", 
494							type: "danger", 
495							title: "", 
496							toastProps: { 
497									autoClose: 5000 
498
499					}) 
500
501			}) 
502		 
503
504</#if> 
505 
506<#-- Rest da edição de pessoa fisica --> 
507							 
508							 
509				<#if orgOrUser == "user"> 
510				 
511					document.querySelector('#formularioDemanda${JournalArticleID}').addEventListener('submit', event => { 
512					event.preventDefault(); 
513					adicionarDemanda${JournalArticleID}();  
514				});			 
515						 
516						function adicionarDemanda${JournalArticleID}() { 
517							Liferay.Util.openToast({message: "Enviando requisição",type: "info",title: ""}); 
518							$("#demandas-saveAndClose${JournalArticleID}").prop("disabled",true); 
519	 
520							const demandaData = { 
521								titulo: document.getElementById("demandaInputTitle${JournalArticleID}").value, 
522								nomeContato: document.getElementById("demandaInputName${JournalArticleID}").value, 
523								telefoneContato: document.getElementById("demandaInputPhone${JournalArticleID}").value, 
524								emailContato: document.getElementById("demandaInputEmail${JournalArticleID}").value, 
525								descricao: document.getElementById("demandaInputDesc${JournalArticleID}").value, 
526								imagem: document.getElementById("inputDemandaBase64${JournalArticleID}").value, 
527
528							 
529							console.log(demandaData); 
530 
531							fetch(Liferay.ThemeDisplay.getPortalURL() + "/o/demanda/${JournalArticleFrontId}", { 
532											method: 'PUT', 
533											"headers": { 
534													"x-csrf-token": Liferay.authToken, 
535													"Content-Type": "application/json" 
536											}, 
537											body: JSON.stringify(demandaData) 
538									}) 
539									.then( res => { 
540								if(res.status == 200) { 
541									Liferay.Util.openToast({ 
542										message: "Demanda editada com sucesso. Após a submissão, será iniciado o processo interno de aprovação do conteúdo enviado. Só então o conteúdo submetido aparecerá no portal.", 
543										type: "success", 
544										title: "", 
545										toastProps: { 
546											autoClose: 5000 
547
548									}) 
549									 setTimeout(function(){ location.reload(); }, 2000); 
550								} else { 
551								 $("#demandas-saveAndClose${JournalArticleID}").prop("disabled",false); 
552									Liferay.Util.openToast({ 
553										message: "Erro ao editar Demanda", 
554										type: "danger", 
555										title: "", 
556										toastProps: { 
557											autoClose: 5000 
558
559									}) 
560
561							}); 
562							 
563					}; 
564						 
565						 
566				</#if> 
567							 
568							 
569								</#if> 
570						</script> 
571					 
572				 
573				 
574				 
575			</#list> 
576		</#if> 
577	</div> 
578</div> 
579 
580<style> 
581.bioec_demanda_img { 
582    overflow: hidden; 
583		background-size: contain; 
584    background-position: center; 
585    background-repeat: no-repeat; 
586
587 
588.bioec_demanda_img_placeholder { 
589    width: 140px; 
590    height: 140px; 
591    background-color: #E8ECEF; 
592    display: flex; 
593    flex-direction: column; 
594    align-items: center; 
595    justify-content: center; 
596    font-size: 14px; 
597    color: #5B5C61; 
598
599 
600.bioec_demanda_img_placeholder i { 
601    font-size: 44px; 
602
603 
604 
605.pagination-items-per-page.active > a,  
606.pagination-items-per-page.active > button,  
607.pagination-items-per-page.show > a,  
608.pagination-items-per-page.show > button, 
609.page-item.active .page-link,  
610.page-item.show .page-link{ 
611    border-color: #4ECD66; 
612    background-color: #4ECD66; 
613
614 
615.pagination-results, 
616.pagination-items-per-page > a,  
617.pagination-items-per-page > button, 
618.pagination-items-per-page > a:hover,  
619.pagination-items-per-page > button:hover, 
620.page-link{ 
621	color: #4ebe66; 
622
623 
624.bioec-profile-demanda-main{ 
625	display: flex; 
626	gap: 40px; 
627	flex-direction: column; 
628	padding-bottom: 20px; 
629
630.bioec-profile-demanda-main h5{ 
631	font-weight: 700; 
632
633.bioec-profile-demanda-main h5, .bioec-profile-demanda-main p{ 
634	color: #5B5C61; 
635	margin-bottom: 0px; 
636	font-size: 16px; 
637 
638
639 
640.bioec-profile-demanda-main #demanda-lista-container>div{ 
641	border: 1px #BEBEBE solid;  
642	padding: 24px 24px 0 24px; 
643	margin-bottom: 40px; 
644	display: grid; 
645	grid-row-gap: 24px; 
646	grid-template-columns: 24px 12px 1fr 15px; 
647	grid-template-areas:  
648		"ck . tit arrw" 
649		"desc desc desc desc" 
650		"clps clps clps clps"; 
651
652 
653.bioec-profile-demanda-main .lista-checkmark { grid-area: ck; display: flex; } 
654.bioec-profile-demanda-main .lista-checkmark i { font-size: 24px; } 
655.bioec-profile-demanda-main .lista-pic { grid-area: pic; display: flex; justify-content: center;} 
656.bioec-profile-demanda-main .lista-arrow { grid-area: arrw; } 
657 
658.bioec-profile-demanda-main .lista-titulo {  
659	grid-area: tit;  
660	display: flex;  
661	flex-direction: column; 
662	justify-content: center; 
663	 
664
665 
666.bioec-profile-demanda-main .lista-titulo h5{ 
667	margin-bottom: 0px; 
668}  
669 
670.bioec-profile-demanda-main .lista-desc { 
671grid-area: desc;  
672}  
673 
674.bioec-profile-demanda-main .lista-desc p{  
675	margin: 0; 
676
677 
678.bioec-profile-demanda-main a{ 
679	color: #5B5C61; 
680
681 
682.demanda-port{ 
683	border: 1px #BEBEBE solid;  
684	padding: 24px; 
685	display: flex; 
686	flex-direction: column; 
687	align-items: center; 
688	gap: 24px; 
689
690 
691.demanda-port p{ 
692text-align: center;	 
693	 
694
695 
696.demanda-port div{ 
697display: flex; 
698	justify-content: space-between; 
699	width: min(558px, 100%); 
700
701 
702.button-empty { 
703border: solid 1px #4ECD66; 
704padding: 8px 24px; 
705color: #333244; 
706	transition: 250ms; 
707
708 
709.button-empty:hover{ 
710	background-color: #4ECD66; 
711
712 
713.button-filled { 
714background-color: #4ECD66; 
715border: solid 1px #4ECD66; 
716padding: 8px 24px; 
717color: #333244; 
718transition: 250ms; 
719	 
720
721 
722.button-filled:hover{ 
723	background-color: transparent; 
724
725 
726.bioec-profile-demanda-main .lista-footnote {  
727 
728	display: flex; 
729	justify-content: space-between; 
730	border-top: 1px solid #E8ECEF; 
731	padding-top: 12px; 
732	font-size: 14px; 
733	font-weight: 300; 
734	gap: 15px; 
735	color: #5B5C61; 
736 
737
738.lista-collapse{ 
739display: flex; 
740flex-direction: column; 
741gap: 24px; 
742grid-area: clps; 
743padding-bottom: 24px; 
744
745 
746 .lista-details{ 
747	display: flex; 
748	justify-content: flex-start; 
749	gap: 24px; 
750
751.lista-pic img { 
752	max-height: 138px; 
753	max-width: 138px; 
754
755 
756.bioec-profile-demanda-main p{ 
757 
758
759 
760.imagemCarregadaDemanda { 
761	height: 100px; 
762	width: 100px; 
763	background-size: contain; 
764	background-position: center; 
765	background-repeat: no-repeat; 
766
767 
768 
769.ButtonAddDemanda { 
770    background: #4ECD66; 
771    border-radius: 8px; 
772    padding: 8px 24px; 
773    border: none; 
774    font-weight: 700; 
775    color: #333244; 
776    font-family: 'Roboto'; 
777    float: right; 
778    text-transform: uppercase; 
779
780.ButtonAddDemanda:hover{ 
781	color: #333244; 
782	text-decoration: none; 
783
784 
785.bioec-profile-demanda-modal label { 
786    margin: 0; 
787    cursor: default; 
788    font-size: 20px; 
789    font-weight: 700; 
790    color: #5B5C61; 
791
792 
793.bioec-profile-demanda-modal div { 
794    width: 100%; 
795
796 
797#demandaModal-l1, .demandaModal-l1 { 
798    padding: 18px 24px; 
799    display: flex; 
800    justify-content: space-between; 
801
802 
803#demandaModal-l1 img, .demandaModal-l1 img { 
804    cursor: pointer; 
805
806 
807#demandaModal-l1 h5, .demandaModal-l1 h5 { 
808   	margin: 0; 
809    font-size: 20px; 
810    font-weight: 700; 
811    color: #5B5C61; 
812
813 
814#demandaModal-l2, .demandaModal-l2 { 
815		border-top: 1px solid #E8ECEF; 
816    display: grid; 
817    grid-template-columns: 1fr 1fr; 
818    grid-template-areas: 
819        "titu nome" 
820        "fone mail" 
821        "desc desc" 
822        "imagem ." 
823
824    column-gap: 24px; 
825    row-gap: 40px; 
826    padding: 24px; 
827
828 
829#demandaModal-l2>div, .demandaModal-l2>div { 
830    display: flex; 
831    flex-direction: column; 
832    gap: 8px; 
833
834 
835#demandaTitle, .demandaTitle { 
836    grid-area: titu; 
837
838 
839#demandaName, .demandaName { 
840    grid-area: nome; 
841
842 
843#demandaTelephone, .demandaTelephone { 
844    grid-area: fone; 
845
846 
847#demandaEmail, .demandaEmail { 
848    grid-area: mail; 
849
850 
851#demandaBrand, .demandaBrand { 
852    grid-area: marca; 
853
854 
855#demandaModal-l2>#demandaImg, .demandaModal-l2>.demandaImg { 
856    grid-area: imagem; 
857    display: flex; 
858    flex-direction: column; 
859
860 
861#demandaDesc, .demandaDesc { 
862    grid-area: desc; 
863 
864
865 
866#demandaDesc input, .demandaDesc input { 
867    height: 80px; 
868
869 
870.TextImportant{ 
871    border-bottom: 1px solid #E8ECEF; 
872 		padding: 24px; 
873		color: #5B5C61;		 
874
875 
876.bioec-profile-demanda-modal input[type="text"] { 
877    border-top: none; 
878    border-left: none; 
879    border-right: none; 
880    border-bottom: 1px solid #BEBEBE; 
881    width: 100%; 
882    font-size: 16px; 
883 
884
885 
886 
887.bioec-profile-demanda-modal input[type="text"]:focus-visible { 
888    outline: none; 
889    border-bottom: 1px solid black; 
890 
891
892 
893.bioec-profile-demanda-modal .ReqLabel:before { 
894    content: "* "; 
895    color: #D90000; 
896 
897
898 
899#inputCarregarImagemDemanda, .inputCarregarImagemDemanda { 
900    display: none; 
901
902 
903#carregarImagem, .carregarImagem  { 
904    padding: 8px 24px; 
905    border: 1px solid #4ECD66; 
906    width: fit-content; 
907    transition: 250ms; 
908 
909
910 
911#carregarImagem:hover, .carregarImagem:hover { 
912    background-color: #4ECD66; 
913
914 
915.button-empty { 
916    border: solid 1px #4ECD66; 
917    padding: 8px 24px; 
918    color: #333244; 
919    transition: 250ms; 
920    font-weight: bold; 
921
922 
923.button-empty:hover { 
924    background-color: #4ECD66; 
925
926 
927.button-filled { 
928    background-color: #4ECD66; 
929    border: solid 1px #4ECD66; 
930    padding: 8px 24px; 
931    color: #333244; 
932    transition: 250ms; 
933    font-weight: bold; 
934
935 
936.button-filled:hover { 
937    background-color: transparent; 
938
939 
940#demandaModal-l3, .demandaModal-l3 { 
941    gap: 24px; 
942    display: flex; 
943    justify-content: flex-end; 
944    padding: 24px; 
945
946 
947.modal { 
948    padding: initial !important; 
949    border-radius: 4px !important; 
950    
951
952 
953.modal a.close-modal { 
954    display: none; 
955
956 
957#removerImagemDemanda, .removerImagemDemanda { 
958	background: none; 
959	border: none; 
960	outline: none; 
961	color: #5B5C61; 
962	font-size: 16px; 
963	font-weight: 900; 
964	line-height: 24px; 
965	letter-spacing: 0em; 
966	width: fit-content; 
967	margin-left: 16px; 
968
969 
970 
971@media(max-width: 964px){ 
972    .lista-pic img { 
973        width: 100%; 
974        max-height: unset; 
975        max-width: unset; 
976 
977
978
979 
980@media (max-width: 550px) { 
981    #demandaModal-l2, .demandaModal-l2 { 
982        display: flex; 
983        flex-direction: column; 
984
985 
986    #demandaModal-l3, .demandaModal-l3 { 
987        display: flex; 
988        flex-direction: column; 
989
990
991 
992@media(max-width: 450px){ 
993	.bioec-profile-demanda-main .lista-details{ 
994		flex-direction: column; 
995
996 
997	.lista-contato{ 
998		text-align: center; 
999
1000 
1001	.bioec-profile-demanda-main .lista-footnote{ 
1002	flex-direction: column; 
1003		gap: 10px; 
1004		align-items: flex-end; 
1005		text-align: right; 
1006
1007
1008 
1009@media(max-width: 992px){ 
1010	#demanda-lista-container { 
1011		padding-inline: 15px; 
1012
1013
1014 
1015.bioec-profile-demanda-main .lista-footnote .buttonsActions { 
1016  display: flex; 
1017  gap: 17px; 
1018
1019 
1020@media (max-width: 768px) { 
1021  .bioec-profile-demanda-main .lista-desc { 
1022    gap: 24px; 
1023    flex-direction: column-reverse; 
1024
1025  .bioec-profile-demanda-main .lista-footnote { 
1026    flex-direction: column; 
1027    align-items: center; 
1028
1029  .bioec-profile-demanda-main .lista-footnote > div { 
1030    text-align: center; 
1031
1032   
1033  .bioec-profile-demanda-main .lista-footnote .barra-pipe { 
1034    display: none; 
1035
1036  .bioec-profile-demanda-main .lista-footnote .lista-author { 
1037    display: flex; 
1038    gap: 4px; 
1039    justify-content: center; 
1040
1041  .bioec-profile-demanda-main .lista-footnote .buttonsActions { 
1042    width: 100%; 
1043    justify-content: space-between; 
1044
1045
1046 
1047 
1048</style> 
1049 
1050 
1051<script> 
1052 
1053 
1054 
1055</script> 
Ofertas drop zone
An error occurred while processing the template.
Java method "com.sun.proxy.$Proxy890.getLatestArticle(long)" threw an exception when invoked on com.sun.proxy.$Proxy890 object "com.liferay.journal.service.impl.JournalArticleLocalServiceImpl@739dbb4a"; see cause exception in the Java stack trace.

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #assign journalArticle = JournalArtic...  [in template "334468#334509#489378" at line 20, column 33]
----
1<#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")> 
2<#assign UserLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.UserLocalService")> 
3<#assign AssetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")> 
4<#assign mbMessageLocalService = serviceLocator.findService("com.liferay.message.boards.service.MBMessageLocalService")> 
5<#assign OrganizationLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.OrganizationLocalService") 
6	tagsLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetTagLocalService") 
7
8 
9 
10 
11 
12	 
13 
14 
15 
16<div class="bioec-profile-oferta-main"> 
17	<div id="oferta-lista-container" class="d-flex flex-column"> 
18		<#if entries?has_content> 
19			<#list entries as entry> 
20				<#assign journalArticle = JournalArticleLocalService.getLatestArticle(entry.getClassPK()) > 
21				<#assign JournalArticleID = journalArticle.getId()> 
22				<#assign JournalArticleFrontId = journalArticle.getArticleId()> 
23				<#assign articleXml = journalArticle.getDocument().getRootElement()  
24				userIsAdmin = false 
25				orgId = "" 
26
27						 
28				 
29						 
30				<#assign nomeParaContato = articleXml.selectSingleNode("dynamic-element[@name='CampoDeTexto50355704']").getStringValue()!"" 
31								 nomeParaContato = nomeParaContato?replace("\n\t\t", "") 
32								 nomeParaContato = nomeParaContato?replace("\n\t", "")			 
33
34				 
35	 
36			 
37				<#assign telefone = articleXml.selectSingleNode("dynamic-element[@name='Text90715721']")!"" 
38				telefone = telefone.getStringValue()!"" 
39								 telefone = telefone?replace("\n\t\t", "") 
40								 telefone = telefone?replace("\n\t", "")	 
41
42 
43				 
44		 
45				 
46				<#assign email = articleXml.selectSingleNode("dynamic-element[@name='Text68569631']").getStringValue()!"" 
47								 email = email?replace("\n\t\t", "") 
48								 email = email?replace("\n\t", "")					 
49
50 
51				 
52 
53				 
54				<#assign desc = articleXml.selectSingleNode("dynamic-element[@name='CopyOfText18267936']").getStringValue()!"" 
55								 desc = desc?replace("\n\t\t", "") 
56								 desc = desc?replace("\n\t", "")		 
57
58 
59				<#assign imagem = articleXml.selectSingleNode("dynamic-element[@name='Text80669990']").getStringValue()!"" 
60								imagem = imagem?replace("\n\t\t", "") 
61								 imagem = imagem?replace("\n\t", "")		 
62
63 
64				<#assign autorId = articleXml.selectSingleNode("dynamic-element[@name='CampoDeTexto97452704']").getStringValue()!"" 
65						autorId = autorId?replace("\n\t\t", "") 
66						autorId = autorId?replace("\n\t", "")			 
67							autorArticleId = "" 
68						commentsCount = mbMessageLocalService.getDiscussionMessagesCount(entry.getClassName(), entry.getClassPK(), 0)!"0" 
69				>	 
70				 
71				 
72			 
73						<#if autorId != "" && autorId??> 
74					<#assign 
75						autor = UserLocalService.fetchUser(autorId?number)!"" 
76						autorArticleId = autor.getExpandoBridge().getAttribute("journal-article")!"0" 
77				/> 
78				<#if autor != ""> 
79				<#assign autor = autor.getFullName()!""> 
80				<#else> 
81				<#assign autor = "Anônimo" > 
82				</#if> 
83				<#else>  
84				<#assign autor = "Anônimo" > 
85		</#if>		 
86		<#assign 	categorias = AssetCategoryLocalService.getCategoryNames(entry.getClassName(), entry.getClassPK())!"" > 
87		<#assign urlWC = ""> 
88		 
89		<#if autorArticleId != "0" && autorArticleId != "" && autor != "Anônimo"> 
90		<#assign autorArticle = JournalArticleLocalService.getLatestArticle(themeDisplay.getLayout().getGroupId(), autorArticleId?string) > 
91		<#assign urlWC = autorArticle.getUrlTitle()!""> 
92		</#if> 
93		 
94		 
95				<#assign tags = tagsLocalService.getTagNames("com.liferay.journal.model.JournalArticle", journalArticle.getResourcePrimKey()?number )  
96				 tagName = tags[0]!"" 
97				 orgOrUser = "" 
98
99				  
100				 <#if tagName?contains("organization") && tagName != "" > 
101					 <#assign orgOrUser = "org"> 
102					<#else> 
103					 <#assign orgOrUser = "user"> 
104				 </#if> 
105			 
106				<#if orgOrUser == "org" > 
107 
108					<#assign 
109					orgId = tagName?keep_after("organization-")				 
110					organization =  OrganizationLocalService.fetchOrganization(orgId?number)!"" 
111
112			 
113					 
114					<#if organization != "" && autor != "Anônimo"> 
115						<#assign	orgArticleId = organization.getExpandoBridge().getAttribute("journal-article") 
116							orgJournalArticle = JournalArticleLocalService.getArticle(themeDisplay.getLayout().getGroupId(),orgArticleId?c)  
117							urlWC = orgJournalArticle.getUrlTitle()!"" 
118							autor = organization.getName()!"" 
119
120 
121					</#if> 
122				</#if> 
123				 
124					<#if themeDisplay.isSignedIn() > 
125							<#if tagName?contains("organization-")> 
126								<#assign userIsAdmin = OrganizationLocalService.hasUserOrganization(themeDisplay.getUserId(), orgId?number)> 
127								<#else> 
128								<#if autorId?number == themeDisplay.getUserId()> 
129								<script>console.log("oi");</script> 
130									<#assign userIsAdmin = true> 
131								</#if> 
132							</#if> 
133							 
134						 
135					</#if> 
136				 
137 
138				<div class="oferta-lista-item"> 
139				<div class="lista-checkmark"> 
140								<#if categorias?seq_contains("aprovado") > <i title="Aprovado" style="color: #4ECD66" class="fa-solid fa-circle-check"></i> </#if> 
141								<#if categorias?seq_contains("pendente") >	<i title="Em análise" style="color: #D90000"class="fa-solid fa-spinner"></i> </#if> 
142								<#if categorias?seq_contains("recusado") >	<i title="Recusado" style="color: #D90000"class="fa-solid fa-exclamation-circle"></i> </#if> 
143				</div> 
144	 
145 
146					<div class="lista-titulo"> 
147						<h5>${entry.getHighlightedTitle()}</h5> 
148					</div> 
149 
150					<div class="lista-arrow"> 
151						<button style="padding: 0;" class="btn" type="button" data-toggle="collapse" data-target="#collapseID${entry.getClassPK()}" aria-expanded="false" aria-controls="collapseID${entry.getClassPK()}"> 
152							<i class="fa-solid fa-chevron-down"></i> 
153						</button> 
154					</div> 
155 
156					<div class="lista-desc"> 
157						<p>${desc}</p> 
158					</div> 
159 
160					<div class="lista-collapse collapse" id="collapseID${entry.getClassPK()}"> 
161					<#if nomeParaContato != "" || telefone != "" || email != "" || imagem?trim !=""> 
162					<div class="lista-details"> 
163								<div class="lista-pic"> 
164									<i class="fa-solid fa-image-slash"></i> 
165									<#if imagem?trim !="" > 
166											<img class="bioec_oferta_img" src="${imagem}"> 
167										<#else> 
168											<div class="bioec_oferta_img_placeholder"> 
169												<i class="fa-solid fa-image"></i> 
170													sem imagem 
171											</div> 
172									</#if> 
173								</div> 
174							<#if nomeParaContato != "" || telefone != "" || email != "" > 
175							<div class="lista-contato"> 
176								<p>Contato</p> 
177								<p class="lista-author">${nomeParaContato}</p> 
178								<p class="lista-phone">${telefone}</p> 
179								<p class="lista-email">${email}</p> 
180							</div> 
181							</#if> 
182						</div> 
183						</#if> 
184						 
185							<#if categorias?seq_contains("recusado") > 
186							<div style="border-top: 1px solid #E8ECEF; font-weight: bold; padding-top: 24px;"> 
187							<p>Conteúdo Em Análise Pelo Cetiqt:</p> 
188							<p>Conteúdo recusado pelo CETIQT por violar as políticas de privacidade.</p> 
189							</div> 
190							</#if> 
191						<div class="lista-footnote"> 
192								<div> 
193									<span class="lista-date">${journalArticle.getDisplayDate()?string('dd/MM/yyyy')}</span> | <span class="lista-commentNumber">${commentsCount} cometários</span> <span class="barra-pipe"> | </span> <span class="lista-author">Publicado por <a <#if urlWC != ''>href="/w/${urlWC}</#if>">${autor}</a></span> 
194								</div> 
195								<#if userIsAdmin> 
196									<div class="buttonsActions"> 
197									<div style="cursor: pointer;font-size: 16px;" data-toggle="modal" data-target="#modalOferta${JournalArticleID}"> 
198											<i class="fa-solid fa-edit"></i> 
199										</div> 
200										<div style="cursor: pointer;font-size: 16px;" data-toggle="modal" data-target="#modal-oferta-${entry.getClassPK()}"> 
201												<i class="fa-solid fa-trash-can"></i> 
202										</div> 
203										 
204									</div> 
205								</#if>		 
206						</div> 
207					</div> 
208				</div> 
209				 
210					<#if userIsAdmin> 
211						<div style="display: none;" id="modal-oferta-${entry.getClassPK()}" class="modal fade" role="dialog"> 
212							<div class="modal-dialog modal-lg" role="document"> 
213								<div class="modal-content"> 
214									<div class="modal-header" > 
215										<h4 class="m-0">Remover Oferta</h4> 
216										<button type="button" class="close" data-dismiss="modal" aria-label="Close"> 
217											<span aria-hidden="true"> 
218												<i class="fa-solid fa-close"></i> 
219											</span> 
220										</button>    
221									</div> 
222									<div class="modal-body"> 
223										<h5>Você tem certeza que deseja remover essa oferta?</h5> 
224										<div> 
225											Ao clicar em continuar, a oferta será removida do seu perfil. 
226										</div> 
227									</div> 
228									<div class="modal-footer justify-content-end"> 
229											<button class="bioec_secondary_button" data-dismiss="modal">CANCELAR</button> 
230											<button class="bioec_primary_button" type="button" onclick="excluirOferta(${JournalArticleFrontId}, ${orgId})">CONTINUAR</button>  
231									</div> 
232								</div> 
233							</div>			 
234						</div> 
235						 
236						<#-- modal edição --> 
237						 
238						 
239						<div style="display: none;" id="modalOferta${JournalArticleID}" class="modal fade bioec-profile-oferta-modal modalOferta" role="dialog"> 
240									<div class="modal-dialog modal-lg" role="document"> 
241										<form id="formularioOferta${JournalArticleID}" class="form-group modal-content formularioOferta"> 
242												<div id="ofertaModal-l1${JournalArticleID}" class="modal-header ofertaModal-l1"> 
243													<h5>Adicionar oferta</h5> 
244														<button type="button" class="close" data-dismiss="modal" aria-label="Close"> 
245															 <span aria-hidden="true">&times;</span> 
246														</button> 
247												</div> 
248												<div id="ofertaModal-l2${JournalArticleID}" class="modal-body ofertaModal-l2"> 
249														<div id="ofertaTitle${JournalArticleID}" class="ofertaTitle"> 
250																<label class="ReqLabel" for="ofertaInputTitle${JournalArticleID}">Título da oferta</label> 
251																<input id="ofertaInputTitle${JournalArticleID}" value="${entry.getHighlightedTitle()}" type="text" placeholder="Inserir um título" required> 
252														</div> 
253														<div id="ofertaName${JournalArticleID}" class="ofertaName"> 
254																<label class="" for="ofertaInputName${JournalArticleID}">Nome para contato</label> 
255																<input value="${nomeParaContato}" id="ofertaInputName${JournalArticleID}" placeholder="Inserir nome" type="text"> 
256														</div> 
257														<div id="ofertaTelephone${JournalArticleID}" class="ofertaTelephone"> 
258																<label class="" for="ofertaInputPhone${JournalArticleID}">Telefone para contato</label> 
259																<input value="${telefone}" id="ofertaInputPhone${JournalArticleID}" name="ofertaInputPhone" type="text" placeholder ='(__)_____-_____' minlength="14"  /> 
260														</div> 
261														<div id="ofertaEmail${JournalArticleID}" class="ofertaEmail"> 
262																<label class="" for="ofertaInputEmail${JournalArticleID}">E-mail para contato</label> 
263																<input value="${email}" id="ofertaInputEmail${JournalArticleID}" placeholder="Inserir e-mail" type="text"> 
264														</div> 
265														<div id="ofertaDesc${JournalArticleID}" class="ofertaDesc"> 
266																<label class="ReqLabel" for="ofertaInputDesc${JournalArticleID}">Descrição</label> 
267																<textarea id="ofertaInputDesc${JournalArticleID}" style="max-width: 100%;font-size: 16px;height: 80px;border: 1px solid #BEBEBE;" required>${desc}</textarea> 
268														</div> 
269														<div id="ofertaImg${JournalArticleID}" class="ofertaImg"> 
270																<div style="display: flex; flex-direction: column; gap: 8px"> 
271																		<label>Imagem da oferta (Máx. 10 MB)</label> 
272																		<label class="btn carregarImagem" id="carregarImagem${JournalArticleID}" for="inputCarregarImagemOferta${JournalArticleID}" style="font-size: 16px; cursor: pointer;">CARREGAR IMAGEM</label> 
273																		<input class="inputCarregarImagemOferta" id="inputCarregarImagemOferta${JournalArticleID}" type="file" accept="image/*" onchange="encodeOfertaImageAsURL${JournalArticleID}(this)"> 
274																		<input class="d-none" id="inputOfertaBase64${JournalArticleID}" value="${imagem}"/> 
275																		<div class="imagemCarregadaOferta imagemCarregadaOferta${JournalArticleID} d-md-none d-block" style="background-image: url(${imagem})"></div> 
276																		<button type="button" id="removerImagemOferta${JournalArticleID}" class="<#if imagem == "" || imagem?? == false> d-none </#if>  removerImagemOferta" > 
277																			<i class="fa fa-trash"></i> Remover imagem	 
278																		</button> 
279																	</div> 
280																	<div class="imagemCarregadaOferta imagemCarregadaOferta${JournalArticleID} d-md-block d-none" style="background-image: url(${imagem})"></div> 
281														</div> 
282												</div> 
283													<div class="TextImportant"> 
284														<p> 
285															Importante: O conteúdo enviado passará por um processo interno de aprovação. Só então o conteúdo adicionado aparecerá no portal. 
286														</p> 
287													</div> 
288 
289												<div id="ofertaModal-l3${JournalArticleID}" class="modal-footer ofertaModal-l3"> 
290														<button  class="btn button-empty" onclick="" id="ofertas-saveAndClose${JournalArticleID}">SALVAR E FECHAR</button> 
291												</div> 
292										</form> 
293									</div> 
294								</div> 
295						 
296						</#if> 
297						<#--  
298						 
299						 
300						 
301						 
302						<div style="display: none;" id="modalInfra${JournalArticleID}" class="modal fade bioec-profile-infra-modal" role="dialog"> 
303							<div  class="modal-dialog modal-lg" role="document"> 
304 
305								<form class="form-group modal-content" id="formularioInfraestrutura${JournalArticleID}"> 
306									<div id="infraModal-l1-${JournalArticleID}" class="modal-header infraModal-l1" > 
307										<h5>Adicionar Infraestrutura</h5> 
308										<button id="fecharModal${JournalArticleID}" type="button" class="close" data-dismiss="modal" aria-label="Close"> 
309											<span aria-hidden="true">&times;</span> 
310										</button>    
311									</div> 
312									<div id="infraModal-l2-${JournalArticleID}" class="modal-body infraModal-l2"> 
313										<div id="infraName${JournalArticleID}" class="infraName"> 
314											<label class="ReqLabel" for="inputInfraName${JournalArticleID}">Nome da infraestrutura</label> 
315											<input type="text" id="inputInfraName${JournalArticleID}" value="${entry.getHighlightedTitle()}" placeholder="Nome da infraestrutura" required> 
316										</div> 
317									<div id="infraModel${JournalArticleID}" class="infraModel"> 
318										<label class="ReqLabel" for="inputInfraModel${JournalArticleID}">Modelo</label> 
319										<input type="text" id="inputInfraModel${JournalArticleID}" value="${modelo}" placeholder="Modelo" required> 
320									</div> 
321									<div id="infraBrand${JournalArticleID}" class="infraBrand"> 
322										<label class="ReqLabel" for="inputInfraBrand${JournalArticleID}">Marca</label> 
323										<input type="text" id="inputInfraBrand${JournalArticleID}" value="${marca}" placeholder="Marca" required> 
324									</div> 
325 
326									<div id="infraImg${JournalArticleID}" class="infraImg"> 
327										<div style="display: flex; flex-direction: column; gap: 8px"> 
328											<label>Imagem da infraestrutura (Máx. 10 MB)</label> 
329											<label class="bioec_secondary_button" id="carregarImagem${JournalArticleID}" for="inputCarregarImagemInfra${JournalArticleID}" style="font-size: 16px;color: #333244;align-self:start;"> 
330												CARREGAR IMAGEM 
331											</label> 
332											<input id="inputCarregarImagemInfra${JournalArticleID}" class="inputCarregarImagemInfra" type="file" accept="image/*" onchange="encodeInfraImageAsURL${JournalArticleID}(this)"> 
333											<input class="d-none" id="inputInfraBase64${JournalArticleID}" /> 
334											<div class="imagemCarregadaInfra${JournalArticleID} d-md-none d-block"></div> 
335											<button type="button" id="removerImagemInfra${JournalArticleID}" class="d-none removerImagemInfra" > 
336												<i class="fa fa-trash"></i> Remover imagem	 
337											</button> 
338										</div> 
339										<div class="imagemCarregadaInfra${JournalArticleID} d-md-block d-none"></div> 
340									</div> 
341 
342									<div id="infraFunction${JournalArticleID}" class="infraFunction"> 
343										<label class="ReqLabel" for="inputInfraFunction${JournalArticleID}">Função</label> 
344										<input type="text" id="inputInfraFunction${JournalArticleID}" class="inputInfraFunction" value="${funcao}" placeholder="Função" required> 
345									</div> 
346								</div> 
347								<div class="TextImportant"> 
348									<p> 
349									Importante: O conteúdo enviado passará por um processo interno de aprovação. Só então o conteúdo adicionado aparecerá no portal. 
350									</p> 
351								</div> 
352								<div id="infraModal-l3-${JournalArticleID}" class="modal-footer infraModal-l3"> 
353											<button class="bioec_secondary_button" id="ofertas-saveAndClose${JournalArticleID}" onclick="">SALVAR E FECHAR</button> 
354								</div> 
355							</form> 
356 
357							</div>			 
358						 
359						 
360						--> 
361						 
362				 
363 
364						<script> 
365						<#if userIsAdmin> 
366						function excluirOferta(wcId, orgId) { 
367								Liferay.Util.openToast({message: "Enviando requisição",type: "info",title: ""}); 
368								fetch(Liferay.ThemeDisplay.getPortalURL() + "/o/oferta/" + wcId, { 
369									method: 'DELETE', 
370									"headers": { 
371										"x-csrf-token": Liferay.authToken, 
372										"Content-Type": "application/json" 
373
374								}) 
375								.then(res => { 
376									if(res.status == 200) { 
377										Liferay.Util.openToast({ 
378												message: "Infraestrutura excluida com sucesso", 
379												type: "success", 
380												title: "", 
381												toastProps: { 
382														autoClose: 5000 
383
384										}) 
385										setTimeout(function(){ location.reload(); }, 2000) 
386									} else { 
387										Liferay.Util.openToast({ 
388												message: "Erro ao excluir infraestrutura", 
389												type: "danger", 
390												title: "", 
391												toastProps: { 
392														autoClose: 5000 
393
394										}) 
395
396								}); 
397
398							 
399						 
400							 
401							 
402	function validImageSize(base64="") { 
403		const decoded = atob(base64.substring(base64.indexOf(',') + 1)); 
404		const sizeMB = decoded.length / 1e+6; 
405		console.log("MB: " + decoded.length / 1e+6); 
406		if(sizeMB > 10) { 
407			Liferay.Util.openToast({ 
408				message: "O tamanho da imagem não deve ultrapassar 10 MB.", 
409				type: "danger", 
410				title: "", 
411				toastProps: { 
412					autoClose: 5000 
413
414			}) 
415			return false 
416
417		return true 
418
419 
420	function encodeOfertaImageAsURL${JournalArticleID}(element) { 
421  	let file = element.files[0]; 
422    let reader = new FileReader(); 
423    reader.onloadend = () => { 
424			if(reader.result) { 
425				if(!validImageSize(reader.result)) return; 
426				try { 
427					const base64_input = document.getElementById("inputOfertaBase64${JournalArticleID}") 
428					base64_input.value = reader.result 
429					Array.from(document.getElementsByClassName("imagemCarregadaOferta${JournalArticleID}")).forEach( el => el.style.backgroundImage = 'url(' + reader.result + ')' ) 
430					 
431					const removeImageButton = document.getElementById("removerImagemOferta${JournalArticleID}") 
432					removeImageButton.classList.remove("d-none") 
433				} catch (error) { 
434					console.error(error) 
435
436
437
438		reader.readAsDataURL(file); 
439
440	 
441	function removeImageOferta${JournalArticleID}() { 
442	try { 
443		const file_input = document.getElementById("inputCarregarImagemOferta${JournalArticleID}") 
444		Array.from(document.getElementsByClassName("imagemCarregadaOferta${JournalArticleID}")).forEach( el => el.style.backgroundImage = "" ) 
445		const base64_input = document.getElementById("inputOfertaBase64${JournalArticleID}") 
446		file_input.value = null 
447		base64_input.value = "" 
448		 
449		const removeImageButton = document.getElementById("removerImagemOferta${JournalArticleID}") 
450		removeImageButton.classList.add("d-none") 
451	} catch (error) { 
452		console.error(error) 
453
454
455 
456 
457 
458document.getElementById("removerImagemOferta${JournalArticleID}").addEventListener("click", removeImageOferta${JournalArticleID}); 
459 
460<#-- Rest da edição de organização --> 
461 
462<#if orgOrUser == "org"> 
463document.querySelector('#formularioOferta${JournalArticleID}').addEventListener('submit', event => { 
464	event.preventDefault(); 
465	adicionarOferta${JournalArticleID}();  
466}); 
467 
468function adicionarOferta${JournalArticleID}() {		 
469		Liferay.Util.openToast({message: "Enviando requisição",type: "info",title: ""}); 
470		$("#ofertas-saveAndClose${JournalArticleID}").prop("disabled",true); 
471	 
472		 
473		 
474		const ofertaData = { 
475			titulo: document.getElementById("ofertaInputTitle${JournalArticleID}").value, 
476			nomeContato: document.getElementById("ofertaInputName${JournalArticleID}").value, 
477			telefoneContato: document.getElementById("ofertaInputPhone${JournalArticleID}").value, 
478			emailContato: document.getElementById("ofertaInputEmail${JournalArticleID}").value, 
479			descricao: document.getElementById("ofertaInputDesc${JournalArticleID}").value, 
480			imagem: document.getElementById("inputOfertaBase64${JournalArticleID}").value, 
481
482		 
483		console.log(ofertaData); 
484		 
485			fetch(Liferay.ThemeDisplay.getPortalURL() + "/o/oferta/${JournalArticleFrontId}", { 
486				method: 'PUT', 
487				"headers": { 
488					"x-csrf-token": Liferay.authToken, 
489					"Content-Type": "application/json" 
490				}, 
491				body: JSON.stringify(ofertaData) 
492			}) 
493			.then(res => { 
494				if(res.status == 200) { 
495					Liferay.Util.openToast({ 
496							message: "Oferta editada com sucesso. Após a submissão, será iniciado o processo interno de aprovação do conteúdo enviado. Só então o conteúdo submetido aparecerá no portal.", 
497							type: "success", 
498							title: "", 
499							toastProps: { 
500									autoClose: 5000 
501
502					}) 
503					 setTimeout(function(){ location.reload(); }, 2000); 
504				} else { 
505				 $("#ofertas-saveAndClose${JournalArticleID}").prop("disabled",false); 
506					Liferay.Util.openToast({ 
507							message: "Erro ao editar oferta", 
508							type: "danger", 
509							title: "", 
510							toastProps: { 
511									autoClose: 5000 
512
513					}) 
514
515			}) 
516
517</#if> 
518 
519<#-- Rest da edição de pessoa fisica --> 
520 
521							 
522							 
523				<#if orgOrUser == "user"> 
524				 
525								document.querySelector('#formularioOferta${JournalArticleID}').addEventListener('submit', event => { 
526					event.preventDefault(); 
527					adicionarOferta${JournalArticleID}();  
528				});			 
529						 
530						function adicionarOferta${JournalArticleID}() { 
531							Liferay.Util.openToast({message: "Enviando requisição",type: "info",title: ""}); 
532							$("#ofertas-saveAndClose${JournalArticleID}").prop("disabled",true); 
533	 
534							const ofertaData = { 
535								titulo: document.getElementById("ofertaInputTitle${JournalArticleID}").value, 
536								nomeContato: document.getElementById("ofertaInputName${JournalArticleID}").value, 
537								telefoneContato: document.getElementById("ofertaInputPhone${JournalArticleID}").value, 
538								emailContato: document.getElementById("ofertaInputEmail${JournalArticleID}").value, 
539								descricao: document.getElementById("ofertaInputDesc${JournalArticleID}").value, 
540								imagem: document.getElementById("inputOfertaBase64${JournalArticleID}").value, 
541
542							 
543							console.log(ofertaData); 
544 
545							fetch(Liferay.ThemeDisplay.getPortalURL() + "/o/oferta/${JournalArticleFrontId}", { 
546											method: 'PUT', 
547											"headers": { 
548													"x-csrf-token": Liferay.authToken, 
549													"Content-Type": "application/json" 
550											}, 
551											body: JSON.stringify(ofertaData) 
552									}) 
553									.then( res => { 
554								if(res.status == 200) { 
555									Liferay.Util.openToast({ 
556										message: "Oferta editada com sucesso. Após a submissão, será iniciado o processo interno de aprovação do conteúdo enviado. Só então o conteúdo submetido aparecerá no portal.", 
557										type: "success", 
558										title: "", 
559										toastProps: { 
560											autoClose: 5000 
561
562									}) 
563									 setTimeout(function(){ location.reload(); }, 2000); 
564								} else { 
565								 $("#ofertas-saveAndClose${JournalArticleID}").prop("disabled",false); 
566									Liferay.Util.openToast({ 
567										message: "Erro ao editar Oferta", 
568										type: "danger", 
569										title: "", 
570										toastProps: { 
571											autoClose: 5000 
572
573									}) 
574
575							}); 
576							 
577					}; 
578						 
579						 
580				</#if> 
581							 
582							 
583								</#if> 
584						</script> 
585					 
586				 
587				 
588				 
589			</#list> 
590		</#if> 
591	</div> 
592</div> 
593 
594<style> 
595.bioec_oferta_img { 
596    overflow: hidden; 
597		background-size: contain; 
598    background-position: center; 
599    background-repeat: no-repeat; 
600
601 
602.bioec_oferta_img_placeholder { 
603    width: 140px; 
604    height: 140px; 
605    background-color: #E8ECEF; 
606    display: flex; 
607    flex-direction: column; 
608    align-items: center; 
609    justify-content: center; 
610    font-size: 14px; 
611    color: #5B5C61; 
612
613 
614.bioec_oferta_img_placeholder i { 
615    font-size: 44px; 
616
617 
618 
619.pagination-items-per-page.active > a,  
620.pagination-items-per-page.active > button,  
621.pagination-items-per-page.show > a,  
622.pagination-items-per-page.show > button, 
623.page-item.active .page-link,  
624.page-item.show .page-link{ 
625    border-color: #4ECD66; 
626    background-color: #4ECD66; 
627
628 
629.pagination-results, 
630.pagination-items-per-page > a,  
631.pagination-items-per-page > button, 
632.pagination-items-per-page > a:hover,  
633.pagination-items-per-page > button:hover, 
634.page-link{ 
635	color: #4ebe66; 
636
637 
638.bioec-profile-oferta-main{ 
639	display: flex; 
640	gap: 40px; 
641	flex-direction: column; 
642	padding-bottom: 20px; 
643
644.bioec-profile-oferta-main h5{ 
645	font-weight: 700; 
646
647.bioec-profile-oferta-main h5, .bioec-profile-oferta-main p{ 
648	color: #5B5C61; 
649	margin-bottom: 0px; 
650	font-size: 16px; 
651 
652
653 
654.bioec-profile-oferta-main #oferta-lista-container>div{ 
655	border: 1px #BEBEBE solid;  
656	padding: 24px 24px 0 24px; 
657	margin-bottom: 40px; 
658	display: grid; 
659	grid-row-gap: 24px; 
660	grid-template-columns: 24px 12px 1fr 15px; 
661	grid-template-areas:  
662		"ck . tit arrw" 
663		"desc desc desc desc" 
664		"clps clps clps clps"; 
665
666 
667.bioec-profile-oferta-main .lista-checkmark { grid-area: ck; display: flex; } 
668.bioec-profile-oferta-main .lista-checkmark i { font-size: 24px; } 
669.bioec-profile-oferta-main .lista-pic { grid-area: pic; display: flex; justify-content: center;} 
670.bioec-profile-oferta-main .lista-arrow { grid-area: arrw; } 
671 
672.bioec-profile-oferta-main .lista-titulo {  
673	grid-area: tit;  
674	display: flex;  
675	flex-direction: column; 
676	justify-content: center; 
677	 
678
679 
680.bioec-profile-oferta-main .lista-titulo h5{ 
681	margin-bottom: 0px; 
682}  
683 
684.bioec-profile-oferta-main .lista-desc { 
685grid-area: desc;  
686}  
687 
688.bioec-profile-oferta-main .lista-desc p{  
689	margin: 0; 
690
691 
692.bioec-profile-oferta-main a{ 
693	color: #5B5C61; 
694
695 
696.oferta-port{ 
697	border: 1px #BEBEBE solid;  
698	padding: 24px; 
699	display: flex; 
700	flex-direction: column; 
701	align-items: center; 
702	gap: 24px; 
703
704 
705.oferta-port p{ 
706text-align: center;	 
707	 
708
709 
710.oferta-port div{ 
711display: flex; 
712	justify-content: space-between; 
713	width: min(558px, 100%); 
714
715 
716.button-empty { 
717border: solid 1px #4ECD66; 
718padding: 8px 24px; 
719color: #333244; 
720	transition: 250ms; 
721
722 
723.button-empty:hover{ 
724	background-color: #4ECD66; 
725
726 
727.button-filled { 
728background-color: #4ECD66; 
729border: solid 1px #4ECD66; 
730padding: 8px 24px; 
731color: #333244; 
732transition: 250ms; 
733	 
734
735 
736.button-filled:hover{ 
737	background-color: transparent; 
738
739 
740.bioec-profile-oferta-main .lista-footnote {  
741 
742	display: flex; 
743	justify-content: space-between; 
744	border-top: 1px solid #E8ECEF; 
745	padding-top: 12px; 
746	font-size: 14px; 
747	font-weight: 300; 
748	gap: 15px; 
749	color: #5B5C61; 
750 
751
752.lista-collapse{ 
753display: flex; 
754flex-direction: column; 
755gap: 24px; 
756grid-area: clps; 
757padding-bottom: 24px; 
758
759 
760 .lista-details{ 
761	display: flex; 
762	justify-content: flex-start; 
763	gap: 24px; 
764
765.lista-pic img { 
766	max-height: 138px; 
767	max-width: 138px; 
768
769 
770.bioec-profile-oferta-main p{ 
771 
772
773 
774.imagemCarregadaOferta { 
775	height: 100px; 
776	width: 100px; 
777	background-size: contain; 
778	background-position: center; 
779	background-repeat: no-repeat; 
780
781 
782 
783.ButtonAddOferta { 
784    background: #4ECD66; 
785    border-radius: 8px; 
786    padding: 8px 24px; 
787    border: none; 
788    font-weight: 700; 
789    color: #333244; 
790    font-family: 'Roboto'; 
791    float: right; 
792    text-transform: uppercase; 
793
794.ButtonAddOferta:hover{ 
795	color: #333244; 
796	text-decoration: none; 
797
798 
799.bioec-profile-oferta-modal label { 
800    margin: 0; 
801    cursor: default; 
802    font-size: 20px; 
803    font-weight: 700; 
804    color: #5B5C61; 
805
806 
807.bioec-profile-oferta-modal div { 
808    width: 100%; 
809
810 
811#ofertaModal-l1, .ofertaModal-l1 { 
812    padding: 18px 24px; 
813    display: flex; 
814    justify-content: space-between; 
815
816 
817#ofertaModal-l1 img, .ofertaModal-l1 img { 
818    cursor: pointer; 
819
820 
821#ofertaModal-l1 h5, .ofertaModal-l1 h5 { 
822   	margin: 0; 
823    font-size: 20px; 
824    font-weight: 700; 
825    color: #5B5C61; 
826
827 
828#ofertaModal-l2, .ofertaModal-l2 { 
829		border-top: 1px solid #E8ECEF; 
830    display: grid; 
831    grid-template-columns: 1fr 1fr; 
832    grid-template-areas: 
833        "titu nome" 
834        "fone mail" 
835        "desc desc" 
836        "imagem ." 
837
838    column-gap: 24px; 
839    row-gap: 40px; 
840    padding: 24px; 
841
842 
843#ofertaModal-l2>div, .ofertaModal-l2>div { 
844    display: flex; 
845    flex-direction: column; 
846    gap: 8px; 
847
848 
849#ofertaTitle, .ofertaTitle { 
850    grid-area: titu; 
851
852 
853#ofertaName, .ofertaName { 
854    grid-area: nome; 
855
856 
857#ofertaTelephone, .ofertaTelephone { 
858    grid-area: fone; 
859
860 
861#ofertaEmail, .ofertaEmail { 
862    grid-area: mail; 
863
864 
865#ofertaBrand, .ofertaBrand { 
866    grid-area: marca; 
867
868 
869#ofertaModal-l2>#ofertaImg, .ofertaModal-l2>.ofertaImg { 
870    grid-area: imagem; 
871    display: flex; 
872    flex-direction: column; 
873
874 
875#ofertaDesc, .ofertaDesc { 
876    grid-area: desc; 
877 
878
879 
880#ofertaDesc input, .ofertaDesc input { 
881    height: 80px; 
882
883 
884.TextImportant{ 
885    border-bottom: 1px solid #E8ECEF; 
886 		padding: 24px; 
887		color: #5B5C61;		 
888
889 
890.bioec-profile-oferta-modal input[type="text"] { 
891    border-top: none; 
892    border-left: none; 
893    border-right: none; 
894    border-bottom: 1px solid #BEBEBE; 
895    width: 100%; 
896    font-size: 16px; 
897 
898
899 
900 
901.bioec-profile-oferta-modal input[type="text"]:focus-visible { 
902    outline: none; 
903    border-bottom: 1px solid black; 
904 
905
906 
907.bioec-profile-oferta-modal .ReqLabel:before { 
908    content: "* "; 
909    color: #D90000; 
910 
911
912 
913#inputCarregarImagemOferta, .inputCarregarImagemOferta { 
914    display: none; 
915
916 
917#carregarImagem, .carregarImagem  { 
918    padding: 8px 24px; 
919    border: 1px solid #4ECD66; 
920    width: fit-content; 
921    transition: 250ms; 
922 
923
924 
925#carregarImagem:hover, .carregarImagem:hover { 
926    background-color: #4ECD66; 
927
928 
929.button-empty { 
930    border: solid 1px #4ECD66; 
931    padding: 8px 24px; 
932    color: #333244; 
933    transition: 250ms; 
934    font-weight: bold; 
935
936 
937.button-empty:hover { 
938    background-color: #4ECD66; 
939
940 
941.button-filled { 
942    background-color: #4ECD66; 
943    border: solid 1px #4ECD66; 
944    padding: 8px 24px; 
945    color: #333244; 
946    transition: 250ms; 
947    font-weight: bold; 
948
949 
950.button-filled:hover { 
951    background-color: transparent; 
952
953 
954#ofertaModal-l3, .ofertaModal-l3 { 
955    gap: 24px; 
956    display: flex; 
957    justify-content: flex-end; 
958    padding: 24px; 
959
960 
961.modal { 
962    padding: initial !important; 
963    border-radius: 4px !important; 
964    
965
966 
967.modal a.close-modal { 
968    display: none; 
969
970 
971#removerImagemOferta, .removerImagemOferta { 
972	background: none; 
973	border: none; 
974	outline: none; 
975	color: #5B5C61; 
976	font-size: 16px; 
977	font-weight: 900; 
978	line-height: 24px; 
979	letter-spacing: 0em; 
980	width: fit-content; 
981	margin-left: 16px; 
982
983 
984 
985@media(max-width: 964px){ 
986    .lista-pic img { 
987        width: 100%; 
988        max-height: unset; 
989        max-width: unset; 
990 
991
992
993 
994@media (max-width: 550px) { 
995    #ofertaModal-l2, .ofertaModal-l2 { 
996        display: flex; 
997        flex-direction: column; 
998
999 
1000    #ofertaModal-l3, .ofertaModal-l3 { 
1001        display: flex; 
1002        flex-direction: column; 
1003
1004
1005 
1006@media(max-width: 450px){ 
1007	.bioec-profile-oferta-main .lista-details{ 
1008		flex-direction: column; 
1009
1010 
1011	.lista-contato{ 
1012		text-align: center; 
1013
1014 
1015	.bioec-profile-oferta-main .lista-footnote{ 
1016	flex-direction: column; 
1017		gap: 10px; 
1018		align-items: flex-end; 
1019		text-align: right; 
1020
1021
1022 
1023@media(max-width: 992px){ 
1024	#oferta-lista-container { 
1025		padding-inline: 15px; 
1026
1027
1028 
1029.bioec-profile-oferta-main .lista-footnote .buttonsActions { 
1030  display: flex; 
1031  gap: 17px; 
1032
1033 
1034@media (max-width: 768px) { 
1035  .bioec-profile-oferta-main .lista-desc { 
1036    gap: 24px; 
1037    flex-direction: column-reverse; 
1038
1039  .bioec-profile-oferta-main .lista-footnote { 
1040    flex-direction: column; 
1041    align-items: center; 
1042
1043  .bioec-profile-oferta-main .lista-footnote > div { 
1044    text-align: center; 
1045
1046   
1047  .bioec-profile-oferta-main .lista-footnote .barra-pipe { 
1048    display: none; 
1049
1050  .bioec-profile-oferta-main .lista-footnote .lista-author { 
1051    display: flex; 
1052    gap: 4px; 
1053    justify-content: center; 
1054
1055  .bioec-profile-oferta-main .lista-footnote .buttonsActions { 
1056    width: 100%; 
1057    justify-content: space-between; 
1058
1059
1060 
1061 
1062</style> 
1063 
1064 
1065<script> 
1066 
1067 
1068 
1069</script> 
Publicações drop zone
An error occurred while processing the template.
Java method "com.sun.proxy.$Proxy890.getLatestArticle(long)" threw an exception when invoked on com.sun.proxy.$Proxy890 object "com.liferay.journal.service.impl.JournalArticleLocalServiceImpl@739dbb4a"; see cause exception in the Java stack trace.

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #assign journalArticle = JournalArtic...  [in template "334468#334509#689600" at line 16, column 41]
----
1<#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")> 
2<#assign UserLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.UserLocalService")> 
3<#assign AssetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")> 
4<#assign PortletFileRepositoryUtil = staticUtil["com.liferay.portal.kernel.portletfilerepository.PortletFileRepositoryUtil"] 
5	JSONFactoryUtil = staticUtil["com.liferay.portal.kernel.json.JSONFactoryUtil"] 
6    mbMessageLocalService = serviceLocator.findService("com.liferay.message.boards.service.MBMessageLocalService") 
7	tagsLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetTagLocalService") 
8	OrganizationLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.OrganizationLocalService") 
9
10 
11<script src="https://unpkg.com/imask"></script> 
12<div class="bioec-profile-post-main"> 
13	<div id="post-lista-container" class="d-flex flex-column"> 
14			<#if entries?has_content> 
15				<#list entries as entry> 
16					<#assign journalArticle = JournalArticleLocalService.getLatestArticle(entry.getClassPK()) > 
17					<#assign JournalArticleID = journalArticle.getId()> 
18          <#assign JournalArticleFrontId = journalArticle.getArticleId()> 
19                    <#assign tipoDePost = "" > 
20                    <#assign urlWC = ""> 
21					<#assign articleXml = journalArticle.getDocument().getRootElement()  
22									 userIsAdmin = false 
23									 orgId = "" 
24									 imagem = "" 
25									 autorId = "" 
26									 desc = "" 
27
28					<#assign tags = tagsLocalService.getTagNames("com.liferay.journal.model.JournalArticle", journalArticle.getResourcePrimKey()?number )  
29					     tagName = tags[0]!"" 
30						 orgOrUser = "" 
31						 link = "" 
32
33				  
34				<#if tagName?contains("organization") && tagName != "" > 
35					 <#assign orgOrUser = "org"> 
36				<#else> 
37					 <#assign orgOrUser = "user"> 
38				</#if> 
39				 
40					<#assign tituloDoPost = ""> 
41					 
42					<#if articleXml.selectSingleNode("dynamic-element[@name='Text33341198']")??> 
43					 
44                        <#assign tituloDoPost = articleXml.selectSingleNode("dynamic-element[@name='Text33341198']").getStringValue()!"" 
45                                    tituloDoPost = tituloDoPost?replace("\n\t\t", "") 
46                                    tituloDoPost = tituloDoPost?replace("\n\t", "")					 
47
48					 
49					</#if> 
50					 
51					<#if articleXml.selectSingleNode("dynamic-element[@name='RichText67646278']")??> 
52                        <#assign desc = articleXml.selectSingleNode("dynamic-element[@name='RichText67646278']").getStringValue()!"" 
53                                    desc = desc?replace("\n\t\t", "") 
54                                    desc = desc?replace("\n\t", "")						 
55
56					</#if> 
57					 
58					<#if articleXml.selectSingleNode("dynamic-element[@name='CampoDeTexto05403380']")??> 
59                        <#assign link = articleXml.selectSingleNode("dynamic-element[@name='CampoDeTexto05403380']").getStringValue()!"" 
60                                    link = link?replace("\n\t\t", "") 
61                                    link = link?replace("\n\t", "")						 
62
63													 
64					</#if> 
65				 
66					<#if articleXml.selectSingleNode("dynamic-element[@name='CampoDeTexto12713402']")??> 
67						<#assign imagem = articleXml.selectSingleNode("dynamic-element[@name='CampoDeTexto12713402']").getStringValue()!"" 
68										 imagem = imagem?replace("\n\t\t", "") 
69										 imagem = imagem?replace("\n\t", "")			 
70
71						<#--if imagem?? && imagem?trim != ""> 
72							<#assign  
73								jsonObject = JSONFactoryUtil.createJSONObject(imagem)  
74								fileEntryId = jsonObject.getLong("fileEntryId")	 
75
76							<#if fileEntryId != 0> 
77								<#assign 
78									fileEntry = PortletFileRepositoryUtil.getPortletFileEntry(fileEntryId) 
79									fileEntryURL = PortletFileRepositoryUtil.getDownloadPortletFileEntryURL(themeDisplay, fileEntry,"") 
80
81							</#if> 
82						</#if-->		 
83				    </#if> 
84				 
85					<#assign 	categorias = AssetCategoryLocalService.getCategoryNames(entry.getClassName(), entry.getClassPK())!""> 
86                    <#if  categorias?is_sequence> 
87                        <#if  categorias?seq_contains("Notícias")> 
88						    <#assign tipoDePost = "Notícia" > 
89                        </#if> 
90                        <#if  categorias?seq_contains("Notas Técnicas")> 
91						    <#assign tipoDePost = "Nota Técnica" > 
92                        </#if> 
93                        <#if  categorias?seq_contains("Artigos")> 
94						    <#assign tipoDePost = "Artigo" > 
95                        </#if> 
96                    </#if> 
97 
98		            
99					<#if articleXml.selectSingleNode("dynamic-element[@name='Text26813532']")??> 
100			        <#assign  
101						autorId = articleXml.selectSingleNode("dynamic-element[@name='Text26813532']").getStringValue()!"" 
102						autorId = autorId?replace("\n\t\t", "") 
103						autorId = autorId?replace("\n\t", "")		 
104
105						</#if> 
106			        <#assign  
107						autorArticleId = "" 
108						commentsCount = mbMessageLocalService.getDiscussionMessagesCount(entry.getClassName(), entry.getClassPK(), 0)!"0" 
109
110				<#if orgOrUser == "user" > 
111					<#if autorId != "" && autorId??> 
112                        <#assign 
113                            autor = UserLocalService.fetchUser(autorId?number)!"" 
114                            autorArticleId = autor.getExpandoBridge().getAttribute("journal-article")!"0"  
115                        /> 
116                        <#if autor != ""> 
117                            <#assign autor = autor.getFullName()!""> 
118                        <#else> 
119                            <#assign autor = "Anônimo" > 
120                        </#if> 
121                    <#else>  
122                        <#assign autor = "Anônimo" > 
123                    </#if>	 
124		 
125				 
126 
127				<#if autorArticleId != "0" && autorArticleId != "" && autor != "Anônimo"> 
128					<#assign autorArticle = JournalArticleLocalService.getLatestArticle(themeDisplay.getLayout().getGroupId(), autorArticleId?string) > 
129					<#assign urlWC = autorArticle.getUrlTitle()!""> 
130				</#if> 
131								 
132				</#if> 
133				  
134				<#if orgOrUser == "org" > 
135					<#assign orgId = tagName?keep_after("organization-")				 
136					organization =  OrganizationLocalService.fetchOrganization(orgId?number)!""> 
137					<#if organization != ""> 
138						<#assign	orgArticleId = organization.getExpandoBridge().getAttribute("journal-article") 
139							orgJournalArticle = JournalArticleLocalService.getArticle(themeDisplay.getLayout().getGroupId(),orgArticleId?c)  
140							urlWC = orgJournalArticle.getUrlTitle()!"" 
141							autor = organization.getName()!""> 
142					</#if> 
143				</#if> 
144				 
145				<#if themeDisplay.isSignedIn() > 
146							<#if tagName?contains("organization-")> 
147								<#assign userIsAdmin = OrganizationLocalService.hasUserOrganization(themeDisplay.getUserId(), orgId?number)> 
148								<#else> 
149								<#if autorId != ""> 
150									<#if autorId?number == themeDisplay.getUserId()> 
151									 
152										<#assign userIsAdmin = true> 
153									</#if> 
154								</#if> 
155							</#if> 
156							 
157						 
158				</#if> 
159							 
160 
161 
162				<div class="post-lista-item"> 
163                    <div class="lista-checkmark"> 
164                        <#if categorias?seq_contains("aprovado") > <i title="Aprovado" style="color: #4ECD66" class="fa-solid fa-circle-check"></i> </#if> 
165                        <#if categorias?seq_contains("pendente") >	<i title="Em análise" style="color: #D90000"class="fa-solid fa-spinner"></i> </#if> 
166                        <#if categorias?seq_contains("recusado") >	<i title="Recusado" style="color: #D90000"class="fa-solid fa-exclamation-circle"></i> </#if> 
167                         
168                    </div> 
169 
170					<div class="lista-titulo"> 
171						<h5>${tipoDePost}</h5> 
172					</div> 
173 
174					<div class="lista-arrow"> 
175						<button style="padding: 0;" class="btn" type="button" data-toggle="collapse" data-target="#collapseID${JournalArticleID}" aria-expanded="false" aria-controls="collapseID${JournalArticleID}"> 
176							<i class="fa-solid fa-chevron-down"></i> 
177						</button> 
178					</div> 
179 
180					<div class="lista-desc"> 
181					    <#if imagem?trim != "" > 
182							<div> 
183								<img src="${imagem}" /> 
184							</div> 
185						<#else> 
186							<div class="bioec_post_img_placeholder"> 
187								<i class="fa-solid fa-image"></i> 
188								sem imagem 
189							</div> 
190						</#if> 
191						<p>${tituloDoPost}</p> 
192					</div> 
193 
194					<div class="lista-collapse collapse" id="collapseID${JournalArticleID}"> 
195                        <#if desc !=""> 
196                            <div class="lista-details"> 
197                                <div class="lista-contato"> 
198                                    ${desc} 
199                                </div> 
200                            </div> 
201                        </#if> 
202					 
203						<#if categorias?seq_contains("recusado") > 
204							<div style="border-top: 1px solid #E8ECEF; font-weight: bold; padding-top: 24px;"> 
205							    <p>Conteúdo Em Análise Pelo Cetiqt:</p> 
206							    <p>Conteúdo recusado pelo CETIQT por violar as políticas de privacidade.</p> 
207							</div> 
208						</#if> 
209 
210						<div class="lista-footnote"> 
211								<div> 
212									<span class="post-type" style="text-transform: uppercase;">${tipoDePost}</span> <span class="barra-pipe"> | </span>  
213									<span class="lista-date">${journalArticle.getDisplayDate()?string('dd/MM/yyyy')}</span> | <span class="lista-commentNumber">${commentsCount} comentários</span> <span class="barra-pipe"> | </span> <span class="lista-author">Publicado por <a <#if urlWC != ''>href="/w/${urlWC}</#if>">${autor}</a></span> 
214								</div> 
215								<#if userIsAdmin> 
216									<div class="buttonsActions"> 
217                                        <div style="cursor: pointer;font-size: 16px;" data-toggle="modal" data-target="#modalEditPost${JournalArticleID}"> 
218                                                <i class="fa-solid fa-edit"></i> 
219                                        </div> 
220                                        <div style="cursor: pointer;font-size: 16px;" data-toggle="modal" data-target="#modal-post-${entry.getClassPK()}"> 
221                                                    <i class="fa-solid fa-trash-can"></i> 
222                                        </div> 
223									</div> 
224								</#if>		 
225						</div> 
226					</div> 
227				</div> 
228				 
229					 
230					<#if userIsAdmin> 
231						<div style="display: none;" id="modal-post-${entry.getClassPK()}" class="modal fade" role="dialog"> 
232							<div class="modal-dialog modal-lg" role="document"> 
233								<div class="modal-content"> 
234									<div class="modal-header" > 
235										<h4 class="m-0">Remover Publicação</h4> 
236										<button type="button" class="close" data-dismiss="modal" aria-label="Close"> 
237											<span aria-hidden="true"> 
238												<i class="fa-solid fa-close"></i> 
239											</span> 
240										</button>    
241									</div> 
242									<div class="modal-body"> 
243										<h5>Você tem certeza que deseja remover essa publicação?</h5> 
244										<div> 
245											Ao clicar em continuar, a publicação será removida do seu perfil. 
246										</div> 
247									</div> 
248									<div class="modal-footer justify-content-end"> 
249											<button class="bioec_secondary_button" data-dismiss="modal">CANCELAR</button> 
250											<button class="bioec_primary_button" type="button" onclick="excluirPost${JournalArticleID}()">CONTINUAR</button>  
251									</div> 
252								</div> 
253							</div>			 
254						</div> 
255						 
256						<#-- modal edição --> 
257						 
258					 
259			<div style="display: none" id="modalEditPost${JournalArticleID}" class="modal fade bioec-profile-edit-post-modal" role="dialog"> 
260                <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document"> 
261        <form class="form-group modal-content" id="formularioEditPost${JournalArticleID}"> 
262          <div id="editPostModal-l1${JournalArticleID}" class="editPostModal-l1 modal-header"> 
263            <h5>Editar ${tipoDePost}</h5> 
264            <button 
265              type="button" 
266              class="close" 
267              data-dismiss="modal" 
268              aria-label="Close" 
269
270              <span aria-hidden="true">&times;</span> 
271            </button> 
272          </div> 
273 
274          <div id="editPostModal-l2${JournalArticleID}" class="editPostModal-l2 modal-body"> 
275            <div id="editPostTitle${JournalArticleID}" class="postTitle"> 
276              <label class="reqLabel" for="editPostInputTitle${JournalArticleID}" 
277                >Título</label 
278
279              <input 
280                id="editPostInputTitle${JournalArticleID}" 
281                class="postInputTitle" 
282                type="text" 
283								value="${tituloDoPost}" 
284                placeholder="Inserir um título" 
285                required 
286              /> 
287            </div> 
288            <div id="editPostDesc${JournalArticleID}" class="postDesc"> 
289              <label class="reqLabel" for="editPostInputDesc${JournalArticleID}" 
290                >Texto principal</label 
291
292              <textarea 
293                id="editPostInputDesc${JournalArticleID}" 
294                class="postInputDesc" 
295                rows="7" 
296                style="border: 1px solid #bebebe" 
297                required 
298              >${desc}</textarea> 
299            </div> 
300 
301            <div id="editPostImg${JournalArticleID}" class="postImg"> 
302              <div style="display: flex; flex-direction: column; gap: 8px"> 
303                <label>Imagem de ${tipoDePost}</label> 
304                <label 
305                  class="btn carregarImagemPost" 
306                  id="carregarImagemPost${JournalArticleID}" 
307                  for="inputCarregarImagemPost${JournalArticleID}" 
308                  style="font-size: 16px; cursor: pointer" 
309                  >CARREGAR IMAGEM</label 
310
311                <input 
312                  id="inputCarregarImagemPost${JournalArticleID}" 
313                  class="inputCarregarImagemPost" 
314                  type="file" 
315                  accept="image/*" 
316                /> 
317                <input class="d-none inputPostBase64" id="inputPostBase64${JournalArticleID}" value="${imagem}" /> 
318                <button type="button" id="removerImagemPost${JournalArticleID}" class="removerImagemPost <#if imagem == "" || imagem?? == false> d-none </#if>"> 
319                  <i class="fa fa-trash"></i> Remover imagem 
320                </button> 
321								          
322              </div> 
323     <div id="imagemCarregadaPost${JournalArticleID}"  class="imagemCarregadaPost" style="background-image: url(${imagem})"></div> 
324            </div> 
325 
326            <div id="postLink${JournalArticleID}" class="postLink"> 
327              <label for="postInputLinkMoreInfo${JournalArticleID}">Link para saber mais</label> 
328              <small id="postLinkMoreInfo${JournalArticleID}" class="postLinkMoreInfo"> 
329                Espaço opcional para adicionar um link externo com mais 
330                informações sobre o assunto. 
331              </small> 
332              <input 
333                id="postInputLinkMoreInfo${JournalArticleID}" 
334                type="text" 
335                placeholder="Inserir link" 
336                aria-describedby="postLinkMoreInfo${JournalArticleID}" 
337								value="${link}" 
338              /> 
339            </div> 
340          </div> 
341          <div class="importantText"> 
342            <p> 
343              Importante: O conteúdo enviado passará por um processo interno de 
344              aprovação. Só então o conteúdo adicionado aparecerá no portal. 
345            </p> 
346          </div> 
347          <div id="editPostModal-l3${JournalArticleID}" class="editPostModal-l3 modal-footer"> 
348            <button class="btn button-empty" id="editPost-saveAndClose${JournalArticleID}"> 
349              SALVAR E FECHAR 
350            </button> 
351          </div> 
352        </form> 
353      </div> 
354    </div> 
355	 
356				  
357						</#if> 
358					 
359						 
360						<script> 
361                        <#if userIsAdmin> 
362      function validImageSize(base64 = "") { 
363  const decoded = atob(base64.substring(base64.indexOf(",") + 1)); 
364  const sizeMB = decoded.length / 1e6; 
365  console.log("MB: " + decoded.length / 1e6); 
366  if (sizeMB > 10) { 
367       Liferay.Util.openToast({ 
368          message: "O tamanho da imagem não deve ultrapassar 10 MB.", 
369           type: "danger", 
370           title: "", 
371           toastProps: { 
372               autoClose: 5000 
373
374       }) 
375    return false; 
376
377  return true; 
378
379 
380 
381 
382 
383 
384function editPost${JournalArticleID}() { 
385   Liferay.Util.openToast({ 
386     message: "Enviando requisição", 
387     type: "info", 
388     title: "", 
389   }); 
390  $("#editPost-saveAndClose").prop("disabled", true); 
391 
392  const postData = { 
393    "titulo": document.getElementById("editPostInputTitle${JournalArticleID}").value, 
394    "conteudo": document.getElementById("editPostInputDesc${JournalArticleID}").value, 
395    "imagem": document.getElementById("inputPostBase64${JournalArticleID}").value, 
396    "link": document.getElementById("postInputLinkMoreInfo${JournalArticleID}").value, 
397  }; 
398 
399console.log(postData); 
400  
401 
402   fetch(Liferay.ThemeDisplay.getPortalURL() + "/o/postagem/${JournalArticleFrontId}", { 
403     method: "PUT", 
404     headers: { 
405       "x-csrf-token": Liferay.authToken, 
406       "Content-Type": "application/json", 
407     }, 
408     body: JSON.stringify(postData), 
409   }).then((res) => { 
410	 console.log(res); 
411     if (res.status == 200) { 
412       Liferay.Util.openToast({ 
413         message: 
414           "Publicação editada com sucesso. Após a submissão, será iniciado o processo interno de aprovação do conteúdo enviado. Só então o conteúdo submetido aparecerá no portal.", 
415         type: "success", 
416         title: "", 
417         toastProps: { 
418           autoClose: 5000, 
419         }, 
420       }); 
421 
422 
423        
424         document.getElementById("formularioEditPost${JournalArticleID}").reset(); 
425         document.getElementById("imagemCarregadaPost${JournalArticleID}").style.backgroundImage = 
426          ""; 
427        
428     } else { 
429      Liferay.Util.openToast({ 
430         message: "Erro ao adicionar Artigo", 
431         type: "danger", 
432         title: "", 
433         toastProps: { 
434           autoClose: 5000, 
435         }, 
436       }); 
437
438 
439   }); 
440 
441   
442    setTimeout(function () { 
443      location.reload(); 
444    }, 2000); 
445   
446
447 
448function encodeEditImageAsURL${JournalArticleID}() { 
449  let file = document.getElementById("inputCarregarImagemPost${JournalArticleID}").files[0]; 
450  let reader = new FileReader(); 
451  reader.onloadend = () => { 
452    if (reader.result) { 
453      if (!validImageSize(reader.result)) return; 
454      try { 
455        const pic_container = document.getElementById("imagemCarregadaPost${JournalArticleID}"); 
456        const base64_input = document.getElementById("inputPostBase64${JournalArticleID}"); 
457        base64_input.value = reader.result; 
458        pic_container.style.backgroundImage = "url(" + reader.result + ")"; 
459 
460        const removeImageButton = document.getElementById( 
461          "removerImagemPost${JournalArticleID}" 
462        ); 
463        removeImageButton.classList.remove("d-none"); 
464      } catch (error) { 
465        console.error(error); 
466
467
468  }; 
469  reader.readAsDataURL(file); 
470
471 
472document 
473  .querySelector("#formularioEditPost${JournalArticleID}") 
474  .addEventListener("submit", (event) => { 
475    event.preventDefault(); 
476    editPost${JournalArticleID}(); 
477  }); 
478 
479function removeImagemPost${JournalArticleID}() { 
480  try { 
481    const file_input = document.getElementById("inputCarregarImagemPost${JournalArticleID}"); 
482    const pic_container = document.getElementById("imagemCarregadaPost${JournalArticleID}"); 
483    const base64_input = document.getElementById("inputPostBase64${JournalArticleID}"); 
484    file_input.value = null; 
485    base64_input.value = ""; 
486    pic_container.style.backgroundImage = null; 
487 
488    const removeImageButton = document.getElementById("removerImagemPost${JournalArticleID}"); 
489    removeImageButton.classList.add("d-none"); 
490  } catch (error) { 
491    console.error(error); 
492
493
494 
495document 
496  .getElementById("removerImagemPost${JournalArticleID}") 
497  .addEventListener("click", removeImagemPost${JournalArticleID}); 
498 
499 
500document 
501  .getElementById("inputCarregarImagemPost${JournalArticleID}") 
502  .addEventListener("change", encodeEditImageAsURL${JournalArticleID}); 
503   
504						 
505						function excluirPost${JournalArticleID}() { 
506								Liferay.Util.openToast({message: "Enviando requisição",type: "info",title: ""}); 
507								fetch(Liferay.ThemeDisplay.getPortalURL() + "/o/postagem/${JournalArticleFrontId}", { 
508									method: 'DELETE', 
509									"headers": { 
510										"x-csrf-token": Liferay.authToken, 
511										"Content-Type": "application/json" 
512
513								}) 
514								.then(res => { 
515									if(res.status == 200) { 
516										Liferay.Util.openToast({ 
517												message: "Publicação excluida com sucesso", 
518												type: "success", 
519												title: "", 
520												toastProps: { 
521														autoClose: 5000 
522
523										}) 
524										setTimeout(function(){ location.reload(); }, 2000) 
525									} else { 
526										Liferay.Util.openToast({ 
527												message: "Erro ao excluir publicação", 
528												type: "danger", 
529												title: "", 
530												toastProps: { 
531														autoClose: 5000 
532
533										}) 
534
535								}); 
536
537							 
538							 
539								</#if> 
540								 
541								 
542 
543								var button = document.querySelector('[data-target="#collapseID${JournalArticleID}"]'); 
544 
545								var chevron = button.querySelector("i.fa-solid"); 
546 
547								button.addEventListener("click", function () { 
548									if (chevron.classList.contains("fa-chevron-up")) { 
549										chevron.classList.remove("fa-chevron-up"); 
550										chevron.classList.add("fa-chevron-down"); 
551									} else { 
552										chevron.classList.remove("fa-chevron-down"); 
553										chevron.classList.add("fa-chevron-up"); 
554
555      }); 
556 
557 
558 
559 
560						</script> 
561					 
562				 
563				 
564				 
565			</#list> 
566		</#if> 
567	</div> 
568</div> 
569 
570<style> 
571.bioec_post_img { 
572    overflow: hidden; 
573		background-size: contain; 
574    background-position: center; 
575    background-repeat: no-repeat; 
576
577 
578.bioec_post_img_placeholder { 
579    width: 140px; 
580    height: 140px; 
581    background-color: #E8ECEF; 
582    display: flex; 
583    flex-direction: column; 
584    align-items: center; 
585    justify-content: center; 
586    font-size: 14px; 
587    color: #5B5C61; 
588
589 
590.bioec_post_img_placeholder i { 
591    font-size: 44px; 
592
593 
594 
595.pagination-items-per-page.active > a,  
596.pagination-items-per-page.active > button,  
597.pagination-items-per-page.show > a,  
598.pagination-items-per-page.show > button, 
599.page-item.active .page-link,  
600.page-item.show .page-link{ 
601    border-color: #4ECD66; 
602    background-color: #4ECD66; 
603
604 
605.pagination-results, 
606.pagination-items-per-page > a,  
607.pagination-items-per-page > button, 
608.pagination-items-per-page > a:hover,  
609.pagination-items-per-page > button:hover, 
610.page-link{ 
611	color: #4ebe66; 
612
613 
614.bioec-profile-post-main{ 
615	display: flex; 
616	gap: 40px; 
617	flex-direction: column; 
618	padding-bottom: 20px; 
619
620.bioec-profile-post-main h5{ 
621	font-weight: 700; 
622
623.bioec-profile-post-main h5, .bioec-profile-post-main p{ 
624	color: #5B5C61; 
625	margin-bottom: 0px; 
626	font-size: 16px; 
627 
628
629 
630.bioec-profile-post-main #post-lista-container>div{ 
631	border: 1px #BEBEBE solid;  
632	padding: 24px 24px 0 24px; 
633	margin-bottom: 40px; 
634	display: grid; 
635	grid-row-gap: 24px; 
636	grid-template-columns: 24px 12px 1fr 15px; 
637	grid-template-areas:  
638		"ck . tit arrw" 
639		"desc desc desc desc" 
640		"clps clps clps clps"; 
641
642 
643.bioec-profile-post-main .lista-checkmark { grid-area: ck; } 
644.bioec-profile-post-main .lista-checkmark i { 
645  font-size: 24px; 
646
647 
648.bioec-profile-post-main .lista-pic { grid-area: pic; display: flex; justify-content: center;} 
649.bioec-profile-post-main .lista-arrow { grid-area: arrw; } 
650 
651.bioec-profile-post-main .lista-titulo {  
652	grid-area: tit;  
653	display: flex;  
654	flex-direction: column; 
655	justify-content: center; 
656	 
657
658 
659.bioec-profile-post-main .lista-titulo h5{ 
660	margin-bottom: 0px; 
661  font-weight: 400; 
662  font-size: 16px; 
663  line-height: 150%; 
664  text-transform: uppercase; 
665}  
666 
667.bioec-profile-post-main .lista-desc { 
668grid-area: desc;  
669display: flex; 
670  align-items: center; 
671  gap: 46px; 
672}  
673 
674.bioec-profile-post-main .lista-desc > div { 
675  height: 138px; 
676
677 
678.bioec-profile-post-main .lista-desc img { 
679  height: 100%; 
680
681 
682.bioec-profile-post-main .lista-desc p { 
683  margin: 0; 
684  font-weight: 700; 
685font-size: 16px; 
686line-height: 150%; 
687
688 
689.bioec-profile-post-main a{ 
690	color: #5B5C61; 
691
692 
693.post-port{ 
694	border: 1px #BEBEBE solid;  
695	padding: 24px; 
696	display: flex; 
697	flex-direction: column; 
698	align-items: center; 
699	gap: 24px; 
700
701 
702.post-port p{ 
703text-align: center;	 
704	 
705
706 
707.post-port div{ 
708display: flex; 
709	justify-content: space-between; 
710	width: min(558px, 100%); 
711
712 
713.button-empty { 
714border: solid 1px #4ECD66; 
715padding: 8px 24px; 
716color: #333244; 
717	transition: 250ms; 
718
719 
720.button-empty:hover{ 
721	background-color: #4ECD66; 
722
723 
724.button-filled { 
725background-color: #4ECD66; 
726border: solid 1px #4ECD66; 
727padding: 8px 24px; 
728color: #333244; 
729transition: 250ms; 
730	 
731
732 
733.button-filled:hover{ 
734	background-color: transparent; 
735
736 
737.bioec-profile-post-main .lista-footnote {  
738 
739	display: flex; 
740	justify-content: space-between; 
741	border-top: 1px solid #E8ECEF; 
742	padding-top: 12px; 
743	font-size: 14px; 
744	font-weight: 300; 
745	gap: 15px; 
746	color: #5B5C61; 
747 
748
749.lista-collapse{ 
750display: flex; 
751flex-direction: column; 
752gap: 24px; 
753grid-area: clps; 
754padding-bottom: 24px; 
755
756 
757 .lista-details{ 
758	display: flex; 
759	justify-content: flex-start; 
760	gap: 24px; 
761	color: #5B5C61; 
762
763.lista-pic img { 
764	max-height: 138px; 
765	max-width: 138px; 
766
767 
768.bioec-profile-post-main p{ 
769 
770
771 
772.imagemCarregadaPost { 
773	height: 100px; 
774	width: 100px; 
775	background-size: contain; 
776	background-position: center; 
777	background-repeat: no-repeat; 
778
779 
780 
781.ButtonAddPost { 
782    background: #4ECD66; 
783    border-radius: 8px; 
784    padding: 8px 24px; 
785    border: none; 
786    font-weight: 700; 
787    color: #333244; 
788    font-family: 'Roboto'; 
789    float: right; 
790    text-transform: uppercase; 
791
792.ButtonAddPost:hover{ 
793	color: #333244; 
794	text-decoration: none; 
795
796 
797.bioec-profile-post-modal label { 
798    margin: 0; 
799    cursor: default; 
800    font-size: 20px; 
801    font-weight: 700; 
802    color: #5B5C61; 
803
804 
805.bioec-profile-post-modal div { 
806    width: 100%; 
807
808 
809#postModal-l1, .postModal-l1 { 
810    padding: 18px 24px; 
811    display: flex; 
812    justify-content: space-between; 
813
814 
815#postModal-l1 img, .postModal-l1 img { 
816    cursor: pointer; 
817
818 
819#postModal-l1 h5, .postModal-l1 h5 { 
820   	margin: 0; 
821    font-size: 20px; 
822    font-weight: 700; 
823    color: #5B5C61; 
824
825 
826#postModal-l2, .postModal-l2 { 
827		border-top: 1px solid #E8ECEF; 
828    display: grid; 
829    grid-template-columns: 1fr 1fr; 
830    grid-template-areas: 
831        "titu nome" 
832        "fone mail" 
833        "desc desc" 
834        "imagem ." 
835
836    column-gap: 24px; 
837    row-gap: 40px; 
838    padding: 24px; 
839
840 
841#postModal-l2>div, .postModal-l2>div { 
842    display: flex; 
843    flex-direction: column; 
844    gap: 8px; 
845
846 
847#postTitle, .postTitle { 
848    grid-area: titu; 
849
850 
851#postName, .postName { 
852    grid-area: nome; 
853
854 
855#postTelephone, .postTelephone { 
856    grid-area: fone; 
857
858 
859#postEmail, .postEmail { 
860    grid-area: mail; 
861
862 
863#postBrand, .postBrand { 
864    grid-area: marca; 
865
866 
867#postModal-l2>#postImg, .editPostModal-l2>.postImg { 
868    grid-area: imagem; 
869    display: flex; 
870    flex-direction: row; 
871
872 
873#postDesc, .postDesc { 
874    grid-area: desc; 
875 
876
877 
878#postDesc input, .postDesc input { 
879    height: 80px; 
880
881 
882.TextImportant{ 
883    border-bottom: 1px solid #E8ECEF; 
884 		padding: 24px; 
885		color: #5B5C61;		 
886
887 
888.bioec-profile-post-modal input[type="text"] { 
889    border-top: none; 
890    border-left: none; 
891    border-right: none; 
892    border-bottom: 1px solid #BEBEBE; 
893    width: 100%; 
894    font-size: 16px; 
895 
896
897 
898 
899.bioec-profile-post-modal input[type="text"]:focus-visible { 
900    outline: none; 
901    border-bottom: 1px solid black; 
902 
903
904 
905.bioec-profile-post-modal .ReqLabel:before { 
906    content: "* "; 
907    color: #D90000; 
908 
909
910 
911#inputCarregarImagemPost, .inputCarregarImagemPost { 
912    display: none; 
913
914 
915#carregarImagem, .carregarImagem  { 
916    padding: 8px 24px; 
917    border: 1px solid #4ECD66; 
918    width: fit-content; 
919    transition: 250ms; 
920 
921
922 
923#carregarImagem:hover, .carregarImagem:hover { 
924    background-color: #4ECD66; 
925
926 
927.button-empty { 
928    border: solid 1px #4ECD66; 
929    padding: 8px 24px; 
930    color: #333244; 
931    transition: 250ms; 
932    font-weight: bold; 
933
934 
935.button-empty:hover { 
936    background-color: #4ECD66; 
937
938 
939.button-filled { 
940    background-color: #4ECD66; 
941    border: solid 1px #4ECD66; 
942    padding: 8px 24px; 
943    color: #333244; 
944    transition: 250ms; 
945    font-weight: bold; 
946
947 
948.button-filled:hover { 
949    background-color: transparent; 
950
951 
952#postModal-l3, .postModal-l3 { 
953    gap: 24px; 
954    display: flex; 
955    justify-content: flex-end; 
956    padding: 24px; 
957
958 
959.modal { 
960    padding: initial !important; 
961    border-radius: 4px !important; 
962    
963
964 
965.modal a.close-modal { 
966    display: none; 
967
968 
969#removerImagemPost, .removerImagemPost { 
970	background: none; 
971	border: none; 
972	outline: none; 
973	color: #5B5C61; 
974	font-size: 16px; 
975	font-weight: 900; 
976	line-height: 24px; 
977	letter-spacing: 0em; 
978	width: fit-content; 
979	margin-left: 16px; 
980
981 
982 
983@media(max-width: 964px){ 
984    .lista-pic img { 
985        width: 100%; 
986        max-height: unset; 
987        max-width: unset; 
988 
989
990
991 
992@media (max-width: 550px) { 
993    #postModal-l2, .postModal-l2 { 
994        display: flex; 
995        flex-direction: column; 
996
997 
998    #postModal-l3, .postModal-l3 { 
999        display: flex; 
1000        flex-direction: column; 
1001
1002
1003 
1004@media(max-width: 450px){ 
1005	.bioec-profile-post-main .lista-details{ 
1006		flex-direction: column; 
1007
1008 
1009	.lista-contato{ 
1010		text-align: center; 
1011
1012 
1013	.bioec-profile-post-main .lista-footnote{ 
1014	flex-direction: column; 
1015		gap: 10px; 
1016		align-items: flex-end; 
1017		text-align: right; 
1018
1019
1020 
1021 
1022 
1023  
1024 
1025 .bioec-profile-edit-post-modal label { 
1026  margin: 0; 
1027  cursor: default; 
1028  font-size: 20px; 
1029  font-weight: 700; 
1030  color: #5b5c61; 
1031
1032 
1033 .bioec-profile-edit-post-modal small { 
1034  font-weight: 300; 
1035  font-size: 14px; 
1036  line-height: 150%; 
1037  color: #5b5c61; 
1038  margin-top: -4px; 
1039
1040 
1041 .bioec-profile-edit-post-modal div { 
1042  /* width: 100%; */ 
1043
1044 
1045 #editPostModal-l1, .editPostModal-l1 { 
1046  padding: 18px 24px; 
1047  display: flex; 
1048  justify-content: space-between; 
1049
1050 
1051 #editPostModal-l1 h5, .editPostModal-l1 h5 { 
1052  line-height: 150%; 
1053  margin: 0; 
1054  font-size: 20px; 
1055  font-weight: 700; 
1056  color: #5b5c61; 
1057
1058 
1059 #editPostModal-l2, .editPostModal-l2 { 
1060  padding: 24px; 
1061
1062 
1063 #editPostModal-l2 > div, .editPostModal-l2 > div { 
1064  display: flex; 
1065  flex-direction: column; 
1066  gap: 8px; 
1067 margin-bottom: 40px; 
1068
1069 
1070 #editPostModal-l2 > div:last-child, .editPostModal-l2 > div:last-child { 
1071  margin-bottom: -4px; 
1072
1073 
1074 #editPostModal-l2 > #editPostImg, .editPostModal-l2 > .editPostImg { 
1075  /* grid-area: imagem; */ 
1076  display: flex; 
1077  flex-direction: row; 
1078
1079 
1080 .importantText { 
1081  padding: 24px; 
1082  color: #5b5c61; 
1083
1084 
1085 .importantText p { 
1086  margin-bottom: 0; 
1087
1088 
1089 .bioec-profile-edit-post-modal input[type="text"] { 
1090  border-top: none; 
1091  border-left: none; 
1092  border-right: none; 
1093  border-bottom: 1px solid #bebebe; 
1094  width: 100%; 
1095  font-size: 16px; 
1096
1097 
1098 
1099  .bioec-profile-edit-post-modal 
1100  input[type="text"]:focus-visible { 
1101  outline: none; 
1102  border-bottom: 1px solid black; 
1103
1104 
1105 .bioec-profile-edit-post-modal .reqLabel:before { 
1106  content: "* "; 
1107  color: #d90000; 
1108
1109 
1110 #imagemCarregadaPost, .imagemCarregadaPost { 
1111  height: 110px; 
1112  width: 110px; 
1113  margin-left: 3rem; 
1114  background-size: contain; 
1115  background-position: center; 
1116  background-repeat: no-repeat; 
1117
1118 
1119 #removerImagemPost, .removerImagemPost { 
1120  background: none; 
1121  cursor: pointer; 
1122  border: none; 
1123  outline: none; 
1124  color: #5b5c61; 
1125  font-size: 16px; 
1126  font-weight: 900; 
1127  line-height: 24px; 
1128  letter-spacing: 0em; 
1129  width: fit-content; 
1130  margin-left: 16px; 
1131
1132 
1133 #inputCarregarImagemPost, .inputCarregarImagemPost { 
1134  display: none; 
1135
1136 
1137 #carregarImagemPost, .carregarImagemPost { 
1138  padding: 8px 24px; 
1139  border: 1px solid #4ecd66; 
1140  width: fit-content; 
1141  transition: 250ms; 
1142  border-radius: 8px; 
1143
1144 
1145 #carregarImagemPost:hover, .carregarImagemPost:hover { 
1146  background-color: #4ecd66; 
1147
1148 
1149 .button-empty { 
1150  border: solid 1px #4ecd66; 
1151  padding: 8px 24px; 
1152  color: #333244; 
1153  transition: 250ms; 
1154  font-weight: bold; 
1155
1156 
1157 .button-empty:hover { 
1158  background-color: #4ecd66; 
1159
1160 
1161 .button-filled { 
1162  background-color: #4ecd66; 
1163  border: solid 1px #4ecd66; 
1164  padding: 8px 24px; 
1165  color: #333244; 
1166  transition: 250ms; 
1167  font-weight: bold; 
1168
1169 
1170 .button-filled:hover { 
1171  background-color: transparent; 
1172
1173 
1174 #editPostModal-l3, .editPostModal-l3 { 
1175  gap: 24px; 
1176  display: flex; 
1177  justify-content: flex-end; 
1178  padding: 15px; 
1179
1180 
1181 #editPostModal-l3 button, .editPostModal-l3 button { 
1182  text-transform: uppercase; 
1183  border-radius: 8px; 
1184
1185 
1186@media (max-width: 550px) { 
1187   #editPostModal-l2, .editPostModal-l2  { 
1188    display: flex; 
1189    flex-direction: column; 
1190
1191 
1192   #editPostModal-l3, .editPostModal-l3 { 
1193    display: flex; 
1194    flex-direction: column; 
1195
1196
1197 
1198 /* .modal { 
1199  padding: initial !important; 
1200  border-radius: 4px !important; 
1201  height: initial !important; 
1202
1203 
1204 .modal a.close-modal { 
1205  display: none; 
1206} */ 
1207 
1208/* final */ 
1209.bioec-profile-post-main .lista-footnote .buttonsActions { 
1210  display: flex; 
1211  gap: 17px; 
1212
1213 
1214@media (max-width: 992px) { 
1215  #post-lista-container { 
1216    padding-inline: 15px; 
1217
1218
1219 
1220@media (max-width: 768px) { 
1221  .bioec-profile-post-main .lista-desc { 
1222    gap: 24px; 
1223    flex-direction: column-reverse; 
1224
1225  .bioec-profile-post-main .lista-footnote { 
1226    flex-direction: column; 
1227    align-items: center; 
1228
1229  .bioec-profile-post-main .lista-footnote > div { 
1230    text-align: center; 
1231
1232  .bioec-profile-post-main .lista-footnote .post-type, 
1233  .bioec-profile-post-main .lista-footnote .barra-pipe { 
1234    display: none; 
1235
1236  .bioec-profile-post-main .lista-footnote .lista-author { 
1237    display: flex; 
1238    gap: 4px; 
1239    justify-content: center; 
1240
1241  .bioec-profile-post-main .lista-footnote .buttonsActions { 
1242    width: 100%; 
1243    justify-content: space-between; 
1244
1245
1246 
1247 
1248</style> 
  • Sobre
  • Organizações
  • Demandas
  • Ofertas
  • Publicações
Category
Tag
Rua Fernando de Souza Barros,120.Cidade
Universitária – Rio de Janeiro – RJCEP: 21941-857
+55 21 2582-1001
portaldebioeconomia@cetiqt.senai.br