1<style>
2
3@include sm() {
4 .list-item-news > article > a > img {
5 width: 100% !important;
6 height: 250px !important;
7 height: calc(100vw / 2 / 1.7777) !important;
8 }
9}
10@include md() {
11 .list-item-news > article > a > img {
12 width: 100% !important;
13 height: calc(970px / 3 / 1.7777) !important;
14 }
15}
16@include lg() {
17 .list-item-news > article > a > img {
18 width: 100% !important;
19 height: 260px !important;
20 }
21}
22
23@media (min-width: 992px) {
24 .list-item-news > article > a > img {
25 width: 100% !important;
26 height: 260px !important;
27 }
28}
29
30@media (min-width: 767px) and (max-width: 992px) {
31 .list-item-news > article > a > img {
32 width: 100% !important;
33 height: 250px !important;
34 height: calc(100vw / 2 / 1.7777) !important;
35 }
36}
37
38
39</style>
40
41<#assign htmlUtil = staticUtil["com.liferay.portal.kernel.util.HtmlUtil"] />
42
43<#function printImage image alt>
44 <#if image?? && image != "">
45 <#if alt?? && alt != "">
46 <#return '<img src="${htmlUtil.escape(image)}" alt="${alt}" />'/>
47 <#else>
48 <#return '<img src="${htmlUtil.escape(image)}" alt=""/>'/>
49 </#if>
50 </#if>
51 <#return "">
52</#function>
53<#if entries?has_content>
54<div class="generic-content">
55 <div class="agbar-list list-news">
56 <div class="container">
57 <div class="row">
58 <#list entries as curEntry>
59 <#assign image = "">
60 <#assign imageAlt = "">
61 <#assign listImage = "">
62 <#assign listImageAlt = "">
63 <#assign detailImage = "">
64 <#assign detailImageAlt = "">
65 <#assign cssClass = (curEntry?index == 0)?then('h2','h4') />
66 <#assign
67 assetRenderer = curEntry.getAssetRenderer()
68 ddmFormValuesReader = assetRenderer.getDDMFormValuesReader()
69 textFields = ddmFormValuesReader.getDDMFormFieldValues('text')
70 dmImages = ddmFormValuesReader.getDDMFormFieldValues('image')
71 dateFields = ddmFormValuesReader.getDDMFormFieldValues('date')
72 />
73 <#assign titulo = assetRenderer.getTitle(locale)
74 listImage=""
75 listImageAlt=""
76 detailImage=""
77 detailImageAlt=""/>
78 <#list textFields as textField>
79 <#if textField.name == 'DescripcionListado'>
80 <#assign descripcion = textField.getValue().getString(locale) />
81 </#if>
82 </#list>
83 <#list dateFields as dateField>
84 <#if dateField.name == 'Fecha'>
85 <#assign fecha = dateField.getValue().getString(locale) />
86 </#if>
87 </#list>
88 <#list dmImages as dmImage>
89 <#assign value = ""/>
90 <#if dmImage.getValue().getString(locale)?has_content>
91 <#assign value = dmImage.getValue().getString(locale)/>
92 </#if>
93 <#if value?has_content && value != "">
94 <#assign icono_map = jsonFactoryUtil.createJSONObject(value) />
95 <#attempt>
96 <#if dmImage.name == 'ImagenListado'>
97 <#if (icono_map.groupId)?? && (icono_map.uuid)?? >
98 <#assign listImage = "/documents/" + icono_map.groupId + "/" + icono_map.uuid />
99 </#if>
100 <#if (icono_map.alt)??>
101 <#assign listImageAlt = icono_map.alt/>
102 </#if>
103 <#elseif dmImage.name == 'ImagenDetalle' && dmImage??>
104 <#if (icono_map.groupId)?? && (icono_map.uuid)?? >
105 <#assign detailImage = "/documents/" + icono_map.groupId + "/" + icono_map.uuid />
106 </#if>
107 <#if (icono_map.alt)??>
108 <#assign detailImageAlt = icono_map.alt/>
109 </#if>
110 </#if>
111 <#recover>
112 </#attempt>
113 </#if>
114 </#list>
115 <#if listImage?? && listImage != "">
116 <#assign image = listImage>
117 <#if listImageAlt?? && listImageAlt != "">
118 <#assign imageAlt = listImageAlt>
119 </#if>
120 <#elseif detailImage?? && detailImage != "">
121 <#assign image = detailImage>
122 <#if detailImageAlt?? && detailImageAlt != "">
123 <#assign imageAlt = detailImageAlt>
124 </#if>
125 </#if>
126 <#assign viewURL1 = assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, curEntry) />
127 <#assign viewURL2 = assetRenderer.getURLViewInContext(renderRequest, renderResponse, viewURL1) />
128 <div class="list-item-news col-md-4 col-sm-6 col-xs-12">
129 <article>
130 <a href="${viewURL2}" data-senna-off="true">
131 ${printImage(image, imageAlt)}
132 </a>
133 <#assign displayDate = curEntry.getCreateDate()?date>
134 <#if fecha?? && fecha != ''>
135
136 <#assign structureDate = fecha>
137 <#assign displayDate = dateUtil.parseDate("yyyy-MM-dd", structureDate, locale)>
138 </#if>
139 <time datetime="${dateUtil.getDate(displayDate, "dd/MM/yyyy", locale)}"><span>${dateUtil.getDate(displayDate, "dd MMM yyyy", locale)}</span></time>
140 <h2><a href="${viewURL2}" data-senna-off="true">${titulo}</a></h2>
141 </article>
142 </div>
143
144 </#list>
145 </div>
146 </div>
147 </div>
148 </div>
149</#if>