1<#assign breadCrumbService=serviceLocator.findService("no.oslomet.liferay.service.breadcrumbservice.api.BreadcrumbService")/>
2<#assign journalService=serviceLocator.findService("no.oslomet.liferay.service.customjournalservice.api.JournalService")/>
3
4<#if themeDisplay??>
5 <#assign breadcrumbs = breadCrumbService.getBreadCrumbs(themeDisplay.getPlid(), locale, false)>
6</#if>
7
8<#assign displaydate = .vars['reserved-article-display-date'].data>
9<#assign modifydate = .vars['reserved-article-modified-date'].data>
10<#assign orgloc = locale>
11<#assign originalLocale = .locale>
12<#setting locale = localeUtil.getDefault()>
13<#assign displaydate = displaydate?datetime("EEE, d MMM yyyy HH:mm:ss Z")>
14<#assign modifydate = modifydate?datetime("EEE, d MMM yyyy HH:mm:ss Z")>
15<#assign locale = originalLocale>
16
17<#assign showNoEnglish = false />
18<#if (orgloc == "en_US" && journalService.shouldShowLanguageMessage(themeDisplay,.vars['reserved-article-id'].getData()))>
19 <#assign showNoEnglish = true />
20</#if>
21
22<#assign showNoNorwegian = false />
23<#if (orgloc == "nb_NO" && nonorwegian?? && getterUtil.getBoolean(nonorwegian.getData()))>
24 <#assign showNoNorwegian = true />
25</#if>
26
27<#macro l key>
28 ${languageUtil.get(orgloc, key)}
29</#macro>
30
31<#-- Main content -->
32<div class="main row-fluid">
33
34 <#-- Article -->
35 <article class="article article-static" aria-label="<@l "template.aria.main.article"/>">
36 <#if (showNoEnglish || showNoNorwegian)>
37 <div class="article-header">
38 <h1 title="${.vars['reserved-article-title'].data}" class="article-title">
39
40 <#if (retur?? && retur?length >0)>
41 <span class="header-back-to"> <a class="icon-circle-arrow-left previous-level" href="${httpUtil.decodeURL(retur)}" title="<@l "template.back.to.overview"/>"> <span class="helper-hidden-accessible"><@l "template.back.to.overview"/></span> </a> </span>
42 </#if>
43
44 ${.vars['reserved-article-title'].data}
45 </h1>
46
47 <#if showNoEnglish>
48 <div class="alert alert-info"><@l "template.static.article.info.no.english"/></div>
49 <#else>
50 <div class="alert alert-info"><@l "template.static.article.info.no.norwegian"/></div>
51 </#if>
52 </div>
53 <#else>
54 <div class="article-header">
55 <#-- Title -->
56 <h1 title="${.vars['reserved-article-title'].data}" class="article-title">
57
58 <#if (retur?? && retur?length >0)>
59 <span class="header-back-to"> <a class="icon-circle-arrow-left previous-level" href="${httpUtil.decodeURL(retur)}" title="<@l "template.back.to.overview"/>"> <span class="helper-hidden-accessible"><@l "template.back.to.overview"/></span> </a> </span>
60 </#if>
61
62 ${.vars['reserved-article-title'].data}
63 </h1>
64 <#-- Lead -->
65 <div class="article-lead lead clearfix">
66 <strong>
67 ${ingress.getData()}
68 </strong>
69 </div>
70 <#-- Article meta -->
71 <div class="article-body clearfix">
72 <div class="article-meta clearfix">
73 <div class="published"><@l "template.statisk.artikkel.published"/> <time datetime="${displaydate?string["yyyy-MM-dd"]}">${displaydate?string["dd.MM.yyyy"]}</time></div>
74 <div class="modified"><@l "template.statisk.artikkel.last.update"/> <time datetime="${modifydate?string["yyyy-MM-dd"]}">${modifydate?string["dd.MM.yyyy"]}</time></div>
75 </div>
76 </div>
77 </div>
78 <#-- Body pt1 -->
79 <#if (body1.getData()) == "" >
80 <#elseif (body1.getData()) == "" >
81 <#else>
82 <div class="article-body clearfix">
83 ${body1.getData()}
84 </div>
85 </#if>
86 <#-- Shortcuts -->
87 <#if actionbuttonalttext?? && actionbuttonalttext.getSiblings()?has_content>
88 <#if (actionbuttonalttext.getSiblings()[0].getData()?length > 0)>
89 <ul class="article-btn-group clearfix">
90 <#list actionbuttonalttext.getSiblings() as cur_actionbuttonalttext>
91 <li class="article-btn">
92 <div class="article-bordered">
93 <div class="title">
94 <#if cur_actionbuttonalttext.getChild("title")??>
95 ${cur_actionbuttonalttext.getChild("title").getData()}
96 </#if>
97 </div>
98 <div class="text">
99 ${cur_actionbuttonalttext.getData()}
100 </div>
101 </div>
102 </li>
103 </#list>
104 </ul>
105 </#if>
106 </#if>
107 <#-- Button -->
108 <#if calltoactiontext?has_content>
109 <#if (calltoactiontext.getData()?length > 0)>
110 <#if body2.getData()?has_content>
111 <#assign bodyextra = ""/>
112 <#else>
113 <#assign bodyextra = "nobody"/>
114 </#if>
115 <div class="hidden-print">
116 <div class="btn-wrapper cta-btn-wrapper-bord">
117 <a href="${calltoactiontext.getChild('calltoactionlink').getData()}" class="btn article-btn2-top article-btn2 btn-large btn-primary offset3 clearfix ${bodyextra}" title="${calltoactiontext.getData()}" role="button">
118 ${calltoactiontext.getData()}
119 </a>
120 </div>
121 </div>
122 </#if>
123 </#if>
124 <#-- Body pt2 -->
125 <#if body2.getData()?has_content>
126 <div class="article-body clearfix">
127 <#if body3.getData()?has_content>
128 <div class="row">
129 <div class="col-md-6">
130 ${body2.getData()}
131 </div>
132 <div class="col-md-6">
133 ${body3.getData()}
134 </div>
135 </div>
136 <#else>
137 ${body2.getData()}
138 </#if>
139 </div>
140 </#if>
141 <#if themeDisplay.locale == "nb_NO" && paragraph??>
142 <#assign name = paragraph/>
143 <#assign body = "body"/>
144 </#if>
145 <#if themeDisplay.locale == "en_US" && enparagraph??>
146 <#assign name = enparagraph/>
147 <#assign body = "enbody"/>
148 </#if>
149 <#if (name?? && name.getSiblings()?has_content)>
150 <#assign has_content = false/>
151 <#assign accordions>
152 <ul type="A" id="statisk-artikkel-toggle">
153 <#list journalService.getAccordions(themeDisplay,.vars['reserved-article-id'].getData(), .vars['reserved-article-version'].getData(), name["name"], body, true) as cur_item>
154 <#if (cur_item["name"]?? && cur_item["name"]?length > 0 && cur_item["body"]?? && cur_item["body"]?length > 0)>
155 <#assign has_content = true/>
156 <li class="statisk-artikkel-accordion">
157 <h2 data-hasher="statisk_avsnitt_${cur_item["id"]}" tabindex="0" class="sa-t-header toggler-header">
158 ${cur_item["name"]}
159 <div class="hash-hack" id="statisk_avsnitt_${cur_item["id"]}"></div>
160 </h2>
161 <div class="clearfix"></div>
162 <div class="sa-t-content toggler-content">
163 ${cur_item["body"]}
164 </div>
165 </li>
166 </#if>
167 </#list>
168 </ul>
169 <script>
170 AUI().ready("aui-toggler", function (A) {
171 new A.TogglerDelegate({
172 animated: false,
173 closeAllOnExpand: false,
174 container: "#statisk-artikkel-toggle",
175 content: ".sa-t-content",
176 expanded: false,
177 header: ".sa-t-header",
178 transition: {
179 duration: 0.2,
180 easing: "cubic-bezier(0, 0.1, 0, 1)"
181 },
182 after: {
183 init: function (e) {
184 if (!Liferay.trekkspilllhopper) {
185 Liferay.trekkspillhopper = {
186 hopp: function (id) {
187 Liferay.trekkspillhopper.targets[id].expand();
188 A.one('#'+Liferay.trekkspillhopper.targets[id].get('header').getAttribute('data-hasher')).scrollIntoView();
189 },
190 targets: {}
191 }
192 }
193 e.target.collapseAll();
194 if (e.target.items.length > 0) {
195 e.target.items.forEach(function (item) {
196 Liferay.trekkspillhopper.targets[item.get('header').getAttribute('data-hasher')] = item;
197 if (window.location.hash.substr(1)) {
198 if (item.get('header').getAttribute('data-hasher') === window.location.hash.substr(1)) {
199 item.expand();
200 A.one('#'+item.get('header').getAttribute('data-hasher')).scrollIntoView();
201 }
202 }
203 item.get('header').on('click', function (event) {
204 if (event.altKey) {
205 if (event.shiftKey) {
206 console.log('URL for intern direktelenke: javascript:Liferay.trekkspillhopper.hopp(\'' +
207 item.get('header').getAttribute('data-hasher')+'\');');
208 prompt("Bruk denne URL-en for intern direktelenking til trekkspill:",
209 'javascript:Liferay.trekkspillhopper.hopp(\'' +
210 item.get('header').getAttribute('data-hasher')+'\');');
211 } else {
212 console.log('URL for direktelenke: ' +
213 location.protocol + '//' + location.host + location.pathname + '#' + item.get('header').getAttribute('data-hasher'));
214 prompt("Bruk denne URL-en for direktelenking til trekkspill:",
215 location.protocol + '//' + location.host + location.pathname + '#' + item.get('header').getAttribute('data-hasher'));
216 }
217 }
218 });
219 item.get('header').on('', function(event) {
220 if (event.keyCode === 13) {
221 item.toggle();
222 }
223 });
224 document.addEventListener('keydown', function(event){
225 if (event.key === "f" && (event.ctrlKey || event.metaKey)) {
226 item.expand();
227 }
228 });
229 });
230 <#--
231 <#if !.vars['nonexpand']?? || !getterUtil.getBoolean(.vars['nonexpand'].getData())>
232 e.target.items[0].expand();
233 </#if>
234 -->
235 }
236 }
237 }
238 });
239 });
240 </script>
241 </#assign>
242 <#if has_content>
243 ${accordions}
244 </#if>
245 </#if>
246 </#if>
247 </article>
248</div>