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 <span class="header_infor-text">
67 Information:
68 </span>
69 <div class="carousel-inner">
70 <#list entries as curEntry>
71
72 <#assign groupId = themeDisplay.getScopeGroupId()>
73
74 <#assign groupLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.GroupLocalService")>
75
76 <#assign group = groupLocalService.getGroup(groupId)>
77
78 <#assign friendlyURL = group.getFriendlyURL()>
79
80 <#assign locale = themeDisplay.getLocale()>
81
82 <#assign region = themeDisplay.getLocale().getCountry()>
83
84 <#assign language = themeDisplay.getLocale().getLanguage()>
85 <#assign infor_index_var = curEntry_index>
86 <#assign renderer = curEntry.getAssetRenderer() >
87 <#assign article = renderer.getArticle() >
88 <#assign tt = article.getTitle(locale)>
89 <#assign viewURL = assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, curEntry) />
90 <#assign viewURL23 = assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, renderer, curEntry, !stringUtil.equals(assetLinkBehavior, "showFullContent")) />
91 <#if curEntry_index = 0>
92 <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)"
93 href="/${friendlyURL}/${language}" he="${article.getUrlTitle()}">
94 <a class="header_infor-link text-wrap" >${tt}</a>
95 </div>
96 <#else>
97 <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)"
98 href="${friendlyURL}/${language}" he="${article.getUrlTitle()}">
99 <a class="header_infor-link text-wrap" >${tt} </a>
100 </div>
101 </#if>
102
103 <!-- The Modal -->
104 <div class="modal fade modaltxtp" id="myModalHeader${curEntry_index}">
105 <div class="modal-dialog modal-xl">
106 <div class="modal-content p-3">
107 <div class="d-flex justify-content-between pt-4">
108 <button type="button" onclick="onClickDelLink(this)" href="/${friendlyURL}/${language}" class="btn-close-pp right-0" data-dismiss="modal" style="font-size: 0;">
109 <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
110 <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"/>
111 </svg>
112 Close
113 </button>
114 </div>
115 <#assign
116 journalArticle = renderer.getAssetObject()
117 />
118 <@liferay_journal["journal-article"]
119 articleId=journalArticle.getArticleId()
120 groupId=journalArticle.getGroupId()
121 />
122 </div>
123 </div>
124 </div>
125 <!-- End -->
126
127 </#list>
128 </div>
129 </div>
130 <div class=" text-right header_infor-color col-2 p-0 d-flex justify-content-end align-items-center">
131 <span class="pr-1 d-flex" href="#travel_advisory_id" onclick="onClickPreInfor()" data-slide="prev" style="cursor:pointer;">
132 <svg width="7" height="12" viewBox="0 0 7 12" fill="none" xmlns="http://www.w3.org/2000/svg">
133 <path d="M5.75 10.5L1.25 6L5.75 1.5" stroke="#344054" stroke-width="1.5" stroke-linecap="square" stroke-linejoin="round"/>
134 </svg>
135 </span>
136 <div>
137 <span id="infor_index123"></span>/${entries?size}
138 </div>
139 <span class="pl-1 d-flex" href="#travel_advisory_id" data-slide="next" style="cursor:pointer;">
140 <svg width="7" height="12" onclick="onClickNeInfor()" viewBox="0 0 7 12" fill="none" xmlns="http://www.w3.org/2000/svg">
141 <path d="M1.25 10.5L5.75 6L1.25 1.5" stroke="#344054" stroke-width="1.5" stroke-linecap="square" stroke-linejoin="round"/>
142 </svg>
143 </span>
144
145 </div>
146 </div>
147</div>
148 <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%);"
149 onclick="onClickCloseAds()">
150 <svg width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
151 <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"/>
152 </svg>
153
154 </div>
155</div>
156
157<script>
158
159
160 window.addEventListener("load", () => {
161 var button = document.getElementById("search-button");
162
163 // Bắt sự kiện click vào nút
164 button.addEventListener("click", function(event) {
165 event.preventDefault();
166 var inputElement = document.getElementById("search-input");
167 var value = inputElement.value;
168 window.location.href = "${friendlyURL}/${language}"+ "/search-results?keyword="+value;
169
170 });
171 });
172
173document.getElementById("infor_index123").innerText = 1;
174var travel_advisory_index = 1;
175function onClickNeInfor(){
176 if( travel_advisory_index >= ${entries?size}){
177 travel_advisory_index = 1;
178 document.getElementById("infor_index123").innerText = travel_advisory_index;
179 }else{
180 travel_advisory_index = travel_advisory_index + 1;
181 document.getElementById("infor_index123").innerText = travel_advisory_index;
182 }
183}
184
185function onClickPreInfor(){
186
187
188
189 if( travel_advisory_index == 1){
190 travel_advisory_index = ${entries?size};
191 document.getElementById("infor_index123").innerText = travel_advisory_index;
192 }else{
193 travel_advisory_index = travel_advisory_index - 1;
194 document.getElementById("infor_index123").innerText = travel_advisory_index;
195 }
196}
197
198function onClickCloseAds(){
199 var closedItem = document.getElementById("closeTopAdsBtnId");
200 closedItem.classList.add("header_infor-dnone")
201}
202
203 let url2 = '';
204 function onClickAddLink(element){
205 const urlCustom = '${themeDisplay.getPortalURL()}' + element.getAttribute("href").replace('/', "");
206 console.log(element)
207 const urlCustom2 = element.getAttribute("he");
208 url2 = urlCustom.replace(/\/+$/, "");
209 window.history.pushState('', '', urlCustom.replace(/\/+$/, "") + '/' + urlCustom2);
210
211 }
212 function onClickDelLink(element){
213 const urlCustom = '${themeDisplay.getPortalURL()}';
214 window.history.pushState('', '', urlCustom.replace(/\/+$/, ""));
215 }
216
217 document.addEventListener("DOMContentLoaded", function() {
218 var modals = document.querySelectorAll(".modaltxtp");
219 modals.forEach(function(modal) {
220 modal.addEventListener("click", function(event) {
221 if (event.target === modal) {
222 window.history.pushState('', '', url2);
223 }
224 });
225 });
226 });
227</script>