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

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

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