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