Error executing template "Designs/Dwsimple/_parsed/Kalenderaftale.parsed.cshtml"
System.IO.IOException: The process cannot access the file 'e:\dynamicweb.net\solutions\SkovboData\agerbaek.dw9.dynamicweb-cms.com\files\Templates\Designs\Dwsimple\css\DWGlobalStylesSite1_auto.css' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost)
   at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
   at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding)
   at Dynamicweb.Core.Helpers.TextFileHelper.WriteTextFile(String value, String path, Boolean appendToFile, Encoding encoding)
   at CompiledRazorTemplates.Dynamic.RazorEngine_63a6ede54b654bd98297278c1b2413f1.Execute() in e:\dynamicweb.net\solutions\SkovboData\agerbaek.dw9.dynamicweb-cms.com\files\Templates\Designs\Dwsimple\_parsed\Kalenderaftale.parsed.cshtml:line 1969
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @using System 2 @using System.Web 3 4 @using System.Text.RegularExpressions 5 @using System.Web 6 7 8 @functions{ 9 public class WrapMethods 10 { 11 //Gets the contrasting color 12 public static string getContrastYIQ(string hexcolor) 13 { 14 if (hexcolor != "") 15 { 16 hexcolor = Regex.Replace(hexcolor, "[^0-9a-zA-Z]+", ""); 17 18 int r = Convert.ToByte(hexcolor.Substring(0, 2), 16); 19 int g = Convert.ToByte(hexcolor.Substring(2, 2), 16); 20 int b = Convert.ToByte(hexcolor.Substring(4, 2), 16); 21 int yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000; 22 23 if (yiq >= 128) 24 { 25 return "black"; 26 } 27 else 28 { 29 return "white"; 30 } 31 } 32 else 33 { 34 return "black"; 35 } 36 } 37 38 39 //Truncate text 40 public static string Truncate (string value, int count, bool strip=true) 41 { 42 if (strip == true){ 43 value = StripHtmlTagByCharArray(value); 44 } 45 46 if (value.Length > count) 47 { 48 value = value.Substring(0, count - 1) + "..."; 49 } 50 51 return value; 52 } 53 54 55 //Strip text from HTML 56 public static string StripHtmlTagByCharArray(string htmlString) 57 { 58 char[] array = new char[htmlString.Length]; 59 int arrayIndex = 0; 60 bool inside = false; 61 62 for (int i = 0; i < htmlString.Length; i++) 63 { 64 char let = htmlString[i]; 65 if (let == '<') 66 { 67 inside = true; 68 continue; 69 } 70 if (let == '>') 71 { 72 inside = false; 73 continue; 74 } 75 if (!inside) 76 { 77 array[arrayIndex] = let; 78 arrayIndex++; 79 } 80 } 81 return new string(array, 0, arrayIndex); 82 } 83 84 //Make the correct count of columns 85 public static string ColumnMaker(int Col, string ScreenSize) 86 { 87 string Columns = ""; 88 89 switch (Col) 90 { 91 case 1: 92 Columns = "col-"+ScreenSize+"-12"; 93 break; 94 95 case 2: 96 Columns = "col-"+ScreenSize+"-6"; 97 break; 98 99 case 3: 100 Columns = "col-"+ScreenSize+"-4"; 101 break; 102 103 case 4: 104 Columns = "col-"+ScreenSize+"-3"; 105 break; 106 107 case 6: 108 Columns = "col-"+ScreenSize+"-2"; 109 break; 110 111 default: 112 Columns = "col-"+ScreenSize+"-3"; 113 break; 114 } 115 116 return Columns; 117 } 118 119 120 private string Custom(string firstoption, string secondoption) 121 { 122 if (firstoption == "custom") 123 { 124 return secondoption; 125 } 126 else 127 { 128 return firstoption; 129 } 130 } 131 } 132 } 133 @helper MiniCart() 134 { 135 <div class="dropdown-cart"> 136 @if (GetInteger("Ecom:Order.OrderLines.TotalProductQuantity") > 0) 137 { 138 <div class="col-md-12 col-sm-12 col-xs-12"> 139 <div class="row"> 140 <span class="cart-items">@Translate("You have", "You have")<strong> @GetValue("Ecom:Order.OrderLines.TotalProductQuantity")</strong> @Translate("items in your cart", "items in your cart")</span> 141 <table class="table table-cart"> 142 <tbody> 143 <tr> 144 <th colspan="2">@Translate("Product", "Product")</th> 145 <th class="text-center">@Translate("Qty", "Qty")</th> 146 <th>@Translate("Total", "Total")</th> 147 </tr> 148 149 @foreach (var orderline in GetLoop("OrderLines")) 150 { 151 var image = orderline.GetString("Ecom:Product.ImageLarge.Clean"); 152 153 <tr> 154 <td><img src="/Admin/Public/GetImage.ashx?width=50&image=@image&Compression=99" class="img-center" alt=""></td> 155 <td><a href="@orderline.GetValue(" ecom:order:orderline.productlink")"="">@orderline.GetValue("Ecom:Order:OrderLine.ProductName")</a><br><small>@orderline.GetString("Ecom:Order:OrderLine.ProductVariantText")</small></td> 156 <td class="text-center">@orderline.GetValue("Ecom:Order:OrderLine.Quantity")</td> 157 <td><nobr>@if(orderline.GetInteger("Ecom:Order:OrderLine.Points")>0){ 158 @orderline.GetDouble("Ecom:Order:OrderLine.Points"); 159 <text> </text>@Translate("orderline_points","points") 160 } 161 else{ 162 @orderline.GetValue("Ecom:Order:olPrice.PriceWithVATFormatted") 163 }</nobr></td> 164 </tr> 165 } 166 167 <tr> 168 <td class="text-center"><i class="fa fa-credit-card"></i></td> 169 <td>@GetValue("Ecom:Order.PaymentMethod")</td> 170 <td class="text-center"></td> 171 <td>@GetValue("Ecom:Order.PaymentFee")</td> 172 </tr> 173 <tr> 174 <td class="text-center"><i class="fa fa-truck"></i></td> 175 <td>@GetValue("Ecom:Order.ShippingMethod")</td> 176 <td class="text-center"></td> 177 <td>@GetValue("Ecom:Order.ShippingFee")</td> 178 </tr> 179 </tbody> 180 </table> 181 </div> 182 </div> 183 <div class="col-md-12 col-sm-12 col-xs-12"> 184 <div class="row"> 185 <div class="col-md-8"> 186 <!-- 187 @{ 188 var edittextstring = Translate("Edit cart", "Edit cart"); 189 var cartid = GetValue("DwAreaCartPageID"); 190 } 191 192 <form action="/Default.aspx?ID=@cartid" method="post"> 193 <input type="submit" name="CartV2.GotoStep1" id="CartV2.GotoStep1" value="@edittextstring" class="btn btn-xs btn-base pull-left" /> 194 </form> 195 --> 196 </div> 197 <div class="col-md-4"> 198 <a href="Default.aspx?ID=@cartid" class="btn btn-xs btn-base pull-right">@Translate("Proceed to checkout", "Proceed to checkout")</a> 199 <span class="clearfix"></span> 200 </div> 201 </div> 202 <div class="row">&nbsp;</div> 203 </div> 204 } 205 else 206 { 207 <span class="cart-items">@Translate("Your shopping cart is empty.", "Your shopping cart is empty.")</span> 208 } 209 </div> 210 } 211 212 213 214 <!DOCTYPE html> 215 <html> 216 <head> 217 <meta charset="utf-8"> 218 <title>@GetValue("Title")</title> 219 @GetValue("MetaTags") 220 @GetValue("CopyRightNotice") 221 222 223 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1"> 224 <meta name="robots" content="index, follow"> 225 226 @{ 227 string MetaDescription = GetString("Meta.Description"); 228 string MetaKeywords = GetString("Meta.Keywords"); 229 } 230 231 232 233 234 235 <!-- Facebook Admin --> 236 @if (!string.IsNullOrWhiteSpace(GetString("Item.Area.FacebookCommendAdmin"))) { 237 string fbadmin = GetString("Item.Area.FacebookCommendAdmin"); 238 <meta property="fb:admins" content="@fbadmin"> 239 } 240 241 <!-- Essential styles --> 242 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" type="text/css"> 243 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" type="text/css"> 244 <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.min.css" media="screen"> 245 246 <!-- Custom styles --> 247 <link rel="stylesheet" href="/Files/Templates/Designs/Dwsimple/css/custom.css" type="text/css"> 248 249 250 <!-- Mobile menu styles --> 251 <link href="//cdnjs.cloudflare.com/ajax/libs/jasny-bootstrap/3.1.3/css/jasny-bootstrap.min.css" rel="stylesheet" type="text/css" media="screen"> 252 253 <!-- Favicon --> 254 @{ 255 var favicon = @GetString("Item.Area.Favicon"); 256 } 257 <link href="@favicon" rel="icon" type="image/png"> 258 259 <!-- Variables --> 260 @{ 261 var attrValue = ""; 262 string currentpageid = GetString("DwPageID"); 263 string firstpageid = GetString("DwAreaFirstActivePageID"); 264 string searchplaceholder = Translate("Search products", "Search products"); 265 266 var cartid = GetValue("DwAreaCartPageID"); 267 268 DateTime areaUpdated = Pageview.Area.Audit.LastModifiedAt; 269 string cssPath = HttpContext.Current.Server.MapPath("/Files/Templates/Designs/Dwsimple/css/DWGlobalStylesSite" + GetString("DwAreaID") + "_auto.min.css"); 270 DateTime lastWriteTime = System.IO.File.GetLastWriteTime(cssPath); 271 bool writeCss = true; 272 string css = String.Empty; 273 if (areaUpdated > lastWriteTime) 274 { 275 writeCss = true; 276 } 277 } 278 <!--FONT SETTINGS--> 279 @functions{ 280 public class FontSettings 281 { 282 public class Logo 283 { 284 public static string FontFamily { get; set; } 285 public static string FontSize { get; set; } 286 public static string FontWeight { get; set; } 287 public static string Color { get; set; } 288 public static string LineHeight { get; set; } 289 public static string Casing { get; set; } 290 public static string LetterSpacing { get; set; } 291 } 292 293 public class H1 294 { 295 public static string FontFamily { get; set; } 296 public static string FontSize { get; set; } 297 public static string FontWeight { get; set; } 298 public static string Color { get; set; } 299 public static string LineHeight { get; set; } 300 public static string Casing { get; set; } 301 public static string LetterSpacing { get; set; } 302 } 303 304 public class H2 305 { 306 public static string FontFamily { get; set; } 307 public static string FontSize { get; set; } 308 public static string FontWeight { get; set; } 309 public static string Color { get; set; } 310 public static string LineHeight { get; set; } 311 public static string Casing { get; set; } 312 public static string LetterSpacing { get; set; } 313 } 314 315 public class Body 316 { 317 public static string FontFamily { get; set; } 318 public static string FontSize { get; set; } 319 public static string FontWeight { get; set; } 320 public static string Color { get; set; } 321 public static string LineHeight { get; set; } 322 public static string Casing { get; set; } 323 public static string LetterSpacing { get; set; } 324 } 325 } 326 327 private void InitFontSettings() 328 { 329 //LOGO 330 FontSettings.Logo.FontFamily = CustomFont(GetString("Item.Area.LogoFont.Font"), GetString("Item.Area.LogoFont.CustomFont")); 331 FontSettings.Logo.FontSize = GetString("Item.Area.LogoFont.Size")+"px"; 332 FontSettings.Logo.FontWeight = CheckExistence(GetString("Item.Area.LogoFont.Weight"), "normal"); 333 FontSettings.Logo.LineHeight = CheckExistence(GetString("Item.Area.LogoFont.LineHeight"), "1"); 334 FontSettings.Logo.LetterSpacing = GetString("Item.Area.LogoFont.LetterSpacing") + "px"; 335 FontSettings.Logo.Casing = GetString("Item.Area.LogoFont.Casing"); 336 FontSettings.Logo.Color = GetString("Item.Area.LogoFont.Color.Color"); 337 338 339 //HEADINGS 340 FontSettings.H1.FontFamily = CustomFont(GetString("Item.Area.HeadingsH1.Font"), GetString("Item.Area.HeadingsH1.CustomFont")); 341 FontSettings.H1.FontSize = GetString("Item.Area.HeadingsH1.Size")+"px"; 342 FontSettings.H1.FontWeight = CheckExistence(GetString("Item.Area.HeadingsH1.Weight"), "normal"); 343 FontSettings.H1.LineHeight = CheckExistence(GetString("Item.Area.HeadingsH1.LineHeight"), "1"); 344 FontSettings.H1.LetterSpacing = GetString("Item.Area.HeadingsH1.LetterSpacing") + "px"; 345 FontSettings.H1.Casing = GetString("Item.Area.HeadingsH1.Casing"); 346 FontSettings.H1.Color = GetString("Item.Area.HeadingsH1.Color.Color"); 347 348 FontSettings.H2.FontFamily = CustomFont(GetString("Item.Area.HeadingsH2.Font"), GetString("Item.Area.HeadingsH2.CustomFont")); 349 FontSettings.H2.FontSize = GetString("Item.Area.HeadingsH2.Size")+"px"; 350 FontSettings.H2.FontWeight = CheckExistence(GetString("Item.Area.HeadingsH2.Weight"), "normal"); 351 FontSettings.H2.LineHeight = CheckExistence(GetString("Item.Area.HeadingsH2.LineHeight"), "1"); 352 FontSettings.H2.LetterSpacing = GetString("Item.Area.HeadingsH2.LetterSpacing") + "px"; 353 FontSettings.H2.Casing = GetString("Item.Area.HeadingsH2.Casing"); 354 FontSettings.H2.Color = GetString("Item.Area.HeadingsH2.Color.Color"); 355 356 357 //BODY 358 FontSettings.Body.FontFamily = CustomFont(GetString("Item.Area.BodyFont.Font"), GetString("Item.Area.BodyFont.CustomFont")); 359 FontSettings.Body.FontSize = GetString("Item.Area.BodyFont.Size") + "px"; 360 FontSettings.Body.FontWeight = CheckExistence(GetString("Item.Area.BodyFont.Weight"), "normal"); 361 FontSettings.Body.LineHeight = CheckExistence(GetString("Item.Area.BodyFont.LineHeight"), "1"); 362 FontSettings.Body.LetterSpacing = GetString("Item.Area.BodyFont.LetterSpacing") + "px"; 363 FontSettings.Body.Casing = GetString("Item.Area.BodyFont.Casing"); 364 FontSettings.Body.Color = GetString("Item.Area.BodyFont.Color.Color"); 365 366 367 gfonts.Add(FontSettings.Logo.FontFamily, ""); 368 if (!gfonts.ContainsKey(FontSettings.H1.FontFamily)) 369 { 370 gfonts.Add(FontSettings.H1.FontFamily, ""); 371 } 372 if (!gfonts.ContainsKey(FontSettings.H2.FontFamily)) 373 { 374 gfonts.Add(FontSettings.H2.FontFamily, ""); 375 } 376 if (!gfonts.ContainsKey(FontSettings.Body.FontFamily)) 377 { 378 gfonts.Add(FontSettings.Body.FontFamily, ""); 379 } 380 381 } 382 383 private string CustomFont (string firstfont, string secondfont) 384 { 385 if (firstfont == "custom") 386 { 387 return secondfont; 388 } 389 else 390 { 391 return firstfont; 392 } 393 } 394 395 private string CheckExistence (string stringitem, string defaultvalue) 396 { 397 if (!string.IsNullOrWhiteSpace(stringitem)) { 398 return stringitem; 399 } else { 400 return defaultvalue; 401 } 402 } 403 404 private System.Collections.Generic.Dictionary<string, object> gfonts = new System.Collections.Generic.Dictionary<string, object>(); 405 } 406 407 @{ 408 InitFontSettings(); 409 } 410 411 @helper GoogleFonts() 412 { 413 if (gfonts != null) 414 { 415 foreach (var item in gfonts) 416 { 417 <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=@item.Key:100,200,300,400,500,600,700,800,900"> 418 } 419 } 420 } 421 422 @functions{ 423 public string FontStylesCSS() 424 { 425 string CssString = @" 426 .dw-logotext { 427 font-family: " + FontSettings.Logo.FontFamily + @"; 428 font-size: " + FontSettings.Logo.FontSize + @"; 429 font-weight: " + FontSettings.Logo.FontWeight + @"; 430 line-height: " + FontSettings.Logo.LineHeight + @" !important; 431 letter-spacing: " + FontSettings.Logo.LetterSpacing + @"; 432 text-transform: " + FontSettings.Logo.Casing + @"; 433 color: " + FontSettings.Logo.Color + @"; 434 } 435 436 h1 { 437 font-family: " + FontSettings.H1.FontFamily + @" !important; 438 font-size: " + FontSettings.H1.FontSize + @"; 439 color: " + FontSettings.H1.Color + @"; 440 line-height: " + FontSettings.H1.LineHeight + @" !important; 441 text-transform: " + FontSettings.H1.Casing + @"; 442 font-weight: " + FontSettings.H1.FontWeight + @"; 443 letter-spacing: " + FontSettings.H1.LetterSpacing + @" !important; 444 } 445 446 447 h2, h3, h4, h5, h6 { 448 margin-top: 0.7em; 449 margin-bottom: 0.7em; 450 451 font-family: " + FontSettings.H2.FontFamily + @" !important; 452 font-size: " + FontSettings.H2.FontSize + @"; 453 color: " + FontSettings.H2.Color + @"; 454 line-height: " + FontSettings.H2.LineHeight + @"; 455 text-transform: " + FontSettings.H2.Casing + @" !important; 456 font-weight: " + FontSettings.H2.FontWeight + @" !important; 457 letter-spacing: " + FontSettings.H2.LetterSpacing + @" !important; 458 } 459 460 h4, h5, h6 { 461 font-size: 16px !important; 462 } 463 464 body { 465 font-family: " + FontSettings.Body.FontFamily + @" !important; 466 font-size: " + FontSettings.Body.FontSize + @"; 467 color: " + FontSettings.Body.Color + @"; 468 line-height: " + FontSettings.Body.LineHeight + @" !important; 469 text-transform: " + FontSettings.Body.Casing + @"; 470 font-weight: " + FontSettings.Body.FontWeight + @"; 471 letter-spacing: " + FontSettings.Body.LetterSpacing + @" !important; 472 } 473 474 .navbar-wp .navbar-nav > li > a { 475 font-family: " + FontSettings.Body.FontFamily + @" !important; 476 } 477 478 .section-title { 479 margin-top: 0.7em; 480 margin-bottom: 0.7em; 481 } 482 "; 483 return CssString; 484 } 485 } 486 @GoogleFonts() 487 <!-- GENERAL/COLOR SETTINGS --> 488 @functions{ 489 public class ColorSettings 490 { 491 public class Color 492 { 493 public static string Primary { get; set; } 494 public static string Secondary { get; set; } 495 public static string NavbarFont { get; set; } 496 public static string Footer { get; set; } 497 public static string FooterFont { get; set; } 498 499 public static string Sticker { get; set; } 500 public static string Price { get; set; } 501 public static string Cart { get; set; } 502 } 503 } 504 505 private void InitColorSettings() 506 { 507 ColorSettings.Color.Primary = GetString("Item.Area.ColorsPrimary.Color"); 508 ColorSettings.Color.Secondary = GetString("Item.Area.ColorsSecondary.Color"); 509 510 ColorSettings.Color.NavbarFont = GetString("Item.Area.NavbarFontColor"); 511 512 if (string.IsNullOrWhiteSpace(ColorSettings.Color.NavbarFont)) 513 { 514 ColorSettings.Color.NavbarFont = WrapMethods.getContrastYIQ(ColorSettings.Color.Secondary); 515 } 516 517 ColorSettings.Color.Footer = GetString("Item.Area.ColorsFooterColor.Color"); 518 ColorSettings.Color.FooterFont = WrapMethods.getContrastYIQ(ColorSettings.Color.Footer); 519 520 ColorSettings.Color.Price = GetString("Item.Area.EcommercePriceColor.Color"); 521 ColorSettings.Color.Sticker = GetString("Item.Area.EcommerceDiscountStickerColor.Color"); 522 ColorSettings.Color.Cart = GetString("Item.Area.EcommerceCartButtonColor.Color"); 523 } 524 525 public string GetColorSettings() 526 { 527 string CssString = @" 528 a:hover, a:focus, a:active { 529 color: @Primary; 530 } 531 532 .navbar-wp, .navbar-wp.affix, .navbar-wp .navbar-nav > li > a { 533 color: @NavbarFont; 534 } 535 536 .navbar-wp .navbar-nav > .active > a, .navbar-wp .navbar-nav > .active > a:hover, .navbar-wp .navbar-nav > .active > a:focus { 537 color: @NavbarFont; 538 } 539 540 .navbar-wp .navbar-nav > li > a:hover, .navbar-wp .navbar-nav > li > a:focus { 541 border-top: 0px solid @Secondary; 542 color: @NavbarFont; 543 } 544 545 .navbar-wp .navbar-nav > li > a span:after { 546 background-color: @Primary; 547 } 548 549 .btn-dw-primary { 550 color: #FFF; 551 background-color: @Primary; 552 border-color: @Primary; 553 } 554 555 .btn-dw-secondary { 556 color: @NavbarFont; 557 background-color: @Secondary; 558 border-color: @Secondary; 559 } 560 561 .btn-dw-cart { 562 color: #FFF; 563 background-color: @Cart; 564 border-color: @Cart; 565 } 566 567 .dw-section-title { 568 border-color: @Secondary; 569 } 570 571 .dw-minicart-update { 572 color: #FFF !important; 573 background-color: @Primary; 574 transition: all 0.3s ease-in-out 0s; 575 } 576 577 .pagination > li > a, .pagination > li > a:hover, .pagination > li > a:focus, .pagination > li > a:active { 578 color: @Primary; 579 } 580 581 .form-control:hover, .form-control:focus, .form-control:active { 582 border-color: @Primary !important; 583 } 584 585 .bg-2 { 586 background: @Primary !important; 587 } 588 589 .blockquote-1:hover { 590 border-color: @Primary !important; 591 } 592 593 .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 { 594 color: @Primary; 595 } 596 597 .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 { 598 color: @Primary; 599 } 600 601 .navbar-wp .navbar-nav > li > a:hover, .navbar-wp .navbar-nav > li > a:focus { 602 border: 0px solid @Primary; 603 } 604 605 .navbar-wp .navbar-toggle:hover, .navbar-wp .navbar-toggle:focus { 606 background-color: @Primary !important; 607 border-color: @Primary !important; 608 } 609 610 .navbar-wp .dropdown-menu { 611 border-top: 1px solid @Primary !important; 612 border-bottom: 3px solid @Primary !important; 613 } 614 615 .navbar-wp .dropdown-menu > li > a:hover { 616 background: @Primary !important; 617 color: #fff; 618 } 619 620 .navbar-wp .dropdown-menu .active { 621 background: @Primary !important; 622 color: #fff; 623 } 624 625 .navbar-wp.navbar-contrasted .dropdown-menu > li > a:hover { 626 background: @Primary !important; 627 } 628 629 .nav > ul > li > a:hover { 630 color: @Primary; 631 } 632 633 .lw .w-box.w-box-inverse .thmb-img i { 634 color: @Primary !important; 635 } 636 637 .w-box.w-box-inverse .thmb-img:hover i { 638 background: @Primary !important; 639 } 640 641 .c-box { 642 border: 1px solid @Primary !important; 643 } 644 645 .c-box .c-box-header { 646 background: @Primary !important; 647 } 648 649 .w-section .aside-feature:hover .icon-feature, .w-section .aside-feature:hover h4 { 650 color: @Primary !important; 651 } 652 653 .layer-slider-wrapper .title.title-base { 654 background: @Primary !important; 655 } 656 657 .layer-slider-wrapper .subtitle { 658 color: @Primary !important; 659 } 660 661 .layer-slider-wrapper .list-item { 662 color: @Primary !important; 663 } 664 665 .box-element.box-element-bordered { 666 border: 1px solid @Primary !important; 667 } 668 669 .carousel-2 .carousel-indicators .active { 670 background-color: @Primary !important; 671 } 672 673 .carousel-2 .carousel-nav a { 674 color: @Primary !important; 675 } 676 677 .carousel-2 .carousel-nav a:hover { 678 background: @Primary !important; 679 } 680 681 .carousel-3 .carousel-nav a { 682 color: @Primary !important; 683 } 684 685 .carousel-3 .carousel-nav a:hover { 686 background: @Primary !important; 687 } 688 689 .like-button .button.liked i { 690 color: @Primary !important; 691 } 692 693 ul.list-listings li.featured { 694 border-color: @Primary !important; 695 } 696 697 ul.list-check li i { 698 color: @Primary !important; 699 } 700 701 ul.dw-categories li a:hover, ul.dw-categories a:focus, ul.dw-categories a:active{ 702 color: @NavbarFont; 703 background-color: @Primary; 704 border-color: @Primary; 705 } 706 707 ul.categories li a:hover, ul.categories a:focus, ul.categories a:active{ 708 color: @NavbarFont; 709 background-color: @Primary; 710 border-color: @Primary; 711 } 712 713 .timeline .event:nth-child(2n):before { 714 background-color: @Primary !important; 715 } 716 717 .timeline .event:nth-child(2n-1):before { 718 background-color: @Primary !important; 719 } 720 721 #toTopHover { 722 background-color: @Primary !important; 723 } 724 725 .tags-list li { 726 border: 1px solid @Primary !important; 727 color: @Primary !important; 728 } 729 730 .tags-list li:hover, 731 a.open-panel { 732 background-color: @Primary !important; 733 } 734 735 .nav-pills > li.active > a, .nav-pills > li.active > a:hover, .nav-pills > li.active > a:focus, 736 .panel-group .panel-heading a i, 737 .tags-list li a { 738 color: @NavbarFont !important; 739 } 740 741 .nav-pills > li > a:hover, .nav-pills > li > a:focus { 742 color: @NavbarFont !important; 743 background: none repeat scroll 0% 0% @Secondary !important; 744 } 745 746 footer { 747 background: @Footer !important; 748 } 749 750 footer h4 { 751 color: @FooterFont !important; 752 } 753 754 footer a { 755 color: @FooterFont !important; 756 } 757 758 footer a:hover, footer a:focus, footer a:active { 759 color: @Secondary !important; 760 } 761 762 footer p { 763 color: @FooterFont !important; 764 } 765 766 footer ul > li { 767 color: @FooterFont !important; 768 } 769 770 footer hr { 771 border-color: @FooterFont 772 } 773 774 775 /* Button colors */ 776 .btn-base { 777 color: @NavbarFont !important; 778 background-color: @Secondary !important; 779 border: 1px solid @Secondary !important; 780 } 781 782 .btn-base:before { 783 background-color: @Secondary !important; 784 } 785 786 .btn-base:hover:before, .btn-base:focus:before, .btn-base:active:before { 787 color: @NavbarFont !important; 788 background-color: @Primary !important; 789 border-color: @Primary !important; 790 } 791 792 .btn-icon:before { 793 transition: none !important; 794 } 795 796 .btn-base:hover, .btn-base:focus, .btn-base:active, .btn-base.active, .open .dropdown-toggle.btn-base { 797 color: @NavbarFont !important; 798 background-color: @Primary !important; 799 border-color: @Primary !important; 800 } 801 802 .btn-two { 803 color: @NavbarFont !important; 804 border-color: @Secondary !important; 805 background-color: @Secondary !important; 806 border: 1px solid @Secondary !important; 807 } 808 809 .btn-two:hover, .btn-two:focus, .btn-two:active, .btn-two.active, .open .dropdown-toggle.btn-two { 810 color: @NavbarFont !important; 811 background-color: @Primary !important; 812 border-color: @Primary !important; 813 } 814 815 .btn-primary { 816 background-color: @Primary !important; 817 border-color: @Primary !important; 818 } 819 820 .open .dropdown-toggle.btn-primary { 821 background-color: @Primary !important; 822 border-color: @Primary !important; 823 } 824 825 .btn-one:hover, .btn-one:focus, .btn-one:active, .btn-one.active, .open .dropdown-toggle.btn-one { 826 color: @Primary !important; 827 } 828 829 .btn-four { 830 border: 2px solid @Primary!important; 831 color: @Primary !important; 832 } 833 834 .btn-four:hover, .btn-four:focus, .btn-four:active, .btn-four.active, .open .dropdown-toggle.btn-four { 835 background-color: #fff !important; 836 } 837 838 839 /* Dropdown-menu */ 840 .dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:focus { 841 background: @Primary !important; 842 color: #fff !important; 843 } 844 845 /* Ecom settings */ 846 .ribbon.base, .ball { 847 background: @Sticker !important; 848 color: #fff; 849 border-right: 5px solid @Sticker !important; 850 } 851 852 .ribbon.base:before { 853 border-top: 27px solid @Sticker !important; 854 } 855 856 .ribbon.base:after { 857 border-bottom: 27px solid @Sticker !important; 858 } 859 860 .price { 861 color: @Price !important; 862 } 863 864 .discount-sticker { 865 background-color: @Sticker !important; 866 } 867 868 .bs-callout-primary { 869 border-left-color: @Primary !important; 870 } 871 872 .ratings .fa-star { 873 color: @Secondary !important; 874 } 875 876 .feature-label { 877 color: @Secondary !important; 878 }"; 879 880 return ParseCSSToString(CssString); 881 } 882 883 private string ParseCSSToString(string TheString) 884 { 885 TheString = TheString.Replace("@Primary", ColorSettings.Color.Primary); 886 TheString = TheString.Replace("@Secondary", ColorSettings.Color.Secondary); 887 TheString = TheString.Replace("@NavbarFont", ColorSettings.Color.NavbarFont); 888 TheString = TheString.Replace("@FooterFont", ColorSettings.Color.FooterFont); 889 TheString = TheString.Replace("@Footer", ColorSettings.Color.Footer); 890 891 TheString = TheString.Replace("@Sticker", ColorSettings.Color.Sticker); 892 TheString = TheString.Replace("@Price", ColorSettings.Color.Price); 893 TheString = TheString.Replace("@Cart", ColorSettings.Color.Cart); 894 895 896 System.Text.StringBuilder sb = new System.Text.StringBuilder(); 897 898 foreach(var item in TheString.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries)) 899 { 900 sb.AppendLine(item); 901 } 902 903 return sb.ToString(); 904 } 905 } 906 907 @{ 908 InitColorSettings(); 909 } 910 911 912 913 @using System.Drawing 914 @using System.Net 915 916 917 @functions{ 918 public class GeneralSettings 919 { 920 921 public class Header 922 { 923 public static string Mode { get; set; } 924 public static string Classes { get; set; } 925 public static bool Show { get; set; } 926 public static string Background { get; set; } 927 public static bool ShowFrontpageImage { get; set; } 928 } 929 930 public class Logo 931 { 932 public static string Image { get; set; } 933 public static string ContrastImage { get; set; } 934 public static string Text { get; set; } 935 public static string Slogan { get; set; } 936 public static string SecondaryColor { get; set; } 937 } 938 939 public class Navigation 940 { 941 public static string Position { get; set; } 942 public static string InvertedPosition { get; set; } 943 public static string StickyMenu { get; set; } 944 public static string TopBGImage { get; set; } 945 public static string SelectionMode { get; set; } 946 public static string SelectionStyle { get; set; } 947 public static int SelectionWeight { get; set; } 948 public static bool Case { get; set; } 949 950 public static string BreadcrumbMode { get; set; } 951 public static string BreadcrumbAlign { get; set; } 952 953 public static string LeftmenuMode { get; set; } 954 955 public static string ButtonDesign { get; set; } 956 } 957 958 public class Headings 959 { 960 public static string Mode { get; set; } 961 } 962 963 public class Background 964 { 965 public static string Color { get; set; } 966 public static string Image { get; set; } 967 public static string CustomImage { get; set; } 968 public static bool GradientColor { get; set; } 969 public static string GradientPercentage { get; set; } 970 public static string Style { get; set; } 971 public static string Position { get; set; } 972 } 973 974 public class Site 975 { 976 public static bool Shadow { get; set; } 977 public static string LayoutMode { get; set; } 978 } 979 980 public class Images 981 { 982 public static bool RoundCorners { get; set; } 983 } 984 985 public class Ecommerce 986 { 987 public static string EcomListDesign { get; set; } 988 public static string EcomCardDesign { get; set; } 989 } 990 } 991 992 private void InitGeneralSettings() 993 { 994 //Header settings 995 GeneralSettings.Header.Mode = GetString("Item.Area.HeaderLayoutMode"); 996 GeneralSettings.Header.Show = GetBoolean("Item.Area.HeaderShow"); 997 GeneralSettings.Header.Background = GetString("Item.Area.NavigationNavbarBackground"); 998 GeneralSettings.Header.ShowFrontpageImage = GetBoolean("Item.Area.HeaderFrontpageImage"); 999 1000 if (GeneralSettings.Header.Mode == "solid"){ 1001 GeneralSettings.Header.Classes = ""; 1002 } 1003 1004 if (GeneralSettings.Header.Mode == "cover" || GeneralSettings.Header.Mode == "mobile"){ 1005 GeneralSettings.Header.Classes = "header-alpha header-cover"; 1006 } 1007 1008 1009 //Logo settings 1010 GeneralSettings.Logo.Image = GetString("Item.Area.GeneralLogo"); 1011 GeneralSettings.Logo.Text = GetString("Item.Area.GeneralLogoText"); 1012 GeneralSettings.Logo.Slogan = GetString("Item.Area.LogoSlogan"); 1013 GeneralSettings.Logo.SecondaryColor = GetString("Item.Area.LogoSecondColor.Color"); 1014 1015 if (!string.IsNullOrWhiteSpace(GetString("Item.Area.LogoContrastImage"))) { 1016 GeneralSettings.Logo.ContrastImage = GetString("Item.Area.LogoContrastImage"); 1017 } else { 1018 GeneralSettings.Logo.ContrastImage = GetString("Item.Area.GeneralLogo"); 1019 } 1020 1021 1022 //Navigation settings 1023 GeneralSettings.Navigation.Position = GetString("Item.Area.NavigationPosition"); 1024 GeneralSettings.Navigation.StickyMenu = "off"; 1025 GeneralSettings.Navigation.TopBGImage = GetString("Item.Area.TopBGImage"); 1026 1027 if (GetBoolean("Item.Area.NavigationSticky")) { 1028 if (GeneralSettings.Header.Show) 1029 { 1030 if (GeneralSettings.Header.Mode == "cover") 1031 { 1032 GeneralSettings.Navigation.StickyMenu = "44"; //"data-spy=\"affix\" data-offset-top=\"44\" data-offset-bottom=\"300\""; 1033 } 1034 else 1035 { 1036 int offset = ImageHeight()+28; 1037 1038 GeneralSettings.Navigation.StickyMenu = offset.ToString(); // "data-spy=\"affix\" data-offset-top=\"" + offset.ToString() + "\" data-offset-bottom=\"300\""; 1039 } 1040 } 1041 else 1042 { 1043 GeneralSettings.Navigation.StickyMenu = "5"; // "data-spy=\"affix\" data-offset-top=\"5\" data-offset-bottom=\"300\""; 1044 } 1045 } 1046 1047 if (GeneralSettings.Navigation.Position == "left") { 1048 GeneralSettings.Navigation.InvertedPosition = "right"; 1049 } 1050 else 1051 { 1052 GeneralSettings.Navigation.InvertedPosition = "left"; 1053 } 1054 1055 GeneralSettings.Navigation.SelectionMode = GetString("Item.Area.NavigationSelectionMode"); 1056 GeneralSettings.Navigation.SelectionStyle = ""; 1057 GeneralSettings.Navigation.SelectionWeight = GetInteger("Item.Area.SelectionWeight"); 1058 1059 if (GeneralSettings.Navigation.SelectionMode == "arrow") { 1060 GeneralSettings.Navigation.SelectionStyle = "navbar-arrow"; 1061 } 1062 1063 GeneralSettings.Navigation.Case = GetBoolean("Item.Area.NavigationUppercase"); 1064 1065 GeneralSettings.Navigation.BreadcrumbMode = GetString("Item.Area.NavigationBreadcrumbLayout"); 1066 GeneralSettings.Navigation.BreadcrumbAlign = GetString("Item.Area.NavigationBreadcrumbAlign"); 1067 1068 GeneralSettings.Navigation.LeftmenuMode = GetString("Item.Area.NavigationLeftNavigationMode"); 1069 1070 GeneralSettings.Navigation.ButtonDesign = GetString("Item.Area.NavigationButtonDesign"); 1071 1072 1073 //Background settings 1074 GeneralSettings.Background.Image = GetString("Item.Area.BackgroundImage.Image.Image"); 1075 GeneralSettings.Background.CustomImage = GetString("Item.Area.BackgroundImage.Image.CustomImage"); 1076 GeneralSettings.Background.Color = GetString("Item.Area.BackgroundImage.Color.Color"); 1077 GeneralSettings.Background.GradientColor = GetBoolean("Item.Area.BackroundGradientColor"); 1078 GeneralSettings.Background.GradientPercentage = GetString("Item.Area.GradientPercentage"); 1079 1080 1081 if (@GetString("Item.Area.BackgroundFixed") == "True") 1082 { 1083 GeneralSettings.Background.Position = "fixed"; 1084 } 1085 else 1086 { 1087 GeneralSettings.Background.Position = ""; 1088 } 1089 1090 1091 if (GeneralSettings.Background.Image == "none") 1092 { 1093 GeneralSettings.Background.Style = ""; 1094 } 1095 else if (GeneralSettings.Background.Image == "custom") 1096 { 1097 if (!string.IsNullOrWhiteSpace(GeneralSettings.Background.CustomImage)) 1098 { 1099 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; "; 1100 } 1101 } 1102 else 1103 { 1104 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; "; 1105 } 1106 1107 1108 //Headings settings 1109 GeneralSettings.Headings.Mode = GetString("Item.Area.AdvHeadingsMode"); 1110 1111 1112 //Site settings 1113 GeneralSettings.Site.Shadow = GetBoolean("Item.Area.BackgroundSiteShadow"); 1114 GeneralSettings.Site.LayoutMode = GetString("Item.Area.LayoutMode"); 1115 1116 if (GeneralSettings.Site.LayoutMode == "boxed"){ 1117 GeneralSettings.Site.LayoutMode = "body-" + GeneralSettings.Site.LayoutMode; 1118 GeneralSettings.Header.Classes += " header-boxed"; 1119 } 1120 1121 1122 //Image settings 1123 GeneralSettings.Images.RoundCorners = GetBoolean("Item.Area.LayoutRoundCorners"); 1124 1125 //Ecommerce settings 1126 GeneralSettings.Ecommerce.EcomListDesign = GetString("Item.Area.EcommerceProductCardDesign"); 1127 GeneralSettings.Ecommerce.EcomCardDesign = GetString("Item.Area.EcommerceProductCardDesign"); 1128 } 1129 1130 public string GetGeneralCSS() 1131 { 1132 string CssString = ""; 1133 int SelectionWeight = GeneralSettings.Navigation.SelectionWeight; 1134 1135 //Site settings 1136 if (GetString("Item.Area.LogoFont.Color.Color") == "#FFF" || GetString("Item.Area.LogoFont.Color.Color") == "#FFFFFF") 1137 { 1138 int offset = ImageHeight()+28; 1139 1140 CssString += @" 1141 .dw-offsetmenu-logo { 1142 color: #333 !important; 1143 }"; 1144 } 1145 1146 if (!string.IsNullOrWhiteSpace(GeneralSettings.Background.Color)) 1147 { 1148 CssString += @" 1149 body { 1150 background-color: " + GeneralSettings.Background.Color + @"; 1151 background-size: cover; 1152 overflow-y: scroll; 1153 }"; 1154 } 1155 1156 if (GeneralSettings.Background.GradientColor) 1157 { 1158 CssString += @" 1159 body { 1160 background: -webkit-linear-gradient(bottom, rgba(0, 0, 0, 0." + GeneralSettings.Background.GradientPercentage + @") 0%, rgba(0, 0, 0, 0) 100%); 1161 background: -o-linear-gradient(bottom, rgba(0, 0, 0, 0." + GeneralSettings.Background.GradientPercentage + @") 0%, rgba(0, 0, 0, 0) 100%); 1162 background: -ms-linear-gradient(bottom, rgba(0, 0, 0, 0." + GeneralSettings.Background.GradientPercentage + @") 0%, rgba(0, 0, 0, 0) 100%); 1163 background: -moz-linear-gradient(bottom, rgba(0, 0, 0, 0." + GeneralSettings.Background.GradientPercentage + @") 0%, rgba(0, 0, 0, 0) 100%); 1164 background: linear-gradient(to top, rgba(0, 0, 0, 0." + GeneralSettings.Background.GradientPercentage + @") 0%, rgba(0, 0, 0, 0) 100%); 1165 background-attachment: fixed; 1166 background-color: " + GeneralSettings.Background.Color + @" !important; 1167 }"; 1168 } 1169 1170 if (GeneralSettings.Site.Shadow) 1171 { 1172 CssString += @" 1173 .shad { 1174 -webkit-box-shadow: 0px 0px 8px 0px rgba(50, 50, 50, 0.75); 1175 -moz-box-shadow: 0px 0px 8px 0px rgba(50, 50, 50, 0.75); 1176 box-shadow: 0px 0px 8px 0px rgba(50, 50, 50, 0.75); 1177 }"; 1178 } 1179 1180 //Image settings 1181 if (GeneralSettings.Images.RoundCorners) 1182 { 1183 CssString += @" 1184 .content-image { 1185 border-radius: 6px; 1186 -webkit-border-radius: 6px; 1187 -moz-border-radius: 6px; 1188 }"; 1189 } 1190 1191 //Navbar and header custom settings 1192 if (GeneralSettings.Header.Mode == "cover") 1193 { 1194 CssString += @" 1195 .navbar-wp { 1196 background-color: none !important; 1197 }"; 1198 1199 if (!GeneralSettings.Header.Show || GeneralSettings.Header.Mode == "mobile") 1200 { 1201 CssString += @" 1202 .header-cover .navbar-wp { 1203 top: 0px !important; 1204 }"; 1205 } 1206 } 1207 else 1208 { 1209 if (GeneralSettings.Header.Show) 1210 { 1211 CssString += @" 1212 .navbar-wp.affix .navbar-nav > li > a { 1213 padding: 16px 16px !important; 1214 }"; 1215 } 1216 } 1217 1218 if (GeneralSettings.Header.Background == "colorline") 1219 { 1220 CssString += @" 1221 .navbar-wp, .navbar-wp.affix { 1222 border-bottom: 4px solid " + ColorSettings.Color.Primary + @" !important; 1223 } 1224 1225 .navbar-wp.affix, .navbar-wp.affix .navbar-nav > li > a { 1226 background-color: #FFF; 1227 color: #333; 1228 } 1229 1230 .navbar-wp.affix .navbar-nav > .active > a, .navbar-wp.affix .navbar-nav > li > a:hover, .navbar-wp.affix .navbar-nav > li > a:focus { 1231 color: " + ColorSettings.Color.NavbarFont + @"; 1232 } 1233 1234 .affix .dw-logotext, .affix .dw-slogantext, .dw-header-sm-title, .dw-offsetmenu-logo { 1235 color: " + GeneralSettings.Logo.SecondaryColor + @" !important; 1236 }"; 1237 } else if (GeneralSettings.Header.Background == "neutral") 1238 { 1239 CssString += @" 1240 .navbar-wp, .navbar-wp.affix, .navbar-wp .navbar-nav > li > a { 1241 background-color: #f1f1f1; 1242 } 1243 1244 .navbar-wp.affix, .navbar-wp.affix .navbar-nav > li > a { 1245 color: #333; 1246 } 1247 1248 .navbar-wp.affix .navbar-nav > .active > a, .navbar-wp.affix .navbar-nav > li > a:hover, .navbar-wp.affix .navbar-nav > li > a:focus { 1249 color: " + ColorSettings.Color.NavbarFont + @"; 1250 } 1251 1252 .affix .dw-logotext, .affix .dw-slogantext, .dw-header-sm-title, .dw-offsetmenu-logo { 1253 color: " + GeneralSettings.Logo.SecondaryColor + @" !important; 1254 }"; 1255 } 1256 else if (GeneralSettings.Header.Background == "transparent") 1257 { 1258 CssString += @" 1259 .navbar-wp, .navbar-wp.affix { 1260 background-color: #FFF; 1261 opacity: 0.9; 1262 filter: alpha(opacity=90); /* For IE8 and earlier */ 1263 } 1264 1265 .navbar-wp.affix, .navbar-wp.affix .navbar-nav > li > a { 1266 color: #333; 1267 } 1268 1269 .navbar-wp.affix .navbar-nav > .active > a, .navbar-wp.affix .navbar-nav > li > a:hover, .navbar-wp.affix .navbar-nav > li > a:focus { 1270 color: " + ColorSettings.Color.NavbarFont + @"; 1271 } 1272 1273 .affix .dw-logotext, .affix .dw-slogantext, .dw-header-sm-title, .dw-offsetmenu-logo { 1274 color: " + GeneralSettings.Logo.SecondaryColor + @" !important; 1275 }"; 1276 } 1277 else 1278 { 1279 CssString += @" 1280 .navbar-wp, .navbar-wp.affix, .navbar-wp .navbar-nav > li > a { 1281 background-color: " + ColorSettings.Color.Secondary + @"; 1282 } 1283 1284 .affix .dw-logotext, .affix .dw-slogantext, .dw-header-sm-title, .dw-offsetmenu-logo { 1285 color: " + GeneralSettings.Logo.SecondaryColor + @" !important; 1286 }"; 1287 } 1288 1289 if (GeneralSettings.Navigation.SelectionMode == "background" || GeneralSettings.Navigation.SelectionMode == "arrow"){ 1290 CssString += NavbarPosition(false, SelectionWeight); 1291 1292 CssString += @" 1293 .dw-navbar-button > a { 1294 background-color: transparent !important; 1295 } 1296 1297 .dw-navbar-button > a:hover, dw-navbar-button > a:active, dw-navbar-button > a:focus, .active > a { 1298 background-color: " + ColorSettings.Color.Primary + @" !important; 1299 }"; 1300 } 1301 1302 if (GeneralSettings.Navigation.SelectionMode == "underline"){ 1303 CssString += NavbarPosition(true); 1304 1305 CssString += ClearBackground(); 1306 1307 CssString += @" 1308 .dw-navbar-button > a span:after { 1309 position: absolute; 1310 content: ''; 1311 left: 0px; 1312 bottom: 0px; 1313 height: " + SelectionWeight + @"px; 1314 width: 100%; 1315 transform: scaleX(0); 1316 transition: all 0.3s ease-in-out 0s; 1317 } 1318 .dw-navbar-button > a:hover, dw-navbar-button > a:active, dw-navbar-button > a:focus, .active > a { 1319 color: " + ColorSettings.Color.Primary + @" !important; 1320 } 1321 1322 .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 { 1323 color: " + ColorSettings.Color.Primary + @" !important; 1324 transform: scaleX(1); 1325 transition: all 0.3s ease-in-out 0s; 1326 }"; 1327 } 1328 1329 if (GeneralSettings.Navigation.SelectionMode == "boxed"){ 1330 CssString += NavbarPosition(true, SelectionWeight); 1331 1332 CssString += @" 1333 .dw-navbar-button > a { 1334 background-color: transparent !important; 1335 } 1336 1337 .dw-navbar-button > a:hover, dw-navbar-button > a:active, dw-navbar-button > a:focus, .active > a { 1338 background-color: " + ColorSettings.Color.Primary + @" !important; 1339 transition: all 0.3s ease-in-out 0s; 1340 }"; 1341 } 1342 1343 if (GeneralSettings.Navigation.SelectionMode == "border"){ 1344 CssString += NavbarPosition(true, 6, SelectionWeight); 1345 1346 CssString += ClearBackground(); 1347 1348 CssString += @" 1349 .dw-navbar-button > a { 1350 border: " + SelectionWeight + @"px solid transparent !important; transition: None !important; 1351 } 1352 1353 .dw-navbar-button > a:hover, dw-navbar-button > a:active, dw-navbar-button > a:focus, .active > a { 1354 border-width: " + SelectionWeight + @"px !important; 1355 border-color: " + ColorSettings.Color.Primary + @" !important; 1356 transition: all 0.3s ease-in-out 0s; 1357 }"; 1358 } 1359 1360 if (GeneralSettings.Navigation.SelectionMode == "font"){ 1361 CssString += NavbarPosition(); 1362 1363 CssString += ClearBackground(); 1364 1365 SelectionWeight = (SelectionWeight*100); 1366 1367 CssString += @" 1368 .dw-navbar-button > a:hover, dw-navbar-button > a:active, dw-navbar-button > a:focus, .active > a { 1369 color: " + ColorSettings.Color.Primary + @" !important; 1370 font-weight: " + SelectionWeight + @" !important; 1371 transition: all 0.3s ease-in-out 0s; 1372 }"; 1373 } 1374 1375 if (GeneralSettings.Navigation.Case){ 1376 CssString += @" 1377 .dw-navbar-button > a { 1378 text-transform: uppercase !important; 1379 }"; 1380 } 1381 else 1382 { 1383 CssString += @" 1384 .dw-navbar-button > a { 1385 text-transform: none !important; 1386 }"; 1387 } 1388 1389 1390 //Breadcrumb custom settings 1391 if (GeneralSettings.Navigation.BreadcrumbMode == "light") 1392 { 1393 CssString += @" 1394 .pg-opt { 1395 border-bottom: 0px; 1396 background: none repeat scroll 0% 0% #FFF; 1397 } 1398 1399 .dw-breadcrumb-title { 1400 font-size: 14px !important; 1401 padding: 5px 0px 5px 0px !important; 1402 } 1403 1404 .dw-breadcrumb { 1405 padding: 5px 0px 5px 0px !important; 1406 }"; 1407 } 1408 1409 if (GeneralSettings.Navigation.BreadcrumbMode == "normal") 1410 { 1411 CssString += @" 1412 .dw-breadcrumb-title { 1413 font-size: 14px !important; 1414 padding: 5px 0px 5px 0px !important; 1415 } 1416 1417 .dw-breadcrumb a, .pg-opt .breadcrumb { 1418 padding: 5px !important; 1419 }"; 1420 } 1421 1422 if (GeneralSettings.Navigation.BreadcrumbMode == "large") 1423 { 1424 CssString += @" 1425 .dw-breadcrumb-title { 1426 font-size: 22px !important; 1427 padding: 15px 0px 15px 0px !important; 1428 } 1429 1430 .dw-breadcrumb { 1431 padding: 15px !important; 1432 }"; 1433 } 1434 1435 1436 if (GeneralSettings.Navigation.BreadcrumbAlign == "right") 1437 { 1438 CssString += @" 1439 .dw-breadcrumb { 1440 float: right !important; 1441 }"; 1442 } 1443 else 1444 { 1445 CssString += @" 1446 .dw-breadcrumb { 1447 float: left !important; 1448 }"; 1449 } 1450 1451 1452 //Left menu custom settings 1453 if (GeneralSettings.Navigation.LeftmenuMode == "light" || GeneralSettings.Navigation.LeftmenuMode == "light-color") 1454 { 1455 CssString += @" 1456 ul.dw-categories > li > ul > li > a { 1457 padding: 5px 35px; 1458 } 1459 1460 ul.dw-categories, ul.dw-categories > li, ul.dw-categories > li > ul > li { 1461 border: 0px solid #EEE; 1462 } 1463 1464 ul.dw-categories > li > ul { 1465 background: none repeat scroll 0% 0% #FFF; 1466 } 1467 1468 ul.dw-categories li a:hover, ul.dw-categories li a:focus, ul.dw-categories li a:active { 1469 background-color: #FFF !important; 1470 color: " + ColorSettings.Color.Primary + @" !important; 1471 } 1472 1473 .list-active, .list-active > a { 1474 background-color: #FFF; 1475 color: " + ColorSettings.Color.Primary + @" !important; 1476 } 1477 1478 .list-open-active { 1479 background-color: #FFF; 1480 color: " + ColorSettings.Color.Primary + @" !important; 1481 }"; 1482 } 1483 1484 if (GeneralSettings.Navigation.LeftmenuMode == "lines") 1485 { 1486 CssString += @" 1487 ul.dw-categories > li { 1488 border-bottom: 1px solid #EEE; 1489 } 1490 1491 ul.dw-categories { 1492 border: 0px solid #EEE; 1493 } 1494 1495 ul.dw-categories > li > ul { 1496 background: none repeat scroll 0% 0% #FFF; 1497 } 1498 1499 ul.dw-categories li a:hover, a:focus, a:active { 1500 background-color: #FFF !important; 1501 color: " + ColorSettings.Color.Primary + @" !important; 1502 } 1503 1504 .list-active, .list-active > a { 1505 background-color: #FFF; 1506 color: " + ColorSettings.Color.Primary + @" !important; 1507 } 1508 1509 .list-open-active { 1510 background-color: #FFF; 1511 color: " + ColorSettings.Color.Primary + @" !important; 1512 }"; 1513 } 1514 1515 if (GeneralSettings.Navigation.LeftmenuMode == "boxed") 1516 { 1517 CssString += @" 1518 ul.dw-categories, ul.dw-categories > li, ul.dw-categories > li > ul > li { 1519 border: 0px solid #EEE; 1520 } 1521 1522 .list-active, .list-active > a { 1523 background-color: " + ColorSettings.Color.Primary + @" !important; 1524 color: #FFF; 1525 }"; 1526 } 1527 1528 if (GeneralSettings.Navigation.LeftmenuMode == "border") 1529 { 1530 CssString += @" 1531 ul.dw-categories > li { 1532 border: 1px solid #EEE; 1533 } 1534 1535 ul.dw-categories > li > ul > li { 1536 border-top: 1px solid #EEE; 1537 } 1538 1539 .list-active, .list-active > a { 1540 background-color: " + ColorSettings.Color.Primary + @" !important; 1541 color: #FFF; 1542 }"; 1543 } 1544 1545 if (GeneralSettings.Navigation.LeftmenuMode == "light-color") 1546 { 1547 CssString += @" 1548 ul.dw-categories li a:hover, ul.dw-categories a:focus, ul.dw-categories a:active { 1549 border-left: 6px solid " + ColorSettings.Color.Primary + @"; 1550 } 1551 1552 ul.dw-categories .list-active > a { 1553 border-left: 6px solid " + ColorSettings.Color.Primary + @"; 1554 } 1555 1556 .btn-dw:hover, .btn-dw:focus, .btn-dw:active { 1557 1558 }"; 1559 } 1560 1561 1562 //Buttons custom designs 1563 if (GeneralSettings.Navigation.ButtonDesign == "light-rounded") 1564 { 1565 CssString += @" 1566 .btn-dw-primary, .btn-dw-secondary, .btn-dw-cart { 1567 border-width: 0px; 1568 } 1569 1570 .btn-dw-primary:hover, .btn-dw-primary:focus, .btn-dw-primary:active { 1571 background-color: #000; 1572 color: #FFF; 1573 border-width: 0px; 1574 } 1575 1576 .btn-dw-secondary:hover, .btn-dw-secondary:focus, .btn-dw-secondary:active { 1577 background-color: " + ColorSettings.Color.Primary + @"; 1578 color: #FFF; 1579 border-width: 0px; 1580 } 1581 1582 .btn-dw-cart:hover, .btn-dw-cart:focus, .btn-dw-cart:active { 1583 background-color: " + GetString("Item.Area.EcommerceCartButtonColor.Color") + @"; 1584 color: #FFF; 1585 border-width: 0px; 1586 }"; 1587 } 1588 1589 if (GeneralSettings.Navigation.ButtonDesign == "corners") 1590 { 1591 CssString += @" 1592 .btn-dw-primary, .btn-dw-secondary, btn-dw-cart , .btn-dw-cart { 1593 border-radius: 0px !important; 1594 border-width: 0px; 1595 } 1596 1597 .btn-dw-primary:hover, .btn-dw-primary:focus, .btn-dw-primary:active { 1598 background-color: " + ColorSettings.Color.Secondary + @"; 1599 color: #FFF; 1600 border-width: 0px; 1601 } 1602 1603 .btn-dw-secondary:hover, .btn-dw-secondary:focus, .btn-dw-secondary:active { 1604 background-color: " + ColorSettings.Color.Primary + @"; 1605 color: #FFF; 1606 border-width: 0px; 1607 } 1608 1609 .btn-dw-cart:hover, .btn-dw-cart:focus, .btn-dw-cart:active { 1610 background-color: " + GetString("Item.Area.EcommerceCartButtonColor.Color") + @"; 1611 color: #FFF; 1612 border-width: 0px; 1613 }"; 1614 } 1615 1616 if (GeneralSettings.Navigation.ButtonDesign == "round") 1617 { 1618 CssString += @" 1619 .btn-dw-primary, .btn-dw-secondary, .btn-dw-cart { 1620 padding: 5px 15px; 1621 border-radius: 200px !important; 1622 border-width: 0px !important; 1623 } 1624 1625 .btn-dw-primary:hover, .btn-dw-primary:focus, .btn-dw-primary:active { 1626 background-color: " + ColorSettings.Color.Secondary + @"; 1627 color: #FFF; 1628 border-width: 0px !important; 1629 } 1630 1631 .btn-dw-secondary:hover, .btn-dw-secondary:focus, .btn-dw-secondary:active { 1632 background-color: " + ColorSettings.Color.Primary + @"; 1633 color: #FFF; 1634 border-width: 0px !important; 1635 } 1636 1637 .btn-dw-cart:hover, .btn-dw-cart:focus, .btn-dw-cart:active { 1638 background-color: " + GetString("Item.Area.EcommerceCartButtonColor.Color") + @"; 1639 color: #FFF; 1640 border-width: 0px !important; 1641 }"; 1642 } 1643 1644 if (GeneralSettings.Navigation.ButtonDesign == "border") 1645 { 1646 CssString += @" 1647 .btn-dw-primary, .btn-dw-secondary, .btn-dw-cart { 1648 background-color: transparent; 1649 } 1650 1651 .btn-dw-primary { 1652 border-width: 4px; 1653 padding: 3px 10px; 1654 color: " + ColorSettings.Color.Primary + @"; 1655 } 1656 1657 .btn-dw-secondary { 1658 border-width: 2px; 1659 color: " + ColorSettings.Color.Secondary + @"; 1660 } 1661 1662 .btn-dw-cart { 1663 border-width: 4px; 1664 padding: 3px 10px; 1665 color: " + GetString("Item.Area.EcommerceCartButtonColor.Color") + @"; 1666 } 1667 1668 .btn-dw-primary:hover, .btn-dw-primary:focus, .btn-dw-primary:active { 1669 background-color: " + ColorSettings.Color.Primary + @"; 1670 border-width: 4px; 1671 padding: 3px 10px; 1672 border-color: " + ColorSettings.Color.Primary + @"; 1673 color: #FFF; 1674 } 1675 1676 .btn-dw-secondary:hover, .btn-dw-secondary:focus, .btn-dw-secondary:active { 1677 background-color: " + ColorSettings.Color.Primary + @"; 1678 border-width: 2px; 1679 color: #FFF; 1680 border-color: #FFF; 1681 } 1682 1683 .btn-dw-cart:hover, .btn-dw-cart:focus, .btn-dw-cart:active { 1684 background-color: " + GetString("Item.Area.EcommerceCartButtonColor.Color") + @"; 1685 border-width: 4px; 1686 padding: 3px 10px; 1687 border-color: " + GetString("Item.Area.EcommerceCartButtonColor.Color") + @"; 1688 color: #FFF; 1689 }"; 1690 } 1691 1692 if (GeneralSettings.Navigation.ButtonDesign == "border-sharp" || GeneralSettings.Navigation.ButtonDesign == "border-round") 1693 { 1694 CssString += @" 1695 .btn-dw-primary, .btn-dw-secondary, .btn-dw-cart { 1696 background-color: transparent; 1697 } 1698 1699 .btn-dw-primary { 1700 border-width: 4px; 1701 padding: 3px 15px; 1702 color: " + ColorSettings.Color.Primary + @"; 1703 } 1704 1705 .btn-dw-secondary { 1706 border-width: 2px; 1707 padding: 5px 15px; 1708 color: " + ColorSettings.Color.Secondary + @"; 1709 } 1710 1711 .btn-dw-cart { 1712 border-width: 4px; 1713 padding: 3px 15px; 1714 color: " + GetString("Item.Area.EcommerceCartButtonColor.Color") + @"; 1715 } 1716 1717 .btn-dw-primary:hover, .btn-dw-primary:focus, .btn-dw-primary:active { 1718 background-color: " + ColorSettings.Color.Primary + @"; 1719 border-width: 4px; 1720 color: #FFF; 1721 padding: 3px 15px; 1722 border-color: " + ColorSettings.Color.Primary + @"; 1723 } 1724 1725 .btn-dw-secondary:hover, .btn-dw-secondary:focus, .btn-dw-secondary:active { 1726 background-color: " + ColorSettings.Color.Primary + @"; 1727 border-width: 2px; 1728 color: #FFF; 1729 padding: 5px 15px; 1730 border-color: #FFF; 1731 } 1732 1733 .btn-dw-cart:hover, .btn-dw-cart:focus, .btn-dw-cart:active { 1734 background-color: " + GetString("Item.Area.EcommerceCartButtonColor.Color") + @"; 1735 border-width: 4px; 1736 color: #FFF; 1737 padding: 3px 15px; 1738 border-color: " + GetString("Item.Area.EcommerceCartButtonColor.Color") + @"; 1739 }"; 1740 } 1741 1742 if (GeneralSettings.Navigation.ButtonDesign == "border-sharp") 1743 { 1744 CssString += @" 1745 .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 { 1746 border-radius: 0px !important; 1747 }"; 1748 } 1749 1750 if (GeneralSettings.Navigation.ButtonDesign == "border-round") 1751 { 1752 CssString += @" 1753 .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 { 1754 border-radius: 200px !important; 1755 }"; 1756 } 1757 1758 1759 //Headings custom settings 1760 if (GeneralSettings.Headings.Mode == "underline") 1761 { 1762 CssString += @" 1763 .dw-section-title { 1764 border-bottom: 2px solid; 1765 margin-bottom: 15px; 1766 }"; 1767 } 1768 1769 if (GeneralSettings.Headings.Mode == "boxed" || GeneralSettings.Headings.Mode == "boxed-line") 1770 { 1771 CssString += @" 1772 .dw-section-title span { 1773 background-color: " + GetString("Item.Area.HeadingsH1.Color.Color") + @"; 1774 display: inline-block; 1775 padding: 8px 16px; 1776 color: #FFF; 1777 }"; 1778 1779 if (string.IsNullOrWhiteSpace(GetString("Item.Area.HeadingsH1.Color.Color"))) 1780 { 1781 CssString += @" 1782 .dw-section-title { 1783 background-color: " + ColorSettings.Color.Primary + @"; 1784 }"; 1785 } 1786 } 1787 1788 if (GeneralSettings.Headings.Mode == "boxed-line") 1789 { 1790 CssString += @" 1791 .dw-section-title span { 1792 margin-bottom: 2px; 1793 } 1794 1795 .dw-section-title { 1796 border-bottom: 2px solid " + GetString("Item.Area.HeadingsH1.Color.Color") + @"; 1797 margin-bottom: 10px; 1798 }"; 1799 1800 if (string.IsNullOrWhiteSpace(GetString("Item.Area.HeadingsH1.Color.Color"))) 1801 { 1802 CssString += @" 1803 .dw-section-title { 1804 border-bottom: 2px solid " + ColorSettings.Color.Primary + @"; 1805 }"; 1806 } 1807 } 1808 1809 if (GeneralSettings.Headings.Mode == "outline") 1810 { 1811 CssString += @" 1812 .dw-section-title { 1813 color: #FFF; 1814 text-shadow: 1815 -1px -1px 0 " + GetString("Item.Area.HeadingsH1.Color.Color") + @", 1816 1px -1px 0 " + GetString("Item.Area.HeadingsH1.Color.Color") + @", 1817 -1px 1px 0 " + GetString("Item.Area.HeadingsH1.Color.Color") + @", 1818 1px 1px 0 " + GetString("Item.Area.HeadingsH1.Color.Color") + @"; 1819 }"; 1820 1821 if (string.IsNullOrWhiteSpace(GetString("Item.Area.HeadingsH1.Color.Color"))) 1822 { 1823 CssString += @" 1824 .dw-section-title { 1825 text-shadow: 1826 -1px -1px 0 #1A1A1A, 1827 1px -1px 0 #1A1A1A, 1828 -1px 1px 0 #1A1A1A, 1829 1px 1px 0 #1A1A1A; 1830 }"; 1831 } 1832 } 1833 1834 if (GeneralSettings.Headings.Mode == "backline") 1835 { 1836 CssString += @" 1837 .dw-section-title { 1838 text-align: center; 1839 border-bottom: 2px solid; 1840 padding: 0; 1841 margin: 50px 0 30px; 1842 line-height: 0em !important; 1843 } 1844 1845 .dw-section-title > span { 1846 background-color: #FFF; 1847 padding: 0 16px; 1848 } 1849 1850 .dw-section-title-small { 1851 margin: 8px 0 20px; 1852 }"; 1853 } 1854 1855 if (GeneralSettings.Ecommerce.EcomCardDesign == "one") 1856 { 1857 1858 } 1859 1860 if (GeneralSettings.Ecommerce.EcomCardDesign == "two") 1861 { 1862 CssString += @" 1863 .product { 1864 border: 1px solid #E5E5E5; 1865 }"; 1866 } 1867 1868 return CssString; 1869 } 1870 1871 private string ClearBackground() { 1872 string CssString = ""; 1873 1874 CssString += @" 1875 .dw-navbar-button > a { 1876 background-color: rgba(0, 0, 0, 0.0) !important; 1877 } 1878 1879 .dw-navbar-button > a:hover, dw-navbar-button > a:active, dw-navbar-button > a:focus, .active > a { 1880 background-color: rgba(0, 0, 0, 0.0) !important; 1881 }"; 1882 1883 return CssString; 1884 } 1885 1886 private string NavbarPosition(bool margin=false, int specialpadding=6, int extramargin=0) { 1887 int LogoHeight = 0; 1888 string CssString = ""; 1889 int Centerpos = 0; 1890 1891 if (GeneralSettings.Header.Mode != "solid"){ 1892 if (!string.IsNullOrWhiteSpace(GeneralSettings.Logo.Image)) 1893 { 1894 LogoHeight = ImageHeight(); 1895 } 1896 else 1897 { 1898 LogoHeight = GetInteger("Item.Area.LogoFont.Size"); 1899 } 1900 } 1901 else 1902 { 1903 if (!string.IsNullOrWhiteSpace(GeneralSettings.Logo.Image)) 1904 { 1905 LogoHeight = 18; 1906 } 1907 else 1908 { 1909 LogoHeight = GetInteger("Item.Area.LogoFont.Size")-10; 1910 } 1911 } 1912 1913 if (margin == false) 1914 { 1915 Centerpos = (LogoHeight/2) + 6; 1916 1917 CssString += @" 1918 .dw-navbar-button > a, .navbar-wp.affix .navbar-nav > li > a { 1919 padding: " + Centerpos + @"px " + (specialpadding+4) + @"px " + Centerpos + @"px " + (specialpadding+4) + @"px !important; 1920 margin: " + extramargin + @"px " + extramargin + @"px !important; 1921 }"; 1922 } 1923 else 1924 { 1925 Centerpos = ((LogoHeight/2)+6)-(specialpadding+extramargin); 1926 1927 CssString += @" 1928 .dw-navbar-button > a, .navbar-wp.affix .navbar-nav > li > a { 1929 padding: " + specialpadding + @"px " + (specialpadding+4) + @"px " + specialpadding + @"px " + (specialpadding+4) + @"px !important; 1930 margin: " + Centerpos + @"px 4px 0px 0px !important; 1931 }"; 1932 } 1933 1934 return CssString; 1935 } 1936 1937 private int ImageHeight () 1938 { 1939 int LogoHeight = 0; 1940 1941 if (!string.IsNullOrWhiteSpace(GetString("Item.Area.GeneralLogo"))) 1942 { 1943 string imageUrl = "http://" + HttpContext.Current.Request.Url.Authority + GetString("Item.Area.GeneralLogo"); 1944 1945 WebRequest request = WebRequest.Create(imageUrl); 1946 WebResponse response = request.GetResponse(); 1947 Image image = Image.FromStream(response.GetResponseStream()); 1948 1949 LogoHeight = image.Height; 1950 } 1951 else 1952 { 1953 LogoHeight = 38; 1954 } 1955 1956 return LogoHeight; 1957 } 1958 } 1959 1960 1961 1962 @{ 1963 InitGeneralSettings(); 1964 } 1965 1966 @if (writeCss) 1967 { 1968 css += FontStylesCSS() + "/*Colors*/" + Environment.NewLine + GetColorSettings() + Environment.NewLine + "/*General*/" + Environment.NewLine + GetGeneralCSS(); 1969 Dynamicweb.Core.Helpers.TextFileHelper.WriteTextFile(css, HttpContext.Current.Server.MapPath("/Files/Templates/Designs/Dwsimple/css/DWGlobalStylesSite" + GetString("DwAreaID") + "_auto.css"), false); 1970 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); 1971 Dynamicweb.Core.Helpers.TextFileHelper.WriteTextFile(RemoveWhiteSpaceFromStylesheets(css), cssPath, false); 1972 } 1973 1974 @functions{ 1975 public static string RemoveWhiteSpaceFromStylesheets(string body) 1976 { 1977 body = Regex.Replace(body, @"[a-zA-Z]+#", "#"); 1978 body = Regex.Replace(body, @"[\n\r]+\s*", string.Empty); 1979 body = Regex.Replace(body, @"\s+", " "); 1980 body = Regex.Replace(body, @"\s?([:,;{}])\s?", "$1"); 1981 body = body.Replace(";}", "}"); 1982 body = Regex.Replace(body, @"([\s:]0)(px|pt|%|em)", "$1"); 1983 // Remove comments from CSS 1984 body = Regex.Replace(body, @"/\*[\d\D]*?\*/", string.Empty); 1985 return body; 1986 } 1987 } 1988 1989 <!-- Template styles --> 1990 <link id="dwStylesheet" type="text/css" href="/Files/Templates/Designs/Dwsimple/css/DWGlobalStyles.min.css" rel="stylesheet" media="screen"> 1991 <link rel="stylesheet" type="text/css" href="/Files/Templates/Designs/Dwsimple/css/invoice.css"> 1992 1993 @{ string cssAutoPath = "/Files/Templates/Designs/Dwsimple/css/DWGlobalStylesSite" + GetString("DwAreaID") + "_auto.min.css?t=@areaUpdated.Ticks"; } 1994 1995 <link type="text/css" href="@cssAutoPath" rel="stylesheet"> 1996 1997 <link id="dwAdaptiveStylesheet" type="text/css" href="/Files/Templates/Designs/Dwsimple/css/timeline.css" rel="stylesheet" media="screen"> 1998 1999 <!-- Analytics code --> 2000 @GetValue("Item.Area.OtherAnalyticsCode") 2001 2002 @GetValue("Stylesheets") 2003 @GetValue("Javascripts") 2004 </head> 2005 <body style="@GeneralSettings.Background.Style" id="sitecontent"> 2006 <!-- MODALS --> 2007 <div class="modal fade" id="login" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> 2008 <div class="modal-dialog modal-sm"> 2009 <div class="modal-content"> 2010 <div class="modal-header"> 2011 <h4 class="modal-title" id="myModalLabel">@Translate("Login", "Login")</h4> 2012 </div> 2013 <form role="form" id="loginform" method="post"> 2014 <div class="modal-body"> 2015 @if (!string.IsNullOrWhiteSpace(GetString("DW_extranet_error_uk"))) 2016 { 2017 <script>alert("@GetValue("DW_extranet_error_uk")");</script> 2018 } 2019 2020 <input type="hidden" name="ID" value="@Pageview.ID"> 2021 <input type="hidden" name="DWExtranetUsernameRemember" value="True"> 2022 <input type="hidden" name="DWExtranetPasswordRemember" value="True"> 2023 <div class="form-group"> 2024 @{ attrValue = Translate("Enter username", "Enter username"); 2025 var username2 = @GetValue("DWExtranetUsername"); 2026 } 2027 2028 <label for="username">@Translate("Email address", "Email address")</label> 2029 <input type="text" class="form-control" name="username" id="username" placeholder="@attrValue" value="@username2"> 2030 </div> 2031 <div class="form-group"> 2032 @{ attrValue = Translate("Enter password", "Enter password"); 2033 } 2034 2035 <label for="password">@Translate("Password", "Password")</label> 2036 <input type="password" class="form-control" name="password" id="password" placeholder="@attrValue"> 2037 <p>&nbsp;</p> 2038 <a class="pull-left" href="/Default.aspx?ID=@firstpageid&LoginAction=Recovery">@Translate("Forgot your password?", "Forgot your password?")</a> 2039 &nbsp; 2040 </div> 2041 </div> 2042 <div class="modal-footer"> 2043 <div class="row"> 2044 <div class="col-md-12"> 2045 <div class="checkbox pull-left"> 2046 <label> 2047 <input type="checkbox" name="Autologin" checked="checked" value="True"> @Translate("Remember me", "Remember me") 2048 </label> 2049 </div> 2050 <button type="submit" class="btn btn-xs btn-base pull-right">@Translate("Sign in", "Sign in")</button> 2051 </div> 2052 </div> 2053 </div> 2054 @if (GetLoop("DWExtranetExternalLoginProviders").Count != 0) 2055 { 2056 <div class="modal-footer"> 2057 <div class="row"> 2058 <div class="col-md-12"> 2059 <div class="pull-left">@Translate("Or sign in using", "Or sign in using"):</div> 2060 <p>&nbsp;</p> 2061 </div> 2062 </div> 2063 2064 <div class="row"> 2065 <div class="col-md-12"> 2066 @foreach (LoopItem LoginProvider in GetLoop("DWExtranetExternalLoginProviders")) 2067 { 2068 var ProviderName = LoginProvider.GetString("ProviderName").ToLower(); 2069 var ProviderID = LoginProvider.GetValue("ProviderID"); 2070 <a href='/Admin/Public/Social/ExternalLogin.aspx?action=login&amp;providerID=@ProviderID' class="btn btn-xs btn-base pull-left"><i class="fa fa-@ProviderName"></i>@LoginProvider.GetString("ProviderName")</a><text>&nbsp;&nbsp;&nbsp;</text> 2071 } 2072 </div> 2073 </div> 2074 </div> 2075 } 2076 </form> 2077 </div> 2078 </div> 2079 </div> 2080 <!-- MOBILE MENU --> 2081 @{ 2082 var offsetmenuplace = "left"; 2083 2084 if (GeneralSettings.Header.Mode == "mobile"){ 2085 offsetmenuplace = GeneralSettings.Navigation.Position; 2086 } 2087 } 2088 2089 <div id="myNavmenu" class="navmenu navmenu-default navmenu-fixed-@offsetmenuplace offcanvas"> 2090 <div class="col-sm-12 col-xs-12 offcanvas-col"> 2091 <div class="row offcanvas-row">&nbsp;</div> 2092 <div class="row offcanvas-row"> 2093 <div class="col-sm-12 col-xs-12 offcanvas-col"> 2094 <a href="/Default.aspx?ID=@firstpageid" class="brand"> 2095 @if (!string.IsNullOrWhiteSpace(GeneralSettings.Logo.Image)) 2096 { 2097 <div class="img-responsive dw-offsetmenu-logo pull-left"> 2098 <img src="@GeneralSettings.Logo.Image" alt="Logo"> 2099 </div> 2100 } 2101 2102 @if (!string.IsNullOrWhiteSpace(GeneralSettings.Logo.Text)) 2103 { 2104 <div class="dw-logotext dw-offsetmenu-logo pull-left">@GeneralSettings.Logo.Text</div> 2105 } 2106 </a> 2107 </div> 2108 </div> 2109 <div class="row offcanvas-row">&nbsp;</div> 2110 </div> 2111 2112 <div class="col-sm-12 col-xs-12 offcanvas-col"> 2113 @if (GetBoolean("Item.Area.EcomEnabled")) { 2114 <div class="row offcanvas-row"> 2115 <div class="col-sm-12 col-xs-12 offcanvas-col"> 2116 <form method="get" action="Default.aspx"> 2117 <input type="hidden" name="ID" value="8399"> 2118 <div class="input-group"> 2119 <input type="text" class="form-control" name="eComQuery" tabindex="1" placeholder="Søg"> 2120 <span class="input-group-btn"> 2121 <button class="btn btn-primary" type="submit"><i class="fa fa-search"></i></button> 2122 </span> 2123 </div> 2124 </form> 2125 </div> 2126 </div> 2127 <div class="row offcanvas-row">&nbsp;</div> 2128 <div class="row offcanvas-row"> 2129 <div class="col-sm-12 col-xs-12 offcanvas-col"> 2130 @if (!Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) { 2131 <div class="pull-left"> 2132 <a href="/Login" class="btn btn-sm btn-default"><i class="fa fa-sign-in"></i> @Translate("Sign in", "Sign in")</a> 2133 </div> 2134 } 2135 2136 @if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) { 2137 <div class="pull-left"> 2138 <a href="Default.aspx?ID=8473" class="btn btn-sm btn-default"> 2139 <i class="fa fa-user"></i> <strong>@GetGlobalValue("Global:Extranet.Name")</strong> 2140 </a> 2141 </div> 2142 <div class="pull-left"> 2143 <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> 2144 </div> 2145 } 2146 </div> 2147 </div> 2148 <div class="row offcanvas-row">&nbsp;</div> 2149 } 2150 </div> 2151 2152 2153 <div class="row offcanvas-row"> 2154 <div class="col-sm-12 col-xs-12 offcanvas-col"> 2155 @GetValue("DwNavigation(drawernavigation)") 2156 </div> 2157 </div> 2158 </div> 2159 2160 <!-- HEADER AND CONTENT--> 2161 2162 <div class="body-wrap shad @GeneralSettings.Site.LayoutMode"> 2163 2164 <!-- HEADER --> 2165 <div id="divHeaderWrapper"> 2166 <header class="@GeneralSettings.Header.Classes"> 2167 2168 2169 <!-- TOP HEADER --> 2170 @if (GeneralSettings.Header.Show){ 2171 <div class="top-header img-responsive"> 2172 <a href="/home"> 2173 <div class="row"> 2174 <div class="col-md-6 logobox"> 2175 @if (GeneralSettings.Header.Mode == "solid"){ 2176 <a href="/Default.aspx?ID=@firstpageid" class="brand"> 2177 @if (!string.IsNullOrWhiteSpace(GeneralSettings.Logo.Image)) 2178 { 2179 <img class="img-responsive dw-logoimage pull-left" src="@GeneralSettings.Logo.Image" alt="Logo"> 2180 } 2181 2182 @if (!string.IsNullOrWhiteSpace(GeneralSettings.Logo.Text)) 2183 { 2184 <div class="dw-logotext pull-left">@GeneralSettings.Logo.Text</div> 2185 } 2186 </a> 2187 } 2188 </div> 2189 <div class="col-md-6 logobox"> 2190 <nav class="top-header-menu hidden-sm hidden-xs"> 2191 <ul class="top-menu"> 2192 2193 <!-- Ecommerce user menu --> 2194 @if (GetBoolean("Item.Area.EcomEnabled")) { 2195 if (!Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) 2196 { 2197 <text> 2198 <li><a href="#" data-toggle="modal" data-target="#login">@Translate("Login", "Login")</a></li> 2199 @GetValue("DwNavigation(toolsnavigationNotloggedin)") 2200 </text> 2201 } 2202 2203 if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) 2204 { 2205 <text> 2206 <li> 2207 <a href="Default.aspx?ID=8473"> 2208 <nobr> 2209 <i class="fa fa-user"></i> <strong>@GetGlobalValue("Global:Extranet.Name")</strong> 2210 </nobr> 2211 </a> 2212 </li> 2213 <li> 2214 <a href='/Admin/Public/ExtranetLogoff.aspx?ID=@currentpageid'>@Translate("Logout", "Logout")</a> 2215 </li> 2216 </text> 2217 } 2218 } 2219 2220 2221 <!-- Ecommerce Cart --> 2222 @if (GetBoolean("Item.Area.EcomEnabled")) { 2223 <li class="dropdown animate-hover" data-animate="animated fadeInUp"> 2224 <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.PriceWithVAT")</span></a> 2225 2226 <ul class="sub-menu"> 2227 <li id="minicart"> 2228 @MiniCart() 2229 </li> 2230 </ul> 2231 </li> 2232 } 2233 </ul> 2234 </nav> 2235 </div> 2236 </div> 2237 </a> 2238 </div> 2239 } 2240 2241 <!-- MAIN NAV --> 2242 @{ 2243 var sticky = GeneralSettings.Navigation.StickyMenu; 2244 var stickyTrigger = "affix"; 2245 var navbarpos = GeneralSettings.Navigation.Position; 2246 var selectionstyle = GeneralSettings.Navigation.SelectionStyle; 2247 2248 if (sticky == "off") { 2249 stickyTrigger = ""; 2250 } 2251 } 2252 2253 2254 <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"> 2255 <div class="container"> 2256 @if (GeneralSettings.Header.Mode != "solid" || !GeneralSettings.Header.Show) 2257 { 2258 <div class="navbar-header pull-@GeneralSettings.Navigation.InvertedPosition"> 2259 <div class="hidden-sm hidden-xs"> 2260 <a href="/Default.aspx?ID=@firstpageid" class="brand"> 2261 @if (!string.IsNullOrWhiteSpace(GeneralSettings.Logo.Image)) 2262 { 2263 <img class="img-responsive dw-logoimage pull-left" src="@GeneralSettings.Logo.Image" alt="Logo"> 2264 } 2265 2266 @if (!string.IsNullOrWhiteSpace(GeneralSettings.Logo.Text)) 2267 { 2268 <div class="dw-logotext pull-left">@GeneralSettings.Logo.Text</div> 2269 } 2270 </a> 2271 </div> 2272 </div> 2273 } 2274 2275 @if (GeneralSettings.Header.Mode != "mobile") 2276 { 2277 <!-- Small screen header --> 2278 <div class="hidden-md hidden-lg row"> 2279 <div class="dw-header-sm"> 2280 <div class="pull-left"> 2281 <button type="button" class="btn btn-sm btn-base" data-toggle="offcanvas" data-target="#myNavmenu" data-canvas="body"> 2282 <i class="fa fa-bars"></i> 2283 </button> 2284 &nbsp;&nbsp;&nbsp; 2285 </div> 2286 2287 <div class="pull-left"> 2288 <h2 class="dw-header-sm-title">@GetGlobalValue("Global:Page.Top.Name")</h2> 2289 </div> 2290 @if (GetBoolean("Item.Area.EcomEnabled")) 2291 { 2292 2293 <div class="pull-right"> 2294 <ul class="top-menu"> 2295 <li> 2296 <a href="Default.aspx?ID=@cartid" title="" class="btn btn-sm btn-base dw-minicart" id="minipagecart-button"><i class="fa fa-shopping-cart"></i><strong> @GetValue("Ecom:Order.OrderLines.TotalProductQuantity") <span class="amount">@GetValue("Ecom:Order.OrderLines.Total.PriceWithVAT")</span></strong></a> 2297 2298 <ul class="sub-menu hidden-xs"> 2299 <li id="smallscreen-minicart"> 2300 @MiniCart() 2301 </li> 2302 </ul> 2303 </li> 2304 </ul> 2305 </div> 2306 2307 2308 if (Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) 2309 { 2310 <div class="hidden-xs pull-right"> 2311 <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> 2312 &nbsp; 2313 </div> 2314 <div class="hidden-xs pull-right"> 2315 <a href="Default.aspx?ID=8473" class="btn btn-sm btn-base"> 2316 <i class="fa fa-user"></i> <strong>@GetGlobalValue("Global:Extranet.Name")</strong> 2317 </a> 2318 &nbsp; 2319 </div> 2320 } 2321 2322 if (!Dynamicweb.Core.Converter.ToBoolean(GetGlobalValue("Global:Extranet.UserName"))) 2323 { 2324 <div class="hidden-xs pull-right"> 2325 <a href="/Login" class="btn btn-sm btn-base"><i class="fa fa-sign-in"></i></a> 2326 &nbsp; 2327 </div> 2328 } 2329 } 2330 2331 2332 </div> 2333 </div> 2334 2335 <!-- Big screen header --> 2336 <div class="navbar-navigation"> 2337 <div class="hidden-sm hidden-xs"> 2338 <nav class="col-md-10 col-sm-10 col-xs-10 navbar-collapse collapse navbar-@navbarpos"> 2339 @GetValue("DwNavigation(topnavigation)") 2340 2341 <!-- Extra navigation when no header is shown --> 2342 @if (GetBoolean("Item.Area.EcomEnabled")) 2343 { 2344 if (!GeneralSettings.Header.Show) 2345 { 2346 <ul class="nav navbar-nav"> 2347 <li>&nbsp;&nbsp;&nbsp;</li> 2348 @if (!Dynamicweb.Core.Converter.ToBooleanLegacy(GetGlobalValue("Global:Extranet.UserName"))) 2349 { 2350 <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> 2351 <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> 2352 } 2353 2354 @if (Dynamicweb.Core.Converter.ToBooleanLegacy(GetGlobalValue("Global:Extranet.UserName"))) 2355 { 2356 <li class="dw-navbar-button"> 2357 <a href="Default.aspx?ID=8473" data-hover="dropdown"> 2358 <nobr> 2359 <strong><i class="fa fa-user"></i></strong> 2360 </nobr> 2361 <span></span> 2362 </a> 2363 </li> 2364 <li class="dw-navbar-button"> 2365 <a href="/Admin/Public/ExtranetLogoff.aspx?ID=@Pageview.Page.ID" data-hover="dropdown"><i class="fa fa-sign-out"></i><span></span></a> 2366 </li> 2367 } 2368 2369 <li class="dw-navbar-button"> 2370 <a href="Default.aspx?ID=@cartid" title="" id="nav_minipagecart" data-hover="dropdown"><i class="fa fa-shopping-cart"></i> @GetValue("Ecom:Order.OrderLines.TotalProductQuantity") <span class="amount">@GetValue("Ecom:Order.OrderLines.Total.PriceWithVAT")</span><span></span></a> 2371 </li> 2372 </ul> 2373 } 2374 2375 if (GeneralSettings.Header.Mode != "solid") 2376 { 2377 <!--<ul class="nav navbar-nav"> 2378 <li class="dropdown dropdown-aux animate-click dw-navbar-button" data-animate-in="animated bounceInUp" data-animate-out="animated fadeOutDown" style="z-index:500;"> 2379 <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown"><i class="fa fa-search"></i><span></span></a> 2380 2381 <ul class="dropdown-menu dropdown-menu-user animate-wr"> 2382 <li id="dropdownForm"> 2383 <div class="dropdown-form"> 2384 <form class="form-light p-15" role="form" method="get" action="Default.aspx"> 2385 <input type="hidden" name="ID" value="8399" /> 2386 <div class="input-group"> 2387 <input type="text" class="form-control" name="eComQuery" placeholder="@searchplaceholder"> 2388 <span class="input-group-btn"> 2389 <button class="btn btn-base" type="submit"><i class="fa fa-search"></i></button> 2390 </span> 2391 </div> 2392 </form> 2393 </div> 2394 </li> 2395 </ul> 2396 </li> 2397 </ul>--> 2398 } 2399 } 2400 </nav> 2401 </div> 2402 2403 @if (GetBoolean("Item.Area.EcomEnabled")) 2404 { 2405 if (GeneralSettings.Header.Mode == "solid" && GeneralSettings.Header.Show) 2406 { 2407 <div class="hidden-sm hidden-xs"> 2408 <div class="col-md-2 col-sm-2 col-xs-2 pull-@GeneralSettings.Navigation.InvertedPosition"> 2409 <form method="get" action="Default.aspx"> 2410 <input type="hidden" name="ID" value="8399"> 2411 <div class="input-group pull-@GeneralSettings.Navigation.InvertedPosition dw-top-search"> 2412 <input type="text" class="form-control" name="eComQuery" tabindex="1" placeholder="@searchplaceholder"> 2413 <span class="input-group-btn"> 2414 <button class="btn btn-primary" type="submit"><i class="fa fa-search"></i></button> 2415 </span> 2416 </div> 2417 </form> 2418 </div> 2419 </div> 2420 } 2421 } 2422 </div> 2423 } 2424 else 2425 { 2426 <!-- Using only mobile navigation --> 2427 <div class="pull-@GeneralSettings.Navigation.Position"> 2428 <ul class="nav navbar-nav"> 2429 <li class="dw-navbar-button" data-toggle="offcanvas" data-target="#myNavmenu" data-canvas="body"> 2430 <a><i class="fa fa-bars fa-2x"></i><span></span></a> 2431 </li> 2432 </ul> 2433 </div> 2434 } 2435 </div> 2436 </div> 2437 2438 2439 2440 @if (!string.IsNullOrWhiteSpace(GetString("Item.Area.HeaderLayoutImage"))){ 2441 if (currentpageid != firstpageid){ 2442 var coverimage = GetString("Item.Area.HeaderLayoutImage"); 2443 2444 <div class="container-fluid dw-header-image"> 2445 <div class="row"> 2446 <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> 2447 </div> 2448 </div> 2449 } 2450 } else if (GeneralSettings.Header.Mode != "solid"){ 2451 if (currentpageid != firstpageid){ 2452 <div class="container-fluid dw-header-image"> 2453 <div class="row"> 2454 <section class="carousel carousel-1 slice fluid" style="height: 160px !important; background-color: transparent; background-size: cover !important;"></section> 2455 </div> 2456 </div> 2457 } 2458 } 2459 </header> 2460 </div> 2461 2462 <!-- MAIN CONTENT --> 2463 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2464 2465 @using System.Collections.Specialized; 2466 2467 2468 @GetValue("Title(News page)") 2469 @GetValue("Description(News page with left navigation and content area 3+9)") 2470 2471 @using System.Xml.Linq; 2472 @using System.Text; 2473 @using System.Globalization; 2474 2475 @{ 2476 string siteurl = GetGlobalValue("Global:Request.Url").ToString(); 2477 string attributeValue = ""; 2478 2479 } 2480 2481 2482 2483 @if(GetBoolean("Item.Page.LayoutShowBreadcrumb")){ 2484 <div class="pg-opt pin"> 2485 <div class="container"> 2486 <div class="row"> 2487 <div class="col-lg-3 col-md-3 hidden-sm hidden-xs"> 2488 @if (GeneralSettings.Navigation.BreadcrumbMode != "light") 2489 { 2490 <div class="dw-breadcrumb-title">@GetGlobalValue("Global:Page.Top.Name")</div> 2491 } 2492 </div> 2493 <div class="col-lg-9 col-md-9 col-sm-12 col-xs-12"> 2494 @GetValue("DwNavigation(breadcrumb)") 2495 </div> 2496 </div> 2497 </div> 2498 </div> 2499 } 2500 2501 <section class="slice white animate-hover-slide"> 2502 <div class="w-section"> 2503 <div class="container"> 2504 <div class="row"> 2505 @if (GetBoolean("Item.VisTitel") != false){ 2506 if (!string.IsNullOrEmpty(GetString("Item.Titel"))) { 2507 <h1 class="dw-section-title alignCenter"> 2508 <span>@GetString("Item.Titel")</span> 2509 </h1> 2510 } 2511 } 2512 @if(!GetBoolean("Item.Page.LayoutHideleftMenu")) { 2513 <div class="col-md-3 hidden-sm hidden-xs"> 2514 <div class="widget"> 2515 <text>&nbsp;</text> 2516 @GetValue("DwNavigation(leftnavigation)") 2517 </div> 2518 </div> 2519 } 2520 2521 <div class="col-md-9 col-sm-12 col-xs-12"> 2522 <div class="post-item"> 2523 @if (!string.IsNullOrWhiteSpace(GetString("Item.GeneralImage"))) { 2524 attributeValue = GetString("Item.GeneralImage"); 2525 <div class="post-meta-top"> 2526 <div class="post-image"> 2527 <div class="img-responsive" style="background-image: url(/Admin/Public/GetImage.ashx?image=@attributeValue&width=100%&height=350&compression=90&crop=1);height:350px;background-position:bottom left; background-repeat:no-repeat"> 2528 </div> 2529 </div> 2530 </div> 2531 } 2532 <div class="post-content"> 2533 <h2 class="post-title">@GetValue("Item.Heading")</h2> 2534 <div class="clearfix"></div> 2535 2536 <div class="post-desc"> 2537 <p>@GetValue("Item.Text")</p> 2538 </div> 2539 2540 @if (GetBoolean("Item.Page.FacebookLikeButton")){ 2541 <p>&nbsp;</p> 2542 <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" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:21px;" allowtransparency="true"></iframe> 2543 } 2544 </div> 2545 </div> 2546 2547 <div class="col-md-9" dwcontent="" id="modulecontent" title="For modules"></div> 2548 2549 </div> 2550 @CalendarItem() 2551 </div> 2552 </div> 2553 </div></section> 2554 2555 @helper CalendarItem() 2556 { 2557 2558 string kalenderid = System.Web.HttpContext.Current.Request.QueryString["kalenderkonto"]; 2559 string aftaleid = System.Web.HttpContext.Current.Request.QueryString["aftaleid"]; 2560 2561 <!-- 2562 string linkstring ="http://kalender.brandsoft.dk/bska/Bska_wsekstern_pck.AftaleDetaljer?InKlientHTTP=1&InKontonr="+kalenderid+"&InAftaleID="+aftaleid; 2563 http://kalender.brandsoft.dk/bska/Bska_wsekstern_pck.AftaleDetaljer?InKlientHTTP=1&InKontonr=11&InAftaleID=64378424 2564 string linkstring = GetString("Item.FeedLink")+"&InKontonr="+GetString("Item.AccountNumber")+"&InMaksAntalAftaler="+Limit+"&InDatoFra="+StartDate+"&InDatoTil="+EndDate.ToString("dd/MM/yyyy")+"&InSognekode="+sognekode; 2565 2566 http://kalender.brandsoft.dk/bska/Bska_wsekstern_pck.AftaleDetaljer?InKlientHTTP=1 2567 string linkstring = GetString("Item.FeedLink")+"&InKontonr="+GetString("Item.AccountNumber")+"&InMaksAntalAftaler="+Limit+"&InDatoFra="+StartDate+"&InDatoTil="+EndDate.ToString("dd/MM/yyyy")+"&InSognekode="+sognekode; 2568 --> 2569 2570 string linkstring ="http://kalender.brandsoft.dk/bska/Bska_wsekstern_pck.AftaleDetaljer?InKlientHTTP=1&InKontonr="+kalenderid+"&InAftaleID="+aftaleid; 2571 XDocument xdoc = XDocument.Load(linkstring); 2572 var elements = xdoc.Element("DATA").Elements("AFTALE"); 2573 2574 foreach (var el in elements) 2575 { 2576 string id = "0"; 2577 string type = "alle"; 2578 DateTime date; 2579 string title = "Title"; 2580 string description = "Description"; 2581 string fulldate = "Date"; 2582 string cleanDate = ""; 2583 string day = ""; 2584 string month = ""; 2585 string location = ""; 2586 string document = ""; 2587 string document_type = "document"; 2588 string billede = ""; 2589 string filnavn= ""; 2590 Dictionary<string, string> domains = new Dictionary<string, string>(); 2591 2592 int docs_count=-1; 2593 2594 if (el.Elements("ID").Any()){ 2595 id = el.Element("ID").Value; 2596 } 2597 2598 if (el.Elements("AFTALETYPE").Any()){ 2599 type = el.Element("AFTALETYPE").Value; 2600 } 2601 2602 if (el.Elements("DATO_FRA").Any() && el.Elements("KL_FRA").Any()) { 2603 date = DateTime.Parse(el.Element("DATO_FRA").Value + " " + el.Element("KL_FRA").Value, new CultureInfo("da-DK")); 2604 cleanDate = date.ToString("dddd d. MMMM kl. HH:mm", new CultureInfo("da-DK")); 2605 day = date.ToString(" d", new CultureInfo("da-DK")); 2606 month = date.ToString("MMM", new CultureInfo("da-DK")); 2607 } 2608 2609 if (el.Elements("OVERSKRIFT").Any()){ 2610 title = el.Element("OVERSKRIFT").Value; 2611 } 2612 2613 if (el.Elements("BESKRIVELSE").Any()){ 2614 description = el.Element("BESKRIVELSE").Value; 2615 } 2616 2617 if (el.Elements("DATO_FORMATERET").Any()){ 2618 fulldate = el.Element("DATO_FORMATERET").Value; 2619 } 2620 2621 if (el.Elements("STED").Any()){ 2622 location = el.Element("STED").Value; 2623 } 2624 2625 IEnumerable<XElement> allGrandChildren = from elx in elements.Elements("OFFENTLIGE_DOKUMENTER").Elements() select elx; 2626 foreach (XElement elx in allGrandChildren){ 2627 2628 document = "http://kalender.brandsoft.dk/bska/" + elx.Element("URL").Value; 2629 document_type=elx.Element("DOKUMENTTYPE").Value; 2630 filnavn=elx.Element("ORG_FILNAVN").Value; 2631 2632 if (document_type == "OFFENTLIGT_AFTALE_BILLEDE"){ 2633 billede = document; 2634 } 2635 if (document_type == "OFFENTLIGT_DOKUMENT"){ 2636 domains.Add(@filnavn, @document); 2637 } 2638 2639 } 2640 <div class="row"> 2641 <div class="media col-md-12"> 2642 <div class="media-body"> 2643 2644 @if (billede != ""){ 2645 <img class="img-responsive" src="@billede" alt="" id="@(id)_img" ;="" style="max-height: 250px; float:right; position: relative;"> 2646 } 2647 <!-- else 2648 { 2649 <img class="img-responsive" src="/Files/Images/SiteImages/IntetBillede.png" alt="" id="@(id)_img"; style="max-height: 250x; float:right; position: relative;"></img> 2650 } 2651 --> 2652 @if(@type == @title) { 2653 <h3 class="dw-section-title dw-section-title-small"><span>@title</span></h3> 2654 } 2655 else { 2656 <h3 class="dw-section-title dw-section-title-small"><span>@title (@type)</span></h3> 2657 } 2658 2659 <!-- <p class="list-item-info nomargin"><i class="fa fa-fw fa-calendar-o"></i> @fulldate</p> --> 2660 <p style="margin-bottom: -3px"><i class="fa"></i><strong>Dato:</strong> @cleanDate</p> 2661 <p class="list-item-info"><i class="fa"></i><strong>Sted:</strong> @location</p> 2662 <p style="font-weight: 700; margin-bottom: -3px">Beskrivelse:</p> 2663 <p>@description</p> 2664 <br> 2665 @if (domains.Count>0) { 2666 <p style="font-weight: 700; margin-bottom: -3px">Dokumenter til download:</p> 2667 <br> 2668 2669 foreach (KeyValuePair<string, string> kvp in domains){ 2670 <div class="pull-left"> 2671 <a href="@kvp.Value" class="btn btn-info pull-right" download="">@kvp.Key</a> 2672 </div> 2673 <br><br><br> 2674 } 2675 } 2676 2677 <div class="pull-left"> 2678 <br> 2679 <a href="javascript:history.go(-1)" class="btn btn-dw-primary"> 2680 <span>Tilbage til kalenderen</span> 2681 </a> 2682 </div> 2683 </div> 2684 </div> 2685 </div> 2686 } 2687 } 2688 2689 @helper RenderImage() 2690 { 2691 if (!string.IsNullOrEmpty(GetString("Item.Image"))) 2692 { 2693 var image = System.Web.HttpContext.Current.Server.UrlEncode(GetString("Item.Image")); 2694 2695 <!-- Choosing the smallest possible width that will work with responsive sizes --> 2696 string optimizedwidth = "1280"; 2697 switch (GetString("Item.Width")){ 2698 case "12": 2699 optimizedwidth = "1280"; 2700 break; 2701 case "9": 2702 optimizedwidth = "960"; 2703 break; 2704 case "6": 2705 optimizedwidth = "722"; 2706 break; 2707 case "3": 2708 optimizedwidth = "722"; 2709 break; 2710 case "8": 2711 optimizedwidth = "960"; 2712 break; 2713 case "4": 2714 optimizedwidth = "722"; 2715 break; 2716 } 2717 2718 if (GetString("Item.ImageStyle") == "ball") { 2719 optimizedwidth = "500&height=500"; 2720 } 2721 2722 2723 if (string.IsNullOrEmpty(GetString("Item.Link"))) 2724 { 2725 <div class="img-responsive dw-std-image"> 2726 <img class="content-image img-responsive img-centered" style="@GetImageBorderCss()" src="/Admin/Public/GetImage.ashx?width=@optimizedwidth&crop=1&Compression=75&image=@image" class="img-responsive" alt=""> 2727 </div> 2728 } else { 2729 <a href="@GetString(" item.link")"=""> 2730 <div class="img-responsive dw-std-image"> 2731 <img class="content-image img-responsive img-centered" style="@GetImageBorderCss()" src="/Admin/Public/GetImage.ashx?width=@optimizedwidth&crop=1&Compression=75&image=@image" class="img-responsive" alt=""> 2732 </div> 2733 </a> 2734 } 2735 } 2736 } 2737 2738 2739 @functions { 2740 private string GetImageBorderCss() 2741 { 2742 if (GetString("Item.ImageStyle") == "cover") 2743 { 2744 return "padding: 8px"; 2745 } 2746 else if (GetString("Item.ImageStyle") == "cover-border") 2747 { 2748 return "padding: 4px; border: 1px solid #e1e1e1; border-radius: 0px !important"; 2749 } 2750 else if (GetString("Item.ImageStyle") == "frame") 2751 { 2752 return "padding: 6px; border: 1px solid #e1e1e1; border-radius: 0px !important"; 2753 } 2754 else if (GetString("Item.ImageStyle") == "rounded") 2755 { 2756 return "border-radius: 8px !important"; 2757 } 2758 else if (GetString("Item.ImageStyle") == "ball") 2759 { 2760 return "border-radius: 1000px !important"; 2761 } 2762 else if (GetString("Item.ImageStyle") == "shadow") 2763 { 2764 return "box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.2)"; 2765 } 2766 else 2767 { 2768 return string.Empty; 2769 } 2770 } 2771 private string GetParagraphWidth() 2772 { 2773 string PctWidth = "100%"; 2774 switch (GetString("Item.Width")){ 2775 case "12": 2776 PctWidth = "100%"; 2777 break; 2778 case "9": 2779 PctWidth = "75%"; 2780 break; 2781 case "6": 2782 PctWidth = "50%"; 2783 break; 2784 case "3": 2785 PctWidth = "25%"; 2786 break; 2787 case "8": 2788 PctWidth = "66%"; 2789 break; 2790 case "4": 2791 PctWidth = "33%"; 2792 break; 2793 } 2794 return PctWidth; 2795 } 2796 } 2797 2798 2799 <style> 2800 .alignCenter{ 2801 text-align:center; 2802 } 2803 2804 .img-centered{ 2805 margin: 0 auto; 2806 } 2807 2808 </style> 2809 <!-- FOOTER --> 2810 <div class="body-wrap @GeneralSettings.Site.LayoutMode"> 2811 <footer class="footer"> 2812 <div class="container"> 2813 <div class="row"> 2814 <div class="col-md-3 col-sm-6 col-xs-12"> 2815 <div class="col"> 2816 <h4>@Translate("Contact us", "Contact us")</h4> 2817 2818 @{ 2819 string footeremail = GetString("Item.Area.FooterEmail"); 2820 } 2821 2822 <ul> 2823 <li>@GetValue("Item.Area.FooterCompanyName")</li> 2824 <li>@GetValue("Item.Area.FooterAddress")</li> 2825 <li>@Translate("Phone", "Phone"): @GetValue("Item.Area.FooterPhone") </li> 2826 <li>@Translate("Email", "Email"): <a href="mailto:@footeremail" title="Email Us">@GetValue("Item.Area.FooterEmail")</a></li> 2827 </ul> 2828 <div>&nbsp;</div> 2829 </div> 2830 </div> 2831 2832 @if (GetBoolean("Item.Area.FooterNewsletterSignUp")) { 2833 <div class="col-md-3 col-sm-6 col-xs-12"> 2834 <div class="col"> 2835 <h4>@Translate("Mailing list", "Mailing list")</h4> 2836 <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> 2837 <form name="UserManagementEditForm" action="/Default.aspx?ID=9204" method="post" enctype="multipart/form-data"> 2838 <input name="UserManagementForm" value="1" type="hidden"> 2839 <input id="UserManagementForm.DeleteImage" name="UserManagementForm.DeleteImage" type="hidden"> 2840 <div style="display: none;"> 2841 <input name="UserManagement_Form_EmailAllowed" id="UserManagement_Form_EmailAllowed" value="True" checked="checked" type="checkbox"> 2842 <input name="UserManagement_Form_EmailAllowed_ApplyValue" id="UserManagement_Form_EmailAllowed_ApplyValue" value="AllowEmail" type="hidden"> 2843 </div> 2844 <div class="input-group"> 2845 @{ attrValue = Translate("Your email address", "Your email address"); 2846 } 2847 2848 <input name="UserManagement_Form_Email" id="UserManagement_Form_Email" type="text" class="form-control" placeholder="@attrValue"> 2849 <span class="input-group-btn"> 2850 <input class="btn btn-base" type="submit" id="submitter" value="Go"> 2851 </span> 2852 2853 </div> 2854 <div>&nbsp;</div> 2855 </form> 2856 </div> 2857 </div> 2858 } 2859 2860 @if (GetBoolean("Item.Area.SocialLinksInFooter")) 2861 { 2862 string sicon = ""; 2863 string slink = ""; 2864 2865 <div class="col-md-3 col-sm-6 col-xs-12"> 2866 <div class="col"> 2867 <h4>@Translate("Social links", "Social links")</h4> 2868 <p> 2869 @foreach (LoopItem socialitem in GetLoop("Item.Area.SocialIconInFooter")) 2870 { 2871 sicon = socialitem.GetString("Item.Area.SocialIconInFooter.Icon"); 2872 slink = socialitem.GetString("Item.Area.SocialIconInFooter.Link"); 2873 2874 <a href="@slink"><i class="fa @sicon fa-2x"></i>&nbsp;&nbsp;</a> 2875 } 2876 </p> 2877 </div> 2878 </div> 2879 } 2880 2881 @if (GetBoolean("Item.Area.FooterShowSitemap")) 2882 { 2883 <div class="col-md-6 col-sm-12 col-xs-12"> 2884 <div class="col"> 2885 @GetValue("DwNavigation(footersitemap)") 2886 </div> 2887 <div>&nbsp;</div> 2888 </div> 2889 } 2890 </div> 2891 2892 <hr> 2893 2894 <div class="row"> 2895 <div class="col-lg-9 col-md-9 col-sm-9 col-xs-9 copyright"> 2896 <div class="col"> 2897 <p>@GetGlobalValue("Global:Server.Date.Year") &copy; @GetValue("Item.Area.FooterCompanyName"). @Translate("All rights reserved.", "All rights reserved.")</p> 2898 </div> 2899 </div> 2900 <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3"> 2901 <div class="col pull-right"> 2902 @{ 2903 var webmasterlink = GetString("Item.Area.WebmasterLinkCode"); 2904 var username = GetValue("Item.Area.FooterEmail"); 2905 var pagename = GetGlobalValue("Global:Page.Name"); 2906 } 2907 <!-- 2908 Oprindelig kode 2909 <p><a href="javascript:void(0);" onclick="window.open('@webmasterlink?un=@username&amp;pn=@pagename&amp;url=' + encodeURI(location),'_blank','width=1050,height=750,resizable=yes,scrollbars=yes');">Webmaster</a></p> --> 2910 2911 <p><a href="@webmasterlink">Webmaster</a></p> 2912 </div> 2913 </div> 2914 </div> 2915 </div> 2916 </footer> 2917 </div> 2918 2919 2920 <!-- Essentials --> 2921 <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 2922 <script src="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js"></script> 2923 <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script> 2924 <script src="//forcdn.googlecode.com/files/jquery.mousewheel.min.js"></script> 2925 <script src="//xoomla.googlecode.com/files/jquery.easing.1.3.js"></script> 2926 2927 <!-- Assets --> 2928 <script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-hover-dropdown/2.0.10/bootstrap-hover-dropdown.min.js"></script> 2929 <script src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script> 2930 <script src="//cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.min.js"></script> 2931 <script src="//cdnjs.cloudflare.com/ajax/libs/spin.js/2.0.1/spin.min.js"></script> 2932 2933 <!-- Sripts for individual pages, depending on what plug-ins are used --> 2934 <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jasny-bootstrap/3.1.3/js/jasny-bootstrap.min.js"></script> 2935 2936 <!-- Replacing the Home text --> 2937 <script> 2938 if (document.getElementById("homemenubtn")) { 2939 document.getElementById("homemenubtn").innerHTML = "<img src='/Files/Images/SiteImages/kirke_ikon.png' /><span></span>"; 2940 } 2941 </script> 2942 2943 <!-- Initialize Fancybox --> 2944 <script type="text/javascript"> 2945 $(document).ready(function () { 2946 $(".fancybox").fancybox(); 2947 }); 2948 </script> 2949 </div></body> 2950 </html>