Virada Investidora de Teste
Organização
Virada Investidora de Teste
The following has evaluated to null or missing: ==> organization.getExpandoBridge().getAttribute("journal-article") [in template "34764#34807#null" at line 23, column 21] ---- Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: articleId = organization.getExpandoBr... [in template "34764#34807#null" at line 23, column 9] ----
1<#assign
2 OrganizationLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.OrganizationLocalService")
3 JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")
4/>
5
6<#assign
7 viewerHasPrivileges = false
8 userId = themeDisplay.getUserId()
9/>
10
11<#if userId?? >
12 <#assign
13 orgId = _CUSTOM_FIELD_organization.getData()?number
14 viewerHasPrivileges = OrganizationLocalService.hasUserOrganization(userId, orgId)
15 organization = OrganizationLocalService.getOrganization(orgId)
16 />
17</#if>
18
19
20<#if viewerHasPrivileges || DDMStructure_Field04200031.getData() != "0">
21<#assign
22 organization = OrganizationLocalService.getOrganization(_CUSTOM_FIELD_organization.getData()?number)
23 articleId = organization.getExpandoBridge().getAttribute("journal-article")
24 journalArticle = JournalArticleLocalService.getArticle(themeDisplay.getLayout().getGroupId(),articleId?c)
25 articleXml = journalArticle.getDocument().getRootElement()
26
27 setores = articleXml.selectNodes("dynamic-element[@name='Text67772680']")
28/>
29<#else>
30<#assign setores = ["privado"] />
31</#if>
32
33<#assign
34
35 sobre = (viewerHasPrivileges || DDMStructure_Field80037203.getData()!="0")?string(DDMStructure_Text54730891.getData()!"","")
36 competencias = (viewerHasPrivileges || DDMStructure_Field75645729.getData()!="0")?string(DDMStructure_Text51537691.getData()!"","")
37
38>
39
40<div>
41
42 <#if viewerHasPrivileges || DDMStructure_Field80037203.getData()!="0" >
43 <div class="bioec_org_sobre">
44 <label>Sobre a organização</label>
45 <div class="bioec_org_sobre_container">
46 <#if sobre != "">
47 ${sobre}
48 <#else>
49 <div class="bioec_org_sobre_vazio">
50 Nenhuma descrição foi adicionada neste perfil ainda
51 </div>
52 </#if>
53 </div>
54 </div>
55 </#if>
56
57 <#if viewerHasPrivileges || DDMStructure_Field75645729.getData()!="0" >
58 <div class="bioec_org_sobre">
59 <label>Competências tecnológicas</label>
60 <div class="bioec_org_sobre_container">
61 <#if competencias != "">
62 ${competencias}
63 <#else>
64 <div class="bioec_org_sobre_vazio">
65 Nenhuma descrição foi adicionada neste perfil ainda
66 </div>
67 </#if>
68 </div>
69 </div>
70 </#if>
71
72 <#if viewerHasPrivileges || DDMStructure_Field04200031.getData()!="0" >
73 <div class="bioec_org_sobre">
74 <label>Setor(es) de atuação</label>
75 <div class="bioec_org_sobre_container">
76 <#if setores[0]!="privado">
77 <#if setores?size == 1 && setores[0].getStringValue()?trim == "" >
78 <div class="bioec_org_sobre_vazio">
79 Nenhum setor foi adicionado neste perfil ainda
80 </div>
81 <#else>
82 <#if setores?size != 0 >
83 <ul>
84 <#list setores as setor>
85 <li>${setor.getStringValue()}</li>
86 </#list>
87 </ul>
88 <#else>
89 <div class="bioec_org_sobre_vazio">
90 Nenhum setor foi adicionado neste perfil ainda
91 </div>
92 </#if>
93 </#if>
94 <#else>
95 <div class="bioec_org_sobre_vazio">
96 Nenhum setor foi adicionado neste perfil ainda
97 </div>
98 </#if>
99 </div>
100 </div>
101 </#if>
102
103</div>
104
105<style>
106.bioec_org_sobre label {
107 color: #5B5C61;
108 font-weight: 700;
109 margin-bottom: 10px;
110 font-size: 20px;
111 line-height: 30px;
112}
113
114.bioec_org_sobre_container {
115 font-size: 16px;
116 border: 1px solid #BEBEBE;
117 padding: 24px;
118 color: #5B5C61;
119 margin-bottom: 40px;
120}
121
122.bioec_org_sobre_vazio {
123 color: #5B5C61;
124 font-size: 16px;
125 text-align: center;
126 font-weight: 700;
127}
128
129.bioec_org_sobre_container ul {
130 color: #5B5C61;
131 margin: 0;
132}
133</style>
The following has evaluated to null or missing: ==> autorId [in template "34764#34807#41130" at line 84, column 46] ---- Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #if autorId != "" && autorId?? [in template "34764#34807#41130" at line 84, 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 OrganizationLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.OrganizationLocalService") >
5<#assign AssetTagLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetTagLocalService")>
6<#-- <#assign
7journalArticle = JournalArticleLocalService.getArticle(themeDisplay.getSiteGroupId(),.data_model["reserved-article-id"].data)
8AssetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService")
9assetEntry = AssetEntryLocalService.getEntry(journalArticle.getModelClassName(), journalArticle.getResourcePrimKey())
10-->
11<#assign
12mbMessageLocalService = serviceLocator.findService("com.liferay.message.boards.service.MBMessageLocalService")
13>
14
15<div id="upload-notice-container" style="display: none;">
16 <span id="close-btn-upload-container"> <i class="fa fa-xmark"></i> </span>
17 <h5 class="upload-notice-title">
18 <i class="fa-sharp fa-solid fa-circle-exclamation"></i>
19 Upload de infraestrutura em andamento
20 </h5>
21 <p>
22 Caso os itens adicionados não estejam visíveis na página, aguarde um instante e <span>atualize a página</span> para visualizá-los.
23 </p>
24 </div>
25
26<div class="bioec-profile-estrutura-main">
27
28 <div id="estruturas-lista" class="d-flex flex-column">
29
30 <#if entries?has_content>
31 <#list entries as entry>
32
33 <#assign journalArticle = JournalArticleLocalService.getLatestArticle(entry.getClassPK()) >
34 <#assign articleXml = journalArticle.getDocument().getRootElement() >
35 <#assign JournalArticleID = journalArticle.getId()>
36 <#assign JournalArticleFrontId = journalArticle.getArticleId()>
37 <#assign
38 userIsAdmin = false
39 orgId = ""
40 >
41 <#if articleXml.selectSingleNode("dynamic-element[@field-reference='Text57816561']")??>
42 <#assign
43 modelo = articleXml.selectSingleNode("dynamic-element[@field-reference='Text57816561']").getStringValue()!""
44 modelo = modelo?replace("\n\t\t", "")
45 modelo = modelo?replace("\n\t", "")
46 >
47 </#if>
48
49 <#if articleXml.selectSingleNode("dynamic-element[@field-reference='Text23707291']")??>
50 <#assign
51 marca = articleXml.selectSingleNode("dynamic-element[@field-reference='Text23707291']").getStringValue()!""
52 marca = marca?replace("\n\t\t", "")
53 marca = marca?replace("\n\t", "")
54 >
55 </#if>
56
57 <#if articleXml.selectSingleNode("dynamic-element[@field-reference='Text74754192']")??>
58 <#assign
59 funcao = articleXml.selectSingleNode("dynamic-element[@field-reference='Text74754192']").getStringValue()!""
60 funcao = funcao?replace("\n\t\t", "")
61 funcao = funcao?replace("\n\t", "")
62 >
63 </#if>
64
65 <#if articleXml.selectSingleNode("dynamic-element[@field-reference='CampoDeTexto02890219']")??>
66 <#assign
67 imageSrc = articleXml.selectSingleNode("dynamic-element[@field-reference='CampoDeTexto02890219']").getStringValue()!""
68
69 >
70 </#if>
71
72 <#if articleXml.selectSingleNode("dynamic-element[@field-reference='Text93109394']")??>
73 <#assign
74 autorId = articleXml.selectSingleNode("dynamic-element[@field-reference='Text93109394']").getStringValue()!""
75 autorId = autorId?replace("\n\t\t", "")
76 autorId = autorId?replace("\n\t", "")
77 autorArticleId = ""
78 >
79 </#if>
80 <#assign
81 commentsCount = mbMessageLocalService.getDiscussionMessagesCount(entry.getClassName(), entry.getClassPK(), 0)!"0"
82 />
83
84 <#if autorId != "" && autorId??>
85 <#assign
86 autor = UserLocalService.fetchUser(autorId?number)!""
87 autorArticleId = autor.getExpandoBridge().getAttribute("journal-article")!"0"
88 />
89 <#if autor != "">
90 <#assign autor = autor.getFullName()!"">
91 <#else>
92 <#assign autor = "Anônimo" >
93 </#if>
94 <#else>
95 <#assign autor = "Anônimo" >
96 </#if>
97
98 <#assign categorias = AssetCategoryLocalService.getCategoryNames(entry.getClassName(), entry.getClassPK())!"" >
99
100 <#assign categorias = AssetCategoryLocalService.getCategoryNames(entry.getClassName(), entry.getClassPK())!"" >
101
102 <#assign urlWC = "">
103 <#if autorArticleId != "0" && autorArticleId != "" && autor != "Anônimo">
104 <#assign autorArticle = JournalArticleLocalService.getLatestArticle(themeDisplay.getLayout().getGroupId(), autorArticleId?string) >
105 <#assign urlWC = autorArticle.getUrlTitle()!"">
106 </#if>
107
108
109 <#assign tags = AssetTagLocalService.getTagNames("com.liferay.journal.model.JournalArticle", journalArticle.getResourcePrimKey()?number )
110 tagName = tags[0]!""
111
112 >
113 <#if tagName?contains("organization") && tagName != "" >
114
115 <#assign
116 orgId = tagName?keep_after("organization-")
117 organization = OrganizationLocalService.fetchOrganization(orgId?number)!""
118 >
119
120
121 <#if organization != "" && autor != "Anônimo" && autorArticleId != "">
122 <#assign orgArticleId = organization.getExpandoBridge().getAttribute("journal-article")
123 orgJournalArticle = JournalArticleLocalService.getArticle(themeDisplay.getLayout().getGroupId(),orgArticleId?c)
124 urlWC = orgJournalArticle.getUrlTitle()!""
125 autor = organization.getName()!""
126 >
127 </#if>
128 </#if>
129
130 <#if themeDisplay.isSignedIn() >
131 <#assign tags = AssetTagLocalService.getTagNames(entry.getClassName(), entry.getClassPK()) >
132 <#assign orgId = (tags[0]!"")?remove_beginning("organization-") >
133 <#assign userIsAdmin = OrganizationLocalService.hasUserOrganization(themeDisplay.getUserId(), orgId?number)>
134 </#if>
135
136 <div class="estruturas-lista-item" id="InfraItem${JournalArticleID}">
137 <div class="lista-checkmark">
138 <#if categorias?seq_contains("aprovado") > <i title="Aprovado" style="color: #4ECD66" class="fa-solid fa-circle-check"></i> </#if>
139 <#if categorias?seq_contains("pendente") > <i title="Em análise" style="color: #D90000"class="fa-solid fa-spinner"></i> </#if>
140 <#if categorias?seq_contains("recusado") > <i title="Recusado" style="color: #D90000"class="fa-solid fa-exclamation-circle"></i> </#if>
141 </div>
142
143 <div class="lista-pic">
144 <#if imageSrc?trim !="" >
145 <div class="bioec_infra_img" style="background-image: url(${imageSrc})">
146 </div>
147 <#else>
148 <div class="bioec_infra_img_placeholder">
149 <i class="fa-solid fa-image"></i>
150 sem imagem
151 </div>
152 </#if>
153 </div>
154
155 <div class="lista-desc">
156 <h5>${entry.getHighlightedTitle()}</h5>
157 <p>Modelo: ${modelo}</p>
158 <p>Marca: ${marca}</p>
159 </div>
160
161 <div class="lista-arrow">
162 <button class="btn" type="button" data-toggle="collapse" data-target="#collapse-${entry.getClassPK()}" aria-expanded="false" aria-controls="collapse-${entry.getClassPK()}">
163 <i class="fa-solid fa-chevron-down"></i>
164 </button>
165 </div>
166
167 <span id="collapse-${entry.getClassPK()}" class="collapse lista-collapse">
168 <div class="lista-func">
169 <h5>Função </h5>
170 <p>${funcao}</p>
171 </div>
172
173 <#if categorias?seq_contains("recusado") >
174 <div style="border-top: 1px solid #E8ECEF; font-weight: bold; padding-top: 24px;">
175 <p>Conteudo Em Análise Pelo Cetiqt:</p>
176 <p>Conteúdo recusado pelo CETIQT por violar as políticas de privacidade.</p>
177 </div>
178 </#if >
179
180 <div class="lista-footnote">
181 <div>
182 <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>
183 </div>
184 <#if userIsAdmin>
185 <div class="buttonsActions">
186 <div style="cursor: pointer;font-size: 16px;" data-toggle="modal" data-target="#modalInfra${JournalArticleID}">
187 <i class="fa-solid fa-edit"></i>
188 </div>
189 <div style="cursor: pointer;font-size: 16px;" data-toggle="modal" data-target="#modal-infra-${entry.getClassPK()}">
190 <i class="fa-solid fa-trash-can"></i>
191 </div>
192
193 </div>
194 </#if>
195 </div>
196 </span>
197 </div>
198
199 <#if userIsAdmin>
200 <div style="display: none;" id="modal-infra-${entry.getClassPK()}" class="modal fade" role="dialog">
201 <div class="modal-dialog modal-lg" role="document">
202 <div class="modal-content">
203 <div class="modal-header" >
204 <h4 class="m-0">Remover Infraestrutura</h4>
205 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
206 <span aria-hidden="true">
207 <i class="fa-solid fa-close"></i>
208 </span>
209 </button>
210 </div>
211 <div class="modal-body">
212 <h5>Você tem certeza que deseja remover essa infraestrutura?</h5>
213 <div>
214 Ao clicar em continuar, a infraestrutura será removida do seu perfil.
215 </div>
216 </div>
217 <div class="modal-footer justify-content-end">
218 <button class="bioec_secondary_button" data-dismiss="modal">CANCELAR</button>
219 <button class="bioec_primary_button" type="button" onclick="excluirInfra(${JournalArticleFrontId}, ${orgId})">CONTINUAR</button>
220 </div>
221 </div>
222 </div>
223 </div>
224 </#if>
225
226 <#-- modal edição -->
227
228<#if userIsAdmin>
229<div style="display: none;" id="modalInfra${JournalArticleID}" class="modal fade bioec-profile-infra-modal" role="dialog">
230 <div class="modal-dialog modal-lg" role="document">
231
232 <form class="form-group modal-content" id="formularioInfraestrutura${JournalArticleID}">
233 <div id="infraModal-l1-${JournalArticleID}" class="modal-header infraModal-l1" >
234 <h5>Adicionar Infraestrutura</h5>
235 <button id="fecharModal${JournalArticleID}" type="button" class="close" data-dismiss="modal" aria-label="Close">
236 <span aria-hidden="true">×</span>
237 </button>
238 </div>
239 <div id="infraModal-l2-${JournalArticleID}" class="modal-body infraModal-l2">
240 <div id="infraName${JournalArticleID}" class="infraName">
241 <label class="ReqLabel" for="inputInfraName${JournalArticleID}">Nome da infraestrutura</label>
242 <input type="text" id="inputInfraName${JournalArticleID}" value="${entry.getHighlightedTitle()}" placeholder="Nome da infraestrutura" required>
243 </div>
244 <div id="infraModel${JournalArticleID}" class="infraModel">
245 <label class="ReqLabel" for="inputInfraModel${JournalArticleID}">Modelo</label>
246 <input type="text" id="inputInfraModel${JournalArticleID}" value="${modelo}" placeholder="Modelo" required>
247 </div>
248 <div id="infraBrand${JournalArticleID}" class="infraBrand">
249 <label class="ReqLabel" for="inputInfraBrand${JournalArticleID}">Marca</label>
250 <input type="text" id="inputInfraBrand${JournalArticleID}" value="${marca}" placeholder="Marca" required>
251 </div>
252
253 <div id="infraImg${JournalArticleID}" class="infraImg">
254 <div style="display: flex; flex-direction: column; gap: 8px">
255 <label>Imagem da infraestrutura (Máx. 10 MB)</label>
256 <label class="bioec_secondary_button" id="carregarImagem${JournalArticleID}" for="inputCarregarImagemInfra${JournalArticleID}" style="font-size: 16px;color: #333244;align-self:start;">
257 CARREGAR IMAGEM
258 </label>
259 <input id="inputCarregarImagemInfra${JournalArticleID}" class="inputCarregarImagemInfra" type="file" accept="image/*" onchange="encodeInfraImageAsURL${JournalArticleID}(this)">
260 <input class="d-none" id="inputInfraBase64${JournalArticleID}" value="${imageSrc}" />
261 <div class="imagemCarregadaInfra${JournalArticleID} d-md-none d-block" style="background-image: url(${imageSrc})"></div>
262 <button type="button" id="removerImagemInfra${JournalArticleID}" class="<#if imageSrc == "" || imageSrc?? == false> d-none </#if> removerImagemInfra" >
263 <i class="fa fa-trash"></i> Remover imagem
264 </button>
265 </div>
266 <div class="imagemCarregadaInfra${JournalArticleID} d-md-block d-none" style="background-image: url(${imageSrc})"></div>
267 </div>
268
269 <div id="infraFunction${JournalArticleID}" class="infraFunction">
270 <label class="ReqLabel" for="inputInfraFunction${JournalArticleID}">Função</label>
271 <input type="text" id="inputInfraFunction${JournalArticleID}" class="inputInfraFunction" value="${funcao}" placeholder="Função" required>
272 </div>
273 </div>
274 <div class="TextImportant">
275 <p>
276 Importante: O conteúdo enviado passará por um processo interno de aprovação. Só então o conteúdo adicionado aparecerá no portal.
277 </p>
278 </div>
279 <div id="infraModal-l3-${JournalArticleID}" class="modal-footer infraModal-l3">
280 <button class="bioec_secondary_button" onclick="">SALVAR E FECHAR</button>
281 </div>
282 </form>
283
284 </div>
285</div>
286</#if>
287
288
289
290
291<script>
292const SHOW_NOTICE_CONTAINER_BIOECONOMIA = "SHOW_NOTICE_CONTAINER_BIOECONOMIA";
293
294
295
296function closeNoticeContainer() {
297 document.getElementById("upload-notice-container").style.display = "none";
298
299 window.localStorage.removeItem(SHOW_NOTICE_CONTAINER_BIOECONOMIA);
300}
301
302document
303 .getElementById("close-btn-upload-container")
304 .addEventListener("click", closeNoticeContainer);
305
306document.addEventListener("DOMContentLoaded", function(event) {
307 console.log('chegou aqui', window.localStorage.getItem(SHOW_NOTICE_CONTAINER_BIOECONOMIA));
308 var showNoticeContainer = window.localStorage.getItem(SHOW_NOTICE_CONTAINER_BIOECONOMIA);
309 if (showNoticeContainer == "true") {
310 document.getElementById("upload-notice-container").style.display = "block";
311 window.localStorage.removeItem(SHOW_NOTICE_CONTAINER_BIOECONOMIA);
312 }
313});
314
315
316
317<#if userIsAdmin>
318
319document.querySelector('#formularioInfraestrutura${JournalArticleID}').addEventListener('submit', event => {
320 event.preventDefault();
321 if (boolAddInfraestrutura == 0){
322 event.preventDefault();
323 }
324 editarSubmissao${JournalArticleID}();
325});
326
327function editarSubmissao${JournalArticleID}(){
328
329
330 Liferay.Util.openToast({message: "Enviando requisição",type: "info",title: ""});
331 const infraData = {
332 nome: document.getElementById("inputInfraName${JournalArticleID}").value,
333 marca: document.getElementById("inputInfraBrand${JournalArticleID}").value,
334 funcao: document.getElementById("inputInfraFunction${JournalArticleID}").value,
335 modelo: document.getElementById("inputInfraModel${JournalArticleID}").value,
336 autor: Liferay.ThemeDisplay.getUserName(),
337 imagem: document.getElementById("inputInfraBase64${JournalArticleID}").value,
338 }
339 console.log(JSON.stringify(infraData));
340
341 fetch(Liferay.ThemeDisplay.getPortalURL() + "/o/infraestrutura/equipamento/${JournalArticleFrontId}", {
342 method: 'PUT',
343 "headers": {
344 "x-csrf-token": Liferay.authToken,
345 "Content-Type": "application/json"
346 },
347 body: JSON.stringify(infraData)
348 })
349 .then(res => {
350 if(res.status == 200) {
351
352 Liferay.Util.openToast({
353 message: "Infraestrutura editada com sucesso. Após a submissão, será iniciado um novo processo interno de aprovação do conteúdo enviado. Só então o conteúdo submetido aparecerá novamente no portal.",
354 type: "success",
355 title: "",
356 toastProps: {
357 autoClose: 5000
358 }
359 })
360
361setTimeout(function(){ location.reload(); }, 2000);
362
363 } else {
364 Liferay.Util.openToast({
365 message: "Erro ao editar infraestrutura",
366 type: "danger",
367 title: "",
368 toastProps: {
369 autoClose: 5000
370 }
371 })
372 }
373 });
374 }
375</#if>
376
377function excluirInfra(wcId, orgId) {
378 Liferay.Util.openToast({message: "Enviando requisição",type: "info",title: ""});
379 fetch(Liferay.ThemeDisplay.getPortalURL() + "/o/infraestrutura/equipamento/" + wcId , {
380 method: 'DELETE',
381 "headers": {
382 "x-csrf-token": Liferay.authToken,
383 "Content-Type": "application/json"
384 }
385 })
386 .then(res => {
387 if(res.status == 200) {
388 Liferay.Util.openToast({
389 message: "Infraestrutura excluida com sucesso",
390 type: "success",
391 title: "",
392 toastProps: {
393 autoClose: 5000
394 }
395 })
396 setTimeout(function(){ location.reload(); }, 2000)
397 } else {
398 Liferay.Util.openToast({
399 message: "Erro ao excluir infraestrutura",
400 type: "danger",
401 title: "",
402 toastProps: {
403 autoClose: 5000
404 }
405 })
406 }
407 });
408 }
409
410
411 function encodeInfraImageAsURL${JournalArticleID}(element) {
412 let file = element.files[0];
413 let reader = new FileReader();
414 reader.onloadend = () => {
415 if(reader.result) {
416 if(!validImageSize(reader.result)) return;
417 try {
418 Array.from(document.getElementsByClassName("imagemCarregadaInfra${JournalArticleID}")).forEach( el => el.style.backgroundImage = 'url(' + reader.result + ')' )
419 const base64_input = document.getElementById("inputInfraBase64${JournalArticleID}")
420 base64_input.value = reader.result
421
422
423 const removeImageButton = document.getElementById("removerImagemInfra${JournalArticleID}")
424 removeImageButton.classList.remove("d-none")
425 } catch (error) {
426 console.error(error)
427 }
428 }
429 }
430 reader.readAsDataURL(file);
431 }
432
433 function removeImageInfra${JournalArticleID}() {
434 try {
435 const file_input = document.getElementById("inputCarregarImagemInfra${JournalArticleID}")
436Array.from(document.getElementsByClassName("imagemCarregadaInfra${JournalArticleID}")).forEach( el => el.style.backgroundImage = "" )
437 const base64_input = document.getElementById("inputInfraBase64${JournalArticleID}")
438 file_input.value = null
439 base64_input.value = ""
440 console.log("foi")
441 const removeImageButton = document.getElementById("removerImagemInfra${JournalArticleID}")
442 removeImageButton.classList.add("d-none")
443 } catch (error) {
444 console.error(error)
445 }
446}
447
448
449document.getElementById("removerImagemInfra${JournalArticleID}").addEventListener("click", removeImageInfra${JournalArticleID});
450
451</script>
452<style>
453
454#upload-notice-container {
455 background: var(--cinza-claro, #e8ecef);
456 padding: 24px 24px 16px;
457 width: 100%;
458 position: relative;
459 margin-bottom: 40px;
460}
461
462#upload-notice-container #close-btn-upload-container {
463 position: absolute;
464 top: 0px;
465 right: 2px;
466 height: 24px;
467 margin: 8px;
468 cursor: pointer;
469}
470
471#upload-notice-container #close-btn-upload-container i {
472 font-size: 22px;
473 color: #5B5C61;
474}
475
476#upload-notice-container .upload-notice-title {
477 font-size: 20px;
478 /* font-family: Roboto; */
479 font-weight: 700;
480 line-height: 150%;
481 color: var(--texto, #5b5c61);
482 display: flex;
483 align-items: center;
484 margin-bottom: 12px;
485}
486
487#upload-notice-container .upload-notice-title i {
488 color: #ffc806;
489 margin-right: 12px;
490 font-size: 24px;
491}
492
493#upload-notice-container p {
494 color: var(--texto, #5b5c61);
495 font-size: 16px;
496 /* font-family: Roboto; */
497 line-height: 150%;
498 margin-bottom: 8px;
499}
500
501#upload-notice-container p > span {
502 font-weight: 700;
503}
504
505
506.imagemCarregadaInfra${JournalArticleID} {
507 background-size: contain;
508 background-position: center;
509 background-repeat: no-repeat;
510 height: 100px;
511 width: 100px;
512}
513
514#removerImagemInfra${JournalArticleID} {
515 background: none;
516 border: none;
517 outline: none;
518 color: #5B5C61;
519 font-size: 16px;
520 font-weight: 900;
521 line-height: 24px;
522 letter-spacing: 0em;
523 width: fit-content;
524 margin-left: 16px;
525}
526</style>
527 </#list>
528 </#if>
529 </div>
530</div>
531
532
533<style>
534
535.bioec_infra_img {
536 width: 140px;
537 height: 140px;
538 overflow: hidden;
539 background-size: contain;
540 background-position: center;
541 background-repeat: no-repeat;
542}
543
544.bioec_infra_img_placeholder {
545 width: 140px;
546 height: 140px;
547 background-color: #E8ECEF;
548 display: flex;
549 flex-direction: column;
550 align-items: center;
551 justify-content: center;
552 font-size: 14px;
553 color: #5B5C61;
554}
555
556.bioec_infra_img_placeholder i {
557 font-size: 44px;
558}
559
560
561.bioec-profile-estrutura-main{
562 display: flex;
563 gap: 40px;
564 flex-direction: column;
565 padding-bottom: 20px;
566}
567
568.bioec-profile-estrutura-main h5, .bioec-profile-estrutura-main p, .bioec-profile-estrutura-main a{
569 color: #5B5C61;
570}
571
572.bioec-profile-estrutura-main h5{
573 font-weight: 700;
574}
575.bioec-profile-estrutura-main h5, .bioec-profile-estrutura-main p{
576
577 font-size: 16px;
578
579}
580
581.bioec-profile-estrutura-main #estruturas-lista .estruturas-lista-item {
582 border: 1px #BEBEBE solid;
583 padding: 24px;
584 display: grid;
585 grid-template-columns: 24px 12px 138px 46px 1fr 12px 15px;
586 grid-template-areas: "ck . pic . desc . arrw"
587 ". . clps clps clps clps clps";
588 margin-bottom: 40px;
589}
590
591.bioec-profile-estrutura-main .lista-checkmark { grid-area: ck; }
592.bioec-profile-estrutura-main .lista-pic { grid-area: pic; display: flex; justify-content: center;}
593.bioec-profile-estrutura-main .lista-arrow { grid-area: arrw; }
594.bioec-profile-estrutura-main .lista-collapse { grid-area: clps; }
595
596.bioec-profile-estrutura-main .lista-desc {
597 grid-area: desc;
598 display: flex;
599 flex-direction: column;
600 justify-content: center;
601
602}
603
604.bioec-profile-estrutura-main .lista-desc h5{
605 margin-bottom: 12px;
606}
607
608.bioec-profile-estrutura-main .lista-desc p{
609 margin: 0;
610}
611
612.bioec-profile-estrutura-main .lista-func {
613
614 margin: 24px 0;
615}
616
617.bioec-profile-estrutura-main .lista-footnote {
618
619 display: flex;
620 justify-content: space-between;
621 border-top: 1px solid #E8ECEF;
622 padding-top: 12px;
623 font-size: 14px;
624 font-weight: 300;
625 gap: 15px;
626 color: #5B5C61;
627
628}
629
630.pagination-items-per-page.active > a,
631.pagination-items-per-page.active > button,
632.pagination-items-per-page.show > a,
633.pagination-items-per-page.show > button,
634.page-item.active .page-link,
635.page-item.show .page-link{
636 border-color: #4ECD66;
637 background-color: #4ECD66;
638}
639
640.pagination-results,
641.pagination-items-per-page > a,
642.pagination-items-per-page > button,
643.pagination-items-per-page > a:hover,
644.pagination-items-per-page > button:hover,
645.page-link{
646 color: #4ebe66;
647}
648
649.estruturas-port{
650 border: 1px #BEBEBE solid;
651 padding: 24px;
652 display: flex;
653 flex-direction: column;
654 align-items: center;
655 gap: 24px;
656}
657
658.estruturas-port p{
659 text-align: center;
660 max-width: 760px;
661 font-size: 18px;
662 color: #5B5C61;
663}
664
665.estruturas-port div{
666display: flex;
667 justify-content: space-between;
668 width: min(558px, 100%);
669}
670
671.lista-arrow button{
672 padding: 0;
673}
674
675.lista-arrow button:focus{
676 box-shadow: none;
677}
678
679@media(max-width: 1100px){
680 .estruturas-port div{
681 flex-direction: column;
682 gap: 30px;
683 }
684
685}
686
687@media(max-width: 450px){
688 .bioec-profile-estrutura-main .lista-footnote{
689 flex-direction: column;
690 gap: 10px;
691 align-items: flex-end;
692 text-align: right;
693 }
694}
695
696.bioec-profile-estrutura-main .lista-footnote .buttonsActions {
697 display: flex;
698 gap: 17px;
699}
700
701@media(max-width: 768px){
702 .bioec-profile-estrutura-main #estruturas-lista .estruturas-lista-item{
703 grid-template-columns: 24px 1fr 10px 1fr 15px;
704 grid-template-areas: "ck desc desc desc arrw"
705 ". pic pic pic ."
706 "clps clps clps clps clps";
707
708 }
709
710 .bioec-profile-estrutura-main .lista-desc{
711 align-items: center;
712 }
713
714 .lista-pic{
715 display: flex;
716 justify-content: center;
717 }
718
719 .bioec-profile-estrutura-main .lista-footnote{
720 flex-direction: column;
721 align-items: center;
722 }
723
724 .bioec-profile-estrutura-main .lista-footnote > div {
725 text-align: center;
726 }
727
728 .bioec-profile-estrutura-main .lista-footnote .barra-pipe {
729 display: none;
730 }
731 .bioec-profile-estrutura-main .lista-footnote .lista-author {
732 display: flex;
733 gap: 4px;
734 justify-content: center;
735 }
736 .bioec-profile-estrutura-main .lista-footnote .buttonsActions {
737 width: 100%;
738 justify-content: space-between;
739 }
740}
741</style>
The following has evaluated to null or missing: ==> autorId [in template "34764#34807#41127" at line 71, column 46] ---- Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #if autorId != "" && autorId?? [in template "34764#34807#41127" at line 71, 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[@field-reference='Text77253735']")??>
26
27 <#assign nomeParaContato = articleXml.selectSingleNode("dynamic-element[@field-reference='Text77253735']").getStringValue()!""
28 nomeParaContato = nomeParaContato?replace("\n\t\t", "")
29 nomeParaContato = nomeParaContato?replace("\n\t", "")
30 >
31
32 </#if>
33 <#if articleXml.selectSingleNode("dynamic-element[@field-reference='Text94974146']")??>
34 <#assign telefone = articleXml.selectSingleNode("dynamic-element[@field-reference='Text94974146']").getStringValue()!""
35 telefone = telefone?replace("\n\t\t", "")
36 telefone = telefone?replace("\n\t", "")
37 >
38 </#if>
39
40 <#if articleXml.selectSingleNode("dynamic-element[@field-reference='Text68569631']")??>
41 <#assign email = articleXml.selectSingleNode("dynamic-element[@field-reference='Text68569631']").getStringValue()!""
42 email = email?replace("\n\t\t", "")
43 email = email?replace("\n\t", "")
44 >
45 </#if>
46
47 <#if articleXml.selectSingleNode("dynamic-element[@field-reference='CopyOfCopyOfText18267936']")??>
48 <#assign desc = articleXml.selectSingleNode("dynamic-element[@field-reference='CopyOfCopyOfText18267936']").getStringValue()!""
49 desc = desc?replace("\n\t\t", "")
50 desc = desc?replace("\n\t", "")
51 >
52 </#if>
53 <#if articleXml.selectSingleNode("dynamic-element[@field-reference='Text97565506']")??>
54 <#assign imagem = articleXml.selectSingleNode("dynamic-element[@field-reference='Text97565506']").getStringValue()!""
55 imagem = imagem?replace("(\r\n)+", "",'r')
56 imagem = imagem?replace(" ", "",'r')
57 >
58 </#if>
59 <#if articleXml.selectSingleNode("dynamic-element[@field-reference='Text99746569']")??>
60 <#assign
61 autorId = articleXml.selectSingleNode("dynamic-element[@field-reference='Text99746569']").getStringValue()!""
62 autorId = autorId?replace("\n\t\t", "")
63 autorId = autorId?replace("\n\t", "")
64 autorArticleId = ""
65 >
66 </#if>
67 <#assign
68 commentsCount = mbMessageLocalService.getDiscussionMessagesCount(entry.getClassName(), entry.getClassPK(), 0)!"0"
69 >
70
71 <#if autorId != "" && autorId??>
72 <#assign
73 autor = UserLocalService.fetchUser(autorId?number)!""
74 autorArticleId = autor.getExpandoBridge().getAttribute("journal-article")!"0"
75 />
76 <#if autor != "">
77 <#assign autor = autor.getFullName()!"">
78 <#else>
79 <#assign autor = "Anônimo" >
80 </#if>
81 <#else>
82 <#assign autor = "Anônimo" >
83 </#if>
84 <#assign categorias = AssetCategoryLocalService.getCategoryNames(entry.getClassName(), entry.getClassPK())!"" >
85 <#assign urlWC = "">
86 <#if autorArticleId != "0" && autorArticleId != "" && autor != "Anônimo">
87 <#assign autorArticle = JournalArticleLocalService.getLatestArticle(themeDisplay.getLayout().getGroupId(), autorArticleId?string) >
88 <#assign urlWC = autorArticle.getUrlTitle()!"">
89 </#if>
90
91 <#assign tags = tagsLocalService.getTagNames("com.liferay.journal.model.JournalArticle", journalArticle.getResourcePrimKey()?number )
92 tagName = tags[0]!""
93 orgOrUser = ""
94 >
95
96 <#if tagName?contains("organization") && tagName != "" >
97 <#assign orgOrUser = "org">
98 <#else>
99 <#assign orgOrUser = "user">
100 </#if>
101
102 <#if orgOrUser == "org" >
103
104 <#assign
105 orgId = tagName?keep_after("organization-")
106 organization = OrganizationLocalService.fetchOrganization(orgId?number)!""
107 >
108
109
110 <#if organization != "" && autor != "Anônimo">
111
112 <#assign orgArticleId = organization.getExpandoBridge().getAttribute("journal-article")
113 orgJournalArticle = JournalArticleLocalService.getArticle(themeDisplay.getLayout().getGroupId(),orgArticleId?c)
114 urlWC = orgJournalArticle.getUrlTitle()!""
115 autor = organization.getName()!""
116 >
117
118 </#if>
119 </#if>
120
121 <#if themeDisplay.isSignedIn() >
122 <#if tagName?contains("organization-")>
123 <#assign userIsAdmin = OrganizationLocalService.hasUserOrganization(themeDisplay.getUserId(), orgId?number)>
124 <#else>
125 <#if autorId?number == themeDisplay.getUserId()>
126 <script>console.log("oi");</script>
127 <#assign userIsAdmin = true>
128 </#if>
129 </#if>
130
131
132 </#if>
133
134
135
136 <div class="demanda-lista-item">
137
138 <div class="lista-checkmark">
139 <#if categorias?seq_contains("aprovado") > <i title="Aprovado" style="color: #4ECD66" class="fa-solid fa-circle-check"></i> </#if>
140 <#if categorias?seq_contains("pendente") > <i title="Em análise" style="color: #D90000"class="fa-solid fa-spinner"></i> </#if>
141 <#if categorias?seq_contains("recusado") > <i title="Recusado" style="color: #D90000"class="fa-solid fa-exclamation-circle"></i> </#if>
142 </div>
143
144
145 <div class="lista-titulo">
146 <h5>${entry.getHighlightedTitle()}</h5>
147 </div>
148
149 <div class="lista-arrow">
150 <button style="padding: 0;" class="btn" type="button" data-toggle="collapse" data-target="#collapseID${entry.getClassPK()}" aria-expanded="false" aria-controls="collapseID${entry.getClassPK()}">
151 <i class="fa-solid fa-chevron-down"></i>
152 </button>
153 </div>
154
155 <div class="lista-desc">
156 <p>${desc}</p>
157 </div>
158
159 <div class="lista-collapse collapse" id="collapseID${entry.getClassPK()}">
160 <#if nomeParaContato != "" || telefone != "" || email != "" || imagem?trim !="">
161 <div class="lista-details">
162 <div class="lista-pic">
163 <i class="fa-solid fa-image-slash"></i>
164 <#if imagem?trim !="" >
165 <img class="bioec_demanda_img" src="${imagem}">
166 <#else>
167 <div class="bioec_demanda_img_placeholder">
168 <i class="fa-solid fa-image"></i>
169 sem imagem
170 </div>
171 </#if>
172 </div>
173 <#if nomeParaContato != "" || telefone != "" || email != "" >
174 <div class="lista-contato">
175 <p>Contato</p>
176 <p class="lista-author">${nomeParaContato}</p>
177 <p class="lista-phone">${telefone}</p>
178 <p class="lista-email">${email}</p>
179 </div>
180 </#if>
181 </div>
182 </#if>
183
184 <#if categorias?seq_contains("recusado") >
185 <div style="border-top: 1px solid #E8ECEF; font-weight: bold; padding-top: 24px;">
186 <p>Conteúdo Em Análise Pelo Cetiqt:</p>
187 <p>Conteúdo recusado pelo CETIQT por violar as políticas de privacidade.</p>
188 </div>
189 </#if>
190 <div class="lista-footnote">
191 <div>
192 <span class="lista-date">${journalArticle.getDisplayDate()?string('dd/MM/yyyy')}</span> | <span class="lista-commentNumber">${commentsCount} cometários</span> <span class="barra-pipe"> | </span> <span class="lista-author">Publicado por <a <#if urlWC != ''>href="/w/${urlWC}</#if>">${autor}</a></span>
193 </div>
194 <#if userIsAdmin>
195 <div class="buttonsActions">
196 <div style="cursor: pointer;font-size: 16px;" data-toggle="modal" data-target="#modalDemanda${JournalArticleID}">
197 <i class="fa-solid fa-edit"></i>
198 </div>
199 <div style="cursor: pointer;font-size: 16px;" data-toggle="modal" data-target="#modal-demanda-${entry.getClassPK()}">
200 <i class="fa-solid fa-trash-can"></i>
201 </div>
202
203 </div>
204 </#if>
205 </div>
206 </div>
207 </div>
208
209 <#if userIsAdmin>
210 <div style="display: none;" id="modal-demanda-${entry.getClassPK()}" class="modal fade" role="dialog">
211 <div class="modal-dialog modal-lg" role="document">
212 <div class="modal-content">
213 <div class="modal-header" >
214 <h4 class="m-0">Remover Demanda</h4>
215 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
216 <span aria-hidden="true">
217 <i class="fa-solid fa-close"></i>
218 </span>
219 </button>
220 </div>
221 <div class="modal-body">
222 <h5>Você tem certeza que deseja remover essa demanda?</h5>
223 <div>
224 Ao clicar em continuar, a demanda será removida do seu perfil.
225 </div>
226 </div>
227 <div class="modal-footer justify-content-end">
228 <button class="bioec_secondary_button" data-dismiss="modal">CANCELAR</button>
229 <button class="bioec_primary_button" type="button" onclick="excluirDemanda(${JournalArticleFrontId}, ${orgId})">CONTINUAR</button>
230 </div>
231 </div>
232 </div>
233 </div>
234
235 <#-- modal edição -->
236
237
238 <div style="display: none;" id="modalDemanda${JournalArticleID}" class="modal fade bioec-profile-demanda-modal modalDemanda" role="dialog">
239 <div class="modal-dialog modal-lg" role="document">
240 <form id="formularioDemanda${JournalArticleID}" class="form-group modal-content formularioDemanda">
241 <div id="demandaModal-l1${JournalArticleID}" class="modal-header demandaModal-l1">
242 <h5>Adicionar demanda</h5>
243 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
244 <span aria-hidden="true">×</span>
245 </button>
246 </div>
247 <div id="demandaModal-l2${JournalArticleID}" class="modal-body demandaModal-l2">
248 <div id="demandaTitle${JournalArticleID}" class="demandaTitle">
249 <label class="ReqLabel" for="demandaInputTitle${JournalArticleID}">Título da demanda</label>
250 <input id="demandaInputTitle${JournalArticleID}" value="${entry.getHighlightedTitle()}" type="text" placeholder="Inserir um título" required>
251 </div>
252 <div id="demandaName${JournalArticleID}" class="demandaName">
253 <label class="" for="demandaInputName${JournalArticleID}">Nome para contato</label>
254 <input value="${nomeParaContato}" id="demandaInputName${JournalArticleID}" placeholder="Inserir nome" type="text">
255 </div>
256 <div id="demandaTelephone${JournalArticleID}" class="demandaTelephone">
257 <label class="" for="demandaInputPhone${JournalArticleID}">Telefone para contato</label>
258 <input value="${telefone}" id="demandaInputPhone${JournalArticleID}" name="demandaInputPhone" type="text" placeholder ='(__)_____-_____' minlength="14" />
259 </div>
260 <div id="demandaEmail${JournalArticleID}" class="demandaEmail">
261 <label class="" for="demandaInputEmail${JournalArticleID}">E-mail para contato</label>
262 <input value="${email}" id="demandaInputEmail${JournalArticleID}" placeholder="Inserir e-mail" type="text">
263 </div>
264 <div id="demandaDesc${JournalArticleID}" class="demandaDesc">
265 <label class="ReqLabel" for="demandaInputDesc${JournalArticleID}">Descrição</label>
266 <textarea id="demandaInputDesc${JournalArticleID}" style="max-width: 100%;font-size: 16px;height: 80px;border: 1px solid #BEBEBE;" required>${desc}</textarea>
267 </div>
268 <div id="demandaImg${JournalArticleID}" class="demandaImg">
269 <div style="display: flex; flex-direction: column; gap: 8px">
270 <label>Imagem da demanda (Máx. 10 MB)</label>
271 <label class="btn carregarImagem" id="carregarImagem${JournalArticleID}" for="inputCarregarImagemDemanda${JournalArticleID}" style="font-size: 16px; cursor: pointer;">CARREGAR IMAGEM</label>
272 <input class="inputCarregarImagemDemanda" id="inputCarregarImagemDemanda${JournalArticleID}" type="file" accept="image/*" onchange="encodeDemandaImageAsURL${JournalArticleID}(this)">
273 <input class="d-none" id="inputDemandaBase64${JournalArticleID}" value="${imagem}" />
274 <div class="imagemCarregadaDemanda imagemCarregadaDemanda${JournalArticleID} d-md-none d-block" style="background-image: url(${imagem})"></div>
275 <button type="button" id="removerImagemDemanda${JournalArticleID}" class="<#if imagem == "" || imagem?? == false> d-none </#if> removerImagemDemanda" >
276 <i class="fa fa-trash"></i> Remover imagem
277 </button>
278 </div>
279 <div class="imagemCarregadaDemanda imagemCarregadaDemanda${JournalArticleID} d-md-block d-none" style="background-image: url(${imagem})"></div>
280 </div>
281 </div>
282 <div class="TextImportant">
283 <p>
284 Importante: O conteúdo enviado passará por um processo interno de aprovação. Só então o conteúdo adicionado aparecerá no portal.
285 </p>
286 </div>
287
288 <div id="demandaModal-l3${JournalArticleID}" class="modal-footer demandaModal-l3">
289 <button class="btn button-empty" onclick="" id="demandas-saveAndClose${JournalArticleID}">SALVAR E FECHAR</button>
290 </div>
291 </form>
292 </div>
293 </div>
294
295 </#if>
296 <#--
297
298
299
300
301 <div style="display: none;" id="modalInfra${JournalArticleID}" class="modal fade bioec-profile-infra-modal" role="dialog">
302 <div class="modal-dialog modal-lg" role="document">
303
304 <form class="form-group modal-content" id="formularioInfraestrutura${JournalArticleID}">
305 <div id="infraModal-l1-${JournalArticleID}" class="modal-header infraModal-l1" >
306 <h5>Adicionar Infraestrutura</h5>
307 <button id="fecharModal${JournalArticleID}" type="button" class="close" data-dismiss="modal" aria-label="Close">
308 <span aria-hidden="true">×</span>
309 </button>
310 </div>
311 <div id="infraModal-l2-${JournalArticleID}" class="modal-body infraModal-l2">
312 <div id="infraName${JournalArticleID}" class="infraName">
313 <label class="ReqLabel" for="inputInfraName${JournalArticleID}">Nome da infraestrutura</label>
314 <input type="text" id="inputInfraName${JournalArticleID}" value="${entry.getHighlightedTitle()}" placeholder="Nome da infraestrutura" required>
315 </div>
316 <div id="infraModel${JournalArticleID}" class="infraModel">
317 <label class="ReqLabel" for="inputInfraModel${JournalArticleID}">Modelo</label>
318 <input type="text" id="inputInfraModel${JournalArticleID}" value="${modelo}" placeholder="Modelo" required>
319 </div>
320 <div id="infraBrand${JournalArticleID}" class="infraBrand">
321 <label class="ReqLabel" for="inputInfraBrand${JournalArticleID}">Marca</label>
322 <input type="text" id="inputInfraBrand${JournalArticleID}" value="${marca}" placeholder="Marca" required>
323 </div>
324
325 <div id="infraImg${JournalArticleID}" class="infraImg">
326 <div style="display: flex; flex-direction: column; gap: 8px">
327 <label>Imagem da infraestrutura (Máx. 10 MB)</label>
328 <label class="bioec_secondary_button" id="carregarImagem${JournalArticleID}" for="inputCarregarImagemInfra${JournalArticleID}" style="font-size: 16px;color: #333244;align-self:start;">
329 CARREGAR IMAGEM
330 </label>
331 <input id="inputCarregarImagemInfra${JournalArticleID}" class="inputCarregarImagemInfra" type="file" accept="image/*" onchange="encodeInfraImageAsURL${JournalArticleID}(this)">
332 <input class="d-none" id="inputInfraBase64${JournalArticleID}" />
333 <div class="imagemCarregadaInfra${JournalArticleID} d-md-none d-block"></div>
334 <button type="button" id="removerImagemInfra${JournalArticleID}" class="d-none removerImagemInfra" >
335 <i class="fa fa-trash"></i> Remover imagem
336 </button>
337 </div>
338 <div class="imagemCarregadaInfra${JournalArticleID} d-md-block d-none"></div>
339 </div>
340
341 <div id="infraFunction${JournalArticleID}" class="infraFunction">
342 <label class="ReqLabel" for="inputInfraFunction${JournalArticleID}">Função</label>
343 <input type="text" id="inputInfraFunction${JournalArticleID}" class="inputInfraFunction" value="${funcao}" placeholder="Função" required>
344 </div>
345 </div>
346 <div class="TextImportant">
347 <p>
348 Importante: O conteúdo enviado passará por um processo interno de aprovação. Só então o conteúdo adicionado aparecerá no portal.
349 </p>
350 </div>
351 <div id="infraModal-l3-${JournalArticleID}" class="modal-footer infraModal-l3">
352 <button class="bioec_secondary_button" id="demandas-saveAndClose${JournalArticleID}" onclick="">SALVAR E FECHAR</button>
353 </div>
354 </form>
355
356 </div>
357
358
359 -->
360
361
362
363 <script>
364 <#if userIsAdmin>
365 function excluirDemanda(wcId, orgId) {
366 Liferay.Util.openToast({message: "Enviando requisição",type: "info",title: ""});
367 fetch(Liferay.ThemeDisplay.getPortalURL() + "/o/demanda/" + wcId, {
368 method: 'DELETE',
369 "headers": {
370 "x-csrf-token": Liferay.authToken,
371 "Content-Type": "application/json"
372 }
373 })
374 .then(res => {
375 if(res.status == 200) {
376 Liferay.Util.openToast({
377 message: "Infraestrutura excluida com sucesso",
378 type: "success",
379 title: "",
380 toastProps: {
381 autoClose: 5000
382 }
383 })
384 setTimeout(function(){ location.reload(); }, 2000)
385 } else {
386 Liferay.Util.openToast({
387 message: "Erro ao excluir infraestrutura",
388 type: "danger",
389 title: "",
390 toastProps: {
391 autoClose: 5000
392 }
393 })
394 }
395 });
396 }
397
398
399
400
401 function validImageSize(base64="") {
402 const decoded = atob(base64.substring(base64.indexOf(',') + 1));
403 const sizeMB = decoded.length / 1e+6;
404 console.log("MB: " + decoded.length / 1e+6);
405 if(sizeMB > 10) {
406 Liferay.Util.openToast({
407 message: "O tamanho da imagem não deve ultrapassar 10 MB.",
408 type: "danger",
409 title: "",
410 toastProps: {
411 autoClose: 5000
412 }
413 })
414 return false
415 }
416 return true
417 }
418
419 function encodeDemandaImageAsURL${JournalArticleID}(element) {
420 let file = element.files[0];
421 let reader = new FileReader();
422 reader.onloadend = () => {
423 if(reader.result) {
424 if(!validImageSize(reader.result)) return;
425 try {
426 const base64_input = document.getElementById("inputDemandaBase64${JournalArticleID}")
427 base64_input.value = reader.result
428 Array.from(document.getElementsByClassName("imagemCarregadaDemanda${JournalArticleID}")).forEach( el => el.style.backgroundImage = 'url(' + reader.result + ')' )
429
430 const removeImageButton = document.getElementById("removerImagemDemanda${JournalArticleID}")
431 removeImageButton.classList.remove("d-none")
432 } catch (error) {
433 console.error(error)
434 }
435 }
436 }
437 reader.readAsDataURL(file);
438 }
439
440 function removeImageDemanda${JournalArticleID}() {
441 try {
442 const file_input = document.getElementById("inputCarregarImagemDemanda${JournalArticleID}")
443 Array.from(document.getElementsByClassName("imagemCarregadaDemanda${JournalArticleID}")).forEach( el => el.style.backgroundImage = "" )
444 const base64_input = document.getElementById("inputDemandaBase64${JournalArticleID}")
445 file_input.value = null
446 base64_input.value = ""
447
448 const removeImageButton = document.getElementById("removerImagemDemanda${JournalArticleID}")
449 removeImageButton.classList.add("d-none")
450 } catch (error) {
451 console.error(error)
452 }
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; display: flex; }
666.bioec-profile-demanda-main .lista-checkmark i { font-size: 24px; }
667.bioec-profile-demanda-main .lista-pic { grid-area: pic; display: flex; justify-content: center;}
668.bioec-profile-demanda-main .lista-arrow { grid-area: arrw; }
669
670.bioec-profile-demanda-main .lista-titulo {
671 grid-area: tit;
672 display: flex;
673 flex-direction: column;
674 justify-content: center;
675
676}
677
678.bioec-profile-demanda-main .lista-titulo h5{
679 margin-bottom: 0px;
680}
681
682.bioec-profile-demanda-main .lista-desc {
683grid-area: desc;
684}
685
686.bioec-profile-demanda-main .lista-desc p{
687 margin: 0;
688}
689
690.bioec-profile-demanda-main a{
691 color: #5B5C61;
692}
693
694.demanda-port{
695 border: 1px #BEBEBE solid;
696 padding: 24px;
697 display: flex;
698 flex-direction: column;
699 align-items: center;
700 gap: 24px;
701}
702
703.demanda-port p{
704text-align: center;
705
706}
707
708.demanda-port div{
709display: flex;
710 justify-content: space-between;
711 width: min(558px, 100%);
712}
713
714.button-empty {
715border: solid 1px #4ECD66;
716padding: 8px 24px;
717color: #333244;
718 transition: 250ms;
719}
720
721.button-empty:hover{
722 background-color: #4ECD66;
723}
724
725.button-filled {
726background-color: #4ECD66;
727border: solid 1px #4ECD66;
728padding: 8px 24px;
729color: #333244;
730transition: 250ms;
731
732}
733
734.button-filled:hover{
735 background-color: transparent;
736}
737
738.bioec-profile-demanda-main .lista-footnote {
739
740 display: flex;
741 justify-content: space-between;
742 border-top: 1px solid #E8ECEF;
743 padding-top: 12px;
744 font-size: 14px;
745 font-weight: 300;
746 gap: 15px;
747 color: #5B5C61;
748
749}
750.lista-collapse{
751display: flex;
752flex-direction: column;
753gap: 24px;
754grid-area: clps;
755padding-bottom: 24px;
756}
757
758 .lista-details{
759 display: flex;
760 justify-content: flex-start;
761 gap: 24px;
762}
763.lista-pic img {
764 max-height: 138px;
765 max-width: 138px;
766}
767
768.bioec-profile-demanda-main p{
769
770}
771
772.imagemCarregadaDemanda {
773 height: 100px;
774 width: 100px;
775 background-size: contain;
776 background-position: center;
777 background-repeat: no-repeat;
778}
779
780
781.ButtonAddDemanda {
782 background: #4ECD66;
783 border-radius: 8px;
784 padding: 8px 24px;
785 border: none;
786 font-weight: 700;
787 color: #333244;
788 font-family: 'Roboto';
789 float: right;
790 text-transform: uppercase;
791}
792.ButtonAddDemanda:hover{
793 color: #333244;
794 text-decoration: none;
795}
796
797.bioec-profile-demanda-modal label {
798 margin: 0;
799 cursor: default;
800 font-size: 20px;
801 font-weight: 700;
802 color: #5B5C61;
803}
804
805.bioec-profile-demanda-modal div {
806 width: 100%;
807}
808
809#demandaModal-l1, .demandaModal-l1 {
810 padding: 18px 24px;
811 display: flex;
812 justify-content: space-between;
813}
814
815#demandaModal-l1 img, .demandaModal-l1 img {
816 cursor: pointer;
817}
818
819#demandaModal-l1 h5, .demandaModal-l1 h5 {
820 margin: 0;
821 font-size: 20px;
822 font-weight: 700;
823 color: #5B5C61;
824}
825
826#demandaModal-l2, .demandaModal-l2 {
827 border-top: 1px solid #E8ECEF;
828 display: grid;
829 grid-template-columns: 1fr 1fr;
830 grid-template-areas:
831 "titu nome"
832 "fone mail"
833 "desc desc"
834 "imagem ."
835 ;
836 column-gap: 24px;
837 row-gap: 40px;
838 padding: 24px;
839}
840
841#demandaModal-l2>div, .demandaModal-l2>div {
842 display: flex;
843 flex-direction: column;
844 gap: 8px;
845}
846
847#demandaTitle, .demandaTitle {
848 grid-area: titu;
849}
850
851#demandaName, .demandaName {
852 grid-area: nome;
853}
854
855#demandaTelephone, .demandaTelephone {
856 grid-area: fone;
857}
858
859#demandaEmail, .demandaEmail {
860 grid-area: mail;
861}
862
863#demandaBrand, .demandaBrand {
864 grid-area: marca;
865}
866
867#demandaModal-l2>#demandaImg, .demandaModal-l2>.demandaImg {
868 grid-area: imagem;
869 display: flex;
870 flex-direction: column;
871}
872
873#demandaDesc, .demandaDesc {
874 grid-area: desc;
875
876}
877
878#demandaDesc input, .demandaDesc input {
879 height: 80px;
880}
881
882.TextImportant{
883 border-bottom: 1px solid #E8ECEF;
884 padding: 24px;
885 color: #5B5C61;
886}
887
888.bioec-profile-demanda-modal input[type="text"] {
889 border-top: none;
890 border-left: none;
891 border-right: none;
892 border-bottom: 1px solid #BEBEBE;
893 width: 100%;
894 font-size: 16px;
895
896}
897
898
899.bioec-profile-demanda-modal input[type="text"]:focus-visible {
900 outline: none;
901 border-bottom: 1px solid black;
902
903}
904
905.bioec-profile-demanda-modal .ReqLabel:before {
906 content: "* ";
907 color: #D90000;
908
909}
910
911#inputCarregarImagemDemanda, .inputCarregarImagemDemanda {
912 display: none;
913}
914
915#carregarImagem, .carregarImagem {
916 padding: 8px 24px;
917 border: 1px solid #4ECD66;
918 width: fit-content;
919 transition: 250ms;
920
921}
922
923#carregarImagem:hover, .carregarImagem:hover {
924 background-color: #4ECD66;
925}
926
927.button-empty {
928 border: solid 1px #4ECD66;
929 padding: 8px 24px;
930 color: #333244;
931 transition: 250ms;
932 font-weight: bold;
933}
934
935.button-empty:hover {
936 background-color: #4ECD66;
937}
938
939.button-filled {
940 background-color: #4ECD66;
941 border: solid 1px #4ECD66;
942 padding: 8px 24px;
943 color: #333244;
944 transition: 250ms;
945 font-weight: bold;
946}
947
948.button-filled:hover {
949 background-color: transparent;
950}
951
952#demandaModal-l3, .demandaModal-l3 {
953 gap: 24px;
954 display: flex;
955 justify-content: flex-end;
956 padding: 24px;
957}
958
959.modal {
960 padding: initial !important;
961 border-radius: 4px !important;
962
963}
964
965.modal a.close-modal {
966 display: none;
967}
968
969#removerImagemDemanda, .removerImagemDemanda {
970 background: none;
971 border: none;
972 outline: none;
973 color: #5B5C61;
974 font-size: 16px;
975 font-weight: 900;
976 line-height: 24px;
977 letter-spacing: 0em;
978 width: fit-content;
979 margin-left: 16px;
980}
981
982
983@media(max-width: 964px){
984 .lista-pic img {
985 width: 100%;
986 max-height: unset;
987 max-width: unset;
988
989 }
990}
991
992@media (max-width: 550px) {
993 #demandaModal-l2, .demandaModal-l2 {
994 display: flex;
995 flex-direction: column;
996 }
997
998 #demandaModal-l3, .demandaModal-l3 {
999 display: flex;
1000 flex-direction: column;
1001 }
1002}
1003
1004@media(max-width: 450px){
1005 .bioec-profile-demanda-main .lista-details{
1006 flex-direction: column;
1007 }
1008
1009 .lista-contato{
1010 text-align: center;
1011 }
1012
1013 .bioec-profile-demanda-main .lista-footnote{
1014 flex-direction: column;
1015 gap: 10px;
1016 align-items: flex-end;
1017 text-align: right;
1018 }
1019}
1020
1021@media(max-width: 992px){
1022 #demanda-lista-container {
1023 padding-inline: 15px;
1024 }
1025}
1026
1027.bioec-profile-demanda-main .lista-footnote .buttonsActions {
1028 display: flex;
1029 gap: 17px;
1030}
1031
1032@media (max-width: 768px) {
1033 .bioec-profile-demanda-main .lista-desc {
1034 gap: 24px;
1035 flex-direction: column-reverse;
1036 }
1037 .bioec-profile-demanda-main .lista-footnote {
1038 flex-direction: column;
1039 align-items: center;
1040 }
1041 .bioec-profile-demanda-main .lista-footnote > div {
1042 text-align: center;
1043 }
1044
1045 .bioec-profile-demanda-main .lista-footnote .barra-pipe {
1046 display: none;
1047 }
1048 .bioec-profile-demanda-main .lista-footnote .lista-author {
1049 display: flex;
1050 gap: 4px;
1051 justify-content: center;
1052 }
1053 .bioec-profile-demanda-main .lista-footnote .buttonsActions {
1054 width: 100%;
1055 justify-content: space-between;
1056 }
1057}
1058
1059
1060</style>
1061
1062
1063<script>
1064
1065
1066
1067</script>
teste pro analytics oferta
teste pro analytics oferta
teste pro analytics oferta org
teste pro analytics oferta org
a
a
Bambu como fonte alternativa de fibra
Objetivo: Desenvolver a fibra de bambu para produção de embalagens na indústria de celulose (fibra longa para embalagens)
Contato
embrapii.bndes@sif.org.br
Isca formicida ecológica
Objetivo: Desenvolvimento de uma isca formicida à partir de um compósito alternativo em substituição a sulfuramida.
Contato
embrapii.bndes@sif.org.br
Tolerância à Seca
Desenvolvimento de clones de Eucalyptus tolerantes a seca no Viveiro de Pesquisas da UFV.
Curvas de Carbonização
Desenvolver curvas de carbonização baseadas nos índices de qualidade da madeira e do carvão vegetal de Eucalyptus e Corymbia para controle do processo de carbonização.
Estufim terceira geração
Estudar a fisiologia e propagação vegetativa de Eucalyptus e Corymbias com minijardim clonal em estufim
Secagem, pré-pirolise e carbonização
Desenvolver e validar um sistema de aproveitamento dos gases do queimador de gases da carbonização para realização da secagem e pré-pirólise da madeira, dentro do próprio forno de produção de carvão vegetal.
Tanino na produção de embalagens
Desenvolvimento de cola a base de tanino para uso em embalagens de fibra longa.
Corymbia para a indústria Florestal
Desenvolver clones de Corymbia para as industria de celulose, carvão vegetal, MDF e energia.
Uso de Resíduos Florestais através da Pirólise Rápida para Produção de HMF
Substituição do plástico derivado do petróleo, para plástico derivado de fibras florestais.
Tecnologia NIR para qualidade da madeira
Avaliação não destrutiva de qualidade da madeira para produção de carvão vegetal para siderurgia via NIR.
Corymbia spp. para celulose
Desenvolver processo de fabricação de Celulose branqueada obtida de madeira de Corymbia.
POP Corymbia
Desenvolvimeto do Procedimento Operacional Padrão (POP) para a propagação clonal de clones de Corymbia spp.
APP Restaure
Utilizar uma plataforma (software) para criar e gerir projetos de restauração em áreas de APP hídricas.
Tratamento de Resíduo Bifásico
Desenvolver tecnologia para o tratamento dos resíduos lodo primário, lodo secundário, drag e grit gerados no processamento da madeira para produção de papel e celulose, além do tratamento de lodos industriais e urbanos.
Eficiência Hídrica
Desenvolver um sistema integrado de controle intensivo da captação, distribuição e consumo de água em um viveiro operacional, gerando dados que embasem a revisão e estabelecimento de novas práticas e protocolos de controle e otimização do uso da água em todas as atividades de um viveiro operacional.
Material Plástico – Bambu
Projeto visa desenvolver tecnologia de desenvolvimento de um compósito Eco-friendly de Bambu + plástico.
Enraizamento de clone Corymbia
Desenvolver técnicas de revigoramento e rejuvenescimento via micropropagação para melhorar enraizamento. Além de determinar o potencial ótimo de indicadores operacionais em minijardim clonal e casa de vegetação.