Error compiling template "Designs/Dwsimple/_parsed/product-catalogue.parsed.cshtml"
Line 5759: A local variable named 'request' is already defined in this scope
1 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>
2
3 @using System
4 @using System.Web
5 @using System.Globalization
6 @using Dynamicweb.Frontend.Devices
7 @using System.Text.RegularExpressions
8 @using Dynamicweb.Environment.Helpers
9 @using Dynamicweb.Rendering
10
11 @using System.Text.RegularExpressions
12 @using System.Web
13
14
15 @functions{
16 public class WrapMethods
17 {
18 //Gets the contrasting color
19 public static string getContrastYIQ(string hexcolor)
20 {
21 if (hexcolor != "")
22 {
23 hexcolor = Regex.Replace(hexcolor, "[^0-9a-zA-Z]+", "");
24
25 int r = Convert.ToByte(hexcolor.Substring(0, 2), 16);
26 int g = Convert.ToByte(hexcolor.Substring(2, 2), 16);
27 int b = Convert.ToByte(hexcolor.Substring(4, 2), 16);
28 int yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000;
29
30 if (yiq >= 128)
31 {
32 return "black";
33 }
34 else
35 {
36 return "white";
37 }
38 }
39 else
40 {
41 return "black";
42 }
43 }
44
45
46 //Truncate text
47 public static string Truncate (string value, int count, bool strip=true)
48 {
49 if (strip == true){
50 value = StripHtmlTagByCharArray(value);
51 }
52
53 if (value.Length > count)
54 {
55 value = value.Substring(0, count - 1) + "...";
56 }
57
58 return value;
59 }
60
61
62 //Strip text from HTML
63 public static string StripHtmlTagByCharArray(string htmlString)
64 {
65 char[] array = new char[htmlString.Length];
66 int arrayIndex = 0;
67 bool inside = false;
68
69 for (int i = 0; i < htmlString.Length; i++)
70 {
71 char let = htmlString[i];
72 if (let == '<')
73 {
74 inside = true;
75 continue;
76 }
77 if (let == '>')
78 {
79 inside = false;
80 continue;
81 }
82 if (!inside)
83 {
84 array[arrayIndex] = let;
85 arrayIndex++;
86 }
87 }
88 return new string(array, 0, arrayIndex);
89 }
90
91 //Make the correct count of columns
92 public static string ColumnMaker(int Col, string ScreenSize)
93 {
94 string Columns = "";
95
96 switch (Col)
97 {
98 case 1:
99 Columns = "col-"+ScreenSize+"-12";
100 break;
101
102 case 2:
103 Columns = "col-"+ScreenSize+"-6";
104 break;
105
106 case 3:
107 Columns = "col-"+ScreenSize+"-4";
108 break;
109
110 case 4:
111 Columns = "col-"+ScreenSize+"-3";
112 break;
113
114 default:
115 Columns = "col-"+ScreenSize+"-3";
116 break;
117 }
118
119 return Columns;
120 }
121
122
123 private string Custom(string firstoption, string secondoption)
124 {
125 if (firstoption == "custom")
126 {
127 return secondoption;
128 }
129 else
130 {
131 return firstoption;
132 }
133 }
134 }
135 }
136
137
138
139
140
141 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>
142
143 @helper MiniCart()
144 {
145 <div class="dropdown-cart">
146 @if (GetInteger("Ecom:Order.OrderLines.TotalProductQuantity") > 0)
147 {
148 <div id="full-cart">
149 <div class="col-md-12 col-sm-12 col-xs-12">
150 <div class="row" id="minicart-content">
151 <span class="cart-items">@Translate("You have", "You have") <span id="mincart-total-items"></span> @Translate("items in your cart", "items in your cart")</span>
152 <table class="table table-cart">
153 <thead>
154 <tr>
155 <th></th>
156 <th>@Translate("Product", "Product")</th>
157 <th class="text-center">@Translate("Qty", "Qty")</th>
158 <th class="text-right">@Translate("Total", "Total")</th>
159 </tr>
160 </thead>
161 <tbody>
162
163 @* Orderlines are rendered from the Ajax template *@
164
165 </tbody>
166 <tfoot>
167 <tr>
168 <td class="text-center"><i class="fa fa-credit-card"></i></td>
169 <td id="minicart-payment"></td>
170 <td class="text-center"></td>
171 <td class="text-right" id="minicart-paymentfee"></td>
172 </tr>
173 <tr>
174 <td class="text-center"><i class="fa fa-truck"></i></td>
175 <td id="minicart-shipping"></td>
176 <td class="text-center"></td>
177 <td class="text-right" id="minicart-shippingfee"></td>
178 </tr>
179 <tr>
180 <td></td>
181 <td><strong>@Translate("Total", "Total")</strong></td>
182 <td class="text-center" id="minicart-total"></td>
183 <td class="text-right" id="minicart-totalprice"></td>
184 </tr>
185 </tfoot>
186 </table>
187 </div>
188 </div>
189 <div class="col-md-12 col-sm-12 col-xs-12">
190 <div class="row">
191 <div class="col-md-8">
192 <button class="btn btn-xs btn-secondary pull-left" onclick="EmptyCart();">@Translate("Empty cart", "Empty cart")</button>
193 </div>
194 <div class="col-md-4">
195 @{
196 var cartid = GetValue("DwAreaCartPageID");
197 }
198
199 <a href="Default.aspx?ID=@cartid" class="btn btn-xs btn-primary pull-right">@Translate("Proceed to checkout", "Proceed to checkout")</a>
200 <span class="clearfix"></span>
201 </div>
202 </div>
203 <div class="row"> </div>
204 </div>
205 </div>
206 }
207 else
208 {
209 <span class="cart-items" id="empty-cart">@Translate("Your shopping cart is empty", "Your shopping cart is empty")</span>
210 }
211 </div>
212 }
213
214 <!DOCTYPE html>
215 <html lang="no">
216 <head>
217 <!-- Global site tag (gtag.js) - Google Analytics -->
218 <script async="" src="https://www.googletagmanager.com/gtag/js?id=UA-27549427-1"></script>
219 <script>
220 window.dataLayer = window.dataLayer || [];
221 function gtag(){dataLayer.push(arguments);}
222 gtag('js', new Date());
223
224 gtag('config', 'UA-27549427-1');
225 </script>
226
227 <meta charset="utf-8">
228 <title>@GetValue("Title")</title>
229 @GetValue("MetaTags")
230 @GetValue("CopyRightNotice")
231
232
233 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
234 <meta name="robots" content="index, follow">
235
236 @{
237 string MetaDescription = GetString("Meta.Description");
238 string MetaKeywords = GetString("Meta.Keywords");
239 string GoogleTagManagerId = GetString("Item.Area.GoogleTagManagerId");
240 string favicon = GetString("Item.Area.Favicon");
241 string currentpageid = GetString("DwPageID");
242 string firstpageid = GetString("DwAreaFirstActivePageID");
243 string logoutid = GetString("Item.Area.LogOutId");
244 string searchplaceholder = Translate("Search products", "Search products");
245 string newsletterid = GetString("Item.Area.NewsletterSignUpFormParagrahId");
246 string downloadLink = GetString("Item.Area.DowloadsLink");
247 string pressLink = GetString("Item.Area.PressLink");
248 }
249
250
251
252
253 @* GOOGLE TAG MANAGER *@
254
255
256 <script>
257
258 (function (w, d, s, l, i) {
259 w[l] = w[l] || []; w[l].push({
260 'gtm.start':
261 new Date().getTime(), event: 'gtm.js'
262 }); var f = d.getElementsByTagName(s)[0],
263 j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f);
264 })(window, document, 'script', 'dataLayer', '@GoogleTagManagerId');
265
266 </script>
267
268 @* FACEBOOK ADMIN *@
269 @if (!string.IsNullOrWhiteSpace(GetString("Item.Area.FacebookCommendAdmin")))
270 {
271 string fbadmin = GetString("Item.Area.FacebookCommendAdmin");
272 <meta property="fb:admins" content="@fbadmin">
273 }
274
275 @* ESSENTIAL STYLES *@
276 <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.4/css/bootstrap.min.css" type="text/css">
277 <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css">
278 <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/fancybox/3.1.20/jquery.fancybox.min.css" media="screen">
279 <link href="/Files/Templates/Designs/Dwsimple/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
280 <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/flag-icon-css/2.5.0/css/flag-icon.min.css" type="text/css">
281
282 @* MOBILE MENU STYLES *@
283 <link href="//cdnjs.cloudflare.com/ajax/libs/jasny-bootstrap/3.1.3/css/jasny-bootstrap.min.css" rel="stylesheet" type="text/css" media="screen">
284
285 @* FAVICON *@
286 <link href="@favicon" rel="icon" type="image/png">
287
288 @* VARIABLES *@
289 @{
290 var attrValue = "";
291 var cartid = GetValue("DwAreaCartPageID");
292 var searchpage = GetString("Item.Area.ShowSearchPage");
293
294 //DateTime areaUpdated = (DateTime)Pageview.Area.get_Value("AreaUpdatedDate");
295 DateTime areaUpdated = DateTime.Now;
296 string cssPath = HttpContext.Current.Server.MapPath("/Files/Templates/Designs/Dwsimple/css/DWGlobalStylesSite" + GetString("DwAreaID") + "_auto.min.css");
297 DateTime lastWriteTime = System.IO.File.GetLastWriteTime(cssPath);
298 bool writeCss = false;
299 string css = String.Empty;
300
301 //if (areaUpdated > lastWriteTime)
302 //{
303 // writeCss = true;
304 //}
305
306 if (areaUpdated > lastWriteTime.AddMinutes(1))
307 {
308 writeCss = true;
309 }
310
311 bool IsNotLoggedIn = !string.IsNullOrWhiteSpace(GetString("DW_extranet_error_uk")) ? false : true;
312 }
313
314 @* FONT SETTINGS *@
315 @{
316
317 }
318 @functions{
319 public class FontSettings
320 {
321 public class Logo
322 {
323 public static string FontFamily { get; set; }
324 public static string FontSize { get; set; }
325 public static string FontWeight { get; set; }
326 public static string Color { get; set; }
327 public static string LineHeight { get; set; }
328 public static string Casing { get; set; }
329 public static string LetterSpacing { get; set; }
330 }
331
332 public class Slogan
333 {
334 public static string FontFamily { get; set; }
335 public static string FontSize { get; set; }
336 public static string FontWeight { get; set; }
337 public static string Color { get; set; }
338 public static string LineHeight { get; set; }
339 public static string Casing { get; set; }
340 public static string LetterSpacing { get; set; }
341 }
342
343 public class H1
344 {
345 public static string FontFamily { get; set; }
346 public static string FontSize { get; set; }
347 public static string FontWeight { get; set; }
348 public static string Color { get; set; }
349 public static string LineHeight { get; set; }
350 public static string Casing { get; set; }
351 public static string LetterSpacing { get; set; }
352 }
353
354 public class H2
355 {
356 public static string FontFamily { get; set; }
357 public static string FontSize { get; set; }
358 public static string FontWeight { get; set; }
359 public static string Color { get; set; }
360 public static string LineHeight { get; set; }
361 public static string Casing { get; set; }
362 public static string LetterSpacing { get; set; }
363 }
364 public class H3
365 {
366 public static string FontFamily { get; set; }
367 public static string FontSize { get; set; }
368 public static string FontWeight { get; set; }
369 public static string Color { get; set; }
370 public static string LineHeight { get; set; }
371 public static string Casing { get; set; }
372 public static string LetterSpacing { get; set; }
373 }
374 public class H4
375 {
376 public static string FontFamily { get; set; }
377 public static string FontSize { get; set; }
378 public static string FontWeight { get; set; }
379 public static string Color { get; set; }
380 public static string LineHeight { get; set; }
381 public static string Casing { get; set; }
382 public static string LetterSpacing { get; set; }
383 }
384 public class Body
385 {
386 public static string FontFamily { get; set; }
387 public static string FontSize { get; set; }
388 public static string FontWeight { get; set; }
389 public static string Color { get; set; }
390 public static string LineHeight { get; set; }
391 public static string Casing { get; set; }
392 public static string LetterSpacing { get; set; }
393 }
394 }
395
396 private void InitFontSettings()
397 {
398 //LOGO
399 FontSettings.Logo.FontFamily = CustomFont(GetString("Item.Area.LogoFont.Font"), GetString("Item.Area.LogoFont.CustomFont"));
400 FontSettings.Logo.FontSize = GetString("Item.Area.LogoFont.Size") + "px";
401 FontSettings.Logo.FontWeight = CheckExistence(GetString("Item.Area.LogoFont.Weight"), "normal");
402 FontSettings.Logo.LineHeight = CheckExistence(GetString("Item.Area.LogoFont.LineHeight"), "1");
403 FontSettings.Logo.LetterSpacing = GetString("Item.Area.LogoFont.LetterSpacing") + "px";
404 FontSettings.Logo.Casing = GetString("Item.Area.LogoFont.Casing");
405 FontSettings.Logo.Color = GetString("Item.Area.LogoFont.Color.Color");
406
407
408 //SLOGAN
409 FontSettings.Slogan.FontFamily = CustomFont(GetString("Item.Area.LogoSloganFont.Font"), GetString("Item.Area.LogoSloganFont.CustomFont"));
410 FontSettings.Slogan.FontSize = GetString("Item.Area.LogoSloganFont.Size") + "px";
411 FontSettings.Slogan.FontWeight = CheckExistence(GetString("Item.Area.LogoSloganFont.Weight"), "normal");
412 FontSettings.Slogan.LineHeight = CheckExistence(GetString("Item.Area.LogoSloganFont.LineHeight"), "1");
413 FontSettings.Slogan.LetterSpacing = GetString("Item.Area.LogoSloganFont.LetterSpacing") + "px";
414 FontSettings.Slogan.Casing = GetString("Item.Area.LogoSloganFont.Casing");
415 FontSettings.Slogan.Color = GetString("Item.Area.LogoSloganFont.Color.Color");
416
417
418 //HEADINGS
419 FontSettings.H1.FontFamily = CustomFont(GetString("Item.Area.HeadingsH1.Font"), GetString("Item.Area.HeadingsH1.CustomFont"));
420 FontSettings.H1.FontSize = GetString("Item.Area.HeadingsH1.Size") + "px";
421 FontSettings.H1.FontWeight = CheckExistence(GetString("Item.Area.HeadingsH1.Weight"), "normal");
422 FontSettings.H1.LineHeight = CheckExistence(GetString("Item.Area.HeadingsH1.LineHeight"), "1");
423 FontSettings.H1.LetterSpacing = GetString("Item.Area.HeadingsH1.LetterSpacing") + "px";
424 FontSettings.H1.Casing = GetString("Item.Area.HeadingsH1.Casing");
425 FontSettings.H1.Color = GetString("Item.Area.HeadingsH1.Color.Color");
426
427 FontSettings.H2.FontFamily = CustomFont(GetString("Item.Area.HeadingsH2.Font"), GetString("Item.Area.HeadingsH2.CustomFont"));
428 FontSettings.H2.FontSize = GetString("Item.Area.HeadingsH2.Size") + "px";
429 FontSettings.H2.FontWeight = CheckExistence(GetString("Item.Area.HeadingsH2.Weight"), "normal");
430 FontSettings.H2.LineHeight = CheckExistence(GetString("Item.Area.HeadingsH2.LineHeight"), "1");
431 FontSettings.H2.LetterSpacing = GetString("Item.Area.HeadingsH2.LetterSpacing") + "px";
432 FontSettings.H2.Casing = GetString("Item.Area.HeadingsH2.Casing");
433 FontSettings.H2.Color = GetString("Item.Area.HeadingsH2.Color.Color");
434
435 FontSettings.H3.FontFamily = CustomFont(GetString("Item.Area.HeadingsH3.Font"), GetString("Item.Area.HeadingsH3.CustomFont"));
436 FontSettings.H3.FontSize = GetString("Item.Area.HeadingsH3.Size") + "px";
437 FontSettings.H3.FontWeight = CheckExistence(GetString("Item.Area.HeadingsH3.Weight"), "normal");
438 FontSettings.H3.LineHeight = CheckExistence(GetString("Item.Area.HeadingsH3.LineHeight"), "1");
439 FontSettings.H3.LetterSpacing = GetString("Item.Area.HeadingsH3.LetterSpacing") + "px";
440 FontSettings.H3.Casing = GetString("Item.Area.HeadingsH3.Casing");
441 FontSettings.H3.Color = GetString("Item.Area.HeadingsH3.Color.Color");
442
443 FontSettings.H4.FontFamily = CustomFont(GetString("Item.Area.HeadingsH4.Font"), GetString("Item.Area.HeadingsH4.CustomFont"));
444 FontSettings.H4.FontSize = GetString("Item.Area.HeadingsH4.Size") + "px";
445 FontSettings.H4.FontWeight = CheckExistence(GetString("Item.Area.HeadingsH4.Weight"), "normal");
446 FontSettings.H4.LineHeight = CheckExistence(GetString("Item.Area.HeadingsH4.LineHeight"), "1");
447 FontSettings.H4.LetterSpacing = GetString("Item.Area.HeadingsH4.LetterSpacing") + "px";
448 FontSettings.H4.Casing = GetString("Item.Area.HeadingsH4.Casing");
449 FontSettings.H4.Color = GetString("Item.Area.HeadingsH4.Color.Color");
450
451
452 //BODY
453 FontSettings.Body.FontFamily = CustomFont(GetString("Item.Area.BodyFont.Font"), GetString("Item.Area.BodyFont.CustomFont"));
454 FontSettings.Body.FontSize = GetString("Item.Area.BodyFont.Size") + "px";
455 FontSettings.Body.FontWeight = CheckExistence(GetString("Item.Area.BodyFont.Weight"), "normal");
456 FontSettings.Body.LineHeight = CheckExistence(GetString("Item.Area.BodyFont.LineHeight"), "1");
457 FontSettings.Body.LetterSpacing = GetString("Item.Area.BodyFont.LetterSpacing") + "px";
458 FontSettings.Body.Casing = GetString("Item.Area.BodyFont.Casing");
459 FontSettings.Body.Color = GetString("Item.Area.BodyFont.Color.Color");
460
461
462 gfonts.Add(FontSettings.Logo.FontFamily, "");
463
464 if (!gfonts.ContainsKey(FontSettings.Slogan.FontFamily))
465 {
466 gfonts.Add(FontSettings.Slogan.FontFamily, "");
467 }
468 if (!gfonts.ContainsKey(FontSettings.H1.FontFamily))
469 {
470 gfonts.Add(FontSettings.H1.FontFamily, "");
471 }
472 if (!gfonts.ContainsKey(FontSettings.H2.FontFamily))
473 {
474 gfonts.Add(FontSettings.H2.FontFamily, "");
475 }
476 if (!gfonts.ContainsKey(FontSettings.H3.FontFamily))
477 {
478 gfonts.Add(FontSettings.H3.FontFamily, "");
479 }
480 if (!gfonts.ContainsKey(FontSettings.H4.FontFamily))
481 {
482 gfonts.Add(FontSettings.H4.FontFamily, "");
483 }
484 if (!gfonts.ContainsKey(FontSettings.Body.FontFamily))
485 {
486 gfonts.Add(FontSettings.Body.FontFamily, "");
487 }
488
489 }
490
491 private string CustomFont(string firstfont, string secondfont)
492 {
493 if (firstfont == "custom")
494 {
495 return secondfont;
496 }
497 else
498 {
499 return firstfont;
500 }
501 }
502
503 private string CheckExistence(string stringitem, string defaultvalue)
504 {
505 if (!string.IsNullOrWhiteSpace(stringitem))
506 {
507 return stringitem;
508 }
509 else
510 {
511 return defaultvalue;
512 }
513 }
514
515 private System.Collections.Generic.Dictionary<string, object>
516 gfonts = new System.Collections.Generic.Dictionary<string, object>
517 ();
518 }
519
520 @{
521 InitFontSettings();
522 }
523
524 @helper GoogleFonts()
525 {
526 if (gfonts != null)
527 {
528 foreach (var item in gfonts)
529 {
530 string fontName = item.Key.Replace(" ", "+");
531 if (fontName.Contains("MetaPro-Norm") || fontName.Contains("MetaPro-Black"))
532 {
533 <link rel="stylesheet" href="/Files/Templates/Designs/Dwsimple/css/font.css" type="text/css">
534 }
535 else
536 {
537 <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=@item.Key:100,200,300,400,500,600,700,800,900">
538 }
539
540 }
541 }
542 }
543
544 @functions{
545 public string FontStylesCSS()
546 {
547 string CssString = @"
548 .dw-logotext {
549 font-family: " + FontSettings.Logo.FontFamily + @", sans-serif;
550 font-size: " + FontSettings.Logo.FontSize + @";
551 font-weight: " + FontSettings.Logo.FontWeight + @";
552 line-height: " + FontSettings.Logo.LineHeight + @" !important;
553 letter-spacing: " + FontSettings.Logo.LetterSpacing + @";
554 text-transform: " + FontSettings.Logo.Casing + @";
555 color: " + FontSettings.Logo.Color + @";
556 }
557
558 .dw-slogantext {
559 font-family: " + FontSettings.Slogan.FontFamily + @", sans-serif;
560 font-size: " + FontSettings.Slogan.FontSize + @";
561 font-weight: " + FontSettings.Slogan.FontWeight + @";
562 line-height: " + FontSettings.Slogan.LineHeight + @" !important;
563 letter-spacing: " + FontSettings.Slogan.LetterSpacing + @";
564 text-transform: " + FontSettings.Slogan.Casing + @";
565 color: " + FontSettings.Slogan.Color + @";
566 }
567
568 h1 {
569 font-family: " + FontSettings.H1.FontFamily + @", sans-serif !important;
570 font-size: " + FontSettings.H1.FontSize + @";
571 color: " + FontSettings.H1.Color + @";
572 line-height: " + FontSettings.H1.LineHeight + @" !important;
573 text-transform: " + FontSettings.H1.Casing + @";
574 font-weight: " + FontSettings.H1.FontWeight + @";
575 letter-spacing: " + FontSettings.H1.LetterSpacing + @" !important;
576 }
577
578 h3 {
579 font-family: " + FontSettings.H3.FontFamily + @", sans-serif !important;
580 font-size: " + FontSettings.H3.FontSize + @";
581 color: " + FontSettings.H3.Color + @";
582 line-height: " + FontSettings.H3.LineHeight + @" !important;
583 text-transform: " + FontSettings.H3.Casing + @";
584 font-weight: " + FontSettings.H3.FontWeight + @";
585 letter-spacing: " + FontSettings.H3.LetterSpacing + @" !important;
586 }
587 h4 {
588 font-family: " + FontSettings.H4.FontFamily + @", sans-serif !important;
589 font-size: " + FontSettings.H4.FontSize + @";
590 color: " + FontSettings.H4.Color + @";
591 line-height: " + FontSettings.H4.LineHeight + @" !important;
592 text-transform: " + FontSettings.H4.Casing + @";
593 font-weight: " + FontSettings.H4.FontWeight + @";
594 letter-spacing: " + FontSettings.H4.LetterSpacing + @" !important;
595 }
596
597 h2, h5, h6 {
598 margin-top: 0.7em;
599 margin-bottom: 0.7em;
600
601 font-family: " + FontSettings.H2.FontFamily + @", sans-serif !important;
602 font-size: " + FontSettings.H2.FontSize + @";
603 color: " + FontSettings.H2.Color + @";
604 line-height: " + FontSettings.H2.LineHeight + @";
605 text-transform: " + FontSettings.H2.Casing + @" !important;
606 font-weight: " + FontSettings.H2.FontWeight + @" !important;
607 letter-spacing: " + FontSettings.H2.LetterSpacing + @" !important;
608 }
609
610 h5, h6 {
611 font-size: 16px !important;
612 }
613
614 body {
615 font-family: " + FontSettings.Body.FontFamily + @", sans-serif !important;
616 font-size: " + FontSettings.Body.FontSize + @";
617 color: " + FontSettings.Body.Color + @";
618 line-height: " + FontSettings.Body.LineHeight + @" !important;
619 text-transform: " + FontSettings.Body.Casing + @";
620 font-weight: " + FontSettings.Body.FontWeight + @";
621 letter-spacing: " + FontSettings.Body.LetterSpacing + @" !important;
622 }
623
624 .navbar-wp .navbar-nav > li > a {
625 font-family: " + FontSettings.Body.FontFamily + @", sans-serif !important;
626 }
627
628 .section-title {
629 margin-top: 0;
630 margin-bottom: 0.7em;
631 }
632 ";
633 return CssString;
634 }
635 }
636
637 @GoogleFonts()
638
639 @* GENERAL/COLOR SETTINGS *@
640 @functions{
641 public class ColorSettings
642 {
643 public class Color
644 {
645 public static string Primary { get; set; }
646 public static string Secondary { get; set; }
647 public static string NavbarFont { get; set; }
648 public static string Footer { get; set; }
649 public static string Address { get; set; }
650 public static string FooterFont { get; set; }
651
652 public static string Sticker { get; set; }
653 public static string Price { get; set; }
654 public static string Cart { get; set; }
655 }
656 }
657
658 private void InitColorSettings()
659 {
660 ColorSettings.Color.Primary = GetString("Item.Area.ColorsPrimary.Color");
661 ColorSettings.Color.Secondary = GetString("Item.Area.ColorsSecondary.Color");
662
663 ColorSettings.Color.NavbarFont = GetString("Item.Area.NavbarFontColor");
664
665 if (string.IsNullOrWhiteSpace(ColorSettings.Color.NavbarFont))
666 {
667 ColorSettings.Color.NavbarFont = WrapMethods.getContrastYIQ(ColorSettings.Color.Secondary);
668 }
669
670 ColorSettings.Color.Footer = GetString("Item.Area.ColorsFooterColor.Color");
671 ColorSettings.Color.Address = GetString("Item.Area.AddressBarBackgroundColor.Color");
672 ColorSettings.Color.FooterFont = WrapMethods.getContrastYIQ(ColorSettings.Color.Footer);
673
674 ColorSettings.Color.Price = GetString("Item.Area.EcommercePriceColor.Color");
675 ColorSettings.Color.Sticker = GetString("Item.Area.EcommerceDiscountStickerColor.Color");
676 ColorSettings.Color.Cart = GetString("Item.Area.EcommerceCartButtonColor.Color");
677 }
678
679 public string GetColorSettings()
680 {
681 string CssString = @"
682 a:hover, a:focus, a:active {
683 color: @Primary;
684 }
685
686 .navbar-wp, .navbar-wp.affix, .navbar-wp .navbar-nav > li > a {
687 color: @NavbarFont;
688 }
689
690 .navbar-wp .navbar-nav > .active > a, .navbar-wp .navbar-nav > .active > a:hover, .navbar-wp .navbar-nav > .active > a:focus {
691 color: @NavbarFont;
692 }
693
694 .navbar-wp .navbar-nav > li > a:hover, .navbar-wp .navbar-nav > li > a:focus {
695 border-top: 0px solid @Secondary;
696 color: @NavbarFont;
697 }
698
699 .navbar-wp .navbar-nav > li > a span:after {
700 background-color: @Primary;
701 }
702
703 .navbar-wp .megamenu > li:hover > a {
704 color: @Primary !important;
705 }
706
707 .btn-dw-primary {
708 color: #FFF;
709 background-color: @Primary;
710 border-color: @Primary;
711 }
712
713 .btn-dw-secondary {
714 color: @NavbarFont;
715 background-color: @Secondary;
716 border-color: @Secondary;
717 }
718
719 .btn-dw-cart {
720 color: #FFF;
721 background-color: @Cart;
722 border-color: @Cart;
723 }
724
725 .dw-section-title {
726 border-color: @Secondary;
727 }
728
729 .dw-minicart-update {
730 color: #FFF !important;
731 background-color: @Primary;
732 transition: all 0.3s ease-in-out 0s;
733 }
734
735 .pagination > li > a, .pagination > li > a:hover, .pagination > li > a:focus, .pagination > li > a:active {
736 color: @Primary;
737 }
738
739 .form-control:hover, .form-control:focus, .form-control:active {
740 border-color: @Primary !important;
741 }
742
743 .bg-2 {
744 background: @Primary !important;
745 }
746
747 .blockquote-1:hover {
748 border-color: @Primary !important;
749 }
750
751 .navbar-wp .navbar-nav > li > a.dropdown-form-toggle, .navbar-wp .navbar-nav > li > a.dropdown-form-toggle:hover, .navbar-wp .navbar-nav > li > a.dropdown-form-toggle:focus {
752 color: @Primary;
753 }
754
755 .navbar-wp .navbar-nav > .open > a.dropdown-form-toggle, .navbar-wp .navbar-nav > .open > a.dropdown-form-toggle:hover, .navbar-wp .navbar-nav > .open > a.dropdown-form-toggle:focus {
756 color: @Primary;
757 }
758
759 .navbar-wp .navbar-nav > li > a:hover, .navbar-wp .navbar-nav > li > a:focus {
760 border: 0px solid @Primary;
761 }
762
763 .navbar-wp .navbar-toggle:hover, .navbar-wp .navbar-toggle:focus {
764 background-color: @Primary !important;
765 border-color: @Primary !important;
766 }
767
768 .navbar-wp .dropdown-menu {
769 border-top: 1px solid @Primary !important;
770 border-bottom: 3px solid @Primary !important;
771 }
772
773 .navbar-wp .dropdown-menu > li > a:hover {
774 background: @Primary !important;
775 color: #fff;
776 }
777
778 .navbar-wp .dropdown-menu .active {
779 background: @Primary !important;
780 color: #fff;
781 }
782
783 .navbar-wp.navbar-contrasted .dropdown-menu > li > a:hover {
784 background: @Primary !important;
785 }
786
787 .nav > ul > li > a:hover {
788 color: @Primary;
789 }
790
791 .lw .w-box.w-box-inverse .thmb-img i {
792 color: @Primary !important;
793 }
794
795 .w-box.w-box-inverse .thmb-img:hover i {
796 background: @Primary !important;
797 }
798
799 .c-box {
800 border: 1px solid @Primary !important;
801 }
802
803 .c-box .c-box-header {
804 background: @Primary !important;
805 }
806
807 .w-section .aside-feature:hover .icon-feature, .w-section .aside-feature:hover h4 {
808 color: @Primary !important;
809 }
810
811 .layer-slider-wrapper .title.title-base {
812 background: @Primary !important;
813 }
814
815 .layer-slider-wrapper .subtitle {
816 color: @Primary !important;
817 }
818
819 .layer-slider-wrapper .list-item {
820 color: @Primary !important;
821 }
822
823 .box-element.box-element-bordered {
824 border: 1px solid @Primary !important;
825 }
826
827 .carousel-2 .carousel-indicators .active {
828 background-color: @Primary !important;
829 }
830
831 .carousel-2 .carousel-nav a {
832 color: @Primary !important;
833 }
834
835 .carousel-2 .carousel-nav a:hover {
836 background: @Primary !important;
837 }
838
839 .carousel-3 .carousel-nav a {
840 color: @Primary !important;
841 }
842
843 .carousel-3 .carousel-nav a:hover {
844 background: @Primary !important;
845 }
846
847 .like-button .button.liked i {
848 color: @Primary !important;
849 }
850
851 ul.list-listings li.featured {
852 border-color: @Primary !important;
853 }
854
855 ul.list-check li i {
856 color: @Primary !important;
857 }
858
859 ul.dw-categories li a:hover, ul.dw-categories a:focus, ul.dw-categories a:active{
860 color: @NavbarFont;
861 background-color: @Primary;
862 border-color: @Primary;
863 }
864
865 ul.categories li a:hover, ul.categories a:focus, ul.categories a:active{
866 color: @NavbarFont;
867 background-color: @Primary;
868 border-color: @Primary;
869 }
870
871 .timeline .event:nth-child(2n):before {
872 background-color: @Primary !important;
873 }
874
875 .timeline .event:nth-child(2n-1):before {
876 background-color: @Primary !important;
877 }
878
879 #toTopHover {
880 background-color: @Primary !important;
881 }
882
883 .tags-list li {
884 border: 1px solid @Primary !important;
885 color: @Primary !important;
886 }
887
888 .tags-list li:hover,
889 a.open-panel {
890 background-color: @Primary !important;
891 }
892
893 .nav-pills > li.active > a, .nav-pills > li.active > a:hover, .nav-pills > li.active > a:focus,
894 .panel-group .panel-heading a i,
895 .tags-list li a {
896 color: @NavbarFont !important;
897 }
898
899 .nav-pills > li > a:hover, .nav-pills > li > a:focus {
900 color: @NavbarFont !important;
901 background: none repeat scroll 0% 0% @Secondary !important;
902 }
903
904 footer {
905 background: @Footer !important;
906 }
907
908 footer h4 {
909 color: @FooterFont !important;
910 }
911
912 footer a {
913 color: @FooterFont !important;
914 }
915
916 footer a:hover, footer a:focus, footer a:active {
917 color: @Secondary !important;
918 }
919
920 footer p {
921 color: @FooterFont !important;
922 }
923
924 footer ul > li {
925 color: @FooterFont !important;
926 }
927
928 footer hr {
929 border-color: @FooterFont
930 }
931
932
933 /* Button colors */
934 .btn-base {
935 color: @NavbarFont !important;
936 background-color: @Secondary !important;
937 border: 1px solid @Secondary !important;
938 }
939 .btn-dw-cart:focus{
940 background-color: @Secondary;
941 }
942 .btn-base:before {
943 background-color: @Secondary !important;
944 }
945
946 .btn-base:hover:before, .btn-base:focus:before, .btn-base:active:before {
947 color: @NavbarFont !important;
948 background-color: @Primary !important;
949 border-color: @Primary !important;
950 }
951
952 .btn-icon:before {
953 transition: none !important;
954 }
955
956 .btn-base:hover, .btn-base:focus, .btn-base:active, .btn-base.active, .open .dropdown-toggle.btn-base {
957 color: @NavbarFont !important;
958 background-color: @Primary !important;
959 border-color: @Primary !important;
960 }
961
962 .btn-primary {
963 background-color: @Primary !important;
964 border-color: @Primary !important;
965 }
966
967 .open .dropdown-toggle.btn-primary {
968 background-color: @Primary !important;
969 border-color: @Primary !important;
970 }
971
972 /* Dropdown-menu */
973 .dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:focus {
974 background: @Primary !important;
975 color: #fff !important;
976 }
977
978 /* Ecom settings */
979 .ribbon.base, .ball {
980 background: @Sticker !important;
981 color: #fff;
982 border-right: 5px solid @Sticker !important;
983 }
984
985 .ribbon.base:before {
986 border-top: 27px solid @Sticker !important;
987 }
988
989 .ribbon.base:after {
990 border-bottom: 27px solid @Sticker !important;
991 }
992
993 .price {
994 color: @Price !important;
995 }
996
997 .discount-sticker {
998 background-color: @Sticker !important;
999 }
1000
1001 .bs-callout-primary {
1002 border-left-color: @Primary !important;
1003 }
1004
1005 .ratings .fa-star {
1006 color: @Secondary !important;
1007 }
1008
1009 .feature-label {
1010 color: @Secondary !important;
1011 }
1012
1013
1014 .navbar-wp .megamenu.navbar-nav > li.active > a {
1015 border-color: @Primary !important;
1016 }
1017 .dw-section-title {
1018 border-color: @Primary !important;
1019 }
1020 .boxImageTextModule .box-size .desc-wrapper {
1021 border-color: @Primary !important;
1022 }
1023 .qoute .btn, .qoute .btn-span {
1024 border-color: @Primary !important;
1025 }
1026 .Multy-module .section-top h2.line {
1027 border-color: @Primary !important;
1028 }
1029 .row:nth-child(2n+2) .box {
1030 border-color: @Primary !important;
1031 }
1032 .row:nth-child(2n+2) .box .year:before,
1033 .history-module .row .box .box-inner .year:after {
1034 background-color: @Primary !important;
1035 }
1036
1037 .history-module .arrow .fa,
1038 .history-module .row .box .box-inner .year {
1039 color: @Primary !important;
1040 }
1041
1042 .history-module .row .box {
1043 border-color: @Primary !important;
1044 }
1045 .thankyouNewsletter {
1046 background: @Primary !important;
1047 }
1048
1049 .slideToggle {
1050 background-color: @Primary !important;
1051 }
1052
1053 .shere-social {
1054 border-color: @Primary !important;
1055 }
1056
1057 .dw-breadcrumb a, .pg-opt .breadcrumb, .pg-opt .goHome {
1058 color: @NavbarFont !important;
1059 }
1060 .panel-default > .panel-heading {
1061 color: @NavbarFont !important;
1062 }
1063 .panel-group {
1064 border-bottom: 1px solid @Primary !important;
1065 }
1066 .list-news .list-body .read-more,
1067 .news-detail .post-item p a,
1068 .searchContent ul li h3 a {
1069 color: @Primary !important;
1070 }
1071 .searchContent ul li {
1072 border-color: @Primary !important;
1073 }
1074 .searchContent > p {
1075 border-bottom: 1px solid @Primary !important;
1076 }
1077 .nav.nav-pills li.offcanvas-menubtn .mobileMenuFix {
1078 color: @Primary !important;
1079 }
1080 .dealer-shops,
1081 .dynamicweb-map .list {
1082 background: @Address !important;
1083 }
1084 .dealer-shops ul li:hover,
1085 .dynamicweb-map .list ol li:hover,
1086 .dynamicweb-map .list ul li:hover,
1087 .dynamicweb-map .list ol li.current,
1088 .dynamicweb-map .list ul li.current {
1089 background: @Primary !important;
1090 color: #fff !important;
1091 }
1092
1093
1094 .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default, .ui-button, html .ui-button.ui-state-disabled:hover, html .ui-button.ui-state-disabled:active {
1095 background: @Primary !important;
1096 }
1097 .ui-widget-content {
1098 background: @Address !important;
1099 }
1100 .lang-sug .langMenu li:hover {
1101 background: @Primary !important;
1102 }
1103 .btn-dw-primary.searchFieldShow:focus, .btn-dw-primary.searchFieldShow:active{
1104 background-color: @Primary !important;
1105 }
1106 .customer-info-section{
1107 border-top: 1px solid @Primary;
1108 border-bottom: 1px solid @Primary;
1109 }
1110 .dealers-customers-user-edit .modal-body input{
1111 border-color: @Primary;
1112 }
1113 .dealers-customers-user-edit .modal-header{
1114 background-color: @Primary;
1115 }
1116 #buy-all-modal .modal-header{
1117 background-color: @Primary;
1118 }
1119 #credit-limit .modal-header{
1120 background-color: @Primary;
1121 }
1122 .buy-all-modal-btn{
1123 background-color: @Primary;
1124 }
1125 #buy-all-modal .price{
1126 border-color: @Primary;
1127 }
1128 #credit-limit .space{
1129 border-color: @Primary;
1130 }
1131 .dealers-customers-list table tr th {
1132 background-color: @Primary;
1133 }
1134 .dealers-customers-list table tr:nth-of-type(2n+1){
1135 background: @Address;
1136 }
1137 tr.resultLine:nth-of-type(2n+2){
1138 background: @Address!important;
1139 }
1140 .QuoteList thead tr, #orderlist thead tr{
1141 background-color: @Primary;
1142 }
1143 .QuoteList tbody tr.pagging, #orderlist tbody tr.pagging{
1144 background-color: @Footer !important;
1145 }
1146 .QuoteList tbody tr:nth-of-type(2n+1), #orderlist tbody tr:nth-of-type(2n+1){
1147 background: @Address;
1148 }
1149 .QuoteDetail .header-tr th{
1150 background-color: @Primary;
1151 }
1152 .TotalPrice {
1153 background-color: @Footer;
1154 }
1155 .OrderDetailTable tr.headerOrder{
1156 background-color: @Primary;
1157 }
1158 #invoice .invoice-financials table > tbody > tr:nth-of-type(2n+2){
1159 background: @Address;
1160 }
1161 .specification .specification-text{
1162 background: @Address;
1163 }
1164 .navbar-wp .megamenu .dropdown-menu {
1165 background-color: @Address;
1166 }
1167 .list-news{
1168 background-color: @Address;
1169 }
1170 .modal-header{
1171 background-color: @Address;
1172 }
1173 .QuoteDetail .SelectFile .fa{
1174 color: @Primary;
1175 }
1176 .QuoteDetail .AddProductsList .AddProducts input{
1177 border-color: @Primary!important;
1178 }
1179 .QuoteDetail .EditCustomerInfo{
1180 background-color: @Primary;
1181 }
1182 .QuoteDetail #editUser .modal-header{
1183 background-color: @Primary !important;
1184 }
1185 #ProductsModal .modal-header{
1186 background-color: @Primary !important;
1187 }
1188 .QuoteDetail #editUser .modal-footer{
1189 border-color: @Primary !important;
1190 }
1191 .QuoteDetail .SelectFile:after{
1192 background-color: @Primary;
1193 }
1194 .SelectCustomerList select{
1195 border-color: @Primary;
1196 }
1197 .customer-information-section input, textarea{
1198 border: 1px solid @Primary;
1199 }
1200 .SelectCustomerList:after{
1201 background-color: @Primary;
1202 }
1203 .QuoteDetail .SelectFile select{
1204 border-color: @Primary;
1205 }
1206 .QuoteDetail #editUser textarea{
1207 border-color: @Primary !important;
1208 }
1209 .QuoteDetail #editUser input{
1210 border-color: @Primary !important;
1211 }
1212 .QuoteDetail .select-delivery-address{
1213 border-color: @Primary !important;
1214 }
1215 .modalbtnProducts{
1216 background-color: @Primary;
1217 }
1218 .productNavigationModal li{
1219 background-color: @Address;
1220 }
1221 .productNavigation.secondLevel li{
1222 background-color: @Address;
1223 }
1224 .sectionFiles{
1225 border-color: @Primary!important;
1226 }
1227 .sectionFiles div.hiddenPrint{
1228 border-color: @Primary!important;
1229 }
1230 .productNavigationModal li.list-open-active{
1231 background-color: @Primary;
1232 }
1233
1234 .history-module .row .modal-open {
1235 color: @Primary !important;
1236 }";
1237
1238 return ParseCSSToString(CssString);
1239 }
1240
1241 private string ParseCSSToString(string TheString)
1242 {
1243 TheString = TheString.Replace("@Primary", ColorSettings.Color.Primary);
1244 TheString = TheString.Replace("@Secondary", ColorSettings.Color.Secondary);
1245 TheString = TheString.Replace("@NavbarFont", ColorSettings.Color.NavbarFont);
1246 TheString = TheString.Replace("@FooterFont", ColorSettings.Color.FooterFont);
1247 TheString = TheString.Replace("@Footer", ColorSettings.Color.Footer);
1248 TheString = TheString.Replace("@Address", ColorSettings.Color.Address);
1249
1250 TheString = TheString.Replace("@Sticker", ColorSettings.Color.Sticker);
1251 TheString = TheString.Replace("@Price", ColorSettings.Color.Price);
1252 TheString = TheString.Replace("@Cart", ColorSettings.Color.Cart);
1253
1254
1255 System.Text.StringBuilder sb = new System.Text.StringBuilder();
1256
1257 foreach(var item in TheString.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries))
1258 {
1259 sb.AppendLine(item);
1260 }
1261
1262 return sb.ToString();
1263 }
1264 }
1265
1266 @{
1267 InitColorSettings();
1268 }
1269
1270
1271
1272 @using System.Drawing
1273 @using System.Net
1274
1275
1276 @functions{
1277 public class GeneralSettings
1278 {
1279
1280 public class Header
1281 {
1282 public static string Mode { get; set; }
1283 public static string Classes { get; set; }
1284 public static bool Show { get; set; }
1285 public static string Background { get; set; }
1286 public static bool ShowFrontpageImage { get; set; }
1287 }
1288
1289 public class Logo
1290 {
1291 public static string Image { get; set; }
1292 public static string ContrastImage { get; set; }
1293 public static string Text { get; set; }
1294 public static string Slogan { get; set; }
1295 public static string SecondaryColor { get; set; }
1296 }
1297
1298 public class Navigation
1299 {
1300 public static string Position { get; set; }
1301 public static bool IsMegamenu { get; set; }
1302 public static bool IsAnimateNavigation { get; set; }
1303 public static string InvertedPosition { get; set; }
1304 public static string StickyMenu { get; set; }
1305 public static string SelectionMode { get; set; }
1306 public static string SelectionStyle { get; set; }
1307 public static int SelectionWeight { get; set; }
1308 public static bool Case { get; set; }
1309
1310 public static string BreadcrumbMode { get; set; }
1311 public static string BreadcrumbAlign { get; set; }
1312
1313 public static string LeftmenuMode { get; set; }
1314
1315 public static string ButtonDesign { get; set; }
1316 }
1317
1318 public class Headings
1319 {
1320 public static string Mode { get; set; }
1321 }
1322
1323 public class Background
1324 {
1325 public static string Color { get; set; }
1326 public static string Image { get; set; }
1327 public static string CustomImage { get; set; }
1328 public static bool GradientColor { get; set; }
1329 public static string GradientPercentage { get; set; }
1330 public static string Style { get; set; }
1331 public static string Position { get; set; }
1332 }
1333
1334 public class Site
1335 {
1336 public static bool Shadow { get; set; }
1337 public static string LayoutMode { get; set; }
1338 }
1339
1340 public class Images
1341 {
1342 public static bool RoundCorners { get; set; }
1343 }
1344
1345 public class Ecommerce
1346 {
1347 public static string EcomListDesign { get; set; }
1348 public static string EcomCardDesign { get; set; }
1349 }
1350 }
1351
1352 private void InitGeneralSettings()
1353 {
1354 //Header settings
1355 GeneralSettings.Header.Mode = GetString("Item.Area.HeaderLayoutMode");
1356 GeneralSettings.Header.Show = GetBoolean("Item.Area.HeaderShow");
1357 GeneralSettings.Header.Background = GetString("Item.Area.NavigationNavbarBackground");
1358 GeneralSettings.Header.ShowFrontpageImage = GetBoolean("Item.Area.HeaderFrontpageImage");
1359
1360 if (GeneralSettings.Header.Mode == "solid"){
1361 GeneralSettings.Header.Classes = "";
1362 }
1363
1364 if (GeneralSettings.Header.Mode == "cover" || GeneralSettings.Header.Mode == "mobile"){
1365 GeneralSettings.Header.Classes = "header-alpha header-cover";
1366 }
1367
1368
1369 //Logo settings
1370 GeneralSettings.Logo.Image = GetString("Item.Area.GeneralLogo");
1371 GeneralSettings.Logo.Text = GetString("Item.Area.GeneralLogoText");
1372 GeneralSettings.Logo.Slogan = GetString("Item.Area.LogoSlogan");
1373 GeneralSettings.Logo.SecondaryColor = GetString("Item.Area.LogoSecondColor.Color");
1374
1375 if (!string.IsNullOrWhiteSpace(GetString("Item.Area.LogoContrastImage"))) {
1376 GeneralSettings.Logo.ContrastImage = GetString("Item.Area.LogoContrastImage");
1377 } else {
1378 GeneralSettings.Logo.ContrastImage = GetString("Item.Area.GeneralLogo");
1379 }
1380
1381
1382 //Navigation settings
1383 GeneralSettings.Navigation.Position = GetString("Item.Area.NavigationPosition");
1384 GeneralSettings.Navigation.StickyMenu = "off";
1385 GeneralSettings.Navigation.IsMegamenu = GetBoolean("Item.Area.IsMegamenu");
1386 GeneralSettings.Navigation.IsAnimateNavigation = GetBoolean("Item.Area.IsAnimateNavigation");
1387
1388 if (GetBoolean("Item.Area.NavigationSticky")) {
1389 if (GeneralSettings.Header.Show)
1390 {
1391 if (GeneralSettings.Header.Mode == "cover")
1392 {
1393 GeneralSettings.Navigation.StickyMenu = "44"; //"data-spy=\"affix\" data-offset-top=\"44\" data-offset-bottom=\"300\"";
1394 }
1395 else
1396 {
1397 int offset = ImageHeight()+28;
1398
1399 GeneralSettings.Navigation.StickyMenu = offset.ToString(); // "data-spy=\"affix\" data-offset-top=\"" + offset.ToString() + "\" data-offset-bottom=\"300\"";
1400 }
1401 }
1402 else
1403 {
1404 GeneralSettings.Navigation.StickyMenu = "5"; // "data-spy=\"affix\" data-offset-top=\"5\" data-offset-bottom=\"300\"";
1405 }
1406 }
1407
1408 if (GeneralSettings.Navigation.Position == "left") {
1409 GeneralSettings.Navigation.InvertedPosition = "right";
1410 }
1411 else
1412 {
1413 GeneralSettings.Navigation.InvertedPosition = "left";
1414 }
1415
1416 GeneralSettings.Navigation.SelectionMode = GetString("Item.Area.NavigationSelectionMode");
1417 GeneralSettings.Navigation.SelectionStyle = "";
1418 GeneralSettings.Navigation.SelectionWeight = GetInteger("Item.Area.SelectionWeight");
1419
1420 if (GeneralSettings.Navigation.SelectionMode == "arrow") {
1421 GeneralSettings.Navigation.SelectionStyle = "navbar-arrow";
1422 }
1423
1424 GeneralSettings.Navigation.Case = GetBoolean("Item.Area.NavigationUppercase");
1425
1426 GeneralSettings.Navigation.BreadcrumbMode = GetString("Item.Area.NavigationBreadcrumbLayout");
1427 GeneralSettings.Navigation.BreadcrumbAlign = GetString("Item.Area.NavigationBreadcrumbAlign");
1428
1429 GeneralSettings.Navigation.LeftmenuMode = GetString("Item.Area.NavigationLeftNavigationMode");
1430
1431 GeneralSettings.Navigation.ButtonDesign = GetString("Item.Area.NavigationButtonDesign");
1432
1433
1434 //Background settings
1435 GeneralSettings.Background.Image = GetString("Item.Area.BackgroundImage.Image.Image");
1436 GeneralSettings.Background.CustomImage = GetString("Item.Area.BackgroundImage.Image.CustomImage");
1437 GeneralSettings.Background.Color = GetString("Item.Area.BackgroundImage.Color.Color");
1438 GeneralSettings.Background.GradientColor = GetBoolean("Item.Area.BackroundGradientColor");
1439 GeneralSettings.Background.GradientPercentage = GetString("Item.Area.GradientPercentage");
1440
1441
1442 if (@GetString("Item.Area.BackgroundFixed") == "True")
1443 {
1444 GeneralSettings.Background.Position = "fixed";
1445 }
1446 else
1447 {
1448 GeneralSettings.Background.Position = "";
1449 }
1450
1451
1452 if (GeneralSettings.Background.Image == "none")
1453 {
1454 GeneralSettings.Background.Style = "";
1455 }
1456 else if (GeneralSettings.Background.Image == "custom")
1457 {
1458 if (!string.IsNullOrWhiteSpace(GeneralSettings.Background.CustomImage))
1459 {
1460 GeneralSettings.Background.Style = "background: url('/Admin/Public/GetImage.ashx?width=1920&Crop=1&Compression=75&image=" + GeneralSettings.Background.CustomImage + "') " + GeneralSettings.Background.Position + " !important; ";
1461 }
1462 }
1463 else
1464 {
1465 GeneralSettings.Background.Style = "background: url('/Admin/Public/GetImage.ashx?width=1920&Crop=1&Compression=75&image=/Files/Templates/Designs/Dwsimple/images/background/" + GeneralSettings.Background.Image + "') " + GeneralSettings.Background.Position + " !important; ";
1466 }
1467
1468
1469 //Headings settings
1470 GeneralSettings.Headings.Mode = GetString("Item.Area.AdvHeadingsMode");
1471
1472
1473 //Site settings
1474 GeneralSettings.Site.Shadow = GetBoolean("Item.Area.BackgroundSiteShadow");
1475 GeneralSettings.Site.LayoutMode = GetString("Item.Area.LayoutMode");
1476
1477 if (GeneralSettings.Site.LayoutMode == "boxed"){
1478 GeneralSettings.Site.LayoutMode = "body-" + GeneralSettings.Site.LayoutMode;
1479 GeneralSettings.Header.Classes += " header-boxed";
1480 }
1481
1482
1483 //Image settings
1484 GeneralSettings.Images.RoundCorners = GetBoolean("Item.Area.LayoutRoundCorners");
1485
1486 //Ecommerce settings
1487 GeneralSettings.Ecommerce.EcomListDesign = GetString("Item.Area.EcommerceProductCardDesign");
1488 GeneralSettings.Ecommerce.EcomCardDesign = GetString("Item.Area.EcommerceProductCardDesign");
1489 }
1490
1491 public string GetGeneralCSS()
1492 {
1493 string CssString = "";
1494 int SelectionWeight = GeneralSettings.Navigation.SelectionWeight;
1495
1496 //Site settings
1497 if (GetString("Item.Area.LogoFont.Color.Color") == "#FFF" || GetString("Item.Area.LogoFont.Color.Color") == "#FFFFFF")
1498 {
1499 int offset = ImageHeight()+28;
1500
1501 CssString += @"
1502 .dw-offsetmenu-logo {
1503 color: #333 !important;
1504 }";
1505 }
1506
1507 if (!string.IsNullOrWhiteSpace(GeneralSettings.Background.Color))
1508 {
1509 CssString += @"
1510 body {
1511 background-color: " + GeneralSettings.Background.Color + @";
1512 background-size: cover;
1513 overflow-y: scroll;
1514 }";
1515 }
1516
1517 if (GeneralSettings.Background.GradientColor)
1518 {
1519 CssString += @"
1520 body {
1521 background: -webkit-linear-gradient(bottom, rgba(0, 0, 0, 0." + GeneralSettings.Background.GradientPercentage + @") 0%, rgba(0, 0, 0, 0) 100%);
1522 background: -o-linear-gradient(bottom, rgba(0, 0, 0, 0." + GeneralSettings.Background.GradientPercentage + @") 0%, rgba(0, 0, 0, 0) 100%);
1523 background: -ms-linear-gradient(bottom, rgba(0, 0, 0, 0." + GeneralSettings.Background.GradientPercentage + @") 0%, rgba(0, 0, 0, 0) 100%);
1524 background: -moz-linear-gradient(bottom, rgba(0, 0, 0, 0." + GeneralSettings.Background.GradientPercentage + @") 0%, rgba(0, 0, 0, 0) 100%);
1525 background: linear-gradient(to top, rgba(0, 0, 0, 0." + GeneralSettings.Background.GradientPercentage + @") 0%, rgba(0, 0, 0, 0) 100%);
1526 background-attachment: fixed;
1527 background-color: " + GeneralSettings.Background.Color + @" !important;
1528 }";
1529 }
1530
1531 if (GeneralSettings.Site.Shadow)
1532 {
1533 CssString += @"
1534 .shad {
1535 -webkit-box-shadow: 0px 0px 8px 0px rgba(50, 50, 50, 0.75);
1536 -moz-box-shadow: 0px 0px 8px 0px rgba(50, 50, 50, 0.75);
1537 box-shadow: 0px 0px 8px 0px rgba(50, 50, 50, 0.75);
1538 }";
1539 }
1540
1541 //Image settings
1542 if (GeneralSettings.Images.RoundCorners)
1543 {
1544 CssString += @"
1545 img {
1546 border-radius: 6px;
1547 -webkit-border-radius: 6px;
1548 -moz-border-radius: 6px;
1549 }";
1550 }
1551
1552 //Navbar and header custom settings
1553 if (GeneralSettings.Header.Mode == "cover")
1554 {
1555 CssString += @"
1556 .navbar-wp {
1557 background-color: none !important;
1558 }";
1559
1560 if (!GeneralSettings.Header.Show || GeneralSettings.Header.Mode == "mobile")
1561 {
1562 CssString += @"
1563 .header-cover .navbar-wp {
1564 top: 0px !important;
1565 }";
1566 }
1567 }
1568 else
1569 {
1570 if (GeneralSettings.Header.Show)
1571 {
1572 CssString += @"
1573 .navbar-wp.affix .navbar-nav > li > a {
1574 padding: 16px 16px !important;
1575 }";
1576 }
1577 }
1578
1579 if (GeneralSettings.Header.Background == "colorline")
1580 {
1581 CssString += @"
1582 .navbar-wp, .navbar-wp.affix {
1583 border-bottom: 4px solid " + ColorSettings.Color.Primary + @" !important;
1584 }
1585
1586 .navbar-wp.affix, .navbar-wp.affix .navbar-nav > li > a {
1587 background-color: #FFF;
1588 color: #333;
1589 }
1590
1591 .navbar-wp.affix .navbar-nav > .active > a, .navbar-wp.affix .navbar-nav > li > a:hover, .navbar-wp.affix .navbar-nav > li > a:focus {
1592 color: " + ColorSettings.Color.NavbarFont + @";
1593 }
1594
1595 .affix .dw-logotext, .affix .dw-slogantext, .dw-header-sm-title, .dw-offsetmenu-logo {
1596 color: " + GeneralSettings.Logo.SecondaryColor + @" !important;
1597 }";
1598 } else if (GeneralSettings.Header.Background == "neutral")
1599 {
1600 CssString += @"
1601 .navbar-wp, .navbar-wp.affix, .navbar-wp .navbar-nav > li > a {
1602 background-color: #f1f1f1;
1603 }
1604
1605 .navbar-wp.affix, .navbar-wp.affix .navbar-nav > li > a {
1606 color: #333;
1607 }
1608
1609 .navbar-wp.affix .navbar-nav > .active > a, .navbar-wp.affix .navbar-nav > li > a:hover, .navbar-wp.affix .navbar-nav > li > a:focus {
1610 color: " + ColorSettings.Color.NavbarFont + @";
1611 }
1612
1613 .affix .dw-logotext, .affix .dw-slogantext, .dw-header-sm-title, .dw-offsetmenu-logo {
1614 color: " + GeneralSettings.Logo.SecondaryColor + @" !important;
1615 }";
1616 }
1617 else if (GeneralSettings.Header.Background == "transparent")
1618 {
1619 CssString += @"
1620 .navbar-wp, .navbar-wp.affix {
1621 background-color: #FFF;
1622 opacity: 0.9;
1623 filter: alpha(opacity=90); /* For IE8 and earlier */
1624 }
1625
1626 .navbar-wp.affix, .navbar-wp.affix .navbar-nav > li > a {
1627 color: #333;
1628 }
1629
1630 .navbar-wp.affix .navbar-nav > .active > a, .navbar-wp.affix .navbar-nav > li > a:hover, .navbar-wp.affix .navbar-nav > li > a:focus {
1631 color: " + ColorSettings.Color.NavbarFont + @";
1632 }
1633
1634 .affix .dw-logotext, .affix .dw-slogantext, .dw-header-sm-title, .dw-offsetmenu-logo {
1635 color: " + GeneralSettings.Logo.SecondaryColor + @" !important;
1636 }";
1637 }
1638 else
1639 {
1640 CssString += @"
1641 .navbar-wp, .navbar-wp.affix, .navbar-wp .navbar-nav > li > a {
1642 background-color: " + ColorSettings.Color.Secondary + @";
1643 }
1644
1645 .affix .dw-logotext, .affix .dw-slogantext, .dw-header-sm-title, .dw-offsetmenu-logo {
1646 color: " + GeneralSettings.Logo.SecondaryColor + @" !important;
1647 }";
1648 }
1649
1650 if (GeneralSettings.Navigation.SelectionMode == "background" || GeneralSettings.Navigation.SelectionMode == "arrow"){
1651 CssString += NavbarPosition(false, SelectionWeight);
1652
1653 CssString += @"
1654 .dw-navbar-button > a {
1655 background-color: transparent !important;
1656 }
1657
1658 .dw-navbar-button > a:hover, dw-navbar-button > a:active, dw-navbar-button > a:focus, .active > a {
1659 background-color: " + ColorSettings.Color.Primary + @" !important;
1660 }";
1661 }
1662
1663 if (GeneralSettings.Navigation.SelectionMode == "underline"){
1664 CssString += NavbarPosition(true);
1665
1666 CssString += ClearBackground();
1667
1668 CssString += @"
1669 .dw-navbar-button > a span:after {
1670 position: absolute;
1671 content: '';
1672 left: 0px;
1673 bottom: 0px;
1674 height: " + SelectionWeight + @"px;
1675 width: 100%;
1676 transform: scaleX(0);
1677 transition: all 0.3s ease-in-out 0s;
1678 }
1679 .dw-navbar-button > a:hover, dw-navbar-button > a:active, dw-navbar-button > a:focus, .active > a {
1680 color: " + ColorSettings.Color.Primary + @" !important;
1681 }
1682
1683 .dw-navbar-button > a:hover span:after, dw-navbar-button > a:active span:after, dw-navbar-button > a:focus span:after, .active > a span:after {
1684 color: " + ColorSettings.Color.Primary + @" !important;
1685 transform: scaleX(1);
1686 transition: all 0.3s ease-in-out 0s;
1687 }";
1688 }
1689
1690 if (GeneralSettings.Navigation.SelectionMode == "boxed"){
1691 CssString += NavbarPosition(true, SelectionWeight);
1692
1693 CssString += @"
1694 .dw-navbar-button > a {
1695 background-color: transparent !important;
1696 }
1697
1698 .dw-navbar-button > a:hover, dw-navbar-button > a:active, dw-navbar-button > a:focus, .active > a {
1699 background-color: " + ColorSettings.Color.Primary + @" !important;
1700 transition: all 0.3s ease-in-out 0s;
1701 }";
1702 }
1703
1704 if (GeneralSettings.Navigation.SelectionMode == "border"){
1705 CssString += NavbarPosition(true, 6, SelectionWeight);
1706
1707 CssString += ClearBackground();
1708
1709 CssString += @"
1710 .dw-navbar-button > a {
1711 border: " + SelectionWeight + @"px solid transparent !important; transition: None !important;
1712 }
1713
1714 .dw-navbar-button > a:hover, dw-navbar-button > a:active, dw-navbar-button > a:focus, .active > a {
1715 border-width: " + SelectionWeight + @"px !important;
1716 border-color: " + ColorSettings.Color.Primary + @" !important;
1717 transition: all 0.3s ease-in-out 0s;
1718 }";
1719 }
1720
1721 if (GeneralSettings.Navigation.SelectionMode == "font"){
1722 CssString += NavbarPosition();
1723
1724 CssString += ClearBackground();
1725
1726 SelectionWeight = (SelectionWeight*100);
1727
1728 CssString += @"
1729 .dw-navbar-button > a:hover, dw-navbar-button > a:active, dw-navbar-button > a:focus, .active > a {
1730 color: " + ColorSettings.Color.Primary + @" !important;
1731 font-weight: " + SelectionWeight + @" !important;
1732 transition: all 0.3s ease-in-out 0s;
1733 }";
1734 }
1735
1736 if (GeneralSettings.Navigation.Case){
1737 CssString += @"
1738 .dw-navbar-button > a {
1739 text-transform: uppercase !important;
1740 }";
1741 }
1742 else
1743 {
1744 CssString += @"
1745 .dw-navbar-button > a {
1746 text-transform: none !important;
1747 }";
1748 }
1749
1750
1751 //Breadcrumb custom settings
1752 if (GeneralSettings.Navigation.BreadcrumbMode == "light")
1753 {
1754 CssString += @"
1755 .pg-opt {
1756 border-bottom: 0px;
1757 background: none repeat scroll 0% 0% #FFF;
1758 }
1759
1760 .dw-breadcrumb-title {
1761 font-size: 14px !important;
1762 padding: 5px 0px 5px 0px !important;
1763 }
1764
1765 .dw-breadcrumb {
1766 padding: 5px 0px 5px 0px !important;
1767 }";
1768 }
1769
1770 if (GeneralSettings.Navigation.BreadcrumbMode == "normal")
1771 {
1772 CssString += @"
1773 .dw-breadcrumb-title {
1774 font-size: 14px !important;
1775 padding: 5px 0px 5px 0px !important;
1776 }
1777
1778 .dw-breadcrumb a, .pg-opt .breadcrumb {
1779 padding: 5px !important;
1780 }";
1781 }
1782
1783 if (GeneralSettings.Navigation.BreadcrumbMode == "large")
1784 {
1785 CssString += @"
1786 .dw-breadcrumb-title {
1787 font-size: 22px !important;
1788 padding: 15px 0px 15px 0px !important;
1789 }
1790
1791 .dw-breadcrumb {
1792 padding: 15px !important;
1793 }";
1794 }
1795
1796
1797 if (GeneralSettings.Navigation.BreadcrumbAlign == "right")
1798 {
1799 CssString += @"
1800 .dw-breadcrumb {
1801 float: right !important;
1802 }";
1803 }
1804 else
1805 {
1806 CssString += @"
1807 .dw-breadcrumb {
1808 float: left !important;
1809 }";
1810 }
1811
1812
1813 //Left menu custom settings
1814 if (GeneralSettings.Navigation.LeftmenuMode == "light" || GeneralSettings.Navigation.LeftmenuMode == "light-color")
1815 {
1816 CssString += @"
1817 ul.dw-categories, ul.dw-categories > li, ul.dw-categories > li > ul > li {
1818 border: 0px solid #EEE;
1819 }
1820
1821 ul.dw-categories > li > ul {
1822 background: none repeat scroll 0% 0% #FFF;
1823 }
1824
1825 ul.dw-categories li a:hover, ul.dw-categories li a:focus, ul.dw-categories li a:active {
1826 background-color: #FFF !important;
1827 color: " + ColorSettings.Color.Primary + @" !important;
1828 }
1829
1830 .list-active, .list-active > a {
1831 background-color: #FFF;
1832 color: " + ColorSettings.Color.Primary + @" !important;
1833 }
1834
1835 .list-open-active {
1836 background-color: #FFF;
1837 color: " + ColorSettings.Color.Primary + @" !important;
1838 }";
1839 }
1840
1841 if (GeneralSettings.Navigation.LeftmenuMode == "lines")
1842 {
1843 CssString += @"
1844 ul.dw-categories > li {
1845 border-bottom: 1px solid #EEE;
1846 }
1847
1848 ul.dw-categories {
1849 border: 0px solid #EEE;
1850 }
1851
1852 ul.dw-categories > li > ul {
1853 background: none repeat scroll 0% 0% #FFF;
1854 }
1855
1856 ul.dw-categories li a:hover, a:focus, a:active {
1857 background-color: #FFF !important;
1858 color: " + ColorSettings.Color.Primary + @" !important;
1859 }
1860
1861 .list-active, .list-active > a {
1862 background-color: #FFF;
1863 color: " + ColorSettings.Color.Primary + @" !important;
1864 }
1865
1866 .list-open-active {
1867 background-color: #FFF;
1868 color: " + ColorSettings.Color.Primary + @" !important;
1869 }";
1870 }
1871
1872 if (GeneralSettings.Navigation.LeftmenuMode == "boxed")
1873 {
1874 CssString += @"
1875 ul.dw-categories, ul.dw-categories > li, ul.dw-categories > li > ul > li {
1876 border: 0px solid #EEE;
1877 }
1878
1879 .list-active, .list-active > a {
1880 background-color: " + ColorSettings.Color.Primary + @" !important;
1881 color: #FFF;
1882 }";
1883 }
1884
1885 if (GeneralSettings.Navigation.LeftmenuMode == "border")
1886 {
1887 CssString += @"
1888 ul.dw-categories > li {
1889 border: 1px solid #EEE;
1890 }
1891
1892 ul.dw-categories > li > ul > li {
1893 border-top: 1px solid #EEE;
1894 }
1895
1896 .list-active, .list-active > a {
1897 background-color: " + ColorSettings.Color.Primary + @" !important;
1898 color: #FFF;
1899 }";
1900 }
1901
1902 if (GeneralSettings.Navigation.LeftmenuMode == "light-color")
1903 {
1904 CssString += @"
1905 ul.dw-categories li a:hover, ul.dw-categories a:focus, ul.dw-categories a:active {
1906 border-left: 6px solid " + ColorSettings.Color.Primary + @";
1907 }
1908
1909 ul.dw-categories .M2 > li > a:hover, ul.dw-categories .M2 > li > a:focus, ul.dw-categories .M2 > li > a:active, ul.dw-categories .M2 > .list-active > a {
1910 padding-left: 20px;
1911 }
1912
1913 ul.dw-categories .M3 > li > a:hover, ul.dw-categories .M3 > li > a:focus, ul.dw-categories .M3 > li > a:active, ul.dw-categories .M3 > .list-active > a {
1914 padding-left: 30px;
1915 }
1916
1917 ul.dw-categories .M4 > li > a:hover, ul.dw-categories .M4 > li > a:focus, ul.dw-categories .M4 > li > a:active, ul.dw-categories .M4 > .list-active > a {
1918 padding-left: 40px;
1919 }
1920
1921 ul.dw-categories .M5 > li > a:hover, ul.dw-categories .M5 > li > a:focus, ul.dw-categories .M5 > li > a:active, ul.dw-categories .M5 > .list-active > a {
1922 padding-left: 50px;
1923 }
1924
1925 ul.dw-categories .M6 > li > a:hover, ul.dw-categories .M6 > li > a:focus, ul.dw-categories .M6 > li > a:active, ul.dw-categories .M6 > .list-active > a {
1926 padding-left: 50px;
1927 }
1928
1929 ul.dw-categories .M7 > li > a:hover, ul.dw-categories .M7 > li > a:focus, ul.dw-categories .M7 > li > a:active, ul.dw-categories .M7 > .list-active > a {
1930 padding-left: 50px;
1931 }
1932
1933 ul.dw-categories .M8 > li > a:hover, ul.dw-categories .M8 > li > a:focus, ul.dw-categories .M8 > li > a:active, ul.dw-categories .M8 > .list-active > a {
1934 padding-left: 50px;
1935 }
1936
1937 ul.dw-categories .list-active > a {
1938 border-left: 6px solid " + ColorSettings.Color.Primary + @";
1939 }
1940
1941 .btn-dw:hover, .btn-dw:focus, .btn-dw:active {
1942
1943 }";
1944 }
1945
1946
1947 //Buttons custom designs
1948 if (GeneralSettings.Navigation.ButtonDesign == "light-rounded")
1949 {
1950 CssString += @"
1951 .btn-dw-primary, .btn-dw-secondary, .btn-dw-cart {
1952 border-width: 0px;
1953 }
1954
1955 .btn-dw-primary:hover, .btn-dw-primary:focus, .btn-dw-primary:active {
1956 background-color: " + ColorSettings.Color.Secondary + @";
1957 color: #FFF;
1958 border-width: 0px;
1959 }
1960
1961 .btn-dw-secondary:hover, .btn-dw-secondary:focus, .btn-dw-secondary:active {
1962 background-color: " + ColorSettings.Color.Primary + @";
1963 color: #FFF;
1964 border-width: 0px;
1965 }
1966
1967 .btn-dw-cart:hover, .btn-dw-cart:focus, .btn-dw-cart:active {
1968 background-color: " + GetString("Item.Area.EcommerceCartButtonColor.Color") + @";
1969 color: #FFF;
1970 border-width: 0px;
1971 }";
1972 }
1973
1974 if (GeneralSettings.Navigation.ButtonDesign == "corners")
1975 {
1976 CssString += @"
1977 .btn-dw-primary, .btn-dw-secondary, btn-dw-cart , .btn-dw-cart {
1978 border-radius: 0px !important;
1979 border-width: 0px;
1980 }
1981
1982 .btn-dw-primary:hover, .btn-dw-primary:focus, .btn-dw-primary:active {
1983 background-color: " + ColorSettings.Color.Secondary + @";
1984 color: #FFF;
1985 border-width: 0px;
1986 }
1987
1988 .btn-dw-secondary:hover, .btn-dw-secondary:focus, .btn-dw-secondary:active {
1989 background-color: " + ColorSettings.Color.Primary + @";
1990 color: #FFF;
1991 border-width: 0px;
1992 }
1993
1994 .btn-dw-cart:hover, .btn-dw-cart:focus, .btn-dw-cart:active {
1995 background-color: " + GetString("Item.Area.EcommerceCartButtonColor.Color") + @";
1996 color: #FFF;
1997 border-width: 0px;
1998 }";
1999 }
2000
2001 if (GeneralSettings.Navigation.ButtonDesign == "round")
2002 {
2003 CssString += @"
2004 .btn-dw-primary, .btn-dw-secondary, .btn-dw-cart {
2005 padding: 5px 15px;
2006 border-radius: 200px !important;
2007 border-width: 0px !important;
2008 }
2009
2010 .btn-dw-primary:hover, .btn-dw-primary:focus, .btn-dw-primary:active {
2011 background-color: " + ColorSettings.Color.Secondary + @";
2012 color: #FFF;
2013 border-width: 0px !important;
2014 }
2015
2016 .btn-dw-secondary:hover, .btn-dw-secondary:focus, .btn-dw-secondary:active {
2017 background-color: " + ColorSettings.Color.Primary + @";
2018 color: #FFF;
2019 border-width: 0px !important;
2020 }
2021
2022 .btn-dw-cart:hover, .btn-dw-cart:focus, .btn-dw-cart:active {
2023 background-color: " + GetString("Item.Area.EcommerceCartButtonColor.Color") + @";
2024 color: #FFF;
2025 border-width: 0px !important;
2026 }";
2027 }
2028
2029 if (GeneralSettings.Navigation.ButtonDesign == "border")
2030 {
2031 CssString += @"
2032 .btn-dw-primary, .btn-dw-secondary, .btn-dw-cart {
2033 background-color: transparent;
2034 }
2035
2036 .btn-dw-primary {
2037 border-width: 4px;
2038 padding: 3px 10px;
2039 color: " + ColorSettings.Color.Primary + @";
2040 }
2041
2042 .btn-dw-secondary {
2043 border-width: 2px;
2044 color: " + ColorSettings.Color.Secondary + @";
2045 }
2046
2047 .btn-dw-cart {
2048 border-width: 4px;
2049 padding: 3px 10px;
2050 color: " + GetString("Item.Area.EcommerceCartButtonColor.Color") + @";
2051 }
2052
2053 .btn-dw-primary:hover, .btn-dw-primary:focus, .btn-dw-primary:active {
2054 background-color: " + ColorSettings.Color.Primary + @";
2055 border-width: 4px;
2056 padding: 3px 10px;
2057 border-color: " + ColorSettings.Color.Primary + @";
2058 color: #FFF;
2059 }
2060
2061 .btn-dw-secondary:hover, .btn-dw-secondary:focus, .btn-dw-secondary:active {
2062 background-color: " + ColorSettings.Color.Primary + @";
2063 border-width: 2px;
2064 color: #FFF;
2065 border-color: #FFF;
2066 }
2067
2068 .btn-dw-cart:hover, .btn-dw-cart:focus, .btn-dw-cart:active {
2069 background-color: " + GetString("Item.Area.EcommerceCartButtonColor.Color") + @";
2070 border-width: 4px;
2071 padding: 3px 10px;
2072 border-color: " + GetString("Item.Area.EcommerceCartButtonColor.Color") + @";
2073 color: #FFF;
2074 }";
2075 }
2076
2077 if (GeneralSettings.Navigation.ButtonDesign == "border-sharp" || GeneralSettings.Navigation.ButtonDesign == "border-round")
2078 {
2079 CssString += @"
2080 .btn-dw-primary, .btn-dw-secondary, .btn-dw-cart {
2081 background-color: transparent;
2082 }
2083
2084 .btn-dw-primary {
2085 border-width: 4px;
2086 padding: 3px 15px;
2087 color: " + ColorSettings.Color.Primary + @";
2088 }
2089
2090 .btn-dw-secondary {
2091 border-width: 2px;
2092 padding: 5px 15px;
2093 color: " + ColorSettings.Color.Secondary + @";
2094 }
2095
2096 .btn-dw-cart {
2097 border-width: 4px;
2098 padding: 3px 15px;
2099 color: " + GetString("Item.Area.EcommerceCartButtonColor.Color") + @";
2100 }
2101
2102 .btn-dw-primary:hover, .btn-dw-primary:focus, .btn-dw-primary:active {
2103 background-color: " + ColorSettings.Color.Primary + @";
2104 border-width: 4px;
2105 color: #FFF;
2106 padding: 3px 15px;
2107 border-color: " + ColorSettings.Color.Primary + @";
2108 }
2109
2110 .btn-dw-secondary:hover, .btn-dw-secondary:focus, .btn-dw-secondary:active {
2111 background-color: " + ColorSettings.Color.Primary + @";
2112 border-width: 2px;
2113 color: #FFF;
2114 padding: 5px 15px;
2115 border-color: #FFF;
2116 }
2117
2118 .btn-dw-cart:hover, .btn-dw-cart:focus, .btn-dw-cart:active {
2119 background-color: " + GetString("Item.Area.EcommerceCartButtonColor.Color") + @";
2120 border-width: 4px;
2121 color: #FFF;
2122 padding: 3px 15px;
2123 border-color: " + GetString("Item.Area.EcommerceCartButtonColor.Color") + @";
2124 }";
2125 }
2126
2127 if (GeneralSettings.Navigation.ButtonDesign == "border-sharp")
2128 {
2129 CssString += @"
2130 .btn-dw-primary, .btn-dw-secondary, .btn-dw-cart, .btn-dw-primary:hover, .btn-dw-primary:focus, .btn-dw-primary:active, .btn-dw-secondary:hover, .btn-dw-secondary:focus, .btn-dw-secondary:active, .btn-dw-cart:hover, .btn-dw-cart:focus, .btn-dw-cart:active {
2131 border-radius: 0px !important;
2132 }";
2133 }
2134
2135 if (GeneralSettings.Navigation.ButtonDesign == "border-round")
2136 {
2137 CssString += @"
2138 .btn-dw-primary, .btn-dw-secondary, .btn-dw-cart, .btn-dw-primary:hover, .btn-dw-primary:focus, .btn-dw-primary:active, .btn-dw-secondary:hover, .btn-dw-secondary:focus, .btn-dw-secondary:active, .btn-dw-cart:hover, .btn-dw-cart:focus, .btn-dw-cart:active {
2139 border-radius: 200px !important;
2140 }";
2141 }
2142
2143
2144 //Headings custom settings
2145 if (GeneralSettings.Headings.Mode == "underline")
2146 {
2147 CssString += @"
2148 .dw-section-title {
2149 border-bottom: 2px solid;
2150 margin-bottom: 15px;
2151 }";
2152 }
2153
2154 if (GeneralSettings.Headings.Mode == "boxed" || GeneralSettings.Headings.Mode == "boxed-line")
2155 {
2156 CssString += @"
2157 .dw-section-title span {
2158 background-color: " + GetString("Item.Area.HeadingsH1.Color.Color") + @";
2159 display: inline-block;
2160 padding: 8px 16px;
2161 color: #FFF;
2162 }";
2163
2164 if (string.IsNullOrWhiteSpace(GetString("Item.Area.HeadingsH1.Color.Color")))
2165 {
2166 CssString += @"
2167 .dw-section-title {
2168 background-color: " + ColorSettings.Color.Primary + @";
2169 }";
2170 }
2171 }
2172
2173 if (GeneralSettings.Headings.Mode == "boxed-line")
2174 {
2175 CssString += @"
2176 .dw-section-title span {
2177 margin-bottom: 2px;
2178 }
2179
2180 .dw-section-title {
2181 border-bottom: 2px solid " + GetString("Item.Area.HeadingsH1.Color.Color") + @";
2182 margin-bottom: 10px;
2183 }";
2184
2185 if (string.IsNullOrWhiteSpace(GetString("Item.Area.HeadingsH1.Color.Color")))
2186 {
2187 CssString += @"
2188 .dw-section-title {
2189 border-bottom: 2px solid " + ColorSettings.Color.Primary + @";
2190 }";
2191 }
2192 }
2193
2194 if (GeneralSettings.Headings.Mode == "outline")
2195 {
2196 CssString += @"
2197 .dw-section-title {
2198 color: #FFF;
2199 text-shadow:
2200 -1px -1px 0 " + GetString("Item.Area.HeadingsH1.Color.Color") + @",
2201 1px -1px 0 " + GetString("Item.Area.HeadingsH1.Color.Color") + @",
2202 -1px 1px 0 " + GetString("Item.Area.HeadingsH1.Color.Color") + @",
2203 1px 1px 0 " + GetString("Item.Area.HeadingsH1.Color.Color") + @";
2204 }";
2205
2206 if (string.IsNullOrWhiteSpace(GetString("Item.Area.HeadingsH1.Color.Color")))
2207 {
2208 CssString += @"
2209 .dw-section-title {
2210 text-shadow:
2211 -1px -1px 0 #1A1A1A,
2212 1px -1px 0 #1A1A1A,
2213 -1px 1px 0 #1A1A1A,
2214 1px 1px 0 #1A1A1A;
2215 }";
2216 }
2217 }
2218
2219 if (GeneralSettings.Headings.Mode == "backline")
2220 {
2221 CssString += @"
2222 .dw-section-title {
2223 font-size: 18px;
2224 text-align: center;
2225 border-bottom: 2px solid;
2226 padding: 0;
2227 margin: 8px 0 20px;
2228 line-height: 0em !important;
2229 }
2230
2231 .dw-section-title > span {
2232 background-color: #FFF;
2233 padding: 0 16px;
2234 }
2235
2236 .dw-section-title-small {
2237 margin: 8px 0 20px;
2238 }";
2239 }
2240
2241 if (GeneralSettings.Ecommerce.EcomCardDesign == "one")
2242 {
2243
2244 }
2245
2246 if (GeneralSettings.Ecommerce.EcomCardDesign == "two")
2247 {
2248 CssString += @"
2249 .product {
2250 border: 1px solid #E5E5E5;
2251 }";
2252 }
2253
2254 return CssString;
2255 }
2256
2257 private string ClearBackground() {
2258 string CssString = "";
2259
2260 CssString += @"
2261 .dw-navbar-button > a {
2262 background-color: rgba(0, 0, 0, 0.0) !important;
2263 }
2264
2265 .dw-navbar-button > a:hover, dw-navbar-button > a:active, dw-navbar-button > a:focus, .active > a {
2266 background-color: rgba(0, 0, 0, 0.0) !important;
2267 }";
2268
2269 return CssString;
2270 }
2271
2272 private string NavbarPosition(bool margin=false, int specialpadding=6, int extramargin=0) {
2273 int LogoHeight = 0;
2274 string CssString = "";
2275 int Centerpos = 0;
2276
2277 if (GeneralSettings.Header.Mode != "solid"){
2278 if (!string.IsNullOrWhiteSpace(GeneralSettings.Logo.Image))
2279 {
2280 LogoHeight = ImageHeight();
2281 }
2282 else
2283 {
2284 LogoHeight = GetInteger("Item.Area.LogoFont.Size");
2285 }
2286 }
2287 else
2288 {
2289 if (!string.IsNullOrWhiteSpace(GeneralSettings.Logo.Image))
2290 {
2291 LogoHeight = 18;
2292 }
2293 else
2294 {
2295 LogoHeight = GetInteger("Item.Area.LogoFont.Size")-10;
2296 }
2297 }
2298
2299 if (margin == false)
2300 {
2301 Centerpos = (LogoHeight/2) + 6;
2302
2303 CssString += @"
2304 .dw-navbar-button > a, .navbar-wp.affix .navbar-nav > li > a {
2305 padding: " + Centerpos + @"px " + (specialpadding+4) + @"px " + Centerpos + @"px " + (specialpadding+4) + @"px !important;
2306 margin: " + extramargin + @"px " + extramargin + @"px !important;
2307 }";
2308 }
2309 else
2310 {
2311 Centerpos = ((LogoHeight/2)+6)-(specialpadding+extramargin);
2312
2313 CssString += @"
2314 .dw-navbar-button > a, .navbar-wp.affix .navbar-nav > li > a {
2315 padding: " + specialpadding + @"px " + (specialpadding+4) + @"px " + specialpadding + @"px " + (specialpadding+4) + @"px !important;
2316 margin: " + Centerpos + @"px 4px 0px 4px !important;
2317 }";
2318 }
2319
2320 return CssString;
2321 }
2322
2323 private int ImageHeight ()
2324 {
2325 int LogoHeight = 0;
2326
2327 if (!string.IsNullOrWhiteSpace(GetString("Item.Area.GeneralLogo")))
2328 {
2329 string imageUrl = "http://" + HttpContext.Current.Request.Url.Authority + GetString("Item.Area.GeneralLogo");
2330
2331 WebRequest request = WebRequest.Create(imageUrl);
2332 WebResponse response = request.GetResponse();
2333 Image image = Image.FromStream(response.GetResponseStream());
2334
2335 LogoHeight = image.Height;
2336 }
2337 else
2338 {
2339 LogoHeight = 38;
2340 }
2341
2342 return LogoHeight;
2343 }
2344 }
2345
2346
2347
2348 @{
2349 InitGeneralSettings();
2350 }
2351
2352
2353 @if (writeCss)
2354 {
2355 css += FontStylesCSS() + "/*Colors*/" + Environment.NewLine + GetColorSettings() + Environment.NewLine + "/*General*/" + Environment.NewLine + GetGeneralCSS();
2356 Dynamicweb.Core.Helpers.TextFileHelper.WriteTextFile(css, HttpContext.Current.Server.MapPath("/Files/Templates/Designs/Dwsimple/css/DWGlobalStylesSite" + GetString("DwAreaID") + "_auto.css"), false);
2357 Dynamicweb.Core.Helpers.TextFileHelper.WriteTextFile(RemoveWhiteSpaceFromStylesheets(Dynamicweb.Core.Helpers.TextFileHelper.ReadTextFile(HttpContext.Current.Server.MapPath("/Files/Templates/Designs/Dwsimple/css/DWGlobalStyles.css"))), HttpContext.Current.Server.MapPath("/Files/Templates/Designs/Dwsimple/css/DWGlobalStyles.min.css"), false);
2358 Dynamicweb.Core.Helpers.TextFileHelper.WriteTextFile(RemoveWhiteSpaceFromStylesheets(css), cssPath, false);
2359 }
2360
2361 @functions{
2362 public static string RemoveWhiteSpaceFromStylesheets(string body)
2363 {
2364 body = Regex.Replace(body, @"[a-zA-Z]+#", "#");
2365 body = Regex.Replace(body, @"[\n\r]+\s*", string.Empty);
2366 body = Regex.Replace(body, @"\s+", " ");
2367 body = Regex.Replace(body, @"\s?([:,;{}])\s?", "$1");
2368 body = body.Replace(";}", "}");
2369 body = Regex.Replace(body, @"([\s:]0)(px|pt|%|em)", "$1");
2370 // Remove comments from CSS
2371 body = Regex.Replace(body, @"/\*[\d\D]*?\*/", string.Empty);
2372 return body;
2373 }
2374 }
2375
2376 @* TEMPLATE STYLES *@
2377 <link rel="stylesheet" type="text/css" href="/Files/Templates/Designs/Dwsimple/css/DWGlobalStyles.min.css" id="dwStylesheet" media="screen">
2378 <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
2379 <link rel="stylesheet" type="text/css" href="/Files/Templates/Designs/Dwsimple/css/invoice.min.css">
2380 <link rel="stylesheet" type="text/css" href="/Files/Templates/Designs/Dwsimple/css/owl.carousel.min.css">
2381 <link rel="stylesheet" type="text/css" href="/Files/Templates/Designs/Dwsimple/css/owl.theme.default.min.css">
2382 <link rel="stylesheet" type="text/css" href="/Files/Templates/Designs/Dwsimple/css/print.min.css" media="print">
2383 <link rel="stylesheet" type="text/css" href="/Files/Templates/Designs/Dwsimple/css/typeahead.min.css">
2384 <link rel="stylesheet" type="text/css" href="/Files/Templates/Designs/Dwsimple/css/fjerdingstad.css">
2385
2386
2387 @{
2388 string cssAutoPath = "/Files/Templates/Designs/Dwsimple/css/DWGlobalStylesSite" + GetString("DwAreaID") + "_auto.min.css?t=@areaUpdated.Ticks";
2389 }
2390 <link rel="stylesheet" type="text/css" href="@cssAutoPath">
2391 <link rel="stylesheet" type="text/css" href="/Files/Templates/Designs/Dwsimple/css/product.min.css">
2392 <link rel="stylesheet" type="text/css" href="/Files/Templates/Designs/Dwsimple/css/style.min.css">
2393 <link rel="stylesheet" type="text/css" href="/Files/Templates/Designs/Dwsimple/css/styles.min.css">
2394
2395 @* ANALYTICS CODE *@
2396 @GetValue("Item.Area.OtherAnalyticsCode")
2397
2398 <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
2399 <script src="//code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
2400 <script src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.9.2/jquery.ui.mouse.min.js"></script>
2401 <script src="/Files/Templates/Designs/Dwsimple/js/jquery.ui.touch-punch.min.js"></script>
2402
2403 <script src="//cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
2404
2405 @foreach (var lang in GetLoop("WebsiteLanguages"))
2406 {
2407 bool IsMaster = lang.GetBoolean("IsMaster");
2408
2409 if (IsMaster)
2410 {
2411 string langCode = lang.GetString("Culture").Substring(3).ToUpper();
2412 <text>
2413 <script>
2414 var $langCode = "@langCode";
2415 </script>
2416 </text>
2417 }
2418 }
2419
2420 @if (GeneralSettings.Navigation.IsMegamenu)
2421 {
2422 <link rel="stylesheet" type="text/css" href="/Files/Templates/Designs/Dwsimple/css/megamenu.min.css">
2423 }
2424
2425 @* CONFIGURING DYNAMICALLY STYLES WHICH COMES FROM CUSTOM MODULES *@
2426 <style>
2427 @RenderSnippet("StylesHead")
2428 </style>
2429 @GetValue("Stylesheets")
2430 @GetValue("Javascripts")
2431 </head>
2432
2433
2434
2435 <body style="@GeneralSettings.Background.Style" id="sitecontent">
2436 @* GOOGLE TAG MANAGER (NOSCRIPT) *@
2437 <noscript>
2438 <iframe src="https://www.googletagmanager.com/ns.html?id=@GoogleTagManagerId" height="0" width="0" style="display:none;visibility:hidden"></iframe>
2439 </noscript>
2440 @* END GOOGLE TAG MANAGER (NOSCRIPT) *@
2441
2442 @* MODALS *@
2443 @{
2444 var request = HttpContext.Current.Request;
2445 }
2446 <div class="modal fade" id="login" tabindex="-1" role="dialog" aria-labelledby="loginLabel" aria-hidden="true">
2447 <div class="modal-dialog mdl-custom">
2448 <div class="modal-content">
2449 <div class="modal-header" id="loginModalDiv">
2450 <h4 class="modal-title" id="myModalLabel">@Translate("Login", "Login")</h4>
2451 </div>
2452
2453 <form name="form" id="loginform" method="post">
2454 <div class="modal-body">
2455 <input type="hidden" name="ID" value="@Pageview.ID">
2456 <input type="hidden" name="DWExtranetUsernameRemember" value="True">
2457 <input type="hidden" name="DWExtranetPasswordRemember" value="True">
2458 <div class="form-group2">
2459 @{ attrValue = Translate("Enter email", "Enter email");
2460 var username2 = @GetValue("DWExtranetUsername");
2461 }
2462 <input type="text" class="form-control" name="username" id="username" placeholder="@attrValue" value="@username2" required="">
2463 </div>
2464 <div class="form-group2">
2465 @{ attrValue = Translate("Enter password", "Enter password");
2466 }<input type="password" class="form-control" name="password" id="password" placeholder="@attrValue" required="">
2467 </div>
2468 @if (!string.IsNullOrWhiteSpace(GetString("DW_extranet_error_uk")) && !string.IsNullOrWhiteSpace(request["username"]))
2469 {
2470 <h5 class="text-center" id="loginModalValidationMessage">@GetValue("DW_extranet_error_uk")</h5>
2471 }
2472 <div class="form-group2">
2473 <button type="submit" class="btn btn-xs btn-base login-btn pull-right">@Translate("Sign in", "Sign in")</button>
2474 </div>
2475 </div>
2476
2477 <div class="row">
2478 <div class="col-md-12 4letter">
2479 <div class="col-md-6 checkbox pull-left">
2480 <label>
2481 <input type="checkbox" name="Autologin" checked="checked" value="True"> @Translate("Remember me", "Remember me")
2482 </label>
2483 </div>
2484 <div class="col-md-6">
2485 <a class="pull-left" href='/Default.aspx?ID=@Pageview.Area.Item["SignInPageId"]&LoginAction=Recovery'>@Translate("Forgot your password?", "Forgot your password?")</a>
2486
2487 <a class="pull-left" href='/Default.aspx?ID=@Pageview.Area.Item["CreateNewUser"]'>@Translate("Create new user", "Create new user")</a>
2488 <p> </p>
2489 <br>
2490 </div>
2491 </div>
2492 </div>
2493
2494 </form>
2495 </div>
2496 </div>
2497 </div>
2498
2499 @* MOBILE MENU *@
2500 @{
2501 var offsetmenuplace = "left";
2502
2503 if (GeneralSettings.Header.Mode == "mobile")
2504 {
2505 offsetmenuplace = GeneralSettings.Navigation.Position;
2506 }
2507 }
2508 <div id="myNavmenu" class="navmenu navmenu-default navmenu-fixed-@offsetmenuplace offcanvas">
2509 <div class="col-sm-12 col-xs-12 offcanvas-col">
2510 <div class="row offcanvas-row"> </div>
2511 <div class="offcanvas-row pull-right">
2512 <button type="button" class="btn btn-sm btn-dw-primary close-menu" data-toggle="offcanvas" data-target="#myNavmenu" data-canvas="body">
2513 <img src="/Files/Templates/Designs/Dwsimple/images/icons/close.png" alt="close">
2514 <span>
2515 @Translate("Menu", "Menu")
2516 </span>
2517 </button>
2518 </div>
2519 <div class="row offcanvas-row hidden">
2520 <div class="col-sm-12 col-xs-12 offcanvas-col">
2521 <a href="/Default.aspx?ID=@firstpageid" class="brand">
2522 @if (!string.IsNullOrWhiteSpace(GeneralSettings.Logo.Image))
2523 {
2524 <div class="img-responsive dw-offsetmenu-logo pull-left">
2525 @if (GeneralSettings.Logo.ContrastImage != GeneralSettings.Logo.Image)
2526 {
2527 <img src="@GeneralSettings.Logo.ContrastImage" alt="Logo">
2528 }
2529 else
2530 {
2531 <img class="img-responsive" src="@GeneralSettings.Logo.Image" alt="Logo">
2532 }
2533 </div>
2534 }
2535
2536 @if (!string.IsNullOrWhiteSpace(GeneralSettings.Logo.Text))
2537 {
2538 <div class="dw-logotext dw-offsetmenu-logo pull-left">@GeneralSettings.Logo.Text</div>
2539 }
2540 </a>
2541 </div>
2542 </div>
2543 <div class="row offcanvas-row"> </div>
2544 </div>
2545
2546 <div class="col-sm-12 col-xs-12 offcanvas-col">
2547 @if (GetBoolean("Item.Area.EcomEnabled"))
2548 {
2549 <div class="row offcanvas-row"> </div>
2550 <div class="row offcanvas-row">
2551 <div class="col-sm-12 col-xs-12 offcanvas-col">
2552 @if (!Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName")))
2553 {
2554 <div class="pull-left hidden">
2555 <a href='Default.aspx?ID=@Pageview.Area.Item["SignInPageId"]' class="btn btn-sm btn-default">@Translate("Sign in", "Sign in")</a>
2556 <a href='Default.aspx?ID=@Pageview.Area.Item["SignUpPageId"]' class="btn btn-sm btn-default">@Translate("Opret brugerprofil", "Opret brugerprofil")</a>
2557 </div>
2558
2559 }
2560 @if (Dynamicweb.Frontend.PageView.Current().Device == Dynamicweb.Frontend.Devices.DeviceType.Desktop)
2561 {
2562 if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName")))
2563 {
2564 <div class="pull-left">
2565 <a href='Default.aspx?ID=@Pageview.Area.Item["OrdersPageId"]' class="btn btn-sm btn-default">
2566 <i class="fa fa-user"></i> <strong>@GetGlobalValue("Global:Extranet.Name")</strong>
2567 </a>
2568 </div>
2569 <div class="pull-left">
2570 <a href="/Admin/Public/ExtranetLogoff.aspx?ID=@Pageview.ID"><button class="btn btn-sm btn-default"><i class="fa fa-sign-out"></i> @Translate("Sign out", "Sign out")</button></a>
2571 </div>
2572 }
2573 }
2574 @if (GetLoop("DWExtranetSecondaryUsers").Count > 0 || !string.IsNullOrWhiteSpace(GetGlobalValue("Global:Extranet.SecondaryUser.UserID")))
2575 {
2576 <p> </p>
2577 <form method="post">
2578 <div class="pull-left">
2579 @if (string.IsNullOrWhiteSpace(GetGlobalValue("Global:Extranet.SecondaryUser.UserID")))
2580 {
2581 <select id="DWExtranetSecondaryUserSelector" name="DWExtranetSecondaryUserSelector" title="Impersonate selected user">
2582 @foreach (var user in GetLoop("DWExtranetSecondaryUsers"))
2583 {
2584 <option value='@user.GetValue("UserID")'>@user.GetValue("UserName")</option>
2585 }
2586 </select>
2587 <input type="submit" class="btn btn-xs" tabindex="3" value="OK">
2588 }
2589 else
2590 {
2591 string impersonateUser = @GetGlobalValue("Global:Extranet.SecondaryUser.UserName") + " is impersonated by " + @Pageview.User.UserName;
2592 <span title="@impersonateUser" class="btn btn-xs impersonation-btn"><i class="fa fa-user-secret"></i> @GetGlobalValue("Global:Extranet.SecondaryUser.UserName")</span>
2593 <input type="submit" class="btn btn-xs" name="DwExtranetRemoveSecondaryUser" id="DwExtranetRemoveSecondaryUser" value="Stop impersonation">
2594 }
2595 </div>
2596 </form>
2597 }
2598 </div>
2599 </div>
2600 <div class="row offcanvas-row"> </div>
2601 }
2602 </div>
2603
2604
2605 <div class="row offcanvas-row">
2606 <div class="col-sm-12 col-xs-12 offcanvas-col">
2607 @GetValue("DwNavigation(drawernavigation)")
2608 </div>
2609 </div>
2610
2611 @if (!GetBoolean("Item.Area.OnlyOneLanguage"))
2612 {
2613 <div class="langMobile">
2614 <div class="lang-sug">
2615 <img class="closeLang" src="/Files/Templates/Designs/Dwsimple/images/icons/close-black.png" alt="close">
2616
2617 <p>@Translate("Change language", "Change language"):</p>
2618
2619 <ul class="langMenu langMobile" area-labelledby="language">
2620
2621 @foreach (var lang in GetLoop("WebsiteLanguages"))
2622 {
2623
2624 string isActive = (lang.GetBoolean("IsCurrent") ? "activeArea" : "");
2625
2626 <li id='@lang.GetValue("ID")area' class="@isActive">
2627 @*@if (GetInteger("Ecom:Order.OrderLines.Count") <= 0)*@
2628 @{
2629 string langCode = lang.GetString("Culture").Substring(0, 2).ToLower();
2630
2631 if (lang.GetBoolean("IsCurrent"))
2632 {
2633 <a data-lang="current" data-code="@langCode" class="activeArea langSelected" href='Default.aspx?ID=@lang.GetValue("FirstActivePageID")'>
2634 @lang.GetString("Culture")
2635
2636 </a>
2637
2638 }
2639 else
2640 {
2641 <a class="langSelected" data-lang="none" data-code="@langCode" href='Default.aspx?ID=@lang.GetValue("FirstActivePageID")'>
2642 @lang.GetString("Culture")
2643
2644 </a>
2645
2646 }
2647 }
2648 </li>
2649 }
2650
2651 </ul>
2652
2653
2654 </div>
2655 </div>
2656 }
2657
2658 <div>
2659 <ul class="top-menu">
2660 @foreach (LoopItem headerLink in GetLoop("Item.Area.HeaderLinks"))
2661 {
2662 string Link = headerLink.GetString("Item.Area.HeaderLinks.Link");
2663 string LinkText = headerLink.GetString("Item.Area.HeaderLinks.LinkText");
2664 string LinkIcon = headerLink.GetString("Item.Area.HeaderLinks.LinkIcon");
2665 string LinkTarget = headerLink.GetString("Item.Area.HeaderLinks.LinkTarget");
2666
2667 <li>
2668 <a href="@Link" title="@LinkText" target="@LinkTarget">
2669 <span class="link-icon" style='background-image: url("@LinkIcon")'></span>
2670 <span class="link-txt">@LinkText</span>
2671 </a>
2672 </li>
2673 }
2674
2675 @if (!GetBoolean("Item.Area.OnlyOneLanguage"))
2676 {
2677 <li class="LangLing">
2678 <a href="#">
2679 <span class="link-icon" style='background-image: url("@GetString("Item.Area.LanguageIcon")")'></span>
2680 <span class="link-txt">@GetString("Item.Area.LanguageText")</span>
2681 </a>
2682 </li>
2683 }
2684
2685 <!-- Ecommerce user menu -->
2686 @if (GetBoolean("Item.Area.EcomEnabled"))
2687 {
2688 if (!Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName")))
2689 {
2690 <text>
2691 <li class="LoginLink">
2692 <a href='Default.aspx?ID=@Pageview.Area.Item["SignInPageId"]'>
2693
2694 <span>@Translate("Login", "Login")</span>
2695 </a>
2696 </li>
2697
2698 </text>
2699 }
2700
2701 if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName")))
2702 {
2703 <text>
2704 <li class="loggedIn">
2705 <a href='Default.aspx?ID=@Pageview.Area.Item["UserProfilePageId"]'>
2706 <nobr>
2707 <i class="fa fa-user"></i> <strong>@GetGlobalValue("Global:Extranet.Name")</strong>
2708 </nobr>
2709 </a>
2710 </li>
2711 @if (GetLoop("DWExtranetSecondaryUsers").Count > 0 || !string.IsNullOrWhiteSpace(GetGlobalValue("Global:Extranet.SecondaryUser.UserID")))
2712 {
2713 <li>
2714 <form method="post">
2715 <span>
2716 @if (string.IsNullOrWhiteSpace(GetGlobalValue("Global:Extranet.SecondaryUser.UserID")))
2717 {
2718 string impersonateTranslation = Translate("Impersonate selected user");
2719 <select id="DWExtranetSecondaryUserSelector" name="DWExtranetSecondaryUserSelector" title="@impersonateTranslation">
2720 @foreach (var user in GetLoop("DWExtranetSecondaryUsers"))
2721 {
2722 <option value='@user.GetValue("UserID")'>@user.GetValue("UserName")</option>
2723 }
2724 </select>
2725 <input type="submit" class="btn btn-xs" tabindex="3" value="OK">
2726 }
2727 else
2728 {
2729 string impersonateUser = GetGlobalValue("Global:Extranet.SecondaryUser.UserName") + " " + Translate("is impersonated by") + " " + Pageview.User.UserName;
2730 string stopImpersonateTranslation = Translate("Stop impersonation");
2731 <span title="@impersonateUser" class="btn btn-xs impersonation-btn"><i class="fa fa-user-secret"></i> @GetGlobalValue("Global:Extranet.SecondaryUser.UserName")</span>
2732 <input type="submit" class="btn btn-xs" name="DwExtranetRemoveSecondaryUser" id="DwExtranetRemoveSecondaryUser" value="@stopImpersonateTranslation">
2733 }
2734 </span>
2735 </form>
2736 </li>
2737 }
2738 <li class="LogOut">
2739 <a href='/Admin/Public/ExtranetLogoff.aspx?ID=@logoutid'>@Translate("Logout", "Logout")</a>
2740 </li>
2741 </text>
2742 }
2743 }
2744
2745 <!-- Ecommerce Cart -->
2746 @if ((Dynamicweb.Frontend.PageView.Current().Device == Dynamicweb.Frontend.Devices.DeviceType.Mobile) || (Dynamicweb.Frontend.PageView.Current().Device == Dynamicweb.Frontend.Devices.DeviceType.Tablet))
2747 {
2748 if (GetBoolean("Item.Area.EcomEnabled"))
2749 {
2750 <li class="dropdown animate-hover" data-animate="animated fadeInUp">
2751 <a href="Default.aspx?ID=@cartid" title="" id="minipagecart" class="dw-minicart"><i class="fa fa-shopping-cart"></i> @GetValue("Ecom:Order.OrderLines.TotalProductQuantity") <span>@GetValue("Ecom:Order.OrderLines.Total.PriceWithoutVAT")</span></a>
2752
2753 <ul class="sub-menu">
2754 <li id="minicart">
2755 @MiniCart()
2756 </li>
2757 </ul>
2758 </li>
2759 }
2760 }
2761 </ul>
2762
2763 </div>
2764 </div>
2765
2766 @* HEADER AND CONTENT *@
2767
2768 <div class="body-wrap shad @GeneralSettings.Site.LayoutMode">
2769
2770 @* HEADER *@
2771 <div id="divHeaderWrapper">
2772 <header class="header nav-down @GeneralSettings.Header.Classes">
2773 <div class="headerLeft pull-left">
2774 <!-- TOP HEADER -->
2775 @if (GeneralSettings.Header.Show)
2776 {
2777 <div class="top-header">
2778 <div class="row">
2779 @if (!GetBoolean("Item.Area.OnlyOneLanguage"))
2780 {
2781 <div class="lang-sug">
2782 <img class="closeLang" src="/Files/Templates/Designs/Dwsimple/images/icons/close-black.png" alt="close">
2783 <div class="container">
2784
2785 <p>@Translate("Change language", "Change language"):</p>
2786
2787 <div id="partnercountry">
2788
2789 </div>
2790 <ul class="langMenu" area-labelledby="language">
2791 @foreach (var lang in GetLoop("WebsiteLanguages"))
2792 {
2793 string isActive = (lang.GetBoolean("IsCurrent") ? "activeArea" : "");
2794
2795 <li id='@lang.GetValue("ID")area' class="@isActive">
2796 @*@if (GetInteger("Ecom:Order.OrderLines.Count") <= 0)*@
2797 @{
2798 string langCode = lang.GetString("Culture").Substring(0, 2).ToLower();
2799
2800 if (lang.GetBoolean("IsCurrent"))
2801 {
2802 <a data-lang="current" data-code="@langCode" class="activeArea langSelected" href='Default.aspx?ID=@lang.GetValue("FirstActivePageID")'>
2803 @lang.GetString("Culture")
2804 </a>
2805 }
2806 else
2807 {
2808 <a class="langSelected" data-lang="none" data-code="@langCode" href='Default.aspx?ID=@lang.GetValue("FirstActivePageID")'>
2809 @lang.GetString("Culture")
2810 </a>
2811 }
2812 }
2813 </li>
2814 }
2815 </ul>
2816 </div>
2817 </div>
2818 }
2819 </div>
2820 <div class="row">
2821 <div class="col-xs-4 col-sm-4 col-md-3 logobox">
2822 @if (GeneralSettings.Header.Mode == "solid")
2823 {
2824 <a href="/Default.aspx?ID=@firstpageid" class="brand">
2825 @if (!string.IsNullOrWhiteSpace(GeneralSettings.Logo.Image))
2826 {
2827 <img class="img-responsive dw-logoimage pull-left" src="@GeneralSettings.Logo.Image" alt="Logo">
2828 }
2829
2830 @if (!string.IsNullOrWhiteSpace(GeneralSettings.Logo.Text))
2831 {
2832 <div class="dw-logotext pull-left">@GeneralSettings.Logo.Text</div>
2833 }
2834 </a>
2835
2836 if (!string.IsNullOrWhiteSpace(GeneralSettings.Logo.Slogan))
2837 {
2838 <div class="dw-slogantext pull-left">@GeneralSettings.Logo.Slogan</div>
2839 }
2840 }
2841 </div>
2842 <div class="col-xs-8 col-sm-8 col-md-9 logobox">
2843 <div class="row">
2844 <div class="hidden-xs hidden-sm hidden-md col-lg-12 search-right">
2845 <div class="searchIcon hidden-xs hidden-sm pull-right">
2846 <span class="buttonIconSearch">
2847 <button class="btn btn-dw-primary searchFieldShow" type="submit">
2848 <img src="/Files/Templates/Designs/Dwsimple/images/icons/search-white.png" class="img-center" alt="">
2849 <span>
2850 @Translate("Search", "Search")
2851 </span>
2852 </button>
2853 </span>
2854 </div>
2855
2856 <div class="pull-right navBar">
2857 <nav class="top-header-menu hidden-sm hidden-xs hidden-md">
2858 <ul class="top-menu">
2859 @*
2860 @if(GetInteger("DwAreaFirstPageID") == 8398)
2861 {
2862 <li><a href="Default.aspx?ID=11424"><img alt="" src="/Files/Images/Ikoner/English.png" style="height:25px; width:50px"></a></li>
2863 <li><a href="Default.aspx?ID=11837"><img alt="" src="/Files/Images/Ikoner/PolishNew.png" style="height:25px; width:50px"></a></li>
2864 }
2865 @if(GetInteger("DwAreaFirstPageID") == 11424)
2866 {
2867 <li><a href="Default.aspx?ID=8398"><img alt="" src="/Files/Images/Ikoner/Norwegian.png" style="height:25px; width:50px"></a></li>
2868 <li><a href="Default.aspx?ID=11837"><img alt="" src="/Files/Images/Ikoner/PolishNew.png" style="height:25px; width:50px"></a></li>
2869 }
2870 @if(GetInteger("DwAreaFirstPageID") == 11586)
2871 {
2872 <li><a href="Default.aspx?ID=11424"><span class"link-txt"="">@Translate("Norwood.UK","Norwood.UK")<img alt="" src="/Files/Images/Ikoner/English.png" style="height:25px; width:50px"></span></a></li>
2873 <li><a href="Default.aspx?ID=11837"><img alt="" src="/Files/Images/Ikoner/English.png" style="height:25px; width:50px"></a></li>
2874 <li><a href="Default.aspx?ID=11837">@Translate("English language","English language")</a></li>
2875 <li><a href="Default.aspx?ID=8398"><img alt="" src="/Files/Images/Ikoner/Norwegian.png" style="height:25px; width:50px"></a></li>
2876 }
2877 @if(GetInteger("DwAreaFirstPageID") == 11837)
2878 {
2879 <li><a href="Default.aspx?ID=11424"><span class"link-txt"="">@Translate("Norwood.UK","Norwood.UK")<img alt="" src="/Files/Images/Ikoner/English.png" style="height:25px; width:50px"></span></a></li>
2880 <li><a href="Default.aspx?ID=11586"><img alt="" src="/Files/Images/Ikoner/PolishNew.png" style="height:25px; width:50px"></a></li>
2881 <li><a href="Default.aspx?ID=11586">@Translate("Polish language","Polish language")</a></li>
2882 <li><a href="Default.aspx?ID=11424"><img alt="" src="/Files/Images/Ikoner/English.png" style="height:25px; width:50px"></a></li>
2883 <li><a href="Default.aspx?ID=8398"><img alt="" src="/Files/Images/Ikoner/Norwegian.png" style="height:25px; width:50px"></a></li>
2884 }
2885 *@
2886
2887 @foreach (LoopItem headerLink in GetLoop("Item.Area.HeaderLinks"))
2888 {
2889
2890 string Link = headerLink.GetString("Item.Area.HeaderLinks.Link");
2891 string LinkText = headerLink.GetString("Item.Area.HeaderLinks.LinkText");
2892 string LinkIcon = headerLink.GetString("Item.Area.HeaderLinks.LinkIcon");
2893 string LinkTarget = headerLink.GetString("Item.Area.HeaderLinks.LinkTarget");
2894
2895 <li>
2896 <a href="@Link" title="@LinkText" target="@LinkTarget">
2897 <span class="link-icon" style='background-image: url("@LinkIcon")'></span>
2898 <span class="link-txt">@LinkText</span>
2899 </a>
2900 </li>
2901 }
2902
2903 @if (!GetBoolean("Item.Area.OnlyOneLanguage"))
2904 {
2905 <li class="LangLing">
2906 <a href="#">
2907 <span class="link-icon" style='background-image: url("@GetString("Item.Area.LanguageIcon")")'></span>
2908 <span class="link-txt">@GetString("Item.Area.LanguageText")</span>
2909 </a>
2910 </li>
2911 }
2912
2913
2914 <!-- Ecommerce user menu -->
2915 @if (GetBoolean("Item.Area.EcomEnabled"))
2916 {
2917 if (!Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName")))
2918 {
2919 <text>
2920 <li class="LoginLink">
2921 <a href="#" data-toggle="modal" data-target="#login">
2922
2923 <span>@Translate("Login", "Login")</span>
2924 </a>
2925 </li>
2926 @*@GetValue("DwNavigation(toolsnavigationNotloggedin)")*@
2927 </text>
2928 }
2929
2930 if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName")))
2931 {
2932 <text>
2933
2934 <li class="loggedIn">
2935 <a id="dLabel" role="button" href='Default.aspx?ID=@Pageview.Area.Item["UserProfilePageId"]'>
2936
2937 <nobr>
2938 <i class="fa fa-user"></i>@GetGlobalValue("Global:Extranet.Name")
2939 </nobr>
2940 </a>
2941 @GetValue("DwNavigation(MyProfileMenu)")
2942 <span class="TitleWelcome" style="display: none;">@Translate("Welcome", "Welcome") @GetGlobalValue("Global:Extranet.Name")</span>
2943 </li><li class="logOut" style="display: none;">
2944 <a href='/Admin/Public/ExtranetLogoff.aspx?ID=@logoutid'>
2945 @*<i class="fa fa-sign-out"></i>*@
2946 @Translate("Logout", "Logout")
2947
2948 </a>
2949 </li>
2950
2951
2952
2953 @if (GetLoop("DWExtranetSecondaryUsers").Count > 0 || !string.IsNullOrWhiteSpace(GetGlobalValue("Global:Extranet.SecondaryUser.UserID")))
2954 {
2955 <li>
2956 <form method="post">
2957 <span>
2958 @if (string.IsNullOrWhiteSpace(GetGlobalValue("Global:Extranet.SecondaryUser.UserID")))
2959 {
2960 string impersonateTranslation = Translate("Impersonate selected user");
2961 <select id="DWExtranetSecondaryUserSelector" name="DWExtranetSecondaryUserSelector" title="@impersonateTranslation">
2962 @foreach (var user in GetLoop("DWExtranetSecondaryUsers"))
2963 {
2964 <option value='@user.GetValue("UserID")'>@user.GetValue("UserName")</option>
2965 }
2966 </select>
2967 <input type="submit" class="btn btn-xs" tabindex="3" value="OK">
2968 }
2969 else
2970 {
2971 string impersonateUser = GetGlobalValue("Global:Extranet.SecondaryUser.UserName") + " " + Translate("is impersonated by") + " " + Pageview.User.UserName;
2972 string stopImpersonateTranslation = Translate("Stop impersonation");
2973 <span title="@impersonateUser" class="btn btn-xs impersonation-btn"><i class="fa fa-user-secret"></i> @GetGlobalValue("Global:Extranet.SecondaryUser.UserName")</span>
2974 <input type="submit" class="btn btn-xs" name="DwExtranetRemoveSecondaryUser" id="DwExtranetRemoveSecondaryUser" value="@stopImpersonateTranslation">
2975 }
2976 </span>
2977 </form>
2978 </li>
2979 }
2980
2981 </text>
2982 }
2983 }
2984
2985 <!-- Ecommerce Cart -->
2986 @if (GetBoolean("Item.Area.EcomEnabled"))
2987 {
2988 <li class="dropdown animate-hover hidden" data-animate="animated fadeInUp">
2989 <a href="Default.aspx?ID=@cartid" title="" id="minipagecart" class="dw-minicart"><i class="fa fa-shopping-cart"></i> @GetValue("Ecom:Order.OrderLines.TotalProductQuantity") <span>@GetValue("Ecom:Order.OrderLines.Total.PriceWithoutVAT")</span></a>
2990
2991 <ul class="sub-menu">
2992 <li id="minicart">
2993 @MiniCart()
2994 </li>
2995 </ul>
2996 </li>
2997 }
2998 </ul>
2999 </nav>
3000 <!-- MAIN NAV -->
3001 @{
3002 var sticky = GeneralSettings.Navigation.StickyMenu;
3003 var stickyTrigger = "affix";
3004 var navbarpos = GeneralSettings.Navigation.Position;
3005 var selectionstyle = GeneralSettings.Navigation.SelectionStyle;
3006
3007 if (sticky == "off")
3008 {
3009 stickyTrigger = "";
3010 }
3011 }
3012
3013 <div id="navOne" class="navbar navbar-wp @selectionstyle navbar-fixed affix-top" role="navigation" data-spy="@stickyTrigger" data-offset-top="@sticky" data-offset-bottom="300">
3014 @if (GeneralSettings.Header.Mode != "solid" || !GeneralSettings.Header.Show)
3015 {
3016 <div class="navbar-header pull-@GeneralSettings.Navigation.InvertedPosition">
3017 <div class="hidden-sm hidden-xs">
3018 <a href="/Default.aspx?ID=@firstpageid" class="brand">
3019 @if (!string.IsNullOrWhiteSpace(GeneralSettings.Logo.Image))
3020 {
3021 if (GeneralSettings.Logo.ContrastImage != GeneralSettings.Logo.Image)
3022 {
3023 <img class="img-responsive dw-logoimage dw-logoimage-normal pull-left" src="@GeneralSettings.Logo.Image" alt="Logo">
3024 <img class="img-responsive dw-logoimage dw-logoimage-contrast pull-left" src="@GeneralSettings.Logo.ContrastImage" alt="Logo">
3025 }
3026 else
3027 {
3028 <img class="img-responsive dw-logoimage pull-left" src="@GeneralSettings.Logo.Image" alt="Logo">
3029 }
3030 }
3031
3032 @if (!string.IsNullOrWhiteSpace(GeneralSettings.Logo.Text))
3033 {
3034 <div class="dw-logotext pull-left">@GeneralSettings.Logo.Text</div>
3035 }
3036 </a>
3037
3038 @if (!string.IsNullOrWhiteSpace(GeneralSettings.Logo.Slogan))
3039 {
3040 <div class="dw-slogantext pull-left">@GeneralSettings.Logo.Slogan</div>
3041 }
3042 </div>
3043 </div>
3044 }
3045
3046 @if (GeneralSettings.Header.Mode != "mobile")
3047 {
3048
3049 <!-- Big screen header -->
3050 <div class="navbar-navigation">
3051 <div class="hidden-sm hidden-xs">
3052 <nav class="col-md-10 col-sm-10 col-xs-10 p-0 navbar-collapse collapse navbar-@navbarpos">
3053 @if (GeneralSettings.Navigation.IsMegamenu)
3054 {
3055 @GetValue("DwNavigation(topnavigationmegamenu)")
3056 }
3057 else
3058 {
3059 @GetValue("DwNavigation(topnavigation)")
3060 }
3061
3062 <!-- Extra navigation when no header is shown -->
3063 @if (GetBoolean("Item.Area.EcomEnabled"))
3064 {
3065 if (!GeneralSettings.Header.Show)
3066 {
3067 <ul class="nav navbar-nav">
3068 <li> </li>
3069 @if (!Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName")))
3070 {
3071 <li class="dw-navbar-button"><a href="#" data-toggle="modal" data-target="#login" data-hover="dropdown"><i class="fa fa-sign-in"></i><span></span></a></li>
3072 <li class="dw-navbar-button"><a href="/not-logged-in/create-user-profile" data-hover="dropdown"><i class="fa fa-user"></i><span></span></a></li>
3073 }
3074
3075 @if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName")))
3076 {
3077 <li class="dw-navbar-button">
3078 <a href='Default.aspx?ID=@Pageview.Area.Item["OrdersPageId"]' data-hover="dropdown">
3079 <nobr>
3080 <strong><i class="fa fa-user"></i></strong>
3081 </nobr>
3082 <span></span>
3083 </a>
3084 </li>
3085 <li class="dw-navbar-button">
3086 <a href="/Admin/Public/ExtranetLogoff.aspx?ID=@Pageview.Page.ID" data-hover="dropdown"><i class="fa fa-sign-out"></i><span></span></a>
3087 </li>
3088 }
3089
3090
3091 </ul>
3092 }
3093
3094 if (GeneralSettings.Header.Mode != "solid")
3095 {
3096 <ul class="nav navbar-nav">
3097 <li class="dropdown dropdown-aux animate-click dw-navbar-button" data-animate-in="animated bounceInUp" data-animate-out="animated fadeOutDown" style="z-index:500;">
3098 <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown"><i class="fa fa-search"></i><span></span></a>
3099 <ul class="dropdown-menu dropdown-menu-user animate-wr">
3100 <li id="dropdownForm">
3101 <div class="dropdown-form">
3102 <form class="form-light p-15" role="form" method="get" action="Default.aspx">
3103 <input type="hidden" name="ID" value='@searchpage'>
3104 <div class="input-group remote">
3105 <input type="text" class="form-control typeahead" name="q" placeholder="@searchplaceholder">
3106 <span class="input-group-btn" style="top:-1px !important;">
3107 <button class="btn btn-base" type="submit"><i class="fa fa-search"></i></button>
3108 </span>
3109 </div>
3110 </form>
3111 </div>
3112 </li>
3113 </ul>
3114 </li>
3115 </ul>
3116 }
3117 }
3118 </nav>
3119 </div>
3120
3121 @*@if (GetBoolean("Item.Area.EcomEnabled"))
3122 {
3123 if (GeneralSettings.Header.Mode == "solid" && GeneralSettings.Header.Show)
3124 {
3125 <div class="hidden-sm hidden-xs">
3126 <div class="col-md-2 col-sm-2 col-xs-2 pull-@GeneralSettings.Navigation.InvertedPosition">
3127 <form method="get" action="Default.aspx">
3128 <input type="hidden" name="ID" value='@Pageview.Area.Item["ProductsPageId"]'>
3129 <div id="remote" class="input-group pull-@GeneralSettings.Navigation.InvertedPosition dw-top-search">
3130 <input type="text" class="form-control typeahead" name="Search" tabindex="1" placeholder="@searchplaceholder">
3131 <span class="input-group-btn" style="top:0px !important;">
3132 <button class="btn btn-primary" type="submit"><i class="fa fa-search"></i></button>
3133 </span>
3134 </div>
3135 </form>
3136 </div>
3137 </div>
3138 }
3139 }*@
3140 </div>
3141 }
3142 else
3143 {
3144 <!-- Using only mobile navigation -->
3145 <div class="pull-@GeneralSettings.Navigation.Position">
3146 <ul class="nav navbar-nav">
3147 <li class="dw-navbar-button" data-toggle="offcanvas" data-target="#myNavmenu" data-canvas="body">
3148 <a><i class="fa fa-bars fa-2x"></i><span></span></a>
3149 </li>
3150 </ul>
3151 </div>
3152 }
3153 </div>
3154 </div>
3155
3156 </div>
3157
3158
3159 </div>
3160 <div class="col-xs-12 mobileMenu hidden-lg">
3161 <span class="buttonIconSearch pull-right ">
3162 <button class="btn btn-dw-primary searchFieldShow" type="submit">
3163 <img src="/Files/Templates/Designs/Dwsimple/images/icons/search-white.png" class="img-center" alt="">
3164 <span>
3165 @Translate("Search", "Search")
3166 </span>
3167 </button>
3168 </span>
3169 <!-- Small screen header -->
3170 <div class="hidden-lg">
3171 <div class="pull-right hamb">
3172 <button type="button" class="btn btn-sm btn-base" data-toggle="offcanvas" data-target="#myNavmenu" data-canvas="body">
3173 <i class="fa fa-bars"></i>
3174 <span>
3175 @Translate("Menu", "Menu")
3176 </span>
3177 </button>
3178 </div>
3179 <div class="pull-right">
3180 @if(GetInteger("DwAreaFirstPageID") == 8398)
3181 {
3182 <a href="Default.aspx?ID=11424"><img alt="" src="/Files/Images/Ikoner/English.png" style="height:25px; width:50px"></a>
3183 }
3184 @if(GetInteger("DwAreaFirstPageID") == 11424)
3185 {
3186 <a href="Default.aspx?ID=8398"><img alt="" src="/Files/Images/Ikoner/Norwegian.png" style="height:25px; width:50px"></a>
3187 }
3188 </div>
3189
3190 <div class="hidden-xs hidden-sm hidden-md pull-left">
3191 <h2 class="dw-header-sm-title">@GetGlobalValue("Global:Page.Top.Name")</h2>
3192 </div>
3193
3194 @if (GetBoolean("Item.Area.EcomEnabled"))
3195 {
3196 @*<div class="pull-right hidden-sm">
3197 <ul class="top-menu">
3198 <li class="hidden-xs">
3199 <a href="Default.aspx?ID=@cartid" title="" class="btn btn-sm btn-base dw-minicart " id="minipagecart-mobile"><i class="fa fa-shopping-cart"></i><strong> @GetValue("Ecom:Order.OrderLines.TotalProductQuantity") <span class="amount">@GetValue("Ecom:Order.OrderLines.Total.PriceWithoutVAT")</span></strong></a>
3200 </li>
3201 </ul>
3202 </div>*@
3203 if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName")))
3204 {
3205 <div class="hidden-xs hidden-sm pull-right ">
3206 <a href='/Admin/Public/ExtranetLogoff.aspx?ID=@Pageview.Page.ID'><button class="btn btn-sm btn-base"><i class="fa fa-sign-out"></i></button></a>
3207
3208 </div>
3209 <div class="hidden-xs pull-right userNameBox">
3210 <a href='Default.aspx?ID=@Pageview.Area.Item["UserProfilePageId"]' class="btn btn-sm btn-base">
3211 <i class="fa fa-user"></i> <strong>@GetGlobalValue("Global:Extranet.Name")</strong>
3212 </a>
3213
3214 </div>
3215 }
3216
3217 if (!Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName")))
3218 {
3219 <div class="hidden-xs hidden-sm pull-right">
3220 <a href='Default.aspx?ID=@Pageview.Area.Item["SignInPageId"]' class="btn btn-sm btn-base"><i class="fa fa-sign-in"></i></a>
3221
3222 </div>
3223 }
3224 }
3225 </div>
3226 <div class="clearfix"></div>
3227 </div>
3228
3229
3230 </div>
3231 <div class="clearfix"></div>
3232 </div>
3233
3234 </div>
3235 }
3236
3237 @if (!string.IsNullOrWhiteSpace(GetString("Item.Area.HeaderLayoutImage")))
3238 {
3239 if (currentpageid != firstpageid)
3240 {
3241 var coverimage = GetString("Item.Area.HeaderLayoutImage");
3242
3243 <div class="container-fluid dw-header-image">
3244 <div class="row">
3245 <section class="carousel carousel-1 slice fluid" style="height: 160px !important; background: url('/Admin/Public/Getimage.ashx?width=1920&compression=75&Crop=5&image=@coverimage') no-repeat; background-size: cover !important; background-color: @ColorSettings.Color.Secondary"></section>
3246 </div>
3247 </div>
3248 }
3249 else if (GeneralSettings.Header.ShowFrontpageImage)
3250 {
3251 var coverimage = GetString("Item.Area.HeaderLayoutImage");
3252
3253 <div class="container-fluid dw-header-image">
3254 <div class="row">
3255 <section class="carousel carousel-1 slice fluid" style="height: 160px !important; background: url('/Admin/Public/Getimage.ashx?width=1920&compression=75&Crop=5&image=@coverimage') no-repeat; background-size: cover !important; background-color: @ColorSettings.Color.Secondary"></section>
3256 </div>
3257 </div>
3258 }
3259 }
3260 else if (GeneralSettings.Header.Mode != "solid")
3261 {
3262 if (currentpageid != firstpageid)
3263 {
3264 <div class="container-fluid dw-header-image">
3265 <div class="row">
3266 <section class="carousel carousel-1 slice fluid" style="height: 160px !important; background-color: transparent; background-size: cover !important;"></section>
3267 </div>
3268 </div>
3269 }
3270 }
3271
3272 </div>
3273 <div class="clearfix"></div>
3274
3275
3276 @if (GeneralSettings.Header.Mode == "solid" && GeneralSettings.Header.Show)
3277 {
3278 <div class="searchRight clearfix">
3279 <div class="slideToggle col-md-12 col-sm-12">
3280 <form method="get" action="Default.aspx">
3281 <input type="hidden" name="ID" value='@searchpage'>
3282 <div id="remote" class="input-group top-search">
3283 <div class="remoteR">
3284 <input type="hidden" name="qurlencoded" id="qurlencoded" value=''>
3285 <input type="text" class="form-control typeahead" name="q" placeholder='@Translate("What are you searching for?")' data-encode="">
3286 <span class="input-group-btn">
3287 <button class="btn btn-primary " type="submit">
3288 <i class="fa fa-angle-double-right"></i>
3289 </button>
3290 </span>
3291 </div>
3292 </div>
3293 </form>
3294 </div>
3295 </div>
3296 <div class="clearfix"></div>
3297 }
3298 </header>
3299
3300
3301 @{
3302 var current = "";
3303 var currentWhole = "";
3304 }
3305 @foreach (var lang in GetLoop("Languages"))
3306 {
3307 if (lang.GetBoolean("IsCurrent"))
3308 {
3309 string input = lang.GetString("Culture");
3310 int index = input.IndexOf("-");
3311 if (index > 0)
3312 {
3313 current = input.Substring(0, index);
3314 }
3315 currentWhole = lang.GetString("Culture").ToLower();
3316 }
3317 }
3318 </div>
3319
3320 @* MAIN CONTENT *@
3321
3322 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>
3323
3324
3325 @GetValue("Title(Full width page)")
3326 @GetValue("Description(Use this page for full width pages with no left navigation.)")
3327
3328 @{
3329 string siteurl = GetGlobalValue("Global:Request.Url").ToString();
3330
3331 string navtag = GetGlobalValue("Global:Page.NavigationTag").ToString();
3332
3333 var request = HttpContext.Current.Request;
3334
3335 var customerCenterId = ""; // Pageview.Area.Item["CustomerCenterId"].ToString().Replace("Default.aspx?Id=", "");
3336
3337 var hiddenXs = "hidden-xs";
3338 if (GetGlobalValue("Global:Page.ID") == customerCenterId)
3339 {
3340 hiddenXs = "";
3341 }
3342 }
3343
3344 <style>
3345 .product-details.left-col {
3346 display: none;
3347 }
3348 .product-details.right-col {
3349 width: 100%;
3350 }
3351 .product-details.right-col .row.product {
3352 margin-left: -15px;
3353 }
3354 </style>
3355
3356
3357 @if (GetBoolean("Item.Page.LayoutShowBreadcrumb"))
3358 {
3359 <div class="pg-opt pin white">
3360 <div class="container">
3361 <div class="row">
3362 @if (!GetBoolean("Item.Page.LayoutHideLeftMenu"))
3363 {
3364 <div class="hidden col-md-3">
3365 @if (GeneralSettings.Navigation.BreadcrumbMode != "light")
3366 {
3367 <div class="dw-breadcrumb-title">@GetGlobalValue("Global:Page.Top.Name")</div>
3368 }
3369 </div>
3370 }
3371 <div class="col-xs-12">
3372 @GetValue("DwNavigation(breadcrumb)")
3373 </div>
3374 </div>
3375 </div>
3376 </div>
3377 }
3378
3379 <section class="slice white animate-hover-slide">
3380 <div class="container">
3381 <div class="row">
3382 <div class="col-xs-12">
3383 <hr>
3384 </div>
3385 @if (!GetBoolean("Item.Page.LayoutHideLeftMenu"))
3386 {
3387 <div class="@hiddenXs col-xs-12 col-sm-4 col-md-3 left-col @navtag">
3388 <div class="widget affix-top"> @*data-spy="affix" data-offset-top="150" data-offset-bottom="300">*@
3389 @GetValue("DwNavigation(leftnavigation)")
3390 @RenderSnippet("Facets")
3391 </div>
3392 <p> </p>
3393 </div>
3394 }
3395 @{
3396 var attributeValue = "col-xs-12 col-sm-8 col-md-9 right-col " + navtag;
3397
3398 if (GetBoolean("Item.Page.LayoutHideLeftMenu"))
3399 {
3400 attributeValue = "col-xs-12";
3401 }
3402 }
3403 @{
3404 string listView = "list";
3405 string productviewtype = "list";
3406 if (Pageview.Device.ToString() == "Mobile")
3407 {
3408 listView = "box";
3409 }
3410 else
3411 {
3412
3413 if (HttpContext.Current.Request.Cookies["productviewtype"] != null)
3414 {
3415 if (HttpContext.Current.Request.Cookies["productviewtype"].Value != null)
3416 {
3417 productviewtype = HttpContext.Current.Request.Cookies["productviewtype"].Value.ToString();
3418 }
3419 }
3420
3421 listView = !String.IsNullOrEmpty(HttpContext.Current.Request["listView"]) ? HttpContext.Current.Request.QueryString.Get("listView") : productviewtype;
3422 }
3423 }
3424 @if (listView != "details")
3425 {
3426 <div class="@attributeValue">
3427 <div id="maincontent">@GetValue("DwContent(maincontent)")</div>
3428 </div>
3429 }
3430 @if (listView == "details")
3431 {
3432 <div class="@attributeValue">
3433 <div id="btob">@GetValue("DwContent(btob)")</div>
3434 </div>
3435 }
3436
3437 @if (GetBoolean("Item.Page.FacebookLikeButton"))
3438 {
3439 <div class="container">
3440 <div class="col-xs-12">
3441 <div class="row">
3442 <iframe src="//www.facebook.com/plugins/like.php?href=@siteurl&width=200&layout=button_count&action=recommend&show_faces=true&share=true&height=21" style="border:none; overflow:hidden; height:21px;"></iframe>
3443 </div>
3444 </div>
3445 </div>
3446 }
3447 </div>
3448 </div>
3449 </section>
3450
3451 @* FOOTER *@
3452
3453 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>
3454
3455 @using System
3456 @using System.Web
3457 @using System.Globalization
3458 @using Dynamicweb.Frontend.Devices
3459 @using System.Text.RegularExpressions
3460 @using Dynamicweb.Environment.Helpers
3461 @using Dynamicweb.Rendering
3462
3463 <footer class="footer">
3464 @if (GetBoolean("Item.Area.FooterShowContactInfo"))
3465 {
3466 <div class="footer-section">
3467 <div class="container">
3468 <div class="row">
3469 <div class="col-xs-12 col-md-4 links">
3470 <div class="col">
3471 <h3>@GetString("Item.Area.HeadingColumnOne")</h3>
3472 <ul>
3473 @foreach (LoopItem linksfooter in GetLoop("Item.Area.FooterLinks"))
3474 {
3475 var footertitle = linksfooter.GetString("Item.Area.FooterLinks.Title");
3476 var footerlinks = linksfooter.GetString("Item.Area.FooterLinks.Link.Value");
3477
3478 if (footerlinks != "")
3479 {
3480 <li>
3481 <a href="@footerlinks">@footertitle</a>
3482 </li>
3483 }
3484 }
3485 </ul>
3486 </div>
3487 </div>
3488
3489 <div class="col-xs-12 col-md-4 links">
3490 <div class="col">
3491 <h3>@GetString("Item.Area.HeadingColumnTwo")</h3>
3492 <ul>
3493 @foreach (LoopItem linksfooter in GetLoop("Item.Area.ServicesLinks"))
3494 {
3495 var footertitle = linksfooter.GetString("Item.Area.ServicesLinks.Title");
3496 var footerlinks = linksfooter.GetString("Item.Area.ServicesLinks.Link.Value");
3497
3498 if (footerlinks != "")
3499 {
3500 <li>
3501 <a href="@footerlinks">@footertitle</a>
3502 </li>
3503 }
3504 }
3505 </ul>
3506 </div>
3507 </div>
3508
3509 <div class="col-xs-12 col-md-4 socials">
3510 <div class="col">
3511 @if (GetBoolean("Item.Area.SocialLinksInFooter"))
3512 {
3513 string sicon = "";
3514 string slink = "";
3515
3516 <h3>@GetString("Item.Area.HeadingColumnThree")</h3>
3517
3518
3519 <p>
3520 @foreach (LoopItem socialitem in GetLoop("Item.Area.SocialIconsInTheFooter"))
3521 {
3522 sicon = socialitem.GetString("Item.Area.SocialIconsInTheFooter.Icon");
3523 slink = socialitem.GetString("Item.Area.SocialIconsInTheFooter.Link");
3524
3525 <a href="@slink"><i class="fa @sicon"></i></a>
3526 }
3527 </p>
3528 }
3529 </div>
3530 @if (GetBoolean("Item.Area.FooterNewsletterSignUp"))
3531 {
3532 string NavTag = GetGlobalValue("Global:Page.NavigationTag").ToString();
3533 string CurrentPageName = GetGlobalValue("Global:Page.Name").ToString();
3534
3535 if (NavTag != CurrentPageName)
3536 {
3537 int NewsletterInfoParagraphID = System.Convert.ToInt32(Pageview.Area.Item["NewsletterSignUpFormParagraph"].ToString());
3538
3539 <div class="col">
3540 <p>@Translate("Sign up if you would like to receive occasional treats from us", "Sign up if you would like to receive occasional treats from us").</p>
3541 @RenderParagraphContent(NewsletterInfoParagraphID)
3542 </div>
3543 }
3544 }
3545 </div>
3546
3547 @if (GetBoolean("Item.Area.FooterShowSitemap"))
3548 {
3549 <div class="col-xs-12 col-md-4">
3550 <div class="col">
3551 @GetValue("DwNavigation(footersitemap)")
3552 </div>
3553 <div> </div>
3554 </div>
3555 }
3556 </div>
3557 </div>
3558 </div>
3559 }
3560
3561 @SnippetStart("StylesHead")
3562 footer .footer-badges {
3563 background-color: @GetString("Item.Area.BadgeListBackgroundColor.Color");
3564 }
3565 footer .footer-menu {
3566 background-color: @GetString("Item.Area.AddressBarBackgroundColor.Color");
3567 }
3568 @SnippetEnd("StylesHead")
3569
3570 @if (GetBoolean("Item.Area.BadgeList") && GetLoop("Item.Area.BadgeList").Count > 0)
3571 {
3572 string blImage = "";
3573 string blLink = "";
3574 string blTarget = "";
3575
3576 <div class="footer-badges">
3577 <div class="container">
3578 <ul>
3579 @foreach (LoopItem badgelistitem in GetLoop("Item.Area.BadgeList"))
3580 {
3581 blImage = badgelistitem.GetString("Item.Area.BadgeList.Image");
3582 blLink = badgelistitem.GetString("Item.Area.BadgeList.Link");
3583 blTarget = badgelistitem.GetString("Item.Area.BadgeList.Target");
3584
3585 <li>
3586 @if (!string.IsNullOrWhiteSpace(blLink))
3587 {
3588 <a href="@blLink" target="@blTarget"><img src="@blImage" alt=""></a>
3589 }
3590 else
3591 {
3592 <img src="@blImage" alt="">
3593 }
3594 </li>
3595 }
3596 </ul>
3597 </div>
3598 </div>
3599 }
3600
3601
3602
3603 <div class="footer-menu">
3604 <div class="container">
3605 @*<div class="footer-logo">
3606 @{
3607 var logofooter = GetString("Item.Area.FooterLogo");
3608 string firstpageidFooter = GetString("DwAreaFirstActivePageID");
3609 }
3610 @if (!string.IsNullOrWhiteSpace(GetString("Item.Area.FooterLogo")))
3611 {
3612 <a href="/Default.aspx?ID=@firstpageidFooter" class="brand">
3613 <img class="img-responsive" src="@logofooter" alt="Logo footer">
3614 </a>
3615 }
3616 </div>*@
3617
3618 <div class="footer-links">
3619 @GetValue("Item.Area.FooterAddress")
3620
3621 @*@{
3622 string footeremail = GetString("Item.Area.FooterEmail");
3623 string footerphone = GetString("Item.Area.FooterPhone").Replace(" ", "");
3624 }
3625 <p>
3626 @Translate("Phone", "Phone"): <a href="tel:@footerphone">@footerphone</a>
3627 @Translate("Email", "Email"): <a href="mailto:@footeremail" title="Email Us">@GetValue("Item.Area.FooterEmail")</a>
3628 </p>*@
3629 </div>
3630 </div>
3631 </div>
3632 </footer>
3633 <!--[if IE]>
3634 <style>
3635 .widget.affix { width:21% !important; }
3636 </style>
3637 <![endif]-->
3638 @* ESSENTIALS *@
3639
3640 <script src="//cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js"></script>
3641 <script src="//cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>
3642 <script src="//cdnjs.cloudflare.com/ajax/libs/fancybox/3.1.20/jquery.fancybox.min.js"></script>
3643
3644
3645 <script src="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js"></script>
3646 <script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.5/handlebars.min.js"></script>
3647 <script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.4/js/bootstrap.min.js"></script>
3648 @*<script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta/js/bootstrap.min.js"></script>*@
3649
3650 @* ASSETS *@
3651 <script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-hover-dropdown/2.0.10/bootstrap-hover-dropdown.min.js"></script>
3652 <script src="//cdnjs.cloudflare.com/ajax/libs/spin.js/2.0.1/spin.min.js"></script>
3653 @*<script type="text/javascript" src="/Files/Templates/Designs/Dwsimple/js/typeahead.bundle.js"></script>*@
3654
3655 @* SRIPTS FOR INDIVIDUAL PAGES, DEPENDING ON WHAT PLUG-INS ARE USED *@
3656 <script src="//cdnjs.cloudflare.com/ajax/libs/jasny-bootstrap/3.1.3/js/jasny-bootstrap.min.js" type="text/javascript"></script>
3657
3658 <script src="//connect.facebook.net/en_US/sdk.js"></script>
3659 <script src="/Files/Templates/Designs/Dwsimple/js/typeahead.js"></script>
3660 <script src="/Files/Templates/Designs/Dwsimple/js/jquery.socialfeed.js"></script>
3661 <script src="/Files/Templates/Designs/Dwsimple/js/codebird.js"></script>
3662 <script src="/Files/Templates/Designs/Dwsimple/js/doT.min.js"></script>
3663 <script src="/Files/Templates/Designs/Dwsimple/js/moment.min.js"></script>
3664
3665 <script src="/Files/Templates/Designs/Dwsimple/js/owl.carousel.min.js"></script>
3666 <script src="/Files/Templates/Designs/Dwsimple/js/custom.js"></script>
3667 @*<script src="/Files/Templates/Designs/Dwsimple/js/filter.js"></script>*@
3668 <script src="/Files/Templates/Designs/Dwsimple/js/GeneralMethods.js"></script>
3669 <script src="/Files/Templates/Designs/Dwsimple/js/cart.js"></script>
3670 <script src="/Files/Templates/Designs/Dwsimple/js/bootstrap-datetimepicker.js"></script>
3671 <script src="/Files/Templates/Designs/Dwsimple/js/jQueryValidation.js"></script>
3672 <script>
3673
3674 $("input.typeahead").on("change", function () {
3675 var qvalue = $(this).val().replace(/æ/g, "æ").replace(/ø/g, "ø").replace(/å/g, "å").replace(/Æ/g, "Æ").replace(/Ø/g, "Ø").replace(/Å/g, "Å");
3676
3677 $('input#qurlencoded').val(qvalue)
3678 })
3679
3680 </script>
3681 <script type="text/html-template" id="OrderlineAjaxTemplate">
3682 <tr>
3683 <td class="text-center"><img src="/Admin/Public/GetImage.ashx?width=50&height=50&crop=5&image=Obj.image&Compression=99" class="img-center" alt=""></td>
3684 <td>
3685 <a href="Obj.link">
3686 Obj.name Obj.variantname
3687 </a>
3688 </td>
3689 <td class="text-center">Obj.quantity</td>
3690 <td class="text-right">
3691 <nobr>
3692 Obj.totalprice
3693 </nobr>
3694 </td>
3695 </tr>
3696 </script>
3697 @* INITIALIZE SCROLLING NAVIGATION *@
3698 @if (GeneralSettings.Navigation.IsAnimateNavigation)
3699 {
3700 <script type="text/javascript">
3701 // Hide Header on on scroll down
3702 var didScroll;
3703 var lastScrollTop = 0;
3704 var delta = 5;
3705 var navbarHeight = $('header').outerHeight();
3706
3707 $(window).scroll(function (event) {
3708 didScroll = true;
3709 });
3710
3711 setInterval(function () {
3712 if (didScroll) {
3713 hasScrolled();
3714 didScroll = false;
3715 }
3716 }, 250);
3717
3718 function hasScrolled() {
3719 var st = $(this).scrollTop();
3720 var $megamenu = $('#topnavigationmegamenu > li.dropdown.ParentShow .dropdown-menu'),
3721 $search = $('.searchRight .slideToggle'),
3722 $isSearchOpen = ($search.is('.open') ? true : false);
3723
3724 // Make sure they scroll more than delta
3725 if (Math.abs(lastScrollTop - st) <= delta)
3726 return;
3727
3728 // If they scrolled down and are past the navbar, add class .nav-up.
3729 // This is necessary so you never see what is "behind" the navbar.
3730 if (st > lastScrollTop && st > navbarHeight) {
3731 // Scroll Down
3732 $('header').removeClass('nav-down').addClass('nav-up');
3733 $megamenu.css('top', '0').fadeOut();
3734 if ($isSearchOpen) $search.fadeOut();
3735 } else {
3736 // Scroll Up
3737 if (st + $(window).height() < $(document).height()) {
3738 $('header').removeClass('nav-up').addClass('nav-down');
3739 $megamenu.fadeIn().css('top', '107px');
3740 if ($isSearchOpen) $search.fadeIn();
3741 }
3742 }
3743 lastScrollTop = st;
3744 }
3745 </script>
3746 }
3747
3748 @* INITIALIZE FANCYBOX *@
3749 <script type="text/javascript">
3750
3751 if ($(".fancybox").length > 0) $(".fancybox")
3752 .fancybox({
3753 padding: 0
3754 });
3755
3756 $(document).ready(function () {
3757 MiniCartInit(@Pageview.Area.Item["JSONFeedForCart"], @Pageview.Area.Item["ProductsPageId"]);
3758 if (typeof ProductModal == 'undefined') {
3759 console.log('missing variable');
3760 }
3761 else ProductModal.init(@Pageview.Area.Item["JSOPNFeedForModal"]);
3762 });
3763 </script>
3764
3765 @RenderSnippet("JavaScriptBottom")
3766
3767 <script type="text/javascript">
3768 $(document).ready(function () {
3769 $('.nav-stacked .offcanvas-menubtn').has('ul').addClass('innerMenuMobile');
3770 $("<i class='fa fa-plus mobileMenuFix' onclick='toggleCheck(this)'></i>").insertAfter(".offcanvas-col>.nav-stacked>.offcanvas-menubtn.innerMenuMobile>a");
3771 //$("<i class='fa fa-sort-desc mobileMenuFix' onclick='toggleCheck(this)'></i>").insertAfter(".offcanvas-col>.nav-stacked>.offcanvas-menubtn>.M1>.offcanvas-menubtn>a");
3772 //$("<i class='fa fa-sort-desc mobileMenuFix' onclick='toggleCheck(this)'></i>").insertAfter(".offcanvas-col>.nav-stacked>.offcanvas-menubtn>.M1>.offcanvas-menubtn>.M2>.offcanvas-menubtn>a");
3773 $(".nav-stacked .0 i").remove();
3774 });
3775
3776 function toggleCheck(elem) {
3777 jQuery(elem).parent().children("ul").toggle();
3778 jQuery(elem).toggleClass('fa-plus fa-minus')
3779 }
3780
3781 function toggleCheckTopNav() {
3782 $("#toggleTopNav").children("ul").toggle();
3783 }
3784
3785 $('.langMenu li').each(function () {
3786 var group = $(this);
3787 var value = group.children("a");
3788 var date = new Date();
3789 var minutes = 1440;
3790 date.setTime(date.getTime() + (minutes * 60 * 1000));
3791 $(value).on('click', function (e) {
3792 $.cookie('remember_lang', $(this).attr("data-code"), { expires: date, path: '/' });;
3793
3794 });
3795 });
3796
3797 function setLangAuto(filterlang) {
3798 var pathname = window.location.pathname;
3799
3800 switch (filterlang) {
3801 case "fr":
3802 pathname = $(".langSelected[data-code='fr']").attr('href');
3803 if ($(".langSelected[data-code='fr']").hasClass("activeArea") || $.cookie('remember_lang') != null) {
3804
3805 break;
3806 } else {
3807 window.location.href = pathname;
3808 }
3809
3810 case "de":
3811 pathname = $(".langSelected[data-code='de']").attr('href');
3812 if ($(".langSelected[data-code='de']").hasClass("activeArea") || $.cookie('remember_lang') != null) {
3813
3814 break;
3815 } else {
3816 window.location.href = pathname;
3817 }
3818 case "es":
3819 pathname = $(".langSelected[data-code='es']").attr('href');
3820 if ($(".langSelected[data-code='es']").hasClass("activeArea") || $.cookie('remember_lang') != null) {
3821
3822 break;
3823 } else {
3824 window.location.href = pathname;
3825 }
3826 case "se":
3827 pathname = $(".langSelected[data-code='se']").attr('href');
3828 if ($(".langSelected[data-code='se']").hasClass("activeArea") || $.cookie('remember_lang') != null) {
3829
3830 break;
3831 } else {
3832 window.location.href = pathname;
3833 }
3834 case "da":
3835 pathname = $(".langSelected[data-code='da']").attr('href');
3836 if ($(".langSelected[data-code='da']").hasClass("activeArea") || $.cookie('remember_lang') != null) {
3837
3838 break;
3839 } else {
3840 window.location.href = pathname;
3841 }
3842 default:
3843 pathname = $(".langSelected[data-code='en']").attr('href');
3844 if ($(".langSelected[data-code='en']").hasClass("activeArea") || $.cookie('remember_lang') != null) {
3845
3846 break;
3847 } else {
3848 window.location.href = pathname;
3849 }
3850 }
3851 }
3852
3853 jQuery(function ($) {
3854 if ($.cookie('remember_lang') != "@current" && $.cookie('remember_lang') != null) {
3855 var href;
3856 $(".langSelected").each(function () {
3857 if ($(this).data("code") == $.cookie('remember_lang')) {
3858 href = $(this).attr("href");
3859 }
3860 });
3861 window.location.href = href;
3862 }
3863 });
3864
3865
3866 $('[data-toggle="dropdown"]').dropdown();
3867
3868 </script>
3869 <script>
3870 $('.TitleWelcome').clone().prependTo('#MyProfileMenu');
3871 $('.logOut').clone().appendTo('#MyProfileMenu .M1');
3872 </script>
3873 @{
3874 //var productsearch = @Pageview.Area.Item["SearchProductsPage"];
3875 string productpageidsearch = GetString("Item.Area.SearchAllProductsPage");
3876 string showedproducts = GetString("Item.Area.ShowedProducts");
3877 var searchproductitem = Pageview.Area.Item["LinkToSearchProductPageItem"];
3878 string ItemPageIDproducts = searchproductitem.ToString().TrimStart('/');
3879 string seoproductsearch = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(ItemPageIDproducts);
3880 string quotecontext = Pageview.Area.Item["QuoteContext"].ToString();
3881 string cartpage = Pageview.Area.Item["QuoteCart"].ToString();
3882 }
3883 <script>
3884 var searchproducts = new Bloodhound({
3885 datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
3886 queryTokenizer: Bloodhound.tokenizers.whitespace,
3887 remote: {
3888 url: '/Default.aspx?ID=@seoproductsearch&q=%QUERY',
3889 wildcard: '%QUERY'
3890 },
3891
3892 });
3893
3894 searchproducts.initialize();
3895
3896 $('#text-input').bind('typeahead:render', function () {
3897 $('.tt-suggestion').removeClass('tt-selectable');
3898 });
3899
3900 $('#remoteproduct .form-control').typeahead(
3901 {
3902 hint: true,
3903 highlight: false,
3904 minLength: 2
3905 },
3906 {
3907 limit: 9999,
3908 name: 'name',
3909 display: 'name',
3910 source: searchproducts,
3911 templates: {
3912 empty: '<div class="search-header clearfix"><h4 class="product-title pull-left">@Translate("Ingen produkter fundet")</h4></div>', //optional
3913 suggestion: function (el) {
3914 if (typeof typeaheadAlternative !== 'undefined' && typeaheadAlternative) {
3915 return '<div class="row row-striped"><div class="form-group"><div class="col-xs-8"><h5>' + el.name + '</h5></div>' +
3916 '<div class="col-xs-2"><small>' + el.price + '</small></div>' +
3917 '<div class="col-xs-2 pull-right">' +
3918 //'<a href="javascript:void(0)" class="btn btn-success btn-sm pull-right" onclick="QuickAddToQuote_AX(\'' + el.number + '\',$(this))"><i class="fa fa-plus-circle fa-lg"></i><i class="fa fa-pulse"></i></a>'+
3919 '<button type="button" class="btnAddProd btn btn-success btn-sm pull-right" onclick="QuickAddToQuote_AX(\'' + el.number + '\',$(this))" ><i class="fa fa-plus-circle fa-lg"></i> <i class="fa fa-pulse"></i></button>' +
3920 '</div>' +
3921 '</div>' +
3922 '</div>';
3923 }
3924 else {
3925 return '<div class="clearfix">' + '<span class="name-search pull-left">' + el.name + '</span>' + '<span class="price-search pull-left">' + el.price + '</span><button class="btn-dw-cart QuickAdd pull-right" onclick="QuickAddToQuote(\'' + el.number + '\',$(this))"><i class="fa fa-plus"></i> <i class="fa fa-pulse"></i></button></div>';
3926 }
3927 }
3928 }
3929 }
3930 );
3931
3932 // Quickly Add to quote
3933 function QuickAddToQuote(product, elm) {
3934 var url = "@Dynamicweb.Context.Current.Request.RawUrl&CartCmd=Add&ProductID=" + product + "&OrderContext=@quotecontext";
3935 var allButtons = $('div.QuickAdd');
3936 var spinner = elm.find($('i.fa-plus'));
3937
3938 spinner.removeClass('fa-plus');
3939 spinner.addClass('fa-spinner fa-pulse');
3940 elm.addClass('reducedOpacity');
3941 elm.attr('disabled', 'disabled');
3942 allButtons.addClass('reducedOpacity');
3943 allButtons.attr('disabled', 'disabled');
3944 document.location.href = url;
3945 //$.ajax({
3946 // type: "GET",
3947 // url: url,
3948 // success: function () {
3949 // update();
3950 // }
3951 //});
3952 }
3953
3954 // Quickly Add to quote
3955 function QuickAddToQuote_AX(productID, elm) {
3956 window.dispatchEvent(new CustomEvent("addLine_Event", {
3957 detail: { ProductID: productID, Qty : 1, Ele : elm }
3958 }));
3959 }
3960 </script>
3961 </div>
3962 @if (!string.IsNullOrWhiteSpace(GetString("DW_extranet_error_uk")))
3963 {
3964 <script>
3965 $('#login').modal('show').addClass("in").attr("aria-hidden", "false").css({
3966 "display": "block",
3967 "padding-left": "17px"
3968 });
3969 </script>
3970 }
3971 </body>
3972 </html>