1<#assign CATEGORY_TEMAS_ID = 1393358 />
2<#assign STRUCTURE_KEY_ARTICLES = "1389184" />
3<#assign STRUCTURE_KEY_NEWS = "1342609" />
4<#assign DESCRIPTION_MAX_LENGTH = 150 />
5
6<#macro getFields curEntry>
7 <#assign assetRenderer = curEntry.getAssetRenderer() />
8 <#assign article = assetRenderer.getArticle() />
9 <#assign DDM_STRUCTURE_KEY = article.getDDMStructureKey() />
10 <#assign articleThumbnail = article.getArticleImageURL(themeDisplay)!"" />
11
12 <#assign document = saxReaderUtil.read(article.getContent()) />
13 <#assign rootElement = document.getRootElement() />
14 <#assign categories = curEntry.getCategories() />
15 <#assign publishDate = curEntry.getPublishDate()?date?string("dd/MM/yyyy") />
16
17 <#attempt>
18 <#if DDM_STRUCTURE_KEY = STRUCTURE_KEY_ARTICLES>
19 <#assign dynamicElement = "textoartigo" />
20 <#elseif DDM_STRUCTURE_KEY = STRUCTURE_KEY_NEWS>
21 <#assign dynamicElement = "texto" />
22 </#if>
23
24 <#assign viewURL = assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, curEntry) />
25 <#assign viewURL = assetRenderer.getURLViewInContext(renderRequest, renderResponse, viewURL) />
26
27 <#if DDM_STRUCTURE_KEY = STRUCTURE_KEY_NEWS>
28 <#assign viewURL = "/busca-de-noticias/-/noticia/" + article.getResourcePrimKey() + "/" + assetRenderer.getUrlTitle()/>
29 <#assign xPathSelectorAuthor = saxReaderUtil.createXPath("dynamic-element[@name='exibirimagememdestaqueFieldSet']") />
30 </#if>
31
32 <#assign xPathSelectorContent = saxReaderUtil.createXPath("dynamic-element[@name='" + dynamicElement + "']")>
33
34 <#assign articleSummary = assetRenderer.getSummary(null, null)!"" />
35 <#assign limitedSummary = makeShortDescription(articleSummary) />
36 <#recover>
37 <#assign limitedSummary = "Sem resumo disponível." />
38
39 </#attempt>
40</#macro>
41
42<#function makeShortDescription text>
43 <#if text?length gt DESCRIPTION_MAX_LENGTH>
44 <#return text?substring(0, DESCRIPTION_MAX_LENGTH) + "..." />
45 <#else>
46 <#return text />
47 </#if>
48</#function>
49
50<style>
51.embp-manchete-news {
52 margin: 0;
53 padding: 0;
54 list-style: none;
55 display: flex;
56 flex-direction: column;
57 gap: 20px;
58}
59
60.embp-manchete-news_item {
61 border-bottom: solid 1px #DDD;
62 padding-bottom: 20px;
63 display: flex;
64 justify-content: space-between;
65}
66
67.embp-manchete-news_item>img {
68 width: 158px;
69 height: 84px;
70 object-fit: cover;
71 border-radius: 8px;
72}
73
74.embp-manchete-news_item .header {
75 display: flex;
76 align-items: center;
77 list-style: none;
78 padding: 0;
79 margin: 0;
80}
81
82.embp-manchete-news_item .header>div {
83 font-size: 0.75rem;
84 border-right: solid 2px gray;
85 padding-right: 15px;
86 font-weight: 700;
87}
88
89.embp-manchete-news_item .header>ul {
90 list-style: none;
91 display: flex;
92 flex-wrap: wrap;
93 gap: 10px;
94 padding: 0 0 0 15px;
95 margin: 0;
96}
97
98.embp-manchete-news_item .header>ul li {
99 text-transform: uppercase;
100 font-size: 0.75rem;
101}
102
103.embp-manchete-news_item a {
104 color: #3a74b0;
105 font-size: 1.2rem;
106 line-height: 1.5rem;
107 font-weight: 700;
108 display: block;
109 margin-top: 10px;
110}
111
112.embp-manchete-news_item>div:last-child {
113 font-size: 0.875rem;
114}
115
116@media screen and (max-width: 768px) {
117 .embp-manchete-news_item {
118 flex-direction: column-reverse;
119 gap: 15px;
120 }
121}
122</style>
123<#if entries?has_content>
124 <ul class="embp-manchete-news">
125 <#list entries as curEntry>
126 <@getFields curEntry=curEntry />
127 <li class="embp-manchete-news_item">
128 <div>
129 <div class="header">
130 <div>
131 ${publishDate}
132 </div>
133 <ul>
134 <#list categories as category>
135 <#if category.getVocabularyId()==CATEGORY_TEMAS_ID>
136 <li>
137 ${category.getName()}
138 </li>
139 </#if>
140 </#list>
141 </ul>
142 </div>
143 <a href="${viewURL}">
144 ${curEntry.getTitle(locale)}
145 </a>
146 <div class="mt-2 embp-manchete-news_item-desc">
147 ${limitedSummary}
148 </div>
149 </div>
150 <#if articleThumbnail !="">
151 <img src="${articleThumbnail}" />
152 </#if>
153 </li>
154 </#list>
155 </ul>
156</#if>