1<style>
2 .portlet{
3 margin: 0;
4 }
5
6 .modal.fade.modaltxtp.show {
7 z-index: 1061;
8 background-color: rgb(0 0 0 / 50%);
9}
10 .header_infor-back{
11 padding: 10px 0;
12 background: #B1D7A9 !important;
13 }
14 .header_infor-text{
15 margin-left: 4px;
16 margin-right: 4px;
17 font-family: 'Open Sans' !important;
18 font-style: normal !important;
19 font-weight: 400 !important;
20 font-size: 14px !important;
21 line-height: 150% !important;
22 color: #344054 !important;
23 }
24 .header_infor-color{
25 color: #344054 !important;
26 }
27 .header_infor-link{
28 font-family: 'Open Sans' !important;
29 font-style: normal !important;
30 font-weight: 400 !important;
31 font-size: 14px !important;
32 line-height: 150% !important;
33 color: #00558F !important;
34 text-decoration-line: underline;
35 overflow: hidden;
36 display: -webkit-box;
37 -webkit-line-clamp: 2;
38 -webkit-box-orient: vertical;
39 }
40
41 .header_infor-cls{
42 top: 9px;
43 right: 16px;
44 }
45 .header_infor-dnone{
46 display: none !important;
47 }
48 .header_infor-back svg{
49 width: 100%;
50 height: 100%;
51 }
52 .btn-close-pp{
53 border: none;
54 background: none;
55 }
56</style>
57<div class="header_infor-back d-flex position-relative" id="closeTopAdsBtnId">
58<div class="container" >
59 <div class="d-flex carousel" id="travel_advisory_id" data-interval="false">
60 <div class="col-9 col-lg-10 p-0 d-flex align-items-start">
61 <div class="header_infor-color" style="width: 23px;">
62 <svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
63 <path d="M9.99935 1.66666C5.39935 1.66666 1.66602 5.39999 1.66602 9.99999C1.66602 14.6 5.39935 18.3333 9.99935 18.3333C14.5993 18.3333 18.3327 14.6 18.3327 9.99999C18.3327 5.39999 14.5993 1.66666 9.99935 1.66666ZM10.8327 14.1667H9.16602V9.16666H10.8327V14.1667ZM10.8327 7.49999H9.16602V5.83332H10.8327V7.49999Z" fill="#344054"/>
64 </svg>
65 </div>
66 <#if locale.getLanguage() = "vi">
67 <span class="header_infor-text" style="width: 73px;">
68 Thông tin:
69 </span>
70 <#else>
71 <span class="header_infor-text">
72 Information:
73 </span>
74 </#if>
75 <div class="carousel-inner">
76 <#list entries as curEntry>
77
78 <#assign groupId = themeDisplay.getScopeGroupId()>
79
80 <#assign groupLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.GroupLocalService")>
81
82 <#assign group = groupLocalService.getGroup(groupId)>
83
84 <#assign friendlyURL = group.getFriendlyURL()>
85
86 <#assign locale = themeDisplay.getLocale()>
87
88 <#assign region = themeDisplay.getLocale().getCountry()>
89
90 <#assign language = themeDisplay.getLocale().getLanguage()>
91 <#assign infor_index_var = curEntry_index>
92 <#assign renderer = curEntry.getAssetRenderer() >
93 <#assign article = renderer.getArticle() >
94 <#assign tt = article.getTitle(locale)>
95 <#assign viewURL = assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, curEntry) />
96 <#assign viewURL23 = assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, renderer, curEntry, !stringUtil.equals(assetLinkBehavior, "showFullContent")) />
97 <#if curEntry_index = 0>
98 <div class="carousel-item active header_infor_class" index="${curEntry_index + 2}" style="cursor: pointer;" id="header_infor_id_${curEntry_index}" ids="myModalHeader${curEntry_index}" data-toggle="modal" data-target="#myModalHeader${curEntry_index}" onclick="onClickAddLink(this)"
99 href="/${friendlyURL}/${language}" he="${article.getUrlTitle()}">
100 <a class="header_infor-link text-wrap" >${tt}</a>
101 </div>
102 <#else>
103 <div class="carousel-item header_infor_class" index="${curEntry_index + 2}" style="cursor: pointer;" id="header_infor_id_${curEntry_index}" ids="myModalHeader${curEntry_index}" data-toggle="modal" data-target="#myModalHeader${curEntry_index}" onclick="onClickAddLink(this)"
104 href="${friendlyURL}/${language}" he="${article.getUrlTitle()}">
105 <a class="header_infor-link text-wrap" >${tt} </a>
106 </div>
107 </#if>
108
109 <!-- The Modal -->
110 <div class="modal fade modaltxtp" id="myModalHeader${curEntry_index}">
111 <div class="modal-dialog modal-xl">
112 <div class="modal-content p-3">
113 <div class="d-flex justify-content-between pt-4">
114 <button type="button" onclick="onClickDelLink(this)" href="/${friendlyURL}/${language}" class="btn-close-pp right-0" data-dismiss="modal" style="font-size: 0;">
115 <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
116 <path d="M25.8334 15.3416L24.6584 14.1666L20.0001 18.825L15.3417 14.1666L14.1667 15.3416L18.8251 20L14.1667 24.6583L15.3417 25.8333L20.0001 21.175L24.6584 25.8333L25.8334 24.6583L21.1751 20L25.8334 15.3416Z" fill="#667085"/>
117 </svg>
118 Close
119 </button>
120 </div>
121 <#assign
122 journalArticle = renderer.getAssetObject()
123 />
124 <@liferay_journal["journal-article"]
125 articleId=journalArticle.getArticleId()
126 groupId=journalArticle.getGroupId()
127 />
128 </div>
129 </div>
130 </div>
131 <!-- End -->
132
133 </#list>
134 </div>
135 </div>
136 <div class=" text-right header_infor-color col-2 p-0 d-flex justify-content-end align-items-center">
137 <span class="pr-1 d-flex" href="#travel_advisory_id" onclick="onClickPreInfor()" data-slide="prev" style="cursor:pointer;">
138 <svg width="7" height="12" viewBox="0 0 7 12" fill="none" xmlns="http://www.w3.org/2000/svg">
139 <path d="M5.75 10.5L1.25 6L5.75 1.5" stroke="#344054" stroke-width="1.5" stroke-linecap="square" stroke-linejoin="round"/>
140 </svg>
141 </span>
142 <div>
143 <span id="infor_index123"></span>/${entries?size}
144 </div>
145 <span class="pl-1 d-flex" href="#travel_advisory_id" data-slide="next" style="cursor:pointer;">
146 <svg width="7" height="12" onclick="onClickNeInfor()" viewBox="0 0 7 12" fill="none" xmlns="http://www.w3.org/2000/svg">
147 <path d="M1.25 10.5L5.75 6L1.25 1.5" stroke="#344054" stroke-width="1.5" stroke-linecap="square" stroke-linejoin="round"/>
148 </svg>
149 </span>
150
151 </div>
152 </div>
153</div>
154 <div class="cursor-pointer position-absolute header_infor-cls translate-middle header_infor-color mr-sm-4 mr-md-0 mr-0" style="cursor:pointer; top: 49%; right: 7px; width: 20px; height: 20px; transform: translate(-50%, -50%);"
155 onclick="onClickCloseAds()">
156 <svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
157 <path d="M15.8327 5.34166L14.6577 4.16666L9.99935 8.82499L5.34102 4.16666L4.16602 5.34166L8.82435 9.99999L4.16602 14.6583L5.34102 15.8333L9.99935 11.175L14.6577 15.8333L15.8327 14.6583L11.1743 9.99999L15.8327 5.34166Z" fill="#344054"/>
158 </svg>
159
160 </div>
161</div>
162
163<script>
164
165
166 window.addEventListener("load", () => {
167 var button = document.getElementById("search-button");
168
169 // Bắt sự kiện click vào nút
170 button.addEventListener("click", function(event) {
171 event.preventDefault();
172 var inputElement = document.getElementById("search-input");
173 var value = inputElement.value;
174 window.location.href = "${friendlyURL}/${language}"+ "/search-results?keyword="+value;
175
176 });
177 });
178
179document.getElementById("infor_index123").innerText = 1;
180var travel_advisory_index = 1;
181function onClickNeInfor(){
182 if( travel_advisory_index >= ${entries?size}){
183 travel_advisory_index = 1;
184 document.getElementById("infor_index123").innerText = travel_advisory_index;
185 }else{
186 travel_advisory_index = travel_advisory_index + 1;
187 document.getElementById("infor_index123").innerText = travel_advisory_index;
188 }
189}
190
191function onClickPreInfor(){
192
193
194
195 if( travel_advisory_index == 1){
196 travel_advisory_index = ${entries?size};
197 document.getElementById("infor_index123").innerText = travel_advisory_index;
198 }else{
199 travel_advisory_index = travel_advisory_index - 1;
200 document.getElementById("infor_index123").innerText = travel_advisory_index;
201 }
202}
203
204function onClickCloseAds(){
205 var closedItem = document.getElementById("closeTopAdsBtnId");
206 closedItem.classList.add("header_infor-dnone")
207}
208
209 let url2 = '';
210 function onClickAddLink(element){
211 const urlCustom = '${themeDisplay.getPortalURL()}' + element.getAttribute("href").replace('/', "");
212 console.log(element)
213 const urlCustom2 = element.getAttribute("he");
214 url2 = urlCustom.replace(/\/+$/, "");
215 window.history.pushState('', '', urlCustom.replace(/\/+$/, "") + '/' + urlCustom2);
216
217 }
218 function onClickDelLink(element){
219 const urlCustom = '${themeDisplay.getPortalURL()}';
220 window.history.pushState('', '', urlCustom.replace(/\/+$/, ""));
221 }
222
223 document.addEventListener("DOMContentLoaded", function() {
224 var modals = document.querySelectorAll(".modaltxtp");
225 modals.forEach(function(modal) {
226 modal.addEventListener("click", function(event) {
227 if (event.target === modal) {
228 window.history.pushState('', '', url2);
229 }
230 });
231 });
232 });
233</script>