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

Bliv medlem af Folkekirken

Folkekirken i Agerbæk og Starup er din lokale kirke, brug dem.

Folkekirken tilbyder dig på et lokalt plan en bred vifte af tiltag! Fra gudstjenester, foredrag og fællesskab.

Folkekirken er der i livets glædelige, men også livets svære situationer.

Folkekirken bevare vores allesammen Danmarks historie.

Man kan altid henvende sig til præsten, hvis man har brug for en samtale! Det er gratis.

Hvis du er kommet til at melde dig ud, kan du bruge følgende link.
 

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

Kontaktoplysninger

  • Agerbæk - Vester Starup Pastorat
  • v/ Sognepræst
    Søren Pedersen
    Kærbjervej 6
    6753 Agerbæk

  • Telefon: 7519 6703
  • Email: sop@km.dk
 

Sociale links