Kirkerne og kirkegårdene lige nu

 

 


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

Kontakt os

  • Holmsland Kirker
  • v/ Sognepræst Ole Lange
    Holmsland Præstegård
    Gadegårdsvej 3, Kloster
    6950 Ringkøbing

  • Tlf: 97 33 70 11
  • Email: hokl@km.dk
 

Accepter cookies fra dette website

Dette website bruger cookies til at følge din adfærd og for at forbedre brugeroplevelsen på sitet.

Du kan altid slette gemte cookies i dine browserinstillinger

Jeg accepterer ikke cookies Jeg accepterer kun funktionelle cookies Jeg accepterer alle cookies