Error executing template "Designs/Dwsimple/Paragraph/Kalender.cshtml"
System.Net.WebException: The remote server returned an error: (503) Server Unavailable.
   at System.Net.HttpWebRequest.GetResponse()
   at System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
   at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
   at System.Xml.XmlTextReaderImpl.FinishInitUriString()
   at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext)
   at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options)
   at CompiledRazorTemplates.Dynamic.RazorEngine_793587d93f23472ea1f8773c1cc56ea1.b__14_0(TextWriter __razor_helper_writer) in E:\dynamicweb.net\solutions\SkovboData\gloslunde.net.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\Paragraph\Kalender.cshtml:line 237
   at CompiledRazorTemplates.Dynamic.RazorEngine_793587d93f23472ea1f8773c1cc56ea1.b__13_0(TextWriter __razor_helper_writer) in E:\dynamicweb.net\solutions\SkovboData\gloslunde.net.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\Paragraph\Kalender.cshtml:line 204
   at CompiledRazorTemplates.Dynamic.RazorEngine_793587d93f23472ea1f8773c1cc56ea1.Execute() in E:\dynamicweb.net\solutions\SkovboData\gloslunde.net.dynamicweb-cms.com\Files\Templates\Designs\Dwsimple\Paragraph\Kalender.cshtml:line 127
   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.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @using System.Xml.Linq; 2 @using System.Text; 3 @using System.Globalization; 4 5 @{ 6 init(); 7 } 8 9 @functions { 10 private int columnsWritten { get; set; } 11 private int columns { get; set; } 12 13 public void init() 14 { 15 columnsWritten = Dynamicweb.Core.Converter.ToInt32(System.Web.HttpContext.Current.Items["currentColumns"]); 16 columns = GetInteger("Item.Width"); 17 System.Web.HttpContext.Current.Items["currentColumns"] = columnsWritten + GetInteger("Item.Width"); 18 } 19 20 public void Fluid() 21 { 22 columnsWritten = Dynamicweb.Core.Converter.ToInt32(System.Web.HttpContext.Current.Items["currentColumns"]); 23 columns = 12; 24 System.Web.HttpContext.Current.Items["currentColumns"] = columnsWritten + 12; 25 } 26 27 public string ColumnClass() 28 { 29 if (GetString("Item.WidthMobile") == "hide"){ 30 return "col-md-" + GetString("Item.Width") + " hidden-xs"; 31 } else { 32 return "col-md-" + GetString("Item.Width") + " col-xs-" + GetString("Item.WidthMobile"); 33 } 34 } 35 36 public string NewRow() 37 { 38 //return columns + " - " + columnsWritten + ">"; 39 40 if (columns + columnsWritten > 12) 41 { 42 System.Web.HttpContext.Current.Items["currentColumns"] = columns; 43 return "</div><div class=\"row\">"; 44 } 45 else 46 { 47 return string.Empty; 48 } 49 50 } 51 52 public string NewRowParagraphExtended() 53 { 54 if (columns + columnsWritten > 12) 55 { 56 System.Web.HttpContext.Current.Items["currentColumns"] = columns; 57 return "</div><div class=\"flex-container\">"; 58 } 59 else if (columnsWritten == 0) 60 { 61 return "<div class=\"flex-container\">"; 62 } 63 else 64 { 65 return string.Empty; 66 } 67 68 } 69 } 70 71 @{ 72 <style> 73 .datobgcolor { 74 background-color: @GetString("Item.DatoBGColor.Color"); 75 } 76 </style> 77 } 78 79 @if (GetParagraphWidth() == "100%"){ 80 81 @NewRow(); 82 83 } else { 84 85 @NewRowParagraphExtended(); 86 87 } 88 89 90 <div class="@ColumnClass(); flex-item; min-width:calc(@GetParagraphWidth() - 10px)" style="margin-bottom: 5px"> 91 <div class="@GetString("Item.ContentStyle") Special-Col-Style" style="background-color: @GetString("Item.BackgroundColor.Color")"> 92 93 @if (GetString("Item.Order") == "title-first" || GetString("Item.Order") == "") 94 { 95 96 if (GetBoolean("Item.VisTitel") != false){ 97 if (!string.IsNullOrEmpty(GetString("Item.Titel"))) { 98 <h1 class="dw-section-title"> 99 <span>@GetString("Item.Titel")</span> 100 </h1> 101 <br> 102 } 103 } else { 104 <h1 class="dw-section-title alignCenter"><span></span></h1> 105 } 106 107 108 @RenderImage() 109 @kalendertype() 110 } 111 112 @if (GetString("Item.Order") == "image-first") 113 { 114 @RenderImage() 115 if (GetBoolean("Item.VisTitel") != false){ 116 if (!string.IsNullOrEmpty(GetString("Item.Titel"))) { 117 <h1 class="dw-section-title"> 118 <span>@GetString("Item.Titel")</span> 119 </h1> 120 <br> 121 } 122 } else { 123 <h1 class="dw-section-title"><span></span></h1> 124 } 125 126 127 @kalendertype() 128 } 129 130 @if (GetString("Item.Order") == "icon-xs") 131 { 132 <div class="col-md-2"> 133 @RenderImage() 134 </div> 135 136 <div class="col-md-10"> 137 if (GetBoolean("Item.VisTitel") != false){ 138 if (!string.IsNullOrEmpty(GetString("Item.Titel"))) { 139 <h1 class="dw-section-title"> 140 <span>@GetString("Item.Titel")</span> 141 </h1> 142 <br> 143 } 144 } else { 145 <h1 class="dw-section-title"><span></span></h1> 146 } 147 148 @kalendertype() 149 </div> 150 } 151 152 @if (GetString("Item.Order") == "icon-sm") 153 { 154 155 <div class="col-md-3"> 156 @RenderImage() 157 </div> 158 159 <div class="col-md-9"> 160 if (GetBoolean("Item.VisTitel") != false){ 161 if (!string.IsNullOrEmpty(GetString("Item.Titel"))) { 162 <h1 class="dw-section-title"> 163 <span>@GetString("Item.Titel")</span> 164 <br> 165 </h1> 166 <br> 167 } 168 } else { 169 <h1 class="dw-section-title"><span></span></h1> 170 } 171 172 @kalendertype() 173 </div> 174 } 175 176 @if (GetString("Item.Order") == "icon-md") 177 { 178 179 <div class="col-md-4"> 180 @RenderImage() 181 </div> 182 183 <div class="col-md-8"> 184 if (GetBoolean("Item.VisTitel") != false){ 185 if (!string.IsNullOrEmpty(GetString("Item.Titel"))) { 186 <h1 class="dw-section-title"> 187 <span>@GetString("Item.Titel")</span> 188 </h1> 189 <br> 190 } 191 } else { 192 <h1 class="dw-section-title"><span></span></h1> 193 } 194 195 196 @kalendertype() 197 </div> 198 } 199 </div> 200 </div> 201 202 @helper kalendertype(){ 203 if (@GetString("Item.LayoutMode") == "ballon") { 204 @Ballon() 205 } 206 207 if (@GetString("Item.LayoutMode") == "list") { 208 <p class="list-item-info nomargin">(Tryk på aktiviten for at se detaljer)</p><p></p> 209 210 @list() 211 } 212 213 if (@GetString("Item.LayoutMode") == "kasse") { 214 @kasse() 215 } 216 } 217 218 @helper Ballon(){ 219 220 <ul class="list-listings blog-list"> 221 @{ 222 DateTime EndDate = DateTime.Now.AddDays(GetInteger("Item.Days")); 223 String StartDate = DateTime.Now.ToString("dd/MM/yyyy"); 224 String Limit = int.Parse(GetString("Item.CountLimit"), NumberStyles.AllowThousands).ToString(); 225 226 if (GetBoolean("Item.StartDateNow") == false){ 227 EndDate = Convert.ToDateTime(GetString("Item.StartDate")).AddDays(GetInteger("Item.Days")); 228 StartDate = GetString("Item.StartDate"); 229 } 230 231 string linkstring = GetString("Item.FeedLink")+"&InKontonr="+GetString("Item.AccountNumber")+"&InMaksAntalAftaler="+Limit+"&InDatoFra="+StartDate+"&InDatoTil="+EndDate.ToString("dd/MM/yyyy"); 232 233 if (GetString("Item.Show.Filter") != "alle"){ 234 linkstring += "&InAftaletypeID=" + GetString("Item.Show.Filter"); 235 } 236 237 XDocument xdoc = XDocument.Load(linkstring); 238 var elements = xdoc.Element("DATA").Elements("AFTALE"); 239 240 foreach (var el in elements) 241 { 242 string id = "0"; 243 string type = "alle"; 244 DateTime date; 245 string title = "Title"; 246 string description = "Description"; 247 string fulldate = "Date"; 248 string cleanDate = ""; 249 string day = ""; 250 string month = ""; 251 string location = ""; 252 string document = ""; 253 string document_type = "document"; 254 string ShowInfo = "Closed"; 255 256 if (el.Elements("ID").Any()){ 257 id = el.Element("ID").Value; 258 } 259 260 if (el.Elements("AFTALETYPE").Any()){ 261 type = el.Element("AFTALETYPE").Value; 262 } 263 264 if (el.Elements("DATO_FRA").Any() && el.Elements("KL_FRA").Any()) { 265 date = DateTime.Parse(el.Element("DATO_FRA").Value + " " + el.Element("KL_FRA").Value, new CultureInfo("da-DK")); 266 cleanDate = date.ToString("dddd d. MMMM kl. HH:mm", new CultureInfo("da-DK")); 267 day = date.ToString(" d", new CultureInfo("da-DK")); 268 month = date.ToString("MMM", new CultureInfo("da-DK")); 269 } 270 271 if (el.Elements("OVERSKRIFT").Any()){ 272 title = el.Element("OVERSKRIFT").Value; 273 } 274 275 if (el.Elements("BESKRIVELSE").Any()){ 276 description = el.Element("BESKRIVELSE").Value; 277 } 278 279 if (el.Elements("DATO_FORMATERET").Any()){ 280 fulldate = el.Element("DATO_FORMATERET").Value; 281 } 282 283 if (el.Elements("STED").Any()){ 284 location = el.Element("STED").Value; 285 } 286 287 if (el.Elements("OFFENTLIGE_DOKUMENTER").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Elements("DOKUMENT").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Elements("URL").Any()){ 288 document = "http://kalender.brandsoft.dk/bska/" + el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Element("URL").Value; 289 } 290 291 if (el.Elements("OFFENTLIGE_DOKUMENTER").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Elements("DOKUMENT").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Elements("DOKUMENTTYPE").Any()){ 292 document_type = el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Element("DOKUMENTTYPE").Value; 293 } 294 295 296 297 <a href="javascript:void(0);" onclick="toggle_visibility('@id');"> 298 <div class="row"> 299 300 <div class="media col-md-12"> 301 302 <div class="media-left"> 303 304 <div class="media-object calendar-date datobgcolor text-center"><span>@day</span> @month</div> 305 306 </div> 307 <div class="media-body"> 308 <h2 class="media-heading">@title</h2> 309 310 <p class="list-item-info">@type</p> 311 <p class="list-item-info nomargin"><i class="fa fa-fw fa-calendar-o"></i> @fulldate</p> 312 <p class="list-item-info nomargin"><i class="fa fa-fw fa-map-marker"></i> @location</p> 313 314 315 @{ 316 string isHidden = ""; 317 if (ShowInfo == "Closed" || ShowInfo == "Hidden"){ 318 isHidden = "style=\"display:none;\""; 319 } 320 } 321 322 <div id="@id" @isHidden> 323 <p>@description</p> 324 </div> 325 326 327 </div> 328 <div class="media-right" style="width: 33%;"> 329 @if (document != ""){ 330 if (document_type == "OFFENTLIGT_AFTALE_BILLEDE"){ 331 <img class="img-responsive" src="@document" alt="" id="@(id)_img" style="max-height: 100px; float:right; position: relative;"></img> 332 } 333 } 334 </div> 335 336 </div> 337 </div> 338 339 @if (!string.IsNullOrWhiteSpace(description) || !string.IsNullOrWhiteSpace(document)){ 340 if (ShowInfo == "Open"){ 341 <p id="@(id)_chevron" class="text-center chevron"></p> 342 } else if (ShowInfo == "Closed") { 343 <p id="@(id)_chevron" class="text-center chevron bottom"></p> 344 } 345 } 346 347 348 </a> 349 <hr> 350 351 352 } 353 } 354 </ul> 355 356 357 358 } 359 360 @helper list(){ 361 <ul class="list-listings blog-list"> 362 @{ 363 DateTime EndDate = DateTime.Now.AddDays(GetInteger("Item.Days")); 364 String StartDate = DateTime.Now.ToString("dd/MM/yyyy"); 365 String Limit = int.Parse(GetString("Item.CountLimit"), NumberStyles.AllowThousands).ToString(); 366 String sognekode = GetString("Item.Sognekode"); 367 string kalenderkonto = GetString("Item.AccountNumber"); 368 369 if (GetBoolean("Item.StartDateNow") == false){ 370 EndDate = Convert.ToDateTime(GetString("Item.StartDate")).AddDays(GetInteger("Item.Days")); 371 StartDate = GetString("Item.StartDate"); 372 } 373 374 string linkstring = GetString("Item.FeedLink")+"&InKontonr="+kalenderkonto+"&InMaksAntalAftaler="+Limit+"&InDatoFra="+StartDate+"&InDatoTil="+EndDate.ToString("dd/MM/yyyy")+"&InSognekode="+sognekode; 375 376 377 if (GetString("Item.Show.Filter") != "alle"){ 378 linkstring += "&InAftaletypeID=" + GetString("Item.Show.Filter"); 379 } 380 381 XDocument xdoc = XDocument.Load(linkstring); 382 var elements = xdoc.Element("DATA").Elements("AFTALE"); 383 384 foreach (var el in elements) 385 { 386 string id = "0"; 387 string type = "alle"; 388 DateTime date; 389 string title = "Title"; 390 string description = "Description"; 391 string fulldate = "Date"; 392 string cleanDate = ""; 393 string day = ""; 394 string month = ""; 395 string location = ""; 396 string document = ""; 397 string document_type = "document"; 398 399 if (el.Elements("ID").Any()){ 400 id = el.Element("ID").Value; 401 } 402 403 if (el.Elements("AFTALETYPE").Any()){ 404 type = el.Element("AFTALETYPE").Value; 405 } 406 407 if (el.Elements("DATO_FRA").Any() && el.Elements("KL_FRA").Any()) { 408 date = DateTime.Parse(el.Element("DATO_FRA").Value + " " + el.Element("KL_FRA").Value, new CultureInfo("da-DK")); 409 cleanDate = date.ToString("dddd d. MMMM kl. HH:mm", new CultureInfo("da-DK")); 410 day = date.ToString(" d", new CultureInfo("da-DK")); 411 month = date.ToString("MMM", new CultureInfo("da-DK")); 412 } 413 414 if (el.Elements("OVERSKRIFT").Any()){ 415 title = el.Element("OVERSKRIFT").Value; 416 } 417 418 if (el.Elements("BESKRIVELSE").Any()){ 419 description = el.Element("BESKRIVELSE").Value; 420 } 421 422 if (el.Elements("DATO_FORMATERET").Any()){ 423 fulldate = el.Element("DATO_FORMATERET").Value; 424 } 425 426 if (el.Elements("STED").Any()){ 427 location = el.Element("STED").Value; 428 } 429 430 if (el.Elements("OFFENTLIGE_DOKUMENTER").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Elements("DOKUMENT").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Elements("URL").Any()){ 431 document = "http://kalender.brandsoft.dk/bska/" + el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Element("URL").Value; 432 } 433 434 if (el.Elements("OFFENTLIGE_DOKUMENTER").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Elements("DOKUMENT").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Elements("DOKUMENTTYPE").Any()){ 435 document_type = el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Element("DOKUMENTTYPE").Value; 436 } 437 438 439 <a href="Kalenderaftale?kalenderkonto=@kalenderkonto&aftaleid=@id" data-toggle="tooltip" data-placement="right" data-html="true" title="@title &#013; &#013Beskrivelse: &#013;@description &#013; &#013;@fulldate"> 440 <div class="row"> 441 <div class="media col-md-12"> 442 443 444 <div class="media-body"> 445 446 <p class="list-item-info nomargin"><i class="fa fa-fw fa-calendar-o"></i> @fulldate</p> 447 <h2 class="media-heading">@title</h2> 448 449 <p class="list-item-info nomargin"><i class="fa fa-fw fa-map-marker"></i> @location</p> 450 451 </div> 452 <br> 453 </div> 454 </div> 455 </a> 456 } 457 } 458 </ul> 459 } 460 461 @helper kasse(){ 462 <div class="sqcalendar"> 463 @{ 464 DateTime EndDate = DateTime.Now.AddDays(GetInteger("Item.Days")); 465 String StartDate = DateTime.Now.ToString("dd/MM/yyyy"); 466 String Limit = int.Parse(GetString("Item.CountLimit"), NumberStyles.AllowThousands).ToString(); 467 String kalenderkonto = GetString("Item.AccountNumber"); 468 469 470 471 if (GetBoolean("Item.StartDateNow") == false){ 472 EndDate = Convert.ToDateTime(GetString("Item.StartDate")).AddDays(GetInteger("Item.Days")); 473 StartDate = GetString("Item.StartDate"); 474 } 475 476 string linkstring = GetString("Item.FeedLink")+"&InKontonr="+GetString("Item.AccountNumber")+"&InMaksAntalAftaler="+Limit+"&InDatoFra="+StartDate+"&InDatoTil="+EndDate.ToString("dd/MM/yyyy"); 477 478 if (GetString("Item.Show.Filter") != "alle"){ 479 linkstring += "&InAftaletypeID=" + GetString("Item.Show.Filter"); 480 } 481 482 XDocument xdoc = XDocument.Load(linkstring); 483 var elements = xdoc.Element("DATA").Elements("AFTALE"); 484 485 foreach (var el in elements) 486 { 487 string id = "0"; 488 string type = "alle"; 489 DateTime date; 490 string title = "Title"; 491 string description = "Description"; 492 string fulldate = "Date"; 493 string cleanDate = ""; 494 string day = ""; 495 string month = ""; 496 string location = ""; 497 string document = ""; 498 string document_type = "document"; 499 500 if (el.Elements("ID").Any()){ 501 id = el.Element("ID").Value; 502 } 503 504 if (el.Elements("AFTALETYPE").Any()){ 505 type = el.Element("AFTALETYPE").Value; 506 } 507 508 if (el.Elements("DATO_FRA").Any() && el.Elements("KL_FRA").Any()) { 509 date = DateTime.Parse(el.Element("DATO_FRA").Value + " " + el.Element("KL_FRA").Value, new CultureInfo("da-DK")); 510 cleanDate = date.ToString("dddd d. MMMM kl. HH:mm", new CultureInfo("da-DK")); 511 day = date.ToString(" d", new CultureInfo("da-DK")); 512 month = date.ToString("MMM", new CultureInfo("da-DK")); 513 } 514 515 if (el.Elements("OVERSKRIFT").Any()){ 516 title = el.Element("OVERSKRIFT").Value; 517 } 518 519 if (el.Elements("BESKRIVELSE").Any()){ 520 description = el.Element("BESKRIVELSE").Value; 521 } 522 523 if (el.Elements("DATO_FORMATERET").Any()){ 524 fulldate = el.Element("DATO_FORMATERET").Value; 525 } 526 527 if (el.Elements("STED").Any()){ 528 location = el.Element("STED").Value; 529 } 530 531 if (el.Elements("OFFENTLIGE_DOKUMENTER").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Elements("DOKUMENT").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Elements("URL").Any()){ 532 document = "http://kalender.brandsoft.dk/bska/" + el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Element("URL").Value; 533 } 534 535 if (el.Elements("OFFENTLIGE_DOKUMENTER").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Elements("DOKUMENT").Any() && el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Elements("DOKUMENTTYPE").Any()){ 536 document_type = el.Element("OFFENTLIGE_DOKUMENTER").Element("DOKUMENT").Element("DOKUMENTTYPE").Value; 537 } 538 539 540 <div class="sqcalendar-item sqkalender-liste-item-odd"> 541 <a class="sqcalendar-link" href="Kalenderaftale?kalenderkonto=@kalenderkonto&aftaleid=@id" data-toggle="tooltip" data-placement="right" data-html="true" title="@title &#013; &#013Beskrivelse: &#013;@description &#013; &#013;@fulldate"> 542 543 544 545 <div class="sqcalendar-date datobgcolor sqevent-date--hide-year"> 546 <div class="sqdate-center"> 547 548 <span class="sqdate">@day</span><span class="sqmonth">@month</span> 549 550 </div> 551 </div> 552 <div class="sqcalendar-desc"> 553 <div class="sqcalendar-item-info"> 554 <span class="sqmedia-heading">@title</span> 555 556 <p class="list-item-info">(@type)</p> 557 <p class="list-item-info nomargin"><i class="fa fa-fw fa-calendar-o"></i> @cleanDate</p> 558 <p class="list-item-info nomargin"><i class="fa fa-fw fa-map-marker"></i> @location</p> 559 560 561 @{ 562 string isHidden = ""; 563 if (GetString("Item.ShowInfo") == "Closed" || GetString("Item.ShowInfo") == "Hidden"){ 564 isHidden = "style=\"display:none;\""; 565 } 566 } 567 568 <div id="@id" @isHidden> 569 <p>@description</p> 570 </div> 571 572 </div> 573 </div> 574 <div class="media-right" style="width: 33%;"> 575 @if (document != ""){ 576 if (document_type == "OFFENTLIGT_AFTALE_BILLEDE"){ 577 <img class="img-responsive" src="@document" alt="" id="@(id)_img" style="max-height: 100px; float:right; position: relative;"></img> 578 } 579 } 580 </div> 581 582 583 584 @if (!string.IsNullOrWhiteSpace(description) || !string.IsNullOrWhiteSpace(document)){ 585 if (GetString("Item.ShowInfo") == "Open"){ 586 <p id="@(id)_chevron" class="text-center chevron"></p> 587 } else if (GetString("Item.ShowInfo") == "Closed") { 588 <p id="@(id)_chevron" class="text-center chevron bottom"></p> 589 } 590 } 591 592 593 </a> 594 </div> 595 596 597 598 } 599 } 600 </div> 601 } 602 603 @helper RenderImage() 604 { 605 if (!string.IsNullOrEmpty(GetString("Item.Image"))) 606 { 607 var image = System.Web.HttpContext.Current.Server.UrlEncode(GetString("Item.Image")); 608 609 <!-- Choosing the smallest possible width that will work with responsive sizes --> 610 string optimizedwidth = "1280"; 611 switch (GetString("Item.Width")){ 612 case "12": 613 optimizedwidth = "1280"; 614 break; 615 case "9": 616 optimizedwidth = "960"; 617 break; 618 case "6": 619 optimizedwidth = "722"; 620 break; 621 case "3": 622 optimizedwidth = "722"; 623 break; 624 case "8": 625 optimizedwidth = "960"; 626 break; 627 case "4": 628 optimizedwidth = "722"; 629 break; 630 } 631 632 if (GetString("Item.ImageStyle") == "ball") { 633 optimizedwidth = "500&height=500"; 634 } 635 636 637 if (string.IsNullOrEmpty(GetString("Item.Link"))) 638 { 639 <div class="img-responsive dw-std-image"> 640 <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=""></img> 641 </div> 642 } else { 643 <a href="@GetString("Item.Link")"> 644 <div class="img-responsive dw-std-image"> 645 <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=""></img> 646 </div> 647 </a> 648 } 649 } 650 } 651 @functions { 652 private string GetImageBorderCss() 653 { 654 if (GetString("Item.ImageStyle") == "cover") 655 { 656 return "padding: 8px"; 657 } 658 else if (GetString("Item.ImageStyle") == "cover-border") 659 { 660 return "padding: 4px; border: 1px solid #e1e1e1; border-radius: 0px !important"; 661 } 662 else if (GetString("Item.ImageStyle") == "frame") 663 { 664 return "padding: 6px; border: 1px solid #e1e1e1; border-radius: 0px !important"; 665 } 666 else if (GetString("Item.ImageStyle") == "rounded") 667 { 668 return "border-radius: 8px !important"; 669 } 670 else if (GetString("Item.ImageStyle") == "ball") 671 { 672 return "border-radius: 1000px !important"; 673 } 674 else if (GetString("Item.ImageStyle") == "shadow") 675 { 676 return "box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.2)"; 677 } 678 else 679 { 680 return string.Empty; 681 } 682 } 683 private string GetParagraphWidth() 684 { 685 string PctWidth = "100%"; 686 switch (GetString("Item.Width")){ 687 case "12": 688 PctWidth = "100%"; 689 break; 690 case "9": 691 PctWidth = "75%"; 692 break; 693 case "6": 694 PctWidth = "50%"; 695 break; 696 case "3": 697 PctWidth = "25%"; 698 break; 699 case "8": 700 PctWidth = "66%"; 701 break; 702 case "4": 703 PctWidth = "33%"; 704 break; 705 } 706 return PctWidth; 707 } 708 709 } 710 <script type="text/javascript"> 711 function toggle_visibility(id) { 712 if($('#' + id + "_chevron").length){ 713 $('#' + id).stop().slideToggle('slow'); 714 $('#' + id + "_chevron").toggleClass('bottom'); 715 716 717 if(!$('#' + id + "_img").hasClass('bigPic')){ 718 719 var container_width = 269; 720 var image_height; 721 var natural_width = document.getElementById(id + "_img").naturalWidth; 722 var natural_height = document.getElementById(id + "_img").naturalHeight; 723 724 if(natural_width < container_width){ //> 725 container_width = natural_width; 726 } 727 728 var res = container_width / natural_width; 729 //console.log(res); 730 731 image_height = natural_height * res; 732 //console.log(image_height); 733 734 if(image_height > 400){ 735 image_height = 400; 736 } 737 738 //console.log(natural_width + " x " + natural_height); 739 //console.log(image_height); 740 $('#' + id + "_img").addClass('bigPic'); 741 $('#' + id + "_img").css('max-height', image_height + "px"); 742 }else{ 743 $('#' + id + "_img").removeClass('bigPic'); 744 $('#' + id + "_img").css('max-height', "100px"); 745 } 746 } 747 } 748 </script> 749 750

Nyt kirkeblad

Kontaktoplysninger

  • Gloslunde Pastorat
  • Kirkevej 1A
    4983 Dannemare

  • Telefon: 54 94 47 90 (Graverkontoret) - 54 94 41 80 (Præsten)
  • Email: gloslundegraveren@outlook.dk