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

Kontakt os

  • SNØF Pastorat
  • Sognepræst Jacob B. Møller
    Nordrupvej 132, Nordrup
    4100 Ringsted
     
  • Tlf: 5764 0085
  • Email: jabm@km.dk
 

Sognepræst

  • Sara Horneman-Thielcke
  • Havemarksvej 59, Ørslev
    4100 Ringsted

     

  • Tlf: 2166 5502
  • Email: shf@km.dk