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

Kontaktoplysninger

  • Hylleholt Kirke - Kirkekontor
  • Telefon: 56 71 60 83 / 24 66 89 77
  • Email: boho@km.dk
 

Sociale links

  


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