Error compiling template "Designs/Dwsimple/_parsed/product-catalogue.parsed.cshtml"
Line 5798: 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">&nbsp;</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&amp;Crop=1&amp;Compression=75&amp;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&amp;Crop=1&amp;Compression=75&amp;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>&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</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>&nbsp;</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">&nbsp;</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 <li> 2860 @if(GetInteger("DwAreaFirstPageID") == 8398) 2861 { 2862 <a href="Default.aspx?ID=11424"><img alt="" src="/Files/Images/Ikoner/English.png" style="height:25px; width:50px"></a> 2863 } 2864 @if(GetInteger("DwAreaFirstPageID") == 11424) 2865 { 2866 <a href="Default.aspx?ID=8398"><img alt="" src="/Files/Images/Ikoner/Norwegian.png" style="height:25px; width:50px"></a> 2867 } 2868 </li> 2869 @foreach (LoopItem headerLink in GetLoop("Item.Area.HeaderLinks")) 2870 { 2871 string Link = headerLink.GetString("Item.Area.HeaderLinks.Link"); 2872 string LinkText = headerLink.GetString("Item.Area.HeaderLinks.LinkText"); 2873 string LinkIcon = headerLink.GetString("Item.Area.HeaderLinks.LinkIcon"); 2874 string LinkTarget = headerLink.GetString("Item.Area.HeaderLinks.LinkTarget"); 2875 2876 <li> 2877 <a href="@Link" title="@LinkText" target="@LinkTarget"> 2878 <span class="link-icon" style='background-image: url("@LinkIcon")'></span> 2879 <span class="link-txt">@LinkText</span> 2880 </a> 2881 </li> 2882 } 2883 @if (!GetBoolean("Item.Area.OnlyOneLanguage")) 2884 { 2885 <li class="LangLing"> 2886 <a href="#"> 2887 <span class="link-icon" style='background-image: url("@GetString("Item.Area.LanguageIcon")")'></span> 2888 <span class="link-txt">@GetString("Item.Area.LanguageText")</span> 2889 </a> 2890 </li> 2891 } 2892 2893 2894 <!-- Ecommerce user menu --> 2895 @if (GetBoolean("Item.Area.EcomEnabled")) 2896 { 2897 if (!Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) 2898 { 2899 <text> 2900 <li class="LoginLink"> 2901 <a href="#" data-toggle="modal" data-target="#login"> 2902 2903 <span>@Translate("Login", "Login")</span> 2904 </a> 2905 </li> 2906 @*@GetValue("DwNavigation(toolsnavigationNotloggedin)")*@ 2907 </text> 2908 } 2909 2910 if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) 2911 { 2912 <text> 2913 2914 <li class="loggedIn"> 2915 <a id="dLabel" role="button" href='Default.aspx?ID=@Pageview.Area.Item["UserProfilePageId"]'> 2916 2917 <nobr> 2918 <i class="fa fa-user"></i>@GetGlobalValue("Global:Extranet.Name") 2919 </nobr> 2920 </a> 2921 @GetValue("DwNavigation(MyProfileMenu)") 2922 <span class="TitleWelcome" style="display: none;">@Translate("Welcome", "Welcome") @GetGlobalValue("Global:Extranet.Name")</span> 2923 </li><li class="logOut" style="display: none;"> 2924 <a href='/Admin/Public/ExtranetLogoff.aspx?ID=@logoutid'> 2925 @*<i class="fa fa-sign-out"></i>*@ 2926 @Translate("Logout", "Logout") 2927 2928 </a> 2929 </li> 2930 2931 2932 2933 @if (GetLoop("DWExtranetSecondaryUsers").Count > 0 || !string.IsNullOrWhiteSpace(GetGlobalValue("Global:Extranet.SecondaryUser.UserID"))) 2934 { 2935 <li> 2936 <form method="post"> 2937 <span> 2938 @if (string.IsNullOrWhiteSpace(GetGlobalValue("Global:Extranet.SecondaryUser.UserID"))) 2939 { 2940 string impersonateTranslation = Translate("Impersonate selected user"); 2941 <select id="DWExtranetSecondaryUserSelector" name="DWExtranetSecondaryUserSelector" title="@impersonateTranslation"> 2942 @foreach (var user in GetLoop("DWExtranetSecondaryUsers")) 2943 { 2944 <option value='@user.GetValue("UserID")'>@user.GetValue("UserName")</option> 2945 } 2946 </select> 2947 <input type="submit" class="btn btn-xs" tabindex="3" value="OK"> 2948 } 2949 else 2950 { 2951 string impersonateUser = GetGlobalValue("Global:Extranet.SecondaryUser.UserName") + " " + Translate("is impersonated by") + " " + Pageview.User.UserName; 2952 string stopImpersonateTranslation = Translate("Stop impersonation"); 2953 <span title="@impersonateUser" class="btn btn-xs impersonation-btn"><i class="fa fa-user-secret"></i> @GetGlobalValue("Global:Extranet.SecondaryUser.UserName")</span> 2954 <input type="submit" class="btn btn-xs" name="DwExtranetRemoveSecondaryUser" id="DwExtranetRemoveSecondaryUser" value="@stopImpersonateTranslation"> 2955 } 2956 </span> 2957 </form> 2958 </li> 2959 } 2960 2961 </text> 2962 } 2963 } 2964 2965 <!-- Ecommerce Cart --> 2966 @if (GetBoolean("Item.Area.EcomEnabled")) 2967 { 2968 <li class="dropdown animate-hover hidden" data-animate="animated fadeInUp"> 2969 <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> 2970 2971 <ul class="sub-menu"> 2972 <li id="minicart"> 2973 @MiniCart() 2974 </li> 2975 </ul> 2976 </li> 2977 } 2978 </ul> 2979 </nav> 2980 <!-- MAIN NAV --> 2981 @{ 2982 var sticky = GeneralSettings.Navigation.StickyMenu; 2983 var stickyTrigger = "affix"; 2984 var navbarpos = GeneralSettings.Navigation.Position; 2985 var selectionstyle = GeneralSettings.Navigation.SelectionStyle; 2986 2987 if (sticky == "off") 2988 { 2989 stickyTrigger = ""; 2990 } 2991 } 2992 2993 <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"> 2994 @if (GeneralSettings.Header.Mode != "solid" || !GeneralSettings.Header.Show) 2995 { 2996 <div class="navbar-header pull-@GeneralSettings.Navigation.InvertedPosition"> 2997 <div class="hidden-sm hidden-xs"> 2998 <a href="/Default.aspx?ID=@firstpageid" class="brand"> 2999 @if (!string.IsNullOrWhiteSpace(GeneralSettings.Logo.Image)) 3000 { 3001 if (GeneralSettings.Logo.ContrastImage != GeneralSettings.Logo.Image) 3002 { 3003 <img class="img-responsive dw-logoimage dw-logoimage-normal pull-left" src="@GeneralSettings.Logo.Image" alt="Logo"> 3004 <img class="img-responsive dw-logoimage dw-logoimage-contrast pull-left" src="@GeneralSettings.Logo.ContrastImage" alt="Logo"> 3005 } 3006 else 3007 { 3008 <img class="img-responsive dw-logoimage pull-left" src="@GeneralSettings.Logo.Image" alt="Logo"> 3009 } 3010 } 3011 3012 @if (!string.IsNullOrWhiteSpace(GeneralSettings.Logo.Text)) 3013 { 3014 <div class="dw-logotext pull-left">@GeneralSettings.Logo.Text</div> 3015 } 3016 </a> 3017 3018 @if (!string.IsNullOrWhiteSpace(GeneralSettings.Logo.Slogan)) 3019 { 3020 <div class="dw-slogantext pull-left">@GeneralSettings.Logo.Slogan</div> 3021 } 3022 </div> 3023 </div> 3024 } 3025 3026 @if (GeneralSettings.Header.Mode != "mobile") 3027 { 3028 3029 <!-- Big screen header --> 3030 <div class="navbar-navigation"> 3031 <div class="hidden-sm hidden-xs"> 3032 <nav class="col-md-10 col-sm-10 col-xs-10 p-0 navbar-collapse collapse navbar-@navbarpos"> 3033 @if (GeneralSettings.Navigation.IsMegamenu) 3034 { 3035 @GetValue("DwNavigation(topnavigationmegamenu)") 3036 } 3037 else 3038 { 3039 @GetValue("DwNavigation(topnavigation)") 3040 } 3041 3042 <!-- Extra navigation when no header is shown --> 3043 @if (GetBoolean("Item.Area.EcomEnabled")) 3044 { 3045 if (!GeneralSettings.Header.Show) 3046 { 3047 <ul class="nav navbar-nav"> 3048 <li>&nbsp;&nbsp;&nbsp;</li> 3049 @if (!Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) 3050 { 3051 <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> 3052 <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> 3053 } 3054 3055 @if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) 3056 { 3057 <li class="dw-navbar-button"> 3058 <a href='Default.aspx?ID=@Pageview.Area.Item["OrdersPageId"]' data-hover="dropdown"> 3059 <nobr> 3060 <strong><i class="fa fa-user"></i></strong> 3061 </nobr> 3062 <span></span> 3063 </a> 3064 </li> 3065 <li class="dw-navbar-button"> 3066 <a href="/Admin/Public/ExtranetLogoff.aspx?ID=@Pageview.Page.ID" data-hover="dropdown"><i class="fa fa-sign-out"></i><span></span></a> 3067 </li> 3068 } 3069 3070 3071 </ul> 3072 } 3073 3074 if (GeneralSettings.Header.Mode != "solid") 3075 { 3076 <ul class="nav navbar-nav"> 3077 <li class="dropdown dropdown-aux animate-click dw-navbar-button" data-animate-in="animated bounceInUp" data-animate-out="animated fadeOutDown" style="z-index:500;"> 3078 <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown"><i class="fa fa-search"></i><span></span></a> 3079 <ul class="dropdown-menu dropdown-menu-user animate-wr"> 3080 <li id="dropdownForm"> 3081 <div class="dropdown-form"> 3082 <form class="form-light p-15" role="form" method="get" action="Default.aspx"> 3083 <input type="hidden" name="ID" value='@searchpage'> 3084 <div class="input-group remote"> 3085 <input type="text" class="form-control typeahead" name="q" placeholder="@searchplaceholder"> 3086 <span class="input-group-btn" style="top:-1px !important;"> 3087 <button class="btn btn-base" type="submit"><i class="fa fa-search"></i></button> 3088 </span> 3089 </div> 3090 </form> 3091 </div> 3092 </li> 3093 </ul> 3094 </li> 3095 </ul> 3096 } 3097 } 3098 </nav> 3099 </div> 3100 3101 @*@if (GetBoolean("Item.Area.EcomEnabled")) 3102 { 3103 if (GeneralSettings.Header.Mode == "solid" && GeneralSettings.Header.Show) 3104 { 3105 <div class="hidden-sm hidden-xs"> 3106 <div class="col-md-2 col-sm-2 col-xs-2 pull-@GeneralSettings.Navigation.InvertedPosition"> 3107 <form method="get" action="Default.aspx"> 3108 <input type="hidden" name="ID" value='@Pageview.Area.Item["ProductsPageId"]'> 3109 <div id="remote" class="input-group pull-@GeneralSettings.Navigation.InvertedPosition dw-top-search"> 3110 <input type="text" class="form-control typeahead" name="Search" tabindex="1" placeholder="@searchplaceholder"> 3111 <span class="input-group-btn" style="top:0px !important;"> 3112 <button class="btn btn-primary" type="submit"><i class="fa fa-search"></i></button> 3113 </span> 3114 </div> 3115 </form> 3116 </div> 3117 </div> 3118 } 3119 }*@ 3120 </div> 3121 } 3122 else 3123 { 3124 <!-- Using only mobile navigation --> 3125 <div class="pull-@GeneralSettings.Navigation.Position"> 3126 <ul class="nav navbar-nav"> 3127 <li class="dw-navbar-button" data-toggle="offcanvas" data-target="#myNavmenu" data-canvas="body"> 3128 <a><i class="fa fa-bars fa-2x"></i><span></span></a> 3129 </li> 3130 </ul> 3131 </div> 3132 } 3133 </div> 3134 </div> 3135 3136 </div> 3137 3138 3139 </div> 3140 <div class="col-xs-12 mobileMenu hidden-lg"> 3141 <span class="buttonIconSearch pull-right "> 3142 <button class="btn btn-dw-primary searchFieldShow" type="submit"> 3143 <img src="/Files/Templates/Designs/Dwsimple/images/icons/search-white.png" class="img-center" alt=""> 3144 <span> 3145 @Translate("Search", "Search") 3146 </span> 3147 </button> 3148 </span> 3149 <!-- Small screen header --> 3150 <div class="hidden-lg"> 3151 <div class="pull-right hamb"> 3152 <button type="button" class="btn btn-sm btn-base" data-toggle="offcanvas" data-target="#myNavmenu" data-canvas="body"> 3153 <i class="fa fa-bars"></i> 3154 <span> 3155 @Translate("Menu", "Menu") 3156 </span> 3157 </button> 3158 </div> 3159 <div class="pull-right"> 3160 @if(GetInteger("DwAreaFirstPageID") == 8398) 3161 { 3162 <a href="Default.aspx?ID=11424"><img alt="" src="/Files/Images/Ikoner/English.png" style="height:25px; width:50px"></a> 3163 } 3164 @if(GetInteger("DwAreaFirstPageID") == 11424) 3165 { 3166 <a href="Default.aspx?ID=8398"><img alt="" src="/Files/Images/Ikoner/Norwegian.png" style="height:25px; width:50px"></a> 3167 } 3168 </div> 3169 3170 <div class="hidden-xs hidden-sm hidden-md pull-left"> 3171 <h2 class="dw-header-sm-title">@GetGlobalValue("Global:Page.Top.Name")</h2> 3172 </div> 3173 3174 @if (GetBoolean("Item.Area.EcomEnabled")) 3175 { 3176 @*<div class="pull-right hidden-sm"> 3177 <ul class="top-menu"> 3178 <li class="hidden-xs"> 3179 <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> 3180 </li> 3181 </ul> 3182 </div>*@ 3183 if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) 3184 { 3185 <div class="hidden-xs hidden-sm pull-right "> 3186 <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> 3187 &nbsp; 3188 </div> 3189 <div class="hidden-xs pull-right userNameBox"> 3190 <a href='Default.aspx?ID=@Pageview.Area.Item["UserProfilePageId"]' class="btn btn-sm btn-base"> 3191 <i class="fa fa-user"></i> <strong>@GetGlobalValue("Global:Extranet.Name")</strong> 3192 </a> 3193 &nbsp; 3194 </div> 3195 } 3196 3197 if (!Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) 3198 { 3199 <div class="hidden-xs hidden-sm pull-right"> 3200 <a href='Default.aspx?ID=@Pageview.Area.Item["SignInPageId"]' class="btn btn-sm btn-base"><i class="fa fa-sign-in"></i></a> 3201 &nbsp; 3202 </div> 3203 } 3204 } 3205 </div> 3206 <div class="clearfix"></div> 3207 </div> 3208 3209 3210 </div> 3211 <div class="clearfix"></div> 3212 </div> 3213 3214 </div> 3215 } 3216 3217 @if (!string.IsNullOrWhiteSpace(GetString("Item.Area.HeaderLayoutImage"))) 3218 { 3219 if (currentpageid != firstpageid) 3220 { 3221 var coverimage = GetString("Item.Area.HeaderLayoutImage"); 3222 3223 <div class="container-fluid dw-header-image"> 3224 <div class="row"> 3225 <section class="carousel carousel-1 slice fluid" style="height: 160px !important; background: url('/Admin/Public/Getimage.ashx?width=1920&amp;compression=75&amp;Crop=5&amp;image=@coverimage') no-repeat; background-size: cover !important; background-color: @ColorSettings.Color.Secondary"></section> 3226 </div> 3227 </div> 3228 } 3229 else if (GeneralSettings.Header.ShowFrontpageImage) 3230 { 3231 var coverimage = GetString("Item.Area.HeaderLayoutImage"); 3232 3233 <div class="container-fluid dw-header-image"> 3234 <div class="row"> 3235 <section class="carousel carousel-1 slice fluid" style="height: 160px !important; background: url('/Admin/Public/Getimage.ashx?width=1920&amp;compression=75&amp;Crop=5&amp;image=@coverimage') no-repeat; background-size: cover !important; background-color: @ColorSettings.Color.Secondary"></section> 3236 </div> 3237 </div> 3238 } 3239 } 3240 else if (GeneralSettings.Header.Mode != "solid") 3241 { 3242 if (currentpageid != firstpageid) 3243 { 3244 <div class="container-fluid dw-header-image"> 3245 <div class="row"> 3246 <section class="carousel carousel-1 slice fluid" style="height: 160px !important; background-color: transparent; background-size: cover !important;"></section> 3247 </div> 3248 </div> 3249 } 3250 } 3251 3252 </div> 3253 <div class="clearfix"></div> 3254 3255 3256 @if (GeneralSettings.Header.Mode == "solid" && GeneralSettings.Header.Show) 3257 { 3258 <div class="searchRight clearfix"> 3259 <div class="slideToggle col-md-12 col-sm-12"> 3260 <form method="get" action="Default.aspx"> 3261 <input type="hidden" name="ID" value='@searchpage'> 3262 <div id="remote" class="input-group top-search"> 3263 <div class="remoteR"> 3264 <input type="hidden" name="qurlencoded" id="qurlencoded" value=''> 3265 <input type="text" class="form-control typeahead" name="q" placeholder='@Translate("What are you searching for?")' data-encode=""> 3266 <span class="input-group-btn"> 3267 <button class="btn btn-primary " type="submit"> 3268 <i class="fa fa-angle-double-right"></i> 3269 </button> 3270 </span> 3271 </div> 3272 </div> 3273 </form> 3274 </div> 3275 </div> 3276 <div class="clearfix"></div> 3277 } 3278 </header> 3279 3280 3281 @{ 3282 var current = ""; 3283 var currentWhole = ""; 3284 } 3285 @foreach (var lang in GetLoop("Languages")) 3286 { 3287 if (lang.GetBoolean("IsCurrent")) 3288 { 3289 string input = lang.GetString("Culture"); 3290 int index = input.IndexOf("-"); 3291 if (index > 0) 3292 { 3293 current = input.Substring(0, index); 3294 } 3295 currentWhole = lang.GetString("Culture").ToLower(); 3296 } 3297 } 3298 </div> 3299 3300 @* MAIN CONTENT *@ 3301 3302 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 3303 3304 3305 @GetValue("Title(Full width page)") 3306 @GetValue("Description(Use this page for full width pages with no left navigation.)") 3307 3308 @{ 3309 string siteurl = GetGlobalValue("Global:Request.Url").ToString(); 3310 3311 string navtag = GetGlobalValue("Global:Page.NavigationTag").ToString(); 3312 3313 var request = HttpContext.Current.Request; 3314 3315 var customerCenterId = ""; // Pageview.Area.Item["CustomerCenterId"].ToString().Replace("Default.aspx?Id=", ""); 3316 3317 var hiddenXs = "hidden-xs"; 3318 if (GetGlobalValue("Global:Page.ID") == customerCenterId) 3319 { 3320 hiddenXs = ""; 3321 } 3322 } 3323 3324 <style> 3325 .product-details.left-col { 3326 display: none; 3327 } 3328 .product-details.right-col { 3329 width: 100%; 3330 } 3331 .product-details.right-col .row.product { 3332 margin-left: -15px; 3333 } 3334 </style> 3335 3336 3337 @if (GetBoolean("Item.Page.LayoutShowBreadcrumb")) 3338 { 3339 <div class="pg-opt pin white"> 3340 <div class="container"> 3341 <div class="row"> 3342 @if (!GetBoolean("Item.Page.LayoutHideLeftMenu")) 3343 { 3344 <div class="hidden col-md-3"> 3345 @if (GeneralSettings.Navigation.BreadcrumbMode != "light") 3346 { 3347 <div class="dw-breadcrumb-title">@GetGlobalValue("Global:Page.Top.Name")</div> 3348 } 3349 </div> 3350 } 3351 <div class="col-xs-12"> 3352 @GetValue("DwNavigation(breadcrumb)") 3353 </div> 3354 </div> 3355 </div> 3356 </div> 3357 } 3358 3359 <section class="slice white animate-hover-slide"> 3360 <div class="container"> 3361 <div class="row"> 3362 <div class="col-xs-12"> 3363 <hr> 3364 </div> 3365 @if (!GetBoolean("Item.Page.LayoutHideLeftMenu")) 3366 { 3367 <div class="@hiddenXs col-xs-12 col-sm-4 col-md-3 left-col @navtag"> 3368 <div class="widget affix-top"> @*data-spy="affix" data-offset-top="150" data-offset-bottom="300">*@ 3369 @GetValue("DwNavigation(leftnavigation)") 3370 @RenderSnippet("Facets") 3371 </div> 3372 <p>&nbsp;</p> 3373 </div> 3374 } 3375 @{ 3376 var attributeValue = "col-xs-12 col-sm-8 col-md-9 right-col " + navtag; 3377 3378 if (GetBoolean("Item.Page.LayoutHideLeftMenu")) 3379 { 3380 attributeValue = "col-xs-12"; 3381 } 3382 } 3383 @{ 3384 string listView = "list"; 3385 string productviewtype = "list"; 3386 if (Pageview.Device.ToString() == "Mobile") 3387 { 3388 listView = "box"; 3389 } 3390 else 3391 { 3392 3393 if (HttpContext.Current.Request.Cookies["productviewtype"] != null) 3394 { 3395 if (HttpContext.Current.Request.Cookies["productviewtype"].Value != null) 3396 { 3397 productviewtype = HttpContext.Current.Request.Cookies["productviewtype"].Value.ToString(); 3398 } 3399 } 3400 3401 listView = !String.IsNullOrEmpty(HttpContext.Current.Request["listView"]) ? HttpContext.Current.Request.QueryString.Get("listView") : productviewtype; 3402 } 3403 } 3404 @if (listView != "details") 3405 { 3406 <div class="@attributeValue"> 3407 <div id="maincontent">@GetValue("DwContent(maincontent)")</div> 3408 </div> 3409 } 3410 @if (listView == "details") 3411 { 3412 <div class="@attributeValue"> 3413 <div id="btob">@GetValue("DwContent(btob)")</div> 3414 </div> 3415 } 3416 3417 @if (GetBoolean("Item.Page.FacebookLikeButton")) 3418 { 3419 <div class="container"> 3420 <div class="col-xs-12"> 3421 <div class="row"> 3422 <iframe src="//www.facebook.com/plugins/like.php?href=@siteurl&amp;width=200&amp;layout=button_count&amp;action=recommend&amp;show_faces=true&amp;share=true&amp;height=21" style="border:none; overflow:hidden; height:21px;"></iframe> 3423 </div> 3424 </div> 3425 </div> 3426 } 3427 </div> 3428 </div> 3429 </section> 3430 3431 @* FOOTER *@ 3432 3433 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 3434 3435 @using System 3436 @using System.Web 3437 @using System.Globalization 3438 @using Dynamicweb.Frontend.Devices 3439 @using System.Text.RegularExpressions 3440 @using Dynamicweb.Environment.Helpers 3441 @using Dynamicweb.Rendering 3442 3443 <footer class="footer"> 3444 @if (GetBoolean("Item.Area.FooterShowContactInfo")) 3445 { 3446 <div class="footer-section"> 3447 <div class="container"> 3448 <div class="row"> 3449 <div class="col-xs-12 col-md-4 links"> 3450 <div class="col"> 3451 <h3>@GetString("Item.Area.HeadingColumnOne")</h3> 3452 <ul> 3453 @foreach (LoopItem linksfooter in GetLoop("Item.Area.FooterLinks")) 3454 { 3455 var footertitle = linksfooter.GetString("Item.Area.FooterLinks.Title"); 3456 var footerlinks = linksfooter.GetString("Item.Area.FooterLinks.Link.Value"); 3457 3458 if (footerlinks != "") 3459 { 3460 <li> 3461 <a href="@footerlinks">@footertitle</a> 3462 </li> 3463 } 3464 } 3465 </ul> 3466 </div> 3467 </div> 3468 3469 <div class="col-xs-12 col-md-4 links"> 3470 <div class="col"> 3471 <h3>@GetString("Item.Area.HeadingColumnTwo")</h3> 3472 <ul> 3473 @foreach (LoopItem linksfooter in GetLoop("Item.Area.ServicesLinks")) 3474 { 3475 var footertitle = linksfooter.GetString("Item.Area.ServicesLinks.Title"); 3476 var footerlinks = linksfooter.GetString("Item.Area.ServicesLinks.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 socials"> 3490 <div class="col"> 3491 @if (GetBoolean("Item.Area.SocialLinksInFooter")) 3492 { 3493 string sicon = ""; 3494 string slink = ""; 3495 3496 <h3>@GetString("Item.Area.HeadingColumnThree")</h3> 3497 3498 3499 <p> 3500 @foreach (LoopItem socialitem in GetLoop("Item.Area.SocialIconsInTheFooter")) 3501 { 3502 sicon = socialitem.GetString("Item.Area.SocialIconsInTheFooter.Icon"); 3503 slink = socialitem.GetString("Item.Area.SocialIconsInTheFooter.Link"); 3504 3505 <a href="@slink"><i class="fa @sicon"></i></a> 3506 } 3507 </p> 3508 } 3509 </div> 3510 @if (GetBoolean("Item.Area.FooterNewsletterSignUp")) 3511 { 3512 string NavTag = GetGlobalValue("Global:Page.NavigationTag").ToString(); 3513 string CurrentPageName = GetGlobalValue("Global:Page.Name").ToString(); 3514 3515 if (NavTag != CurrentPageName) 3516 { 3517 int NewsletterInfoParagraphID = System.Convert.ToInt32(Pageview.Area.Item["NewsletterSignUpFormParagraph"].ToString()); 3518 3519 <div class="col"> 3520 <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> 3521 @RenderParagraphContent(NewsletterInfoParagraphID) 3522 </div> 3523 } 3524 } 3525 </div> 3526 3527 @if (GetBoolean("Item.Area.FooterShowSitemap")) 3528 { 3529 <div class="col-xs-12 col-md-4"> 3530 <div class="col"> 3531 @GetValue("DwNavigation(footersitemap)") 3532 </div> 3533 <div>&nbsp;</div> 3534 </div> 3535 } 3536 </div> 3537 </div> 3538 </div> 3539 } 3540 3541 @SnippetStart("StylesHead") 3542 footer .footer-badges { 3543 background-color: @GetString("Item.Area.BadgeListBackgroundColor.Color"); 3544 } 3545 footer .footer-menu { 3546 background-color: @GetString("Item.Area.AddressBarBackgroundColor.Color"); 3547 } 3548 @SnippetEnd("StylesHead") 3549 3550 @if (GetBoolean("Item.Area.BadgeList") && GetLoop("Item.Area.BadgeList").Count > 0) 3551 { 3552 string blImage = ""; 3553 string blLink = ""; 3554 string blTarget = ""; 3555 3556 <div class="footer-badges"> 3557 <div class="container"> 3558 <ul> 3559 @foreach (LoopItem badgelistitem in GetLoop("Item.Area.BadgeList")) 3560 { 3561 blImage = badgelistitem.GetString("Item.Area.BadgeList.Image"); 3562 blLink = badgelistitem.GetString("Item.Area.BadgeList.Link"); 3563 blTarget = badgelistitem.GetString("Item.Area.BadgeList.Target"); 3564 3565 <li> 3566 @if (!string.IsNullOrWhiteSpace(blLink)) 3567 { 3568 <a href="@blLink" target="@blTarget"><img src="@blImage" alt=""></a> 3569 } 3570 else 3571 { 3572 <img src="@blImage" alt=""> 3573 } 3574 </li> 3575 } 3576 </ul> 3577 </div> 3578 </div> 3579 } 3580 3581 3582 3583 <div class="footer-menu"> 3584 <div class="container"> 3585 @*<div class="footer-logo"> 3586 @{ 3587 var logofooter = GetString("Item.Area.FooterLogo"); 3588 string firstpageidFooter = GetString("DwAreaFirstActivePageID"); 3589 } 3590 @if (!string.IsNullOrWhiteSpace(GetString("Item.Area.FooterLogo"))) 3591 { 3592 <a href="/Default.aspx?ID=@firstpageidFooter" class="brand"> 3593 <img class="img-responsive" src="@logofooter" alt="Logo footer"> 3594 </a> 3595 } 3596 </div>*@ 3597 3598 <div class="footer-links"> 3599 @GetValue("Item.Area.FooterAddress") 3600 3601 @*@{ 3602 string footeremail = GetString("Item.Area.FooterEmail"); 3603 string footerphone = GetString("Item.Area.FooterPhone").Replace(" ", ""); 3604 } 3605 <p> 3606 @Translate("Phone", "Phone"): <a href="tel:@footerphone">@footerphone</a> 3607 @Translate("Email", "Email"): <a href="mailto:@footeremail" title="Email Us">@GetValue("Item.Area.FooterEmail")</a> 3608 </p>*@ 3609 </div> 3610 </div> 3611 </div> 3612 </footer> 3613 <!--[if IE]> 3614 <style> 3615 .widget.affix { width:21% !important; } 3616 </style> 3617 <![endif]--> 3618 @* ESSENTIALS *@ 3619 3620 <script src="//cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js"></script> 3621 <script src="//cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script> 3622 <script src="//cdnjs.cloudflare.com/ajax/libs/fancybox/3.1.20/jquery.fancybox.min.js"></script> 3623 3624 3625 <script src="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js"></script> 3626 <script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.5/handlebars.min.js"></script> 3627 <script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.4/js/bootstrap.min.js"></script> 3628 @*<script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta/js/bootstrap.min.js"></script>*@ 3629 3630 @* ASSETS *@ 3631 <script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-hover-dropdown/2.0.10/bootstrap-hover-dropdown.min.js"></script> 3632 <script src="//cdnjs.cloudflare.com/ajax/libs/spin.js/2.0.1/spin.min.js"></script> 3633 @*<script type="text/javascript" src="/Files/Templates/Designs/Dwsimple/js/typeahead.bundle.js"></script>*@ 3634 3635 @* SRIPTS FOR INDIVIDUAL PAGES, DEPENDING ON WHAT PLUG-INS ARE USED *@ 3636 <script src="//cdnjs.cloudflare.com/ajax/libs/jasny-bootstrap/3.1.3/js/jasny-bootstrap.min.js" type="text/javascript"></script> 3637 3638 <script src="//connect.facebook.net/en_US/sdk.js"></script> 3639 <script src="/Files/Templates/Designs/Dwsimple/js/typeahead.js"></script> 3640 <script src="/Files/Templates/Designs/Dwsimple/js/jquery.socialfeed.js"></script> 3641 <script src="/Files/Templates/Designs/Dwsimple/js/codebird.js"></script> 3642 <script src="/Files/Templates/Designs/Dwsimple/js/doT.min.js"></script> 3643 <script src="/Files/Templates/Designs/Dwsimple/js/moment.min.js"></script> 3644 3645 <script src="/Files/Templates/Designs/Dwsimple/js/owl.carousel.min.js"></script> 3646 <script src="/Files/Templates/Designs/Dwsimple/js/custom.js"></script> 3647 @*<script src="/Files/Templates/Designs/Dwsimple/js/filter.js"></script>*@ 3648 <script src="/Files/Templates/Designs/Dwsimple/js/GeneralMethods.js"></script> 3649 <script src="/Files/Templates/Designs/Dwsimple/js/cart.js"></script> 3650 <script src="/Files/Templates/Designs/Dwsimple/js/bootstrap-datetimepicker.js"></script> 3651 <script src="/Files/Templates/Designs/Dwsimple/js/jQueryValidation.js"></script> 3652 <script> 3653 3654 $("input.typeahead").on("change", function () { 3655 var qvalue = $(this).val().replace(/æ/g, "&aelig;").replace(/ø/g, "&oslash;").replace(/å/g, "&aring;").replace(/Æ/g, "&AElig;").replace(/Ø/g, "&Oslash;").replace(/Å/g, "&Aring;"); 3656 3657 $('input#qurlencoded').val(qvalue) 3658 }) 3659 3660 </script> 3661 <script type="text/html-template" id="OrderlineAjaxTemplate"> 3662 <tr> 3663 <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> 3664 <td> 3665 <a href="Obj.link"> 3666 Obj.name Obj.variantname 3667 </a> 3668 </td> 3669 <td class="text-center">Obj.quantity</td> 3670 <td class="text-right"> 3671 <nobr> 3672 Obj.totalprice 3673 </nobr> 3674 </td> 3675 </tr> 3676 </script> 3677 @* INITIALIZE SCROLLING NAVIGATION *@ 3678 @if (GeneralSettings.Navigation.IsAnimateNavigation) 3679 { 3680 <script type="text/javascript"> 3681 // Hide Header on on scroll down 3682 var didScroll; 3683 var lastScrollTop = 0; 3684 var delta = 5; 3685 var navbarHeight = $('header').outerHeight(); 3686 3687 $(window).scroll(function (event) { 3688 didScroll = true; 3689 }); 3690 3691 setInterval(function () { 3692 if (didScroll) { 3693 hasScrolled(); 3694 didScroll = false; 3695 } 3696 }, 250); 3697 3698 function hasScrolled() { 3699 var st = $(this).scrollTop(); 3700 var $megamenu = $('#topnavigationmegamenu > li.dropdown.ParentShow .dropdown-menu'), 3701 $search = $('.searchRight .slideToggle'), 3702 $isSearchOpen = ($search.is('.open') ? true : false); 3703 3704 // Make sure they scroll more than delta 3705 if (Math.abs(lastScrollTop - st) <= delta) 3706 return; 3707 3708 // If they scrolled down and are past the navbar, add class .nav-up. 3709 // This is necessary so you never see what is "behind" the navbar. 3710 if (st > lastScrollTop && st > navbarHeight) { 3711 // Scroll Down 3712 $('header').removeClass('nav-down').addClass('nav-up'); 3713 $megamenu.css('top', '0').fadeOut(); 3714 if ($isSearchOpen) $search.fadeOut(); 3715 } else { 3716 // Scroll Up 3717 if (st + $(window).height() < $(document).height()) { 3718 $('header').removeClass('nav-up').addClass('nav-down'); 3719 $megamenu.fadeIn().css('top', '107px'); 3720 if ($isSearchOpen) $search.fadeIn(); 3721 } 3722 } 3723 lastScrollTop = st; 3724 } 3725 </script> 3726 } 3727 3728 @* INITIALIZE FANCYBOX *@ 3729 <script type="text/javascript"> 3730 3731 if ($(".fancybox").length > 0) $(".fancybox") 3732 .fancybox({ 3733 padding: 0 3734 }); 3735 3736 $(document).ready(function () { 3737 MiniCartInit(@Pageview.Area.Item["JSONFeedForCart"], @Pageview.Area.Item["ProductsPageId"]); 3738 if (typeof ProductModal == 'undefined') { 3739 console.log('missing variable'); 3740 } 3741 else ProductModal.init(@Pageview.Area.Item["JSOPNFeedForModal"]); 3742 }); 3743 </script> 3744 3745 @RenderSnippet("JavaScriptBottom") 3746 3747 <script type="text/javascript"> 3748 $(document).ready(function () { 3749 $('.nav-stacked .offcanvas-menubtn').has('ul').addClass('innerMenuMobile'); 3750 $("<i class='fa fa-plus mobileMenuFix' onclick='toggleCheck(this)'></i>").insertAfter(".offcanvas-col>.nav-stacked>.offcanvas-menubtn.innerMenuMobile>a"); 3751 //$("<i class='fa fa-sort-desc mobileMenuFix' onclick='toggleCheck(this)'></i>").insertAfter(".offcanvas-col>.nav-stacked>.offcanvas-menubtn>.M1>.offcanvas-menubtn>a"); 3752 //$("<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"); 3753 $(".nav-stacked .0 i").remove(); 3754 }); 3755 3756 function toggleCheck(elem) { 3757 jQuery(elem).parent().children("ul").toggle(); 3758 jQuery(elem).toggleClass('fa-plus fa-minus') 3759 } 3760 3761 function toggleCheckTopNav() { 3762 $("#toggleTopNav").children("ul").toggle(); 3763 } 3764 3765 $('.langMenu li').each(function () { 3766 var group = $(this); 3767 var value = group.children("a"); 3768 var date = new Date(); 3769 var minutes = 1440; 3770 date.setTime(date.getTime() + (minutes * 60 * 1000)); 3771 $(value).on('click', function (e) { 3772 $.cookie('remember_lang', $(this).attr("data-code"), { expires: date, path: '/' });; 3773 3774 }); 3775 }); 3776 3777 function setLangAuto(filterlang) { 3778 var pathname = window.location.pathname; 3779 3780 switch (filterlang) { 3781 case "fr": 3782 pathname = $(".langSelected[data-code='fr']").attr('href'); 3783 if ($(".langSelected[data-code='fr']").hasClass("activeArea") || $.cookie('remember_lang') != null) { 3784 3785 break; 3786 } else { 3787 window.location.href = pathname; 3788 } 3789 3790 case "de": 3791 pathname = $(".langSelected[data-code='de']").attr('href'); 3792 if ($(".langSelected[data-code='de']").hasClass("activeArea") || $.cookie('remember_lang') != null) { 3793 3794 break; 3795 } else { 3796 window.location.href = pathname; 3797 } 3798 case "es": 3799 pathname = $(".langSelected[data-code='es']").attr('href'); 3800 if ($(".langSelected[data-code='es']").hasClass("activeArea") || $.cookie('remember_lang') != null) { 3801 3802 break; 3803 } else { 3804 window.location.href = pathname; 3805 } 3806 case "se": 3807 pathname = $(".langSelected[data-code='se']").attr('href'); 3808 if ($(".langSelected[data-code='se']").hasClass("activeArea") || $.cookie('remember_lang') != null) { 3809 3810 break; 3811 } else { 3812 window.location.href = pathname; 3813 } 3814 case "da": 3815 pathname = $(".langSelected[data-code='da']").attr('href'); 3816 if ($(".langSelected[data-code='da']").hasClass("activeArea") || $.cookie('remember_lang') != null) { 3817 3818 break; 3819 } else { 3820 window.location.href = pathname; 3821 } 3822 default: 3823 pathname = $(".langSelected[data-code='en']").attr('href'); 3824 if ($(".langSelected[data-code='en']").hasClass("activeArea") || $.cookie('remember_lang') != null) { 3825 3826 break; 3827 } else { 3828 window.location.href = pathname; 3829 } 3830 } 3831 } 3832 3833 jQuery(function ($) { 3834 if ($.cookie('remember_lang') != "@current" && $.cookie('remember_lang') != null) { 3835 var href; 3836 $(".langSelected").each(function () { 3837 if ($(this).data("code") == $.cookie('remember_lang')) { 3838 href = $(this).attr("href"); 3839 } 3840 }); 3841 window.location.href = href; 3842 } 3843 }); 3844 3845 3846 $('[data-toggle="dropdown"]').dropdown(); 3847 3848 </script> 3849 <script> 3850 $('.TitleWelcome').clone().prependTo('#MyProfileMenu'); 3851 $('.logOut').clone().appendTo('#MyProfileMenu .M1'); 3852 </script> 3853 @{ 3854 //var productsearch = @Pageview.Area.Item["SearchProductsPage"]; 3855 string productpageidsearch = GetString("Item.Area.SearchAllProductsPage"); 3856 string showedproducts = GetString("Item.Area.ShowedProducts"); 3857 var searchproductitem = Pageview.Area.Item["LinkToSearchProductPageItem"]; 3858 string ItemPageIDproducts = searchproductitem.ToString().TrimStart('/'); 3859 string seoproductsearch = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(ItemPageIDproducts); 3860 string quotecontext = Pageview.Area.Item["QuoteContext"].ToString(); 3861 string cartpage = Pageview.Area.Item["QuoteCart"].ToString(); 3862 } 3863 <script> 3864 var searchproducts = new Bloodhound({ 3865 datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'), 3866 queryTokenizer: Bloodhound.tokenizers.whitespace, 3867 remote: { 3868 url: '/Default.aspx?ID=@seoproductsearch&q=%QUERY', 3869 wildcard: '%QUERY' 3870 3871 }, 3872 3873 }); 3874 3875 searchproducts.initialize(); 3876 3877 $('#text-input').bind('typeahead:render', function () { 3878 $('.tt-suggestion').removeClass('tt-selectable'); 3879 }); 3880 3881 $('#remoteproduct .form-control').typeahead( 3882 { 3883 hint: true, 3884 highlight: false, 3885 minLength: 2 3886 }, 3887 { 3888 limit: 9999, 3889 name: 'name', 3890 display: 'name', 3891 source: searchproducts, 3892 templates: { 3893 empty: '<div class="search-header clearfix"><h4 class="product-title pull-left">@Translate("Ingen produkter fundet")</h4></div>', //optional 3894 suggestion: function (el) { 3895 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>'; 3896 } 3897 } 3898 } 3899 ); 3900 3901 // Quickly Add to quote 3902 function QuickAddToQuote(product, elm) { 3903 var url = "@Dynamicweb.Context.Current.Request.RawUrl&CartCmd=Add&ProductID=" + product + "&OrderContext=@quotecontext"; 3904 var allButtons = $('div.QuickAdd'); 3905 var spinner = elm.find($('i.fa-plus')); 3906 3907 spinner.removeClass('fa-plus'); 3908 spinner.addClass('fa-spinner fa-pulse'); 3909 elm.addClass('reducedOpacity'); 3910 elm.attr('disabled', 'disabled'); 3911 allButtons.addClass('reducedOpacity'); 3912 allButtons.attr('disabled', 'disabled'); 3913 document.location.href = url; 3914 //$.ajax({ 3915 // type: "GET", 3916 // url: url, 3917 // success: function () { 3918 // update(); 3919 // } 3920 //}); 3921 } 3922 </script> 3923 </div> 3924 @if (!string.IsNullOrWhiteSpace(GetString("DW_extranet_error_uk"))) 3925 { 3926 <script> 3927 $('#login').modal('show').addClass("in").attr("aria-hidden", "false").css({ 3928 "display": "block", 3929 "padding-left": "17px" 3930 }); 3931 </script> 3932 } 3933 </body> 3934 </html>