Início MATO GROSSO SECEL

SECEL


1<#-- 
2 
3 
4 
5 
6 
7--> 
8 
9<#setting url_escaping_charset="UTF-8" /> 
10<#setting locale = locale /> 
11<#setting time_zone="GMT-4" /> 
12<#setting datetime_format="dd 'de' MMMM 'de' yyyy 'às' HH:mm"> 
13 
14<#if getterUtil.getBoolean(slideshow.getData())> 
15	 
16<#else> 
17	 
18#if> 
19 
20<#if getterUtil.getBoolean(slideshow_portal.getData())> 
21	 
22<#else> 
23	 
24#if> 
25 
26<#assign  
27	journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") 
28	FriendlyURLEntryLocalServiceUtil = serviceLocator.findService("com.liferay.friendly.url.service.FriendlyURLEntryLocalService") 
29	dlFileEntryLocalService =	serviceLocator.findService("com.liferay.document.library.kernel.service.DLFileEntryLocalService") 
30 
31 
32	articleId = .vars['reserved-article-id'].data 
33	journalArticle = journalArticleLocalService.getArticle( groupId, articleId ) 
34	dataPublicacao = journalArticle["displayDate"]?datetime 
35	titulo = journalArticle["title"]!"" 
36	chapeu = (.vars['hat'].getData())!"" 
37	tituloCapa = (.vars['front_title'].getData())!"" 
38	subTitulo = (.vars['sub_title'].getData())!"" 
39	autor = (.vars['author'].getData())!"" 
40	local = (.vars['source'].getData())!"" 
41	imagemDestaque = (.vars['full_image'].getData())!"" 
42	imagemLegenda = (.vars['legenda_da_foto'].getData())!"" 
43	imagemCredito = (.vars['credito_da_foto'].getData())!"" 
44	urlVideo = (.vars['video'].getData())!"" 
45	idGaleria = (.vars['gallery'].getData())!"" 
46	anexos = (.vars['attach'])!"" 
47	resourceprimKey = journalArticle.getResourcePrimKey() 
48	classFileEntryID = 20423?long 
49/> 
50 
51<#function getAdaptiveMediaFromFileUploadField imageField> 
52	<#if imageField?? && imageField?has_content> 
53        <#attempt> 
54			<#assign imageData = imageField.data?eval> 
55			<#return "${themeDisplay.getURLPortal()}/o/adaptive-media/image/${imageData.fileEntryId}/Thumbnail-1024x1024/${imageData.title}"> 
56		<#recover> 
57			<#return "/o/mt-secom-theme/images/sem_imagem.jpg"> 
58		#attempt> 
59	<#else> 
60		<#return "Imagem não encontrada!"> 
61	#if> 
62#function> 
63 
64
65	.btn-warning{ 
66		margin-left: 230px;font-size: 15px; 
67
68	.component-title:before { 
69		content:"${chapeu}"; 
70		font-size: 13px; 
71		display: -webkit-box; 
72		line-height: 15px; 
73		text-transform: uppercase; 
74		font-family: Arial,Helvetica,sans-serif; 
75		display: block; 
76		text-align: left; 
77
78	.align-items-center.d-flex.mb-2 .header-back-to a { 
79		margin-top: 5px; 
80		font-size: 1.8em; 
81		margin-left: -10px; 
82
83	.portlet-boundary_com_liferay_portal_search_web_portlet_SearchPortlet_ { 
84		display: none; 
85
86	.increaseFont, 
87	.decreaseFont { 
88		cursor: pointer; 
89
90	.increaseFont a:hover, 
91	.decreaseFont a:hover { 
92		text-decoration: none !important; 
93
94	.increaseFont { 
95		font-size: 24px; 
96
97	.increaseFont i, 
98	.decreaseFont i { 
99		font-size: 14px; 
100
101	.full-content img { 
102		padding: 0px !important; 
103
104	.attach-content ol li { 
105		text-align: left; 
106
107	div.imgCaption { 
108		background: rgba(0, 0, 0, 0.5); 
109		color: rgb(220, 220, 220); 
110		font-size: 11px; 
111		padding: 0px 4px; 
112		position: relative; 
113
114	.full-content picture img { 
115		height: 100% !important; 
116		width: 100% !important; 
117
118	.full-content { 
119		font-size: 18px; 
120
121	.anexos > span { 
122		background: var(--color-azul-01); 
123		padding: 5px; 
124		font-weight: bold; 
125		color: white; 
126
127 
128 
129<@liferay_util["html-top"]> 
130	 
131	 
132	 
133	 
134	 
135	 
136	 
137	 
138@> 
139 
140<#macro exibeCorpoNoticia> 
141	<#assign legendasArray = [] /> 
142	<#assign regexImg = r']*src="http://www.secel.mt.gov.br/w/([^"]*)"[^>]*>' /> 
143	<#assign listaImgs = ((full_text.getData())!'')?matches(regexImg) /> 
144	<#assign corpoFinal = (full_text.getData())!'' /> 
145	<#list listaImgs as curImg> 
146		<#assign srcUrl = curImg?groups[1] /> 
147		<#assign temThumb = srcUrl?contains('imageThumbnail') /> 
148		<#if !temThumb> 
149			<#if srcUrl?contains('?') > 
150				<#assign separador="&" /> 
151			<#else> 
152				<#assign separador="?" /> 
153			#if> 
154			<#assign corpoFinal = corpoFinal?replace(srcUrl, "${srcUrl}${separador}imageThumbnail=3", 'f') /> 
155		#if> 
156		<#assign urlNovoFormato = srcUrl?starts_with("/documents/d/") /> 
157		<#assign filename = srcUrl?split("/")?last?split("?")?first /> 
158		<#if urlNovoFormato> 
159			<#-- DFCT0012822 - início --> 
160			<#assign returnFriendUrlHash =	FriendlyURLEntryLocalServiceUtil.fetchFriendlyURLEntry(groupId, classFileEntryID, filename)/> 
161			<#assign returnClassPKfetchFriendlyURL =	returnFriendUrlHash.classPK /> 
162			<#assign  
163				restReturn = restClient.get("/headless-delivery/v1.0/documents/${returnClassPKfetchFriendlyURL}")  
164				documentType = (restReturn["documentType"])![] 
165			/> 
166			<#if documentType["name"] == "Imagem"> 
167				<#list documentType["contentFields"] as contentField> 
168					<#if (contentField["name"]!'') == "image_text" > 
169						<#assign subTitleImg = (contentField["contentFieldValue"]["data"])!'' /> 
170					#if> 
171					<#if (contentField["name"]!'') == "image_credits" > 
172						<#assign creditImg = (contentField["contentFieldValue"]["data"])!'' /> 
173					#if> 
174					<#assign fullLegenda=""> 
175					<#if subTitleImg?has_content && !creditImg?has_content> 
176						<#assign fullLegenda = "Legenda - ${subTitleImg}" /> 
177					<#elseif !subTitleImg?has_content && creditImg?has_content> 
178						<#assign fullLegenda = "Créditos - ${creditImg}" /> 
179					<#elseif subTitleImg?has_content && creditImg?has_content> 
180						<#assign fullLegenda = "Legenda - ${subTitleImg} - Créditos - ${creditImg}" /> 
181					#if> 
182				#list> 
183				<#assign legendasArray = legendasArray + [fullLegenda]> 
184			<#else> 
185				<#assign legendasArray = legendasArray + [" "]> 
186			#if> 
187			<#-- DFCT0012822 - Fim --> 
188		<#elseif srcUrl?starts_with("/documents/") && srcUrl?split("/")[2]?matches(r"\d+")> 
189			<#assign fileEntryObj = (dlFileEntryLocalService.fetchFileEntry(filename, groupId))!"ERRO" /> 
190			<#if fileEntryObj?is_hash_ex > 
191				<#assign extRefCode = (fileEntryObj.getExternalReferenceCode())!'' /> 
192				<#if extRefCode?matches(r"\d+")> 
193					<#assign restReturn = restClient.get("/headless-delivery/v1.0/documents/${extRefCode}") /> 
194					<#assign documentType = (restReturn["documentType"])![] /> 
195					<#if documentType["name"] == "Imagem"> 
196						<#list documentType["contentFields"] as contentField> 
197							<#if contentField["name"]?? > 
198								<#if (contentField["name"]!'') == "image_text" > 
199									<#assign subTitleImg = (contentField["contentFieldValue"]["data"])!'' /> 
200								#if> 
201							#if> 
202							<#if contentField["name"]?? > 
203								<#if (contentField["name"]!'') == "image_credits" > 
204									<#assign creditImg = (contentField["contentFieldValue"]["data"])!'' /> 
205								#if> 
206							#if> 
207							<#assign fullLegenda="" /> 
208							<#if subTitleImg?has_content && !creditImg?has_content> 
209								<#assign fullLegenda = "Legenda - ${subTitleImg}" /> 
210							<#elseif !subTitleImg?has_content && creditImg?has_content> 
211								<#assign fullLegenda = "Créditos - ${creditImg}" /> 
212							<#elseif subTitleImg?has_content && creditImg?has_content> 
213								<#assign fullLegenda = "Legenda - ${subTitleImg} - Créditos - ${creditImg}" /> 
214							#if> 
215						#list> 
216						<#assign legendasArray = legendasArray + [fullLegenda]> 
217					<#else> 
218						<#assign legendasArray = legendasArray + [" "]> 
219					#if> 
220				<#else> 
221					<#assign legendasArray = legendasArray + [" "]> 
222				#if> 
223			<#else> 
224				<#assign legendasArray = legendasArray + [" "]> 
225			#if> 
226		<#else> 
227			<#assign legendasArray = legendasArray + [" "]> 
228		#if> 
229	#list> 
230	${corpoFinal} 
231	
232		let legendas = [ 
233			<#list legendasArray as legenda> 
234				"${legenda?js_string}"<#sep>, #sep> 
235			#list> 
236		]; 
237		$(function() { 
238			let images = document.querySelectorAll('.full-content img'); 
239			let pictures = document.querySelectorAll('.full-content picture'); 
240			 
241			function checkImageWidth(image, callback, tentativa = 0) { 
242				const maxAttempts = 10; 
243				const delay = 100; // tempo de espera entre as tentativas em milissegundos 
244 
245				if (image.width > 0 || tentativa >= maxAttempts) { 
246					callback(); 
247				} else { 
248					setTimeout(() => { 
249						checkImageWidth(image, callback, tentativa + 1); 
250					}, delay); 
251
252
253 
254			pictures.forEach(function(picture, index) { 
255				checkImageWidth(images[index], function() { 
256					if(legendas[index] != " "){ 
257						let caption = document.createElement('div'); 
258						 
259						caption.id = 'imgCaption_' + index; 
260						caption.classList.add('imgCaption'); 
261						caption.style.width = images[index].width + 'px'; 
262						caption.style.float = images[index].style.float; 
263						caption.textContent = legendas[index]; 
264 
265 
266						// Div da legenda por cima da foto: 
267						// caption.style.transform = 'translateY(-100%)'; 
268 
269						if (picture.parentNode.style.textAlign === 'center') { 
270							caption.style.left="50%"; 
271							caption.style.translate="-50%"; 
272
273						 
274						let wrapper = document.createElement('div'); 
275 
276						wrapper.appendChild(picture.cloneNode(true)); 
277						wrapper.appendChild(caption); 
278 
279						picture.parentNode.replaceChild(wrapper, picture); 
280
281				}); 
282			}); 
283		}); 
284	 
285#macro> 
286 
287<#-- Ajustar valores para ativar a validação de conteúdo apropriado para época de eleição --> 
288<#assign  
289	validarEleicao = false  
290	tagEleicao = "eleicao2026_nova" 
291/> 
292 
293<#if validarEleicao > 
294	<#assign 
295		assetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService") 
296		assetEntry = assetEntryLocalService.getEntry("com.liferay.journal.model.JournalArticle", resourceprimKey) 
297		jaTags = serviceLocator.findService("com.liferay.portal.kernel.service.AssetTagLocalService") 
298		listaTags = jaTags.getAssetEntryAssetTags(assetEntry.entryId) 
299	/> 
300	<#-- sites que não validam eleição (todo conteúdo é permitido) --> 
301	<#assign conteudoPermitido = groupId == 9777918 || groupId == 22572295 /> 
302 
303	<#-- Se conteudo possui tag de eleição ou é de site que não valida, permite o conteúdo --> 
304	<#assign conteudoPermitido = listaTags?seq_contains(tagEleicao) || conteudoPermitido /> 
305<#else> 
306	<#assign conteudoPermitido = true /> 
307#if> 
308 
309<#if !conteudoPermitido > 
310	
311	.portlet-body { display: none; } 
312	 
313<#else> 
314	${chapeu} 
315	

${titulo}

 
316   
319	
 
320	
${dataPublicacao}
 
321	
${subTitulo}
 
322	<#if local != "" > 
323		
 
324			${autor} | ${local} 
325		

 

326	<#else> 
327		 
330	#if> 
331	
 
332	<#if imagemDestaque != "" > 
333		<#if imagemLegenda != "" > 
334			<#if imagemCredito != "" > 
335				<#assign imagemCredito = " - Foto por: " + imagemCredito > 
336			#if> 
337		<#else> 
338			<#assign destaqueNovoFormato = imagemDestaque?contains("/documents/d/") /> 
339			<#assign destaqueEmLista = imagemDestaque?split("/") /> 
340			<#if destaqueEmLista?size gt 2> 
341				<#if destaqueNovoFormato > 
342					<#assign destaqueFileName = (destaqueEmLista[destaqueEmLista?size - 2]?split("?")?first)! /> 
343					<#if destaqueFileName != ''> 
344						<#assign  
345							destaqueFue =	FriendlyURLEntryLocalServiceUtil.fetchFriendlyURLEntry(groupId, classFileEntryID, destaqueFileName) 
346							destaqueClassPK =	destaqueFue.classPK 
347							restReturn = restClient.get("/headless-delivery/v1.0/documents/${destaqueClassPK}")  
348							documentType = (restReturn["documentType"])![] 
349						/> 
350						<#if documentType["name"] == "Imagem"> 
351							<#list documentType["contentFields"] as contentField> 
352								<#if (contentField["name"]!'') == "image_text" > 
353									<#assign imagemLegenda = (contentField["contentFieldValue"]["data"])!'' /> 
354								#if> 
355								<#if (contentField["name"]!'') == "image_credits" > 
356									<#assign imagemCredito = (contentField["contentFieldValue"]["data"])!'' /> 
357								#if> 
358							#list> 
359						#if> 
360					#if> 
361				#if> 
362				<#if imagemLegenda != "" && imagemCredito != "" > 
363					<#assign imagemCredito = " - Foto por: " + imagemCredito > 
364				#if> 
365			#if> 
366		#if> 
367		
 
368			
 
369				${imagemLegenda!} ${imagemCredito!} 
370			

 

371			
      
372                alt="${titulo} - ${imagemLegenda}"  
373                src="http://www.secel.mt.gov.br/w/${getAdaptiveMediaFromFileUploadField(full_image)}"  
374                class="featured-image img-fluid"  
375								style="width:100%;" 
376                title="${imagemLegenda} ${imagemCredito}" 
377            /> 
378		

 

379	#if> 
380 
381	
 
382		A |  
383		A 
384	

 

385	
 
386		<@exibeCorpoNoticia/> 
387	

 

388	
 
389	<#if urlVideo != "" && urlVideo??> 
390		<#if urlVideo?starts_with("https://youtu.be/")> 
391			<#assign urlVideo = urlVideo?split("/")[3]> 
392		<#else> 
393			<#assign urlVideo = ""> 
394			 
395			
396				$(function () { 
397					$('[data-toggle="popover"]').popover() 
398				}) 
399			 
400 
401		#if> 
402		
403			 
405			 
406		 
407		
408			 
410			 
411		 
 
412	#if> 
413	
 
414	<#if anexos?is_hash> 
415		<#if ((anexos.getSiblings()?size)!0) gt 0> 
416			<#list anexos.getSiblings() as cur_item> 
417				<#assign attachURL = cur_item.getData() > 
418				<#if attachURL?trim != ''> 
419					<#if cur_item["data"]?starts_with("{") && cur_item["data"]?ends_with("}") > 
420						<#assign attachTitle = ((cur_item["data"]?eval)["title"])!'Anexo' /> 
421					<#else> 
422						<#assign attachTitle="Anexo" /> 
423					#if> 
424					<#assign links_anexos = (links_anexos![]) + ["${attachTitle}"] /> 
425				#if> 
426			#list> 
427		#if> 
428		<#if (links_anexos![])?size gt 0> 
429			
 
430				
 
431					
 
432						Anexos
 
433						<#list links_anexos as cur_link> 
434							${cur_link} 
435						#list> 
436					

 

437				

 

438			

 

439		#if> 
440	#if> 
441 
442#if> 
443 
444<#if idGaleria?has_content> 
445	
 
446		<@liferay_journal["journal-article"] 
447			articleId=idGaleria 
448			groupId=groupId 
449		/> 
450	

 

451#if> 



FONTE

Google search engine