RealMæglerne

Gemte Boliger

Gemte Boliger er din oversigt over boliger på markedet, som er interessante for dig. Listen bliver automatisk opdateret med boliger, som dine boligagenter finder til dig, når der er et match mellem dine søgekriterier
og aktuelle boliger til salg. 

Error compiling template "/Paragraph/user_favorites.cshtml"
Line 13: The using directive for 'Dynamicweb.Ecommerce.Products' appeared previously in this namespace
Line 42: Argument 1: cannot convert from 'System.Collections.Generic.IEnumerable' to 'System.Collections.Generic.List>.LoopItem>'

1 // <auto-generated/> 2 #pragma warning disable 1591 3 namespace CompiledRazorTemplates.Dynamic 4 { 5 #line hidden 6 using System.Threading.Tasks; 7 using System; 8 using System.Collections.Generic; 9 using System.Linq; 10 using RealEstate.User; 11 using Dynamicweb.Ecommerce.Products; 12 using Dynamicweb.Content.Items; 13 using Dynamicweb.Ecommerce.Products; 14 using RealMaeglerne.Dynamicweb; 15 using RealMaeglerne.Dynamicweb.Models; 16 using RealMaeglerne.Library; 17 using RealMaeglerne.Library.Models; 18 using System.Text.RegularExpressions; 19 internal class RazorEngine_6519a92ffb7542b295d1096cab1ecd3d : Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 20 { 21 #pragma warning disable 1998 22 public async override global::System.Threading.Tasks.Task ExecuteAsync() 23 { 24 WriteLiteral("\r\n"); 25 WriteLiteral("\r\n"); 26 WriteLiteral("\r\n"); 27 WriteLiteral("\r\n"); 28 WriteLiteral("\r\n"); 29 WriteLiteral("\r\n"); 30 WriteLiteral("\r\n\r\n\r\n"); 31 32 IEnumerable<Product> boliglistFavorites = Enumerable.Empty<Product>();; 33 try { 34 boliglistFavorites = RealEstate.User.Helper.GetFavorites(); 35 } catch { 36 // Ignore 37 } 38 WriteLiteral("<section class=\"bolig-list my-favorites\">\r\n\t<div class=\"container\">\r\n"); 39 if(boliglistFavorites != null && boliglistFavorites.Any()) { 40 WriteLiteral("\t\t\t<div class=\"list list-favorites row\">\r\n"); 41 42 RenderBoligList(boliglistFavorites); 43 WriteLiteral("\t </div>\r\n"); 44 } else { 45 WriteLiteral("\t\t\t<div class=\"row\">\r\n\t\t\t\t<div class=\"col-xs-12 text-center\">\r\n\t\t\t\t\t<h2>"); 46 Write(Translate("no_favorites_yet", "Du har endnu ingen gemte boliger")); 47 WriteLiteral("</h2>\r\n <br /><br />\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n"); 48 } 49 WriteLiteral("\t</div>\r\n</section>\r\n"); 50 } 51 #pragma warning restore 1998 52 53 void RenderErhvervsTypeCheckboxes(string productGroupFilter) 54 { 55 WriteLiteral(@" <div class=""col-xs-6 col-md-4""> 56 <div class=""checkbox""> 57 <label> 58 <input type=""checkbox"" name=""propertytype"" value=""bolig/erhverv, kombineret erhverv og bolig, byejendom (kontor, butik, beboelse)"" /> 59 <span>Bolig/erhverv</span> 60 </label> 61 </div> 62 <div class=""checkbox""> 63 <label> 64 <input type=""checkbox"" name=""propertytype"" value=""erhvervsgrund"" /> 65 <span>Erhvervsgrund</span> 66 </label> 67 </div> 68 <div class=""checkbox""> 69 <label> 70 <input type=""checkbox"" name=""propertytype"" value=""boligudlejning"" /> 71 <span>Boligudlejningsejendom</span> 72 </label> 73 </div> 74 <div class=""checkbox""> 75 <label> 76 <input type=""checkbox"" name=""propertytype"" value=""kontor, klinik, kontorhotel, showroom, under"); 77 WriteLiteral(@"visningslokaler"" /> 78 <span>Kontor</span> 79 </label> 80 </div> 81 </div> 82 <div class=""col-xs-6 col-md-4""> 83 <div class=""checkbox""> 84 <label> 85 <input type=""checkbox"" name=""propertytype"" value=""butik / detail, butik / detailhandel"" /> 86 <span>Butik/detailhandel</span> 87 </label> 88 </div> 89 <div class=""checkbox""> 90 <label> 91 <input type=""checkbox"" name=""propertytype"" value=""industri / logistik, håndværk, industri, kontor / lager, logistik"" /> 92 <span>Produktion/lager</span> 93 </label> 94 </div> 95 <div class=""checkbox""> 96 <label> 97 <input type=""checkbox"" name=""propertytype"" value=""hotel - kursusejendom, restaurant"" /> 98 <span>Hotel og restaurant</span> 99 </label> 100 </div> 101 <div c"); 102 WriteLiteral(@"lass=""checkbox""> 103 <label> 104 <input type=""checkbox"" name=""propertytype"" value=""projekt ejendom"" /> 105 <span>Projektejendom</span> 106 </label> 107 </div> 108 </div> 109 <div class=""col-xs-6 col-md-4""> 110 <div class=""checkbox""> 111 <label> 112 <input type=""checkbox"" name=""propertytype"" value=""andet"" /> 113 <span>Andet</span> 114 </label> 115 </div> 116 </div> 117 "); 118 WriteLiteral(" <input type=\"hidden\" name=\"propertycategory\" value=\"erhverv, udlejning\" />\r\n <input type=\"hidden\" name=\"filtrering\""); 119 BeginWriteAttribute("value", " value=\"", 3142, "\"", 3169, 1); 120 WriteAttributeValue("", 3150, productGroupFilter, 3150, 19, false); 121 EndWriteAttribute(); 122 WriteLiteral(" />\r\n"); 123 } 124 void RenderBoligtypeCheckboxes() 125 { 126 WriteLiteral(@" <div class=""col-6 col-md-4""> 127 <div class=""checkbox""> 128 <label> 129 <input type=""checkbox"" name=""propertytype"" value=""villa"" /> 130 <span>Villa</span> 131 </label> 132 </div> 133 <div class=""checkbox""> 134 <label> 135 <input type=""checkbox"" name=""propertytype"" value=""rækkehus"" /> 136 <span>Rækkehus</span> 137 </label> 138 </div> 139 <div class=""checkbox""> 140 <label> 141 <input type=""checkbox"" name=""propertytype"" value=""villalejlighed"" /> 142 <span>Villalejlighed</span> 143 </label> 144 </div> 145 <div class=""checkbox""> 146 <label> 147 <input type=""checkbox"" name=""propertytype"" value=""andelsbolig"" /> 148 <span>Andelsbolig</span> 149 </label> 150 </div> 151 </div> 152 <div class=""co"); 153 WriteLiteral(@"l-6 col-md-4""> 154 <div class=""checkbox""> 155 <label> 156 <input type=""checkbox"" name=""propertytype"" value=""fritidshus, fritidsbolig"" /> 157 <span>Fritidsbolig</span> 158 </label> 159 </div> 160 <div class=""checkbox""> 161 <label> 162 <input type=""checkbox"" name=""propertytype"" value=""ejerlejlighed"" class=""specialOption"" data-disable-slider=""#grundareal"" data-disable-slider-ranges=""#grundarealmin,#grundarealmax"" /> 163 <span>Ejerlejlighed</span> 164 </label> 165 </div> 166 <div class=""checkbox""> 167 <label> 168 <input type=""checkbox"" name=""propertytype"" value=""helårsgrund"" class=""specialOption"" data-disable-slider=""#boligareal,#roomsslider"" data-disable-slider-ranges=""#boligarealmin,#boligarealmax,#roomsmin"" /> 169 <span>Helårsgrund</span> 170 </label> 171 </div> 172 <div "); 173 WriteLiteral(@"class=""checkbox""> 174 <label> 175 <input type=""checkbox"" name=""propertytype"" value=""fritidsgrund"" class=""specialOption"" data-disable-slider=""#boligareal,#roomsslider"" data-disable-slider-ranges=""#boligarealmin,#boligarealmax,#roomsmin"" /> 176 <span>Fritidsgrund</span> 177 </label> 178 </div> 179 </div> 180 <div class=""col-6 col-md-4""> 181 <div class=""checkbox""> 182 <label> 183 <input type=""checkbox"" name=""propertytype"" value=""landejendom, lystejendom"" class=""specialOption"" data-disable-checkbox=""true"" /> 184 <span>Landejendom</span> 185 </label> 186 </div> 187 <div class=""checkbox""> 188 <label> 189 <input type=""checkbox"" name=""propertytype"" value=""erhverv"" class=""specialOption"" data-disable-checkbox=""true"" data-disable-slider=""#roomsslider"" data-disable-slider-ranges=""#roomsmin"" /> 190 <span>Erhverv<"); 191 WriteLiteral("/span>\r\n </label>\r\n </div>\r\n </div>\r\n"); 192 } 193 194 void RenderChecked(string queryString) 195 { 196 if (Dynamicweb.Context.Current.Request.QueryString["propertytype"] == queryString) 197 { 198 Write("checked"); 199 200 } 201 } 202 203 void RenderBoligtypeCheckboxesDropdown() 204 { 205 Dictionary<string, string> propertyTypes = new Dictionary<string, string>(){ 206 { "Villa", "villa" }, { "Rækkehus", "rækkehus" }, { "Villalejlighed", "villalejlighed" }, 207 { "Andelsbolig", "andelsbolig" } 208 }; 209 foreach (KeyValuePair<string, string> type in propertyTypes) 210 { 211 bool ischecked = false; 212 string[] propertytypeSplit = new string[0]; 213 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["propertytype"])) 214 { 215 propertytypeSplit = Dynamicweb.Context.Current.Request.QueryString["propertytype"].Split(','); 216 } 217 foreach (var propertytypeParams in propertytypeSplit) 218 { 219 if (propertytypeParams == type.Value) 220 { 221 ischecked = true; 222 } 223 } 224 WriteLiteral(" <li>\r\n <label class=\"checkbox-container d-flex\">\r\n "); 225 Write(Translate("Smartpage:Search.DropDown." + type.Key + "", "" + type.Key + "")); 226 WriteLiteral("\r\n <input type=\"checkbox\" name=\"propertytype\""); 227 BeginWriteAttribute("value", " value=\"", 7765, "\"", 7784, 1); 228 WriteAttributeValue("", 7773, type.Value, 7773, 11, false); 229 EndWriteAttribute(); 230 WriteLiteral(" class=\"js-input-check datavalue js-datavalue js-count\" data-val=\""); 231 Write(type.Key); 232 WriteLiteral("\" onchange=\"submitFilter()\""); 233 BeginWriteAttribute("checked", " checked=\"", 7887, "\"", 7907, 1); 234 WriteAttributeValue("", 7897, ischecked, 7897, 10, false); 235 EndWriteAttribute(); 236 WriteLiteral(" />\r\n <span class=\"checkmark grey\"></span>\r\n </label>\r\n </li>\r\n"); 237 } 238 239 Dictionary<string, string> propertyTypes2 = new Dictionary<string, string>(){ 240 { "Fritidsbolig", "fritidshus, fritidsbolig" }, { "Ejerlejlighed", "ejerlejlighed" }, { "Helårsgrund", "helårsgrund" }, 241 { "Fritidsgrund", "fritidsgrund" }, { "Landejendom", "landejendom, lystejendom" } 242 }; 243 foreach (KeyValuePair<string, string> type in propertyTypes2) 244 { 245 bool ischecked = false; 246 string[] propertytypeSplit2 = new string[0]; 247 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["propertytype"])) 248 { 249 propertytypeSplit2 = Dynamicweb.Context.Current.Request.QueryString["propertytype"].Split(','); 250 } 251 foreach (var propertytypeParams in propertytypeSplit2) 252 { 253 if (propertytypeParams == type.Value) 254 { 255 ischecked = true; 256 } 257 } 258 WriteLiteral(" <li>\r\n <label class=\"checkbox-container d-flex\">\r\n "); 259 Write(Translate("Smartpage:Search.DropDown." + type.Key + "", "" + type.Key + "")); 260 WriteLiteral("\r\n"); 261 if (type.Value == "ejerlejlighed") 262 { 263 WriteLiteral(" <input type=\"checkbox\" name=\"propertytype\""); 264 BeginWriteAttribute("value", " value=\"", 9331, "\"", 9350, 1); 265 WriteAttributeValue("", 9339, type.Value, 9339, 11, false); 266 EndWriteAttribute(); 267 WriteLiteral(" class=\"js-input-check datavalue\" data-disable-slider=\"#grundareal\" data-disable-slider-ranges=\"#grundarealmin,#grundarealmax\" data-val=\""); 268 Write(type.Key); 269 WriteLiteral("\" onchange=\"submitFilter()\""); 270 BeginWriteAttribute("checked", " checked=\"", 9524, "\"", 9544, 1); 271 WriteAttributeValue("", 9534, ischecked, 9534, 10, false); 272 EndWriteAttribute(); 273 WriteLiteral(" />\r\n"); 274 } 275 else if (type.Value == "helårsgrund") 276 { 277 WriteLiteral(" <input type=\"checkbox\" name=\"propertytype\""); 278 BeginWriteAttribute("value", " value=\"", 9721, "\"", 9740, 1); 279 WriteAttributeValue("", 9729, type.Value, 9729, 11, false); 280 EndWriteAttribute(); 281 WriteLiteral(" class=\"js-input-check datavalue\" data-disable-slider=\"#boligareal,#roomsslider\" data-disable-slider-ranges=\"#boligarealmin,#boligarealmax,#roomsmin\" data-val=\""); 282 Write(type.Key); 283 WriteLiteral("\" onchange=\"submitFilter()\""); 284 BeginWriteAttribute("checked", " checked=\"", 9937, "\"", 9957, 1); 285 WriteAttributeValue("", 9947, ischecked, 9947, 10, false); 286 EndWriteAttribute(); 287 WriteLiteral(" />\r\n"); 288 } 289 else if (type.Value == "fritidsgrund") 290 { 291 WriteLiteral(" <input type=\"checkbox\" name=\"propertytype\""); 292 BeginWriteAttribute("value", " value=\"", 10135, "\"", 10154, 1); 293 WriteAttributeValue("", 10143, type.Value, 10143, 11, false); 294 EndWriteAttribute(); 295 WriteLiteral(" class=\"js-input-check datavalue\" data-disable-slider=\"#boligareal,#roomsslider\" data-disable-slider-ranges=\"#boligarealmin,#boligarealmax,#roomsmin\" data-val=\""); 296 Write(type.Key); 297 WriteLiteral("\" onchange=\"submitFilter()\""); 298 BeginWriteAttribute("checked", " checked=\"", 10351, "\"", 10371, 1); 299 WriteAttributeValue("", 10361, ischecked, 10361, 10, false); 300 EndWriteAttribute(); 301 WriteLiteral(" />\r\n"); 302 } 303 else 304 { 305 WriteLiteral(" <input type=\"checkbox\" name=\"propertytype\""); 306 BeginWriteAttribute("value", " value=\"", 10515, "\"", 10534, 1); 307 WriteAttributeValue("", 10523, type.Value, 10523, 11, false); 308 EndWriteAttribute(); 309 WriteLiteral(" class=\"js-input-check datavalue\" data-val=\""); 310 Write(type.Key); 311 WriteLiteral("\" onchange=\"submitFilter()\""); 312 BeginWriteAttribute("checked", " checked=\"", 10615, "\"", 10635, 1); 313 WriteAttributeValue("", 10625, ischecked, 10625, 10, false); 314 EndWriteAttribute(); 315 WriteLiteral(" />\r\n"); 316 } 317 WriteLiteral(" <span class=\"checkmark grey\"></span>\r\n </label>\r\n </li>\r\n"); 318 } 319 } 320 321 void RenderBoligTypeErhverv(bool submitOnChange = false, bool frontpage = false) 322 { 323 Dictionary<string, string> erhverType = new Dictionary<string, string>(){ 324 { "Kontor", "OwnUseOffices" }, { "Lager + Produktion", "OwnUseStoresAndProductions" }, { "Detailhandel", "OwnUseRetailAndStores" }, 325 { "Grunde", "OwnUseParcel" }, { "Andre typer", "OwnUseOtherTypes" }, { "Hotel + Restaurant", "OwnUseHotelsAndRestaurants" } 326 }; 327 var submitonchange = ""; 328 if (submitOnChange) 329 { 330 submitonchange = "onchange='submitFilter()'"; 331 } 332 333 foreach (KeyValuePair<string, string> type in erhverType) 334 { 335 string ischecked = ""; 336 string[] olineParamsSplit = new string[0]; 337 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["olinecategory"])) 338 { 339 olineParamsSplit = Dynamicweb.Context.Current.Request.QueryString["olinecategory"].Split(','); 340 } 341 foreach (var olineParams in olineParamsSplit) 342 { 343 if (olineParams == type.Value) 344 { 345 ischecked = "checked"; 346 } 347 } 348 349 WriteLiteral(" <li>\r\n <label class=\"checkbox-container d-flex\">\r\n "); 350 Write(Translate("Smartpage:Search.DropDown." + type.Key + "", "" + type.Key + "")); 351 WriteLiteral("\r\n <input type=\"checkbox\" name=\"olinecategory\""); 352 BeginWriteAttribute("value", " value=\"", 12279, "\"", 12298, 1); 353 WriteAttributeValue("", 12287, type.Value, 12287, 11, false); 354 EndWriteAttribute(); 355 WriteLiteral(" class=\"js-input-check datavalue\" data-val=\""); 356 Write(type.Key); 357 WriteLiteral("\" "); 358 Write(submitonchange); 359 WriteLiteral(" "); 360 Write(ischecked); 361 WriteLiteral(" />\r\n <span class=\"checkmark grey\"></span>\r\n </label>\r\n </li>\r\n"); 362 } 363 } 364 365 void RenderBoligTypeErhvervInvest(bool submitOnChange = false) 366 { 367 Dictionary<string, string> erhverType = new Dictionary<string, string>(){ 368 { "Kontor", "Kontor" }, { "Lager + Produktion", "InvestmentStoresAndProductions" }, { "Boligudlejning", "InvestmentHousingRental" }, 369 { "Detailhandel", "InvestmentRetailAndStores" }, { "Grunde", "InvestmentParcel" }, { "Hotel + Restaurant", "InvestmentHotelsAndRestaurants" }, { "Andre typer", "InvestmentOtherTypes" } 370 }; 371 372 foreach (KeyValuePair<string, string> type in erhverType) 373 { 374 bool ischecked = false; 375 string[] olineParamsSplit = new string[0]; 376 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["olinecategory"])) 377 { 378 olineParamsSplit = Dynamicweb.Context.Current.Request.QueryString["olinecategory"].Split(','); 379 } 380 foreach (var olineParams in olineParamsSplit) 381 { 382 if (olineParams == type.Value) 383 { 384 ischecked = true; 385 } 386 } 387 388 WriteLiteral(" <li>\r\n <label class=\"checkbox-container\">\r\n "); 389 Write(Translate("Smartpage:Search.DropDown." + type.Key + "", "" + type.Key + "")); 390 WriteLiteral("\r\n <input type=\"checkbox\" name=\"olinecategory\""); 391 BeginWriteAttribute("value", " value=\"", 13889, "\"", 13908, 1); 392 WriteAttributeValue("", 13897, type.Value, 13897, 11, false); 393 EndWriteAttribute(); 394 WriteLiteral(" class=\"js-input-check datavalue\" data-val=\""); 395 Write(type.Key); 396 WriteLiteral("\" onchange=\"submitFilter()\""); 397 BeginWriteAttribute("checked", " checked=\"", 13989, "\"", 14009, 1); 398 WriteAttributeValue("", 13999, ischecked, 13999, 10, false); 399 EndWriteAttribute(); 400 WriteLiteral(" />\r\n <span class=\"checkmark grey\"></span>\r\n </label>\r\n </li>\r\n"); 401 } 402 } 403 int GetWebsiteSettingsPageId(string pageSysName) 404 { 405 int sideId = 0; 406 407 var pw = Dynamicweb.Frontend.PageView.Current(); 408 409 string settingsItemId = "1"; 410 411 if ((pw.Area.Item.ContainsKey("Type") && pw.Area.Item["Type"].ToString() == "bone") || Dynamicweb.Context.Current.Request.QueryString["bone"] == "true") 412 { 413 settingsItemId = "2"; 414 } 415 416 var settingsItem = ItemManager.Storage.GetById("Delte_Egenskaber", settingsItemId); 417 418 if (settingsItem == null || !settingsItem.ContainsKey(pageSysName)) 419 { 420 return sideId; 421 } 422 423 string boligsideLink = settingsItem[pageSysName] as String; 424 string linkPrefix = "Default.aspx?ID="; 425 426 if (!String.IsNullOrEmpty(boligsideLink) && boligsideLink.ToLower().StartsWith(linkPrefix.ToLower())) 427 { 428 Int32.TryParse(boligsideLink.Substring(linkPrefix.Length), out sideId); 429 } 430 431 return sideId; 432 } 433 434 int GetPageSettingsPageId(string pageSysName) 435 { 436 int sideId = 0; 437 438 var pw = Dynamicweb.Frontend.PageView.Current(); 439 440 if (pw.Page == null || pw.Page.PropertyItem == null || !pw.Page.PropertyItem.ContainsKey(pageSysName)) 441 { 442 return sideId; 443 } 444 445 string boligsideLink = pw.Page.PropertyItem[pageSysName] as String; 446 string linkPrefix = "Default.aspx?ID="; 447 448 if (!String.IsNullOrEmpty(boligsideLink) && boligsideLink.ToLower().StartsWith(linkPrefix.ToLower())) 449 { 450 Int32.TryParse(boligsideLink.Substring(linkPrefix.Length), out sideId); 451 } 452 453 return sideId; 454 } 455 void RenderMobileSelectBox(string name, int max, int step, string className, string inputname) 456 { 457 WriteLiteral(" <select"); 458 BeginWriteAttribute("class", " class=\"", 15952, "\"", 16007, 5); 459 WriteAttributeValue("", 15960, "form-control", 15960, 12, true); 460 WriteAttributeValue(" ", 15972, "d-block", 15973, 8, true); 461 WriteAttributeValue(" ", 15980, "d-lg-none", 15981, 10, true); 462 WriteAttributeValue(" ", 15990, "mb-10", 15991, 6, true); 463 WriteAttributeValue(" ", 15996, className, 15997, 10, false); 464 EndWriteAttribute(); 465 WriteLiteral(" onchange=\"submitFilter()\""); 466 BeginWriteAttribute("name", " name=\"", 16034, "\"", 16051, 1); 467 WriteAttributeValue("", 16041, inputname, 16041, 10, false); 468 EndWriteAttribute(); 469 WriteLiteral(">\r\n <option selected=\"true\" disabled=\"disabled\">"); 470 Write(Translate("Smartpage:Search.Placeholder." + name + "", "" + name + "")); 471 WriteLiteral("</option>\r\n\r\n"); 472 for (var i = 0; i <= max; i += step) 473 { 474 var selected = string.Empty; 475 var current = string.Empty; 476 if (i == max) 477 { 478 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString[inputname]) && Dynamicweb.Context.Current.Request.QueryString[inputname] == Convert.ToString(i)) 479 { 480 WriteLiteral(" <option"); 481 BeginWriteAttribute("value", " value=\"", 16647, "\"", 16657, 1); 482 WriteAttributeValue("", 16655, i, 16655, 2, false); 483 EndWriteAttribute(); 484 WriteLiteral(" data-value=\'"); 485 Write(Convert.ToInt32(i).ToString("N0")); 486 WriteLiteral("\' selected=\"selected\">"); 487 Write(Convert.ToInt32(i).ToString("N0")); 488 WriteLiteral("+</option>\r\n"); 489 } 490 else 491 { 492 WriteLiteral(" <option"); 493 BeginWriteAttribute("value", " value=\"", 16876, "\"", 16886, 1); 494 WriteAttributeValue("", 16884, i, 16884, 2, false); 495 EndWriteAttribute(); 496 WriteLiteral(" data-value=\'"); 497 Write(Convert.ToInt32(i).ToString("N0")); 498 WriteLiteral("\'>"); 499 Write(Convert.ToInt32(i).ToString("N0")); 500 WriteLiteral("+</option>\r\n"); 501 } 502 } 503 else 504 { 505 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString[inputname]) && Dynamicweb.Context.Current.Request.QueryString[inputname] == Convert.ToString(i)) 506 { 507 WriteLiteral(" <option"); 508 BeginWriteAttribute("value", " value=\"", 17310, "\"", 17320, 1); 509 WriteAttributeValue("", 17318, i, 17318, 2, false); 510 EndWriteAttribute(); 511 WriteLiteral(" data-value=\'"); 512 Write(Convert.ToInt32(i).ToString("N0")); 513 WriteLiteral("\' selected=\"selected\">"); 514 Write(Convert.ToInt32(i).ToString("N0")); 515 WriteLiteral("</option>\r\n"); 516 } 517 else 518 { 519 WriteLiteral(" <option"); 520 BeginWriteAttribute("value", " value=\"", 17538, "\"", 17548, 1); 521 WriteAttributeValue("", 17546, i, 17546, 2, false); 522 EndWriteAttribute(); 523 WriteLiteral(" data-value=\'"); 524 Write(Convert.ToInt32(i).ToString("N0")); 525 WriteLiteral("\'>"); 526 Write(Convert.ToInt32(i).ToString("N0")); 527 WriteLiteral("</option>\r\n"); 528 } 529 } 530 } 531 WriteLiteral(" </select>\r\n"); 532 } 533 534 void RenderTopFilter(string parameter) 535 { 536 if (parameter == "pricemin" || parameter == "pricemax") 537 { 538 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["pricemin"])) 539 { 540 if (parameter == "pricemin") 541 { 542 Write("<div class='search-terms' id='priceFilter'>"); 543 Write("Pris "); 544 Write(Dynamicweb.Context.Current.Request[parameter]); 545 546 } 547 548 else 549 { 550 Write(" - "); 551 Write(Dynamicweb.Context.Current.Request[parameter]); 552 Write(" kr."); 553 WriteLiteral(" <i class=\"fa fa-times ml-2 pointer\" onclick=\"removeParams(this)\" data-tag=\"pricemin,pricemax\"></i>\r\n"); 554 Write("</div>"); 555 556 } 557 } 558 } 559 560 else if (parameter == "subsidymin" || parameter == "subsidymax") 561 { 562 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["subsidymin"])) 563 { 564 if (parameter == "subsidymin") 565 { 566 Write("<div class='search-terms' id='subsidyFilter'>"); 567 Write("Årlig leje "); 568 Write(Dynamicweb.Context.Current.Request[parameter]); 569 570 } 571 572 else 573 { 574 Write(" - "); 575 Write(Dynamicweb.Context.Current.Request[parameter]); 576 Write(" kr."); 577 WriteLiteral(" <i class=\"fa fa-times ml-2 pointer\" onclick=\"removeParams(this)\" data-tag=\"subsidymin,subsidymax\"></i>\r\n"); 578 Write("</div>"); 579 580 } 581 } 582 } 583 else if (parameter == "etagearealmin" || parameter == "etagearealmax") 584 { 585 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["etagearealmin"])) 586 { 587 if (parameter == "etagearealmin") 588 { 589 Write("<div class='search-terms' id='etagearealFilter'>"); 590 Write("Etageareal "); 591 Write(Dynamicweb.Context.Current.Request[parameter]); 592 593 } 594 595 else 596 { 597 Write(" - "); 598 Write(Dynamicweb.Context.Current.Request[parameter]); 599 Write(" kvm."); 600 WriteLiteral(" <i class=\"fa fa-times ml-2 pointer\" onclick=\"removeParams(this)\" data-tag=\"etagearealmin,etagearealmax\"></i>\r\n"); 601 Write("</div>"); 602 603 } 604 } 605 } 606 607 else if (parameter == "grundarealmin" || parameter == "grundarealmax") 608 { 609 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["grundarealmin"])) 610 { 611 if (parameter == "grundarealmin") 612 { 613 Write("<div class='search-terms' id='grundarealFilter'>"); 614 Write("Grundareal "); 615 Write(Dynamicweb.Context.Current.Request[parameter]); 616 617 } 618 619 else 620 { 621 Write(" - "); 622 Write(Dynamicweb.Context.Current.Request[parameter]); 623 Write(" kvm."); 624 WriteLiteral(" <i class=\"fa fa-times ml-2 pointer\" onclick=\"removeParams(this)\" data-tag=\"grundarealmin,grundarealmax\"></i>\r\n"); 625 Write("</div>"); 626 627 } 628 } 629 } 630 631 else if (parameter == "subsidykvmmin" || parameter == "subsidykvmmax") 632 { 633 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["subsidykvmmin"])) 634 { 635 if (parameter == "subsidykvmmin") 636 { 637 Write("<div class='search-terms' id='subsidykvmFilter'>"); 638 Write("Årlig leje kvm "); 639 Write(Dynamicweb.Context.Current.Request[parameter]); 640 641 } 642 643 else 644 { 645 Write(" - "); 646 Write(Dynamicweb.Context.Current.Request[parameter]); 647 Write(" kr."); 648 WriteLiteral(" <i class=\"fa fa-times ml-2 pointer\" onclick=\"removeParams(this)\" data-tag=\"subsidykvmmin,subsidykvmmax\"></i>\r\n"); 649 Write("</div>"); 650 651 } 652 } 653 } 654 655 else if (parameter == "olinecategory") 656 { 657 658 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["olinecategory"])) 659 { 660 Dictionary<string, string> erhverType = new Dictionary<string, string>(){ 661 {"OwnUseOffices", "Kontor" }, { "OwnUseStoresAndProductions","Lager + Produktion" }, { "OwnUseRetailAndStores","Detailhandel" }, 662 { "OwnUseParcel", "Grunde" }, { "OwnUseHotelsAndRestaurants", "Hotel + Restaurant" }, { "OwnUseOtherTypes", "Andre typer"}, 663 { "Kontor", "Kontor" }, { "InvestmentStoresAndProductions", "Lager + Produktion" }, { "InvestmentHousingRental", "Boligudlejning" }, 664 { "InvestmentRetailAndStores", "Detailhandel" }, { "InvestmentParcel", "Grunde" }, { "InvestmentHotelsAndRestaurants", "Hotel + Restaurant" }, { "InvestmentOtherTypes", "Andre typer" } 665 }; 666 667 668 foreach (var er in erhverType) 669 { 670 if (Dynamicweb.Context.Current.Request[parameter].Contains(er.Key)) 671 { 672 WriteLiteral(" <div class=\"search-terms\""); 673 BeginWriteAttribute("id", " id=\"", 22718, "\"", 22733, 1); 674 WriteAttributeValue("", 22723, parameter, 22723, 10, false); 675 EndWriteAttribute(); 676 WriteLiteral(">\r\n "); 677 Write(er.Value); 678 WriteLiteral(" <i class=\"fa fa-times ml-2 pointer\" onclick=\"removeParams(this)\" data-tag=\""); 679 Write(parameter); 680 WriteLiteral("\" data-val=\""); 681 Write(er.Key); 682 WriteLiteral("\"></i>\r\n </div>\r\n"); 683 } 684 } 685 } 686 } 687 else if (parameter == "search") 688 { 689 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["search"])) 690 { 691 WriteLiteral(" <div class=\"search-terms\""); 692 BeginWriteAttribute("id", " id=\"", 23181, "\"", 23196, 1); 693 WriteAttributeValue("", 23186, parameter, 23186, 10, false); 694 EndWriteAttribute(); 695 WriteLiteral(">\r\n "); 696 Write(Dynamicweb.Context.Current.Request[parameter]); 697 WriteLiteral(" <i class=\"fa fa-times ml-2 pointer\" onclick=\"removeParams(this)\" data-tag=\""); 698 Write(parameter); 699 WriteLiteral("\"></i>\r\n </div>\r\n"); 700 } 701 } 702 else 703 { 704 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request[parameter])) 705 { 706 Dictionary<string, string> 707 ubudsform = new Dictionary<string, string> 708 (){ 709 {"salg", "Salg" }, { "leje","Leje" } 710 }; 711 712 foreach (var er in ubudsform) 713 { 714 if (Dynamicweb.Context.Current.Request[parameter].Contains(er.Key)) 715 { 716 WriteLiteral(" <div class=\"search-terms\""); 717 BeginWriteAttribute("id", " id=\"", 24345, "\"", 24360, 1); 718 WriteAttributeValue("", 24350, parameter, 24350, 10, false); 719 EndWriteAttribute(); 720 WriteLiteral(">\r\n "); 721 Write(er.Value); 722 WriteLiteral(" <i class=\"fa fa-times ml-2 pointer\" onclick=\"removeParams(this)\" data-tag=\""); 723 Write(parameter); 724 WriteLiteral("\" data-val=\""); 725 Write(er.Key); 726 WriteLiteral("\"></i>\r\n </div>\r\n"); 727 } 728 } 729 730 731 } 732 } 733 } 734 735 void RenderSelectValue(string dropdownname, string dropdownvalue, string queryString) 736 { 737 var selected = ""; 738 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString[queryString]) && Dynamicweb.Context.Current.Request.QueryString[queryString] == dropdownvalue) 739 { 740 selected = "selected"; 741 } 742 743 var current = string.Format("<option value='" + dropdownvalue + "'>" + dropdownname + "</option>", selected); 744 745 Write(current); 746 747 } 748 749 void RenderSearchForHousing(int searchPageId, string querySearch, string querySearchNameAttr, string queryZipCodeFrom, string queryZipCodeTo, string template, Item SettingsItem, string cssClasses = "") 750 { 751 WriteLiteral(" <div"); 752 BeginWriteAttribute("class", " class=\"", 25364, "\"", 25410, 3); 753 WriteAttributeValue("", 25372, "main-search-form", 25372, 16, true); 754 WriteAttributeValue(" ", 25388, "frontpage", 25389, 10, true); 755 WriteAttributeValue(" ", 25398, cssClasses, 25399, 11, false); 756 EndWriteAttribute(); 757 WriteLiteral(">\r\n <div class=\"dropdown-overlay\"></div>\r\n <div class=\"row mb-3 align-items-center\">\r\n <div class=\"col-xs-12 col-md-3 border-right\">\r\n <h3>"); 758 Write(Translate("Smartpage:Search.Søg bolig", "Søg bolig")); 759 WriteLiteral("</h3>\r\n </div>\r\n <div class=\"col-xs-12 col-md-9 home-count d-none d-md-block\">\r\n <span class=\"search-count\" id=\"searchCounter\">0</span> <span>"); 760 Write(Translate("Smartpage:Search.BoligerTilSalg", "Boliger til salg")); 761 WriteLiteral("</span>\r\n </div>\r\n </div>\r\n\r\n <form id=\"main-search-frontpage\" class=\"searchbar-wrapper\" action=\"/Default.aspx\" method=\"GET\">\r\n <input type=\"hidden\" name=\"ID\""); 762 BeginWriteAttribute("value", " value=\'", 26125, "\'", 26146, 1); 763 WriteAttributeValue("", 26133, searchPageId, 26133, 13, false); 764 EndWriteAttribute(); 765 WriteLiteral(@" id=""searchPageId-frontpage"" disabled=""disabled"" /> 766 <div class=""row form-wrapper no-gutters""> 767 768 <div class=""col-xs-12 col-md-5 col-searchbar""> 769 <div class=""searchbar""> 770 <input type=""text"""); 771 BeginWriteAttribute("name", " name=\"", 26424, "\"", 26451, 1); 772 WriteAttributeValue("", 26431, querySearchNameAttr, 26431, 20, false); 773 EndWriteAttribute(); 774 WriteLiteral(" id=\"searchfield-frontpage\" class=\"search-input\" placeholder=\"Postnummer, by, vej eller sagsnummer\" tabindex=\"1\""); 775 BeginWriteAttribute("value", " value=\"", 26564, "\"", 26642, 1); 776 WriteAttributeValue("", 26572, Dynamicweb.Core.Encoders.HtmlEncoder.HtmlAttributeEncode(querySearch), 26572, 70, false); 777 EndWriteAttribute(); 778 WriteLiteral(" />\r\n <input type=\"hidden\" id=\"zipcodefrom-frontpage\" name=\"zipcodefrom\""); 779 BeginWriteAttribute("value", " value=\"", 26742, "\"", 26825, 1); 780 WriteAttributeValue("", 26750, Dynamicweb.Core.Encoders.HtmlEncoder.HtmlAttributeEncode(queryZipCodeFrom), 26750, 75, false); 781 EndWriteAttribute(); 782 WriteLiteral(" />\r\n <input type=\"hidden\" id=\"zipcodeto-frontpage\" name=\"zipcodeto\""); 783 BeginWriteAttribute("value", " value=\"", 26921, "\"", 27002, 1); 784 WriteAttributeValue("", 26929, Dynamicweb.Core.Encoders.HtmlEncoder.HtmlAttributeEncode(queryZipCodeTo), 26929, 73, false); 785 EndWriteAttribute(); 786 WriteLiteral(@" /> 787 </div> 788 </div> 789 <div class=""col-xs-12 col-md-5""> 790 <div class=""row no-gutters""> 791 <div class=""col-xs-12 col-md-6 input-col""> 792 <div class=""dropdown w-overlay""> 793 <button class=""btn btn-dropdown dropdown-toggle reverse position-absolute-md"" type=""button"" id=""Boligtype-frontpage"" data-toggle=""dropdown"" aria-haspopup=""true"" aria-expanded=""false""> 794 "); 795 Write(Translate("Smartpage:Search.Boligtype", "Boligtype")); 796 WriteLiteral(@" 797 </button> 798 <div class=""dropdown-menu box-shadow bolig-dropdown-container"" aria-labelledby=""Boligtype""> 799 <ul class=""bolig-dropdown list-unstyled""> 800 "); 801 802 RenderBoligtypeCheckboxesDropdown(); 803 WriteLiteral(" </ul>\r\n <span class=\"border-fat\"></span>\r\n <button class=\"btn btn-primary js-close-dropdown\">"); 804 Write(Translate("Smartpage:Search.Anvend", "Anvend")); 805 WriteLiteral(@"</button> 806 </div> 807 808 </div> 809 810 </div> 811 <div class=""col-xs-12 col-md-6 input-col""> 812 <div class=""dropdown w-overlay""> 813 <button class=""btn btn-dropdown dropdown-toggle reverse position-absolute-md"" type=""button"" id=""Pris-frontpage"" data-toggle=""dropdown"" aria-haspopup=""true"" aria-expanded=""false""> 814 "); 815 Write(Translate("Smartpage:Search.Pris", "Pris")); 816 WriteLiteral(@" 817 </button> 818 <div class=""dropdown-menu box-shadow dropdown-price"" aria-labelledby=""Pris""> 819 <input type=""text"" class=""form-control mb-10 js-auto-thousand js-pricemin-frontpage-input"""); 820 BeginWriteAttribute("placeholder", " placeholder=\'", 29181, "\'", 29257, 1); 821 WriteAttributeValue("", 29195, Translate("Smartpage:Search.Placeholder.MinPris","Min. pris"), 29195, 62, false); 822 EndWriteAttribute(); 823 WriteLiteral(" />\r\n <select class=\"form-control js-pricemin-frontpage-select js-input-min-select mb-10\">\r\n <option selected=\"true\" disabled=\"disabled\">"); 824 Write(Translate("Smartpage:Search.Placeholder.MinPris", "Min. pris")); 825 WriteLiteral("</option>\r\n"); 826 for (var i = 0; i <= 10000000; i += 100000) 827 { 828 if (i == 10000000) 829 { 830 WriteLiteral(" <option"); 831 BeginWriteAttribute("value", " value=\"", 29866, "\"", 29876, 1); 832 WriteAttributeValue("", 29874, i, 29874, 2, false); 833 EndWriteAttribute(); 834 WriteLiteral(" data-value=\'"); 835 Write(Convert.ToInt32(i).ToString("N0")); 836 WriteLiteral("+\'>"); 837 Write(Convert.ToInt32(i).ToString("N0")); 838 WriteLiteral("+</option>\r\n"); 839 } 840 else 841 { 842 WriteLiteral(" <option"); 843 BeginWriteAttribute("value", " value=\"", 30188, "\"", 30198, 1); 844 WriteAttributeValue("", 30196, i, 30196, 2, false); 845 EndWriteAttribute(); 846 WriteLiteral(" data-value=\'"); 847 Write(Convert.ToInt32(i).ToString("N0")); 848 WriteLiteral("\'>"); 849 Write(Convert.ToInt32(i).ToString("N0")); 850 WriteLiteral("</option>\r\n"); 851 } 852 } 853 WriteLiteral(@" </select> 854 <input type=""hidden"" id=""pricemin-frontpage"" name=""pricemin"" /> 855 856 <input type=""text"" class=""form-control js-auto-thousand js-pricemax-frontpage-input"""); 857 BeginWriteAttribute("placeholder", " placeholder=\'", 30673, "\'", 30749, 1); 858 WriteAttributeValue("", 30687, Translate("Smartpage:Search.Placeholder.MaxPris","Max. pris"), 30687, 62, false); 859 EndWriteAttribute(); 860 WriteLiteral(" />\r\n <select class=\"form-control js-pricemax-frontpage-select js-input-max-select\">\r\n <option selected=\"true\" disabled=\"disabled\">"); 861 Write(Translate("Smartpage:Search.Placeholder.MaxPris", "Max. pris")); 862 WriteLiteral("</option>\r\n"); 863 for (var i = 0; i <= 10000000; i += 100000) 864 { 865 if (i == 10000000) 866 { 867 WriteLiteral(" <option"); 868 BeginWriteAttribute("value", " value=\"", 31352, "\"", 31362, 1); 869 WriteAttributeValue("", 31360, i, 31360, 2, false); 870 EndWriteAttribute(); 871 WriteLiteral(" data-value=\'"); 872 Write(Convert.ToInt32(i).ToString("N0")); 873 WriteLiteral("+\'>"); 874 Write(Convert.ToInt32(i).ToString("N0")); 875 WriteLiteral("+</option>\r\n"); 876 } 877 else 878 { 879 WriteLiteral(" <option"); 880 BeginWriteAttribute("value", " value=\"", 31674, "\"", 31684, 1); 881 WriteAttributeValue("", 31682, i, 31682, 2, false); 882 EndWriteAttribute(); 883 WriteLiteral(" data-value=\'"); 884 Write(Convert.ToInt32(i).ToString("N0")); 885 WriteLiteral("\'>"); 886 Write(Convert.ToInt32(i).ToString("N0")); 887 WriteLiteral("</option>\r\n"); 888 } 889 } 890 WriteLiteral(" </select>\r\n <input type=\"hidden\" id=\"pricemax-frontpage\" name=\"pricemax\" />\r\n <button class=\"btn btn-primary js-close-dropdown mt-3\">"); 891 Write(Translate("Smartpage:Search.Anvend", "Anvend")); 892 WriteLiteral(@"</button> 893 </div> 894 </div> 895 </div> 896 </div> 897 </div> 898 <div class=""col-xs-12 col-md-2 d-none d-md-block""> 899 <button type=""submit"" class=""btn btn-block btn-search""><i class=""fa fa-search""></i> "); 900 Write(Translate("Smartpage:Search.Søg", "Søg")); 901 WriteLiteral(@"</button> 902 </div> 903 </div> 904 905 <div class=""row moresearch-btn no-gutters""> 906 <div class=""col-sm-12""> 907 <div class=""row align-items-center no-gutters""> 908 <div class=""col-12 col-md-4""> 909 <button class=""btn-blank js-search-collapse"" type=""button"" data-toggle=""collapse"" data-target=""#moreSearch"" aria-expanded=""false"" aria-controls=""moreSearch""> 910 <span class=""moreSearch-text""><i class=""fas fa-plus open-close""></i> <span class=""not-open"">"); 911 Write(Translate("Smartpage:Search.Flere søgemuligheder", "Flere søgemuligheder")); 912 WriteLiteral("</span> <span class=\"open\"><span class=\"js-filter-count\">0</span> "); 913 Write(Translate("Smartpage:Search.FiltreAnvendt", "filtre anvendt")); 914 WriteLiteral(" </span></span>\r\n </button>\r\n </div>\r\n <div class=\"col-6 col-md-2 mb-xs-4\">\r\n <a class=\"js-reset reset-btn\">"); 915 Write(Translate("Smartpage:Search.NulstilValg", "Nulstil valg")); 916 WriteLiteral("</a>\r\n </div>\r\n </div>\r\n\r\n <div class=\"collapse\" id=\"moreSearch\">\r\n <h4 class=\"mt-20\"><b>"); 917 Write(Translate("Smartpage:Search.Bolig", "Bolig")); 918 WriteLiteral(@"</b></h4> 919 <div class=""row align-items-end mb-30""> 920 <div class=""col-12 col-sm-6 col-lg-3 mb-3 mb-lg-0""> 921 <div class=""filter-container row""> 922 <label class=""d-block col-12"">"); 923 Write(Translate("Smartpage:Search.Boligareal", "Boligareal")); 924 WriteLiteral(@"</label> 925 <div class=""col-6 pr-sm-0 pr-2""> 926 <input type=""text"" name=""boligarealmin"" id=""boligarealmin-frontpage"" class=""form-control js-boligarealmin-frontpage-input js-count"""); 927 BeginWriteAttribute("placeholder", " placeholder=\'", 34550, "\'", 34622, 1); 928 WriteAttributeValue("", 34564, Translate("Smartpage:Search.Placeholder.Minm2","Min. m2"), 34564, 58, false); 929 EndWriteAttribute(); 930 WriteLiteral(" />\r\n <select class=\"form-control js-boligarealmin-frontpage-select js-count\">\r\n <option selected=\"true\" disabled=\"disabled\">"); 931 Write(Translate("Smartpage:Search.Placeholder.Minm2", "Min. m2")); 932 WriteLiteral("</option>\r\n"); 933 for (var i = 0; i <= 300; i += 10) 934 { 935 if (i == 300) 936 { 937 WriteLiteral(" <option"); 938 BeginWriteAttribute("value", " value=\"", 35229, "\"", 35239, 1); 939 WriteAttributeValue("", 35237, i, 35237, 2, false); 940 EndWriteAttribute(); 941 WriteLiteral(">"); 942 Write(i); 943 WriteLiteral("+</option>\r\n"); 944 } 945 else 946 { 947 WriteLiteral(" <option"); 948 BeginWriteAttribute("value", " value=\"", 35486, "\"", 35496, 1); 949 WriteAttributeValue("", 35494, i, 35494, 2, false); 950 EndWriteAttribute(); 951 WriteLiteral(">"); 952 Write(i); 953 WriteLiteral("</option>\r\n"); 954 } 955 } 956 WriteLiteral(@" </select> 957 </div> 958 <div class=""col-6 pl-sm-0 pl-2""> 959 <input type=""text"" name=""boligarealmax"" id=""boligarealmax-frontpage"" class=""form-control js-boligarealmax-frontpage-input js-count"""); 960 BeginWriteAttribute("placeholder", " placeholder=\'", 35969, "\'", 36041, 1); 961 WriteAttributeValue("", 35983, Translate("Smartpage:Search.Placeholder.Maxm2","Max. m2"), 35983, 58, false); 962 EndWriteAttribute(); 963 WriteLiteral(" />\r\n <select class=\"form-control js-boligarealmax-frontpage-select js-count\">\r\n <option selected=\"true\" disabled=\"disabled\">"); 964 Write(Translate("Smartpage:Search.Placeholder.Maxm2", "Max. m2")); 965 WriteLiteral("</option>\r\n"); 966 for (var i = 0; i <= 300; i += 10) 967 { 968 if (i == 300) 969 { 970 WriteLiteral(" <option"); 971 BeginWriteAttribute("value", " value=\"", 36648, "\"", 36658, 1); 972 WriteAttributeValue("", 36656, i, 36656, 2, false); 973 EndWriteAttribute(); 974 WriteLiteral(">"); 975 Write(i); 976 WriteLiteral("+</option>\r\n"); 977 } 978 else 979 { 980 WriteLiteral(" <option"); 981 BeginWriteAttribute("value", " value=\"", 36905, "\"", 36915, 1); 982 WriteAttributeValue("", 36913, i, 36913, 2, false); 983 EndWriteAttribute(); 984 WriteLiteral(">"); 985 Write(i); 986 WriteLiteral("</option>\r\n"); 987 } 988 } 989 WriteLiteral(@" </select> 990 </div> 991 </div> 992 </div> 993 <div class=""col-12 col-sm-6 col-lg-3 mb-3 mb-lg-0""> 994 <div class=""filter-container row""> 995 <label class=""d-block col-12"">"); 996 Write(Translate("Smartpage:Search.Grundareal", "Grundareal")); 997 WriteLiteral(@"</label> 998 <div class=""col-6 pr-sm-0 pr-2""> 999 <input type=""text"" name=""grundarealmin"" id=""grundarealmin-frontpage"" class=""form-control js-grundarealmin-frontpage-input js-count"""); 1000 BeginWriteAttribute("placeholder", " placeholder=\'", 37764, "\'", 37836, 1); 1001 WriteAttributeValue("", 37778, Translate("Smartpage:Search.Placeholder.Minm2","Min. m2"), 37778, 58, false); 1002 EndWriteAttribute(); 1003 WriteLiteral(" />\r\n <select class=\"form-control js-grundarealmin-frontpage-select js-count\">\r\n <option selected=\"true\" disabled=\"disabled\">"); 1004 Write(Translate("Smartpage:Search.Placeholder.Minm2", "Min. m2")); 1005 WriteLiteral("</option>\r\n"); 1006 for (var i = 0; i <= 10000; i += 100) 1007 { 1008 if (i == 10000) 1009 { 1010 WriteLiteral(" <option"); 1011 BeginWriteAttribute("value", " value=\"", 38448, "\"", 38458, 1); 1012 WriteAttributeValue("", 38456, i, 38456, 2, false); 1013 EndWriteAttribute(); 1014 WriteLiteral(">"); 1015 Write(i); 1016 WriteLiteral("+</option>\r\n"); 1017 } 1018 else 1019 { 1020 WriteLiteral(" <option"); 1021 BeginWriteAttribute("value", " value=\"", 38705, "\"", 38715, 1); 1022 WriteAttributeValue("", 38713, i, 38713, 2, false); 1023 EndWriteAttribute(); 1024 WriteLiteral(">"); 1025 Write(i); 1026 WriteLiteral("</option>\r\n"); 1027 } 1028 } 1029 WriteLiteral(@" </select> 1030 </div> 1031 <div class=""col-6 pl-sm-0 pl-2""> 1032 <input type=""text"" name=""grundarealmax"" id=""grundarealmax-frontpage"" class=""form-control js-grundarealmax-frontpage-input js-count"""); 1033 BeginWriteAttribute("placeholder", " placeholder=\'", 39188, "\'", 39260, 1); 1034 WriteAttributeValue("", 39202, Translate("Smartpage:Search.Placeholder.Maxm2","Max. m2"), 39202, 58, false); 1035 EndWriteAttribute(); 1036 WriteLiteral(" />\r\n <select class=\"form-control js-grundarealmax-frontpage-select js-count\">\r\n <option selected=\"true\" disabled=\"disabled\">"); 1037 Write(Translate("Smartpage:Search.Placeholder.Maxm2", "Max. m2")); 1038 WriteLiteral("</option>\r\n"); 1039 for (var i = 0; i <= 10000; i += 100) 1040 { 1041 if (i == 10000) 1042 { 1043 WriteLiteral(" <option"); 1044 BeginWriteAttribute("value", " value=\"", 39872, "\"", 39882, 1); 1045 WriteAttributeValue("", 39880, i, 39880, 2, false); 1046 EndWriteAttribute(); 1047 WriteLiteral(">"); 1048 Write(i); 1049 WriteLiteral("+</option>\r\n"); 1050 } 1051 else 1052 { 1053 WriteLiteral(" <option"); 1054 BeginWriteAttribute("value", " value=\"", 40129, "\"", 40139, 1); 1055 WriteAttributeValue("", 40137, i, 40137, 2, false); 1056 EndWriteAttribute(); 1057 WriteLiteral(">"); 1058 Write(i); 1059 WriteLiteral("</option>\r\n"); 1060 } 1061 } 1062 WriteLiteral(@" </select> 1063 </div> 1064 </div> 1065 </div> 1066 <div class=""col-12 col-sm-6 col-lg-3 mb-3 mb-lg-0""> 1067 <div class=""filter-container row""> 1068 <label class=""d-block col-12"">Antal rum</label> 1069 1070 <div class=""col-6 pr-sm-0 pr-2""> 1071 <select name=""roomsmin"" id=""roomsmin-frontpage"" class=""form-control reverse js-count""> 1072 <option selected=""true"" disabled=""disabled"">"); 1073 Write(Translate("Smartpage:Search.Placeholder.Min", "Min")); 1074 WriteLiteral(@"</option> 1075 <option value=""1"">1</option> 1076 <option value=""2"">2</option> 1077 <option value=""3"">3</option> 1078 <option value=""4"">4</option> 1079 <option value=""5+"">5+</option> 1080 </select> 1081 </div> 1082 <div class=""col-6 pl-sm-0 pl-2""> 1083 <select name=""roomsmax"" id=""roomsmax-frontpage"" class=""form-control reverse js-count""> 1084 <option selected=""true"" disabled=""disabled"">"); 1085 Write(Translate("Smartpage:Search.Placeholder.Max", "Max")); 1086 WriteLiteral(@"</option> 1087 <option value=""1"">1</option> 1088 <option value=""2"">2</option> 1089 <option value=""3"">3</option> 1090 <option value=""4"">4</option> 1091 <option value=""5+"">"); 1092 Write(Translate("Smartpage:Rooms.5", "5")); 1093 WriteLiteral(@"</option> 1094 </select> 1095 </div> 1096 </div> 1097 </div> 1098 <div class=""col-12 col-sm-6 col-lg-3 mb-3 mb-lg-0""> 1099 <div class=""row""> 1100 <div class=""col-12""> 1101 <div class=""filter-container""> 1102 <label class=""d-block"">Energimærke</label> 1103 <select name=""energylabel"" id=""energylabel-frontpage"" class=""form-control reverse js-count""> 1104 <option disabled selected=""selected"">"); 1105 Write(Translate("Smartpage:Search.Vælg", "Vælg")); 1106 WriteLiteral(@"</option> 1107 <option value=""01"">G</option> 1108 <option value=""02"">F</option> 1109 <option value=""03"">E</option> 1110 <option value=""04"">D</option> 1111 <option value=""05"">C</option> 1112 <option value=""06"">B</option> 1113 <option value=""07"">A</option> 1114 <option value=""08"">A2010</option> 1115 <option value=""09"">A2015</option> 1116 <option value=""10"">A2020+</option> 1117 </select> 1118 </div> 1119 </div> 1120 "); 1121 WriteLiteral(" </div>\r\n </div>\r\n <div class=\"col-12 col-sm-6 col-lg-3 mt-3\">\r\n <h4"); 1122 BeginWriteAttribute("class", " class=\"", 44384, "\"", 44392, 0); 1123 EndWriteAttribute(); 1124 WriteLiteral("><b>"); 1125 Write(Translate("Smartpage:Search.Økonomi", "Økonomi")); 1126 WriteLiteral("</b></h4>\r\n <div class=\"filter-container row\">\r\n <label class=\"d-block col-12\">"); 1127 Write(Translate("Smartpage:Search.Ejerudgift/boligydelse pr. måned", "Ejerudgift/boligydelse pr. måned")); 1128 WriteLiteral("</label>\r\n <div class=\"col-6 pr-sm-0 pr-2\">\r\n <input type=\"text\" name=\"subsidymin\" id=\"subsidymin-frontpage\" class=\"form-control js-subsidymin-frontpage-input js-count\""); 1129 BeginWriteAttribute("placeholder", " placeholder=\'", 44948, "\'", 45022, 1); 1130 WriteAttributeValue("", 44962, Translate("Smartpage:Search.Placeholder.MinDKK","Min. DKK"), 44962, 60, false); 1131 EndWriteAttribute(); 1132 WriteLiteral(" />\r\n <select class=\"form-control js-subsidymin-frontpage-select js-count\">\r\n <option selected=\"true\" disabled=\"disabled\">"); 1133 Write(Translate("Smartpage:Search.Placeholder.MinDKK", "Min. DKK")); 1134 WriteLiteral("</option>\r\n"); 1135 for (var i = 0; i <= 25000; i += 1250) 1136 { 1137 if (i == 25000) 1138 { 1139 WriteLiteral(" <option>"); 1140 Write(Convert.ToInt32(i).ToString("N0")); 1141 WriteLiteral("+</option>\r\n"); 1142 } 1143 else 1144 { 1145 WriteLiteral(" <option>"); 1146 Write(Convert.ToInt32(i).ToString("N0")); 1147 WriteLiteral("</option>\r\n"); 1148 } 1149 } 1150 WriteLiteral(@" </select> 1151 </div> 1152 <div class=""col-6 pl-sm-0 pl-2""> 1153 <input type=""text"" name=""subsidymax"" id=""subsidymax-frontpage"" class=""form-control js-subsidymax-frontpage-input js-count"""); 1154 BeginWriteAttribute("placeholder", " placeholder=\'", 46407, "\'", 46481, 1); 1155 WriteAttributeValue("", 46421, Translate("Smartpage:Search.Placeholder.MaxDKK","Max. DKK"), 46421, 60, false); 1156 EndWriteAttribute(); 1157 WriteLiteral(" />\r\n <select class=\"form-control js-subsidymax-frontpage-select js-count\">\r\n <option selected=\"true\" disabled=\"disabled\">"); 1158 Write(Translate("Smartpage:Search.Placeholder.MaxDKK", "Max. DKK")); 1159 WriteLiteral("</option>\r\n"); 1160 for (var i = 0; i <= 25000; i += 1250) 1161 { 1162 if (i == 25000) 1163 { 1164 WriteLiteral(" <option"); 1165 BeginWriteAttribute("value", " value=\"", 47093, "\"", 47120, 1); 1166 WriteAttributeValue("", 47101, Convert.ToInt32(i), 47101, 19, false); 1167 EndWriteAttribute(); 1168 WriteLiteral(">"); 1169 Write(Convert.ToInt32(i).ToString("N0")); 1170 WriteLiteral("+</option>\r\n"); 1171 } 1172 else 1173 { 1174 WriteLiteral(" <option"); 1175 BeginWriteAttribute("value", " value=\"", 47399, "\"", 47426, 1); 1176 WriteAttributeValue("", 47407, Convert.ToInt32(i), 47407, 19, false); 1177 EndWriteAttribute(); 1178 WriteLiteral(">"); 1179 Write(Convert.ToInt32(i).ToString("N0")); 1180 WriteLiteral("</option>\r\n"); 1181 } 1182 } 1183 WriteLiteral(@" </select> 1184 </div> 1185 </div> 1186 </div> 1187 <div class=""col-12 col-sm-6 col-lg-4 offset-lg-5 mt-3 mt-sm-0""> 1188 <button type=""submit"" class=""btn btn-block btn-search""><i class=""fa fa-search""></i> "); 1189 Write(Translate("Smartpage:Search.AnvendFiltre", "Anvend filtre")); 1190 WriteLiteral(@"</button> 1191 </div> 1192 </div> 1193 </div> 1194 </div> 1195 </div> 1196 1197 <div class=""row d-block d-md-none form-wrapper no-gutters""> 1198 <div class=""col-xs-12 col-md-2""> 1199 <button type=""submit"" class=""btn btn-block btn-search btn-mobile-search"">"); 1200 Write(Translate("Smartpage:Search.SøgBolig", "Søg Bolig")); 1201 WriteLiteral(@"<i class=""fa fa-search cta-icon""></i></button> 1202 </div> 1203 </div> 1204 </form> 1205 <div class=""front-page-actions d-md-none""> 1206 <div> 1207 <button class=""btn btn-block btn-search btn-mobile-search js-search-mobile"">"); 1208 Write(Translate("Smartpage:Search.SøgBolig", "Søg Bolig")); 1209 WriteLiteral("<i class=\"fa fa-search cta-icon\"></i></button>\r\n </div>\r\n <div>\r\n"); 1210 1211 string brokerSearchId = SettingsItem != null ? Dynamicweb.Core.Converter.ToString(SettingsItem["Maeglersogning"]).Replace("Default.aspx?Id=", "") : ""; 1212 string ctaText = Translate("Smartpage.Frontpage.Mobile.FindBroker", "FIND EJENDOMSMÆGLER"); 1213 WriteLiteral(" <form method=\"GET\" action=\"/Default.aspx\">\r\n <input name=\"id\""); 1214 BeginWriteAttribute("value", " value=\"", 49369, "\"", 49392, 1); 1215 WriteAttributeValue("", 49377, brokerSearchId, 49377, 15, false); 1216 EndWriteAttribute(); 1217 WriteLiteral(@" type=""hidden"" /> 1218 <div class=""icon-wrapper-wclick""> 1219 <i class=""fas fa-search ta-submit-on-icon-click""></i> 1220 <input class=""box-cta-input ta-postnummer ta-submit-on-select ta-submit-on-enter"" name=""q"" type=""text"""); 1221 BeginWriteAttribute("placeholder", " placeholder=\"", 49696, "\"", 49718, 1); 1222 WriteAttributeValue("", 49710, ctaText, 49710, 8, false); 1223 EndWriteAttribute(); 1224 WriteLiteral(" onfocus=\"this.placeholder = \'\'\""); 1225 BeginWriteAttribute("onblur", " onblur=\"", 49751, "\"", 49787, 3); 1226 WriteAttributeValue("", 49760, "this.placeholder=\'", 49760, 18, true); 1227 WriteAttributeValue("", 49778, ctaText, 49778, 8, false); 1228 WriteAttributeValue("", 49786, "\'", 49786, 1, true); 1229 EndWriteAttribute(); 1230 WriteLiteral(" />\r\n </div>\r\n </form>\r\n"); 1231 WriteLiteral(" </div>\r\n <div>\r\n <a href=\"javascript:panelSalgsvurdering(\'Hovedmenu\')\" class=\"btn btn-orange btn-block\">"); 1232 Write(Translate("Smartpage:Frontpage.Mobile.GetFreeAppraisal", "BESTIL GRATIS VURDERING")); 1233 WriteLiteral("<i class=\"cta-icon fa fa-angle-right\"></i></a>\r\n </div>\r\n </div>\r\n </div>\r\n"); 1234 1235 } 1236 Custom.Integration.Brokers.Models.BrokerEmployee GetBrokerFromCurrentProduct() 1237 { 1238 string productId = Dynamicweb.Context.Current.Request["ProductId"]; 1239 1240 if (string.IsNullOrWhiteSpace(productId)) 1241 { 1242 return null; 1243 } 1244 1245 var propertyProduct = Dynamicweb.Ecommerce.Services.Products.GetProductById(productId, string.Empty, true); 1246 if (propertyProduct == null) 1247 { 1248 return null; 1249 } 1250 1251 string employee = Dynamicweb.Core.Converter.ToString( 1252 Dynamicweb.Ecommerce.Services.Products.GetProductFieldValue(propertyProduct, "xAktoererMaeglerKontaktEmail") 1253 ); 1254 string storeId = Dynamicweb.Core.Converter.ToString( 1255 Dynamicweb.Ecommerce.Services.Products.GetProductFieldValue(propertyProduct, "xButikID") 1256 ); 1257 1258 if (string.IsNullOrWhiteSpace(employee) || string.IsNullOrWhiteSpace(storeId)) 1259 { 1260 return null; 1261 } 1262 1263 return Custom.Integration.Brokers.Search.GetEmployee(storeId, employee); 1264 } 1265 1266 string GetAgentTitleFromCurrentProduct() 1267 { 1268 var propBroker = GetBrokerFromCurrentProduct(); 1269 1270 if (propBroker?.Broker == null) 1271 { 1272 return string.Empty; 1273 } 1274 1275 if (!string.IsNullOrEmpty(propBroker.Broker.CompanyName)) 1276 { 1277 return propBroker.Broker.CompanyName; 1278 } 1279 1280 return propBroker.Broker.Name ?? string.Empty; 1281 } 1282 1283 string GetMasterBrokerUrlFromCurrentProduct() 1284 { 1285 var propBroker = GetBrokerFromCurrentProduct(); 1286 1287 var itemId = propBroker?.Broker?.ItemId; 1288 var itemType = propBroker?.Broker?.ItemType; 1289 1290 if (string.IsNullOrWhiteSpace(itemId) || string.IsNullOrWhiteSpace(itemType)) 1291 { 1292 return string.Empty; 1293 } 1294 var brokerItem = Dynamicweb.Content.Items.ItemManager.Storage.GetById(itemType, itemId); 1295 1296 if (brokerItem == null) 1297 { 1298 return string.Empty; 1299 } 1300 1301 var websiteId = Dynamicweb.Core.Converter.ToInt32(brokerItem["WebsiteId"]); 1302 var page = Dynamicweb.Content.Services.Pages.GetFirstPageForArea(websiteId); 1303 return Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("Default.aspx?Id=" + page?.ID); 1304 } 1305 1306 // === Video link helpers (used by the property page) === 1307 1308 // True when the link points directly at a video file we can play in a <video> element. Everything else is iframed. 1309 bool IsDirectVideoFile(string url) 1310 { 1311 if (string.IsNullOrWhiteSpace(url)) { return false; } 1312 1313 // Strip query/fragment before checking the file extension. 1314 string path = url.Split('?', '#')[0]; 1315 string[] directExtensions = { ".mp4", ".webm", ".ogg", ".ogv", ".mov", ".m4v" }; 1316 foreach (var ext in directExtensions) 1317 { 1318 if (path.EndsWith(ext, StringComparison.InvariantCultureIgnoreCase)) { return true; } 1319 } 1320 return false; 1321 } 1322 1323 string GetYouTubeId(string url) 1324 { 1325 if (string.IsNullOrWhiteSpace(url)) { return string.Empty; } 1326 1327 string[] patterns = { @"youtu\.be/([^?&/]+)", @"[?&]v=([^?&]+)", @"/embed/([^?&/]+)", @"/shorts/([^?&/]+)" }; 1328 foreach (var pattern in patterns) 1329 { 1330 var match = System.Text.RegularExpressions.Regex.Match(url, pattern); 1331 if (match.Success) { return match.Groups[1].Value; } 1332 } 1333 1334 return string.Empty; 1335 } 1336 1337 string GetVimeoId(string url) 1338 { 1339 if (string.IsNullOrWhiteSpace(url)) { return string.Empty; } 1340 var match = System.Text.RegularExpressions.Regex.Match(url, @"vimeo\.com/(?:.*?/)?(\d+)"); 1341 return match.Success ? match.Groups[1].Value : string.Empty; 1342 } 1343 1344 string GetVimeoHash(string url) 1345 { 1346 if (string.IsNullOrWhiteSpace(url)) { return string.Empty; } 1347 // Unlisted videos carry a privacy hash: vimeo.com/{id}/{hash} 1348 var match = System.Text.RegularExpressions.Regex.Match(url, @"vimeo\.com/(?:.*?/)?\d+/(\w+)"); 1349 return match.Success ? match.Groups[1].Value : string.Empty; 1350 } 1351 1352 // Builds the iframe src for a non-file link. YouTube/Vimeo share links are rewritten to their embeddable form 1353 // (their pages block framing); every other link (Matterport, CR3, already-embeddable pages) is used as-is. 1354 string BuildEmbedUrl(string url, bool background) 1355 { 1356 if (string.IsNullOrWhiteSpace(url)) { return string.Empty; } 1357 1358 if (url.Contains("youtube", StringComparison.InvariantCultureIgnoreCase) || url.Contains("youtu.be", StringComparison.InvariantCultureIgnoreCase)) 1359 { 1360 string id = GetYouTubeId(url); 1361 if (!string.IsNullOrEmpty(id)) 1362 { 1363 string baseUrl = "https://www.youtube-nocookie.com/embed/" + id; 1364 return background 1365 ? baseUrl + "?autoplay=1&mute=1&loop=1&playlist=" + id + "&controls=0&playsinline=1&rel=0" 1366 : baseUrl + "?rel=0"; 1367 } 1368 } 1369 else if (url.Contains("vimeo", StringComparison.InvariantCultureIgnoreCase)) 1370 { 1371 string id = GetVimeoId(url); 1372 if (!string.IsNullOrEmpty(id)) 1373 { 1374 string baseUrl = "https://player.vimeo.com/video/" + id; 1375 var queryParams = new List<string>(); 1376 string hash = GetVimeoHash(url); 1377 if (!string.IsNullOrEmpty(hash)) { queryParams.Add("h=" + hash); } 1378 if (background) { queryParams.Add("background=1"); } 1379 return queryParams.Count > 0 ? baseUrl + "?" + string.Join("&", queryParams) : baseUrl; 1380 } 1381 } 1382 1383 // Matterport, CR3 and any already-embeddable link frame as-is. 1384 return url; 1385 } 1386 1387 public class WrapMethods 1388 { 1389 //Gets the contrasting color 1390 public static string getContrastYIQ(string hexcolor) 1391 { 1392 if (hexcolor != "") 1393 { 1394 hexcolor = Regex.Replace(hexcolor, "[^0-9a-zA-Z]+", ""); 1395 1396 int r = Convert.ToByte(hexcolor.Substring(0, 2), 16); 1397 int g = Convert.ToByte(hexcolor.Substring(2, 2), 16); 1398 int b = Convert.ToByte(hexcolor.Substring(4, 2), 16); 1399 int yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000; 1400 1401 if (yiq >= 128) 1402 { 1403 return "black"; 1404 } 1405 else 1406 { 1407 return "white"; 1408 } 1409 } 1410 else 1411 { 1412 return "black"; 1413 } 1414 } 1415 1416 1417 //Truncate text 1418 public static string Truncate (string value, int count, bool strip=true) 1419 { 1420 if (strip == true){ 1421 value = StripHtmlTagByCharArray(value); 1422 } 1423 1424 if (value.Length > count) 1425 { 1426 value = value.Substring(0, count - 1) + "..."; 1427 } 1428 1429 return value; 1430 } 1431 1432 //Truncate Reverse 1433 public static string TruncateReverse (string value, int count) 1434 { 1435 if (value.Length > count) 1436 { 1437 value = value.Substring(count, value.Length); 1438 } 1439 return value; 1440 } 1441 1442 1443 //Strip text from HTML 1444 public static string StripHtmlTagByCharArray(string htmlString) 1445 { 1446 char[] array = new char[htmlString.Length]; 1447 int arrayIndex = 0; 1448 bool inside = false; 1449 1450 for (int i = 0; i < htmlString.Length; i++) 1451 { 1452 char let = htmlString[i]; 1453 if (let == '<') 1454 { 1455 inside = true; 1456 continue; 1457 } 1458 if (let == '>') 1459 { 1460 inside = false; 1461 continue; 1462 } 1463 if (!inside) 1464 { 1465 array[arrayIndex] = let; 1466 arrayIndex++; 1467 } 1468 } 1469 return new string(array, 0, arrayIndex); 1470 } 1471 1472 //Make the correct count of columns 1473 public static string ColumnMaker(int Col, string ScreenSize) 1474 { 1475 string Columns = ""; 1476 1477 switch (Col) 1478 { 1479 case 1: 1480 Columns = "col-"+ScreenSize+"-12"; 1481 break; 1482 1483 case 2: 1484 Columns = "col-"+ScreenSize+"-6"; 1485 break; 1486 1487 case 3: 1488 Columns = "col-"+ScreenSize+"-4"; 1489 break; 1490 1491 case 4: 1492 Columns = "col-"+ScreenSize+"-3"; 1493 break; 1494 1495 default: 1496 Columns = "col-"+ScreenSize+"-3"; 1497 break; 1498 } 1499 1500 return Columns; 1501 } 1502 1503 1504 private string Custom(string firstoption, string secondoption) 1505 { 1506 if (firstoption == "custom") 1507 { 1508 return secondoption; 1509 } 1510 else 1511 { 1512 return firstoption; 1513 } 1514 } 1515 } 1516 1517 void RenderBoligList(List<LoopItem> boliglist) 1518 { 1519 int propertyIndex = GetInteger("Ecom:ProductList.CurrentPage") > 0 ? (GetInteger("Ecom:ProductList.CurrentPage") - 1) * GetInteger("Ecom:ProductList.PageSize") : 0; 1520 foreach (LoopItem bolig in boliglist) 1521 { 1522 RenderPropertyCard(bolig, propertyIndex); 1523 propertyIndex++; 1524 } 1525 } 1526 1527 void RenderPropertyCard(LoopItem property, int propertyIndex, int? itemsPerPage = null) 1528 { 1529 int? pageNum = itemsPerPage != null ? (propertyIndex / itemsPerPage) + 1 : null; 1530 string fallbackImage = "/Files/Templates/Designs/rm/assets/images/na-real.png"; 1531 string iconPath = "/Files/Templates/Designs/rm/assets/images/svg/"; 1532 var boligManager = new RealMaeglerne.Library.BoligManager(Pageview); 1533 RealMaeglerne.Library.Models.Bolig bolig = boligManager.CreateBolig(property, true); 1534 1535 bool isRental = bolig.UdbudsForm.Equals("Leje", StringComparison.InvariantCultureIgnoreCase); 1536 string propCategory = isRental 1537 ? Translate("Custom.Property.Rental.PropertyCategory", "Lejebolig") 1538 : (!string.IsNullOrWhiteSpace(bolig.EjendomstypeDisplay) ? bolig.EjendomstypeDisplay : bolig.Ejendomskategori); 1539 1540 List<RealMaeglerne.Library.Models.Bolig.CaseAsset> allImages = bolig.ImagesOfProperty.Take(3).ToList(); 1541 1542 if (bolig.AndenMaegler) 1543 { 1544 var image = bolig.ImageUrl; 1545 1546 if (!string.IsNullOrEmpty(image)) 1547 { 1548 allImages.Add(new Bolig.CaseAsset() { ImageXs = image, ImageSm = image, ImageMd = image, ImageLg = image, ImageXl = image }); 1549 } 1550 else 1551 { 1552 allImages.Add(new Bolig.CaseAsset() { ImageXs = fallbackImage, ImageSm = fallbackImage, ImageMd = fallbackImage, ImageLg = fallbackImage, ImageXl = fallbackImage }); 1553 } 1554 } 1555 else 1556 { 1557 while (allImages.Count < 3) 1558 { 1559 allImages.Add(new Bolig.CaseAsset() { ImageXs = fallbackImage, ImageSm = fallbackImage, ImageMd = fallbackImage, ImageLg = fallbackImage, ImageXl = fallbackImage }); 1560 } 1561 } 1562 1563 int totalImageCount = allImages.Count; 1564 WriteLiteral(" <div property-card class=\"property-card js-property-card\" data-is-rental=\""); 1565 Write(isRental ? "true" : "false"); 1566 WriteLiteral("\" "); 1567 Write(pageNum != null ? $"data-page=\"{pageNum}\"" : ""); 1568 WriteLiteral(">\r\n <!-- Hidden radio buttons for image navigation -->\r\n"); 1569 for (int imgIndex = 1; imgIndex <= totalImageCount; imgIndex++) 1570 { 1571 WriteLiteral(" <input type=\"radio\""); 1572 BeginWriteAttribute("name", "\r\n name=\"", 62698, "\"", 62755, 3); 1573 WriteAttributeValue("", 62729, "card-", 62729, 5, true); 1574 WriteAttributeValue("", 62734, propertyIndex, 62734, 14, false); 1575 WriteAttributeValue("", 62748, "-images", 62748, 7, true); 1576 EndWriteAttribute(); 1577 BeginWriteAttribute("id", "\r\n id=\"", 62756, "\"", 62818, 4); 1578 WriteAttributeValue("", 62785, "card-", 62785, 5, true); 1579 WriteAttributeValue("", 62790, propertyIndex, 62790, 14, false); 1580 WriteAttributeValue("", 62804, "-img-", 62804, 5, true); 1581 WriteAttributeValue("", 62809, imgIndex, 62809, 9, false); 1582 EndWriteAttribute(); 1583 WriteLiteral("\r\n class=\"image-radio d-none\"\r\n "); 1584 Write(imgIndex == 1 ? "checked" : ""); 1585 WriteLiteral(">\r\n"); 1586 } 1587 WriteLiteral("\r\n <div class=\"property-card-images-wrapper\">\r\n"); 1588 1589 int currentImageIndex = 1; 1590 foreach (var image in allImages) 1591 { 1592 WriteLiteral(" <a"); 1593 BeginWriteAttribute("href", " href=\"", 63183, "\"", 63240, 2); 1594 WriteAttributeValue("", 63190, bolig.LinkUrl, 63190, 14, false); 1595 WriteAttributeValue("", 63204, isRental ? "?Udlejning=true" : "", 63204, 36, false); 1596 EndWriteAttribute(); 1597 WriteLiteral(" target=\"_blank\" class=\"property-image js-property-image\" data-image=\""); 1598 Write(currentImageIndex); 1599 WriteLiteral("\">\r\n <img"); 1600 BeginWriteAttribute("src", " src=\"", 63361, "\"", 63381, 1); 1601 WriteAttributeValue("", 63367, fallbackImage, 63367, 14, false); 1602 EndWriteAttribute(); 1603 WriteLiteral(" data-src=\""); 1604 Write(image.ImageMd); 1605 WriteLiteral("\""); 1606 BeginWriteAttribute("alt", " alt=\"", 63408, "\"", 63428, 1); 1607 WriteAttributeValue("", 63414, bolig.Adresse, 63414, 14, false); 1608 EndWriteAttribute(); 1609 WriteLiteral(" />\r\n\r\n"); 1610 if (totalImageCount > 1) 1611 { 1612 WriteLiteral(" <div class=\"property-card-images-indicators\">\r\n <label"); 1613 BeginWriteAttribute("for", " for=\"", 63627, "\"", 63658, 3); 1614 WriteAttributeValue("", 63633, "card-", 63633, 5, true); 1615 WriteAttributeValue("", 63638, propertyIndex, 63638, 14, false); 1616 WriteAttributeValue("", 63652, "-img-1", 63652, 6, true); 1617 EndWriteAttribute(); 1618 WriteLiteral("\r\n class=\"property-card-images-indicator js-property-card-images-indicator\""); 1619 BeginWriteAttribute("aria-label", "\r\n aria-label=\"", 63772, "\"", 63895, 1); 1620 WriteAttributeValue("", 63825, Translate("Custom.Propertypage.FirstIndicatorLabel","Første billede"), 63825, 70, false); 1621 EndWriteAttribute(); 1622 WriteLiteral(">\r\n </label>\r\n <label"); 1623 BeginWriteAttribute("for", " for=\"", 63979, "\"", 64010, 3); 1624 WriteAttributeValue("", 63985, "card-", 63985, 5, true); 1625 WriteAttributeValue("", 63990, propertyIndex, 63990, 14, false); 1626 WriteAttributeValue("", 64004, "-img-2", 64004, 6, true); 1627 EndWriteAttribute(); 1628 WriteLiteral("\r\n class=\"property-card-images-indicator js-property-card-images-indicator\""); 1629 BeginWriteAttribute("aria-label", "\r\n aria-label=\"", 64124, "\"", 64247, 1); 1630 WriteAttributeValue("", 64177, Translate("Custom.Propertypage.SecondIndicatorLabel","Andet billede"), 64177, 70, false); 1631 EndWriteAttribute(); 1632 WriteLiteral(">\r\n </label>\r\n <label"); 1633 BeginWriteAttribute("for", " for=\"", 64331, "\"", 64362, 3); 1634 WriteAttributeValue("", 64337, "card-", 64337, 5, true); 1635 WriteAttributeValue("", 64342, propertyIndex, 64342, 14, false); 1636 WriteAttributeValue("", 64356, "-img-3", 64356, 6, true); 1637 EndWriteAttribute(); 1638 WriteLiteral("\r\n class=\"property-card-images-indicator js-property-card-images-indicator\""); 1639 BeginWriteAttribute("aria-label", "\r\n aria-label=\"", 64476, "\"", 64599, 1); 1640 WriteAttributeValue("", 64529, Translate("Custom.Propertypage.ThirdIndicatorLabel","Tredie billede"), 64529, 70, false); 1641 EndWriteAttribute(); 1642 WriteLiteral(">\r\n </label>\r\n </div>\r\n"); 1643 } 1644 WriteLiteral(" </a>\r\n"); 1645 currentImageIndex++; 1646 } 1647 if (bolig.AabentHus && !bolig.Solgt && !bolig.PurchaseAgreementSigned) 1648 { 1649 var upcomingOpenHouses = boligManager.KommendeAabnehuse(bolig); 1650 1651 if (upcomingOpenHouses != null) 1652 { 1653 bool hasSignUp = upcomingOpenHouses.Any(oh => oh.Tilmelding); 1654 var primaryOpenHouse = upcomingOpenHouses.FirstOrDefault(); 1655 1656 if (primaryOpenHouse != null) 1657 { 1658 WriteLiteral(" <div class=\"open-house position-absolute d-flex\" role=\"region\""); 1659 BeginWriteAttribute("aria-label", " aria-label=\"", 65412, "\"", 65556, 1); 1660 WriteAttributeValue("", 65425, Dynamicweb.Core.Encoders.HtmlEncoder.HtmlAttributeEncode(Translate("Custom:Accessibility.OpenHouseInfo", "Åbent hus information")), 65425, 131, false); 1661 EndWriteAttribute(); 1662 WriteLiteral(@"> 1663 <div class=""open-house-dates d-flex align-items-center""> 1664 <div class=""d-flex flex-column align-items-end""> 1665 <div class=""section-header mb-0""> 1666 "); 1667 Write(Translate("Custom.PropertyList.OpenHouseSection.Header", "Åbent hus")); 1668 WriteLiteral("\r\n"); 1669 if (hasSignUp) 1670 { 1671 WriteLiteral(" <span class=\"signup\">"); 1672 Write(Translate("Custom.PropertyList.OpenHouseSection.Header.Singup.PostFix", " med tilmelding")); 1673 WriteLiteral("</span>\r\n"); 1674 } 1675 WriteLiteral(" </div>\r\n <div class=\"open-house-text\">\r\n <span"); 1676 BeginWriteAttribute("class", " class=\"", 66419, "\"", 66427, 0); 1677 EndWriteAttribute(); 1678 WriteLiteral(">"); 1679 Write(primaryOpenHouse.Dato.ToString("d. MMM", Pageview.Area.CultureInfo)); 1680 WriteLiteral("</span>\r\n\r\n"); 1681 if (!string.IsNullOrEmpty(primaryOpenHouse.TidspunktFormateret)) 1682 { 1683 WriteLiteral(" <div class=\"d-inline-block\">\r\n "); 1684 Write(Translate("Custom.Propertypage.OpenHouseSection.Kl", "kl.")); 1685 WriteLiteral(" "); 1686 Write(FormatTime(primaryOpenHouse.FraKlokken)); 1687 WriteLiteral(" - "); 1688 Write(FormatTime(primaryOpenHouse.TilKlokken)); 1689 WriteLiteral("\r\n </div>\r\n"); 1690 } 1691 WriteLiteral(" </div>\r\n\r\n </div>\r\n\r\n"); 1692 if (hasSignUp) 1693 { 1694 WriteLiteral(" <div class=\"property-card-button\">\r\n <a class=\"btn btn-primary\""); 1695 BeginWriteAttribute("href", " href=\"", 67379, "\"", 67400, 1); 1696 WriteAttributeValue("", 67386, bolig.LinkUrl, 67386, 14, false); 1697 EndWriteAttribute(); 1698 WriteLiteral(" target=\"_blank\">\r\n "); 1699 Write(Translate("Custom.Propertypage.OpenHouseSection.SignupButton.Label", "Tilmeld")); 1700 WriteLiteral("\r\n </a>\r\n </div>\r\n"); 1701 } 1702 WriteLiteral(" </div>\r\n </div>\r\n"); 1703 } 1704 } 1705 } 1706 WriteLiteral(" </div>\r\n <div class=\"property-card-info-wrapper d-flex flex-column\">\r\n <div class=\"d-flex justify-content-between w-100\">\r\n <a"); 1707 BeginWriteAttribute("href", " href=\"", 68015, "\"", 68072, 2); 1708 WriteAttributeValue("", 68022, bolig.LinkUrl, 68022, 14, false); 1709 WriteAttributeValue("", 68036, isRental ? "?Udlejning=true" : "", 68036, 36, false); 1710 EndWriteAttribute(); 1711 WriteLiteral(" target=\"_blank\" class=\"property-card-address d-flex flex-column\">\r\n <div>"); 1712 Write(bolig.Adresse); 1713 WriteLiteral("</div>\r\n <div>"); 1714 Write(bolig.PostAdresse); 1715 WriteLiteral("</div>\r\n </a>\r\n"); 1716 1717 var labels = new (bool Condition, string Color, string Stroke, string Key, string Default)[] 1718 { 1719 (bolig.Solgt && isRental, "#C50000", "#FFB3B3", "Custom.PropertyList.Label.Leased", "Udlejet"), 1720 (bolig.Solgt, "#C50000", "#FFB3B3", "Custom.PropertyList.Label.Sold", "Solgt"), 1721 (bolig.PurchaseAgreementSigned, "#003761", "#5A6B77", "Custom.PropertyList.Label.PurchaseAgreementSigned", "Købsaftale <br/> underskrevet"), 1722 (bolig.Nyhed, "#DE8344", "#F9CBAB", "Custom.PropertyList.Label.New", "Ny"), 1723 (bolig.NyPris, "#DE8344", "#F9CBAB", "Custom.PropertyList.Label.NewPrice", "Ny pris") 1724 }; 1725 1726 var match = labels.FirstOrDefault(l => l.Condition); 1727 1728 WriteLiteral("\r\n"); 1729 if (match.Condition) 1730 { 1731 WriteLiteral(" <div"); 1732 BeginWriteAttribute("class", " class=\"", 69295, "\"", 69396, 4); 1733 WriteAttributeValue("", 69303, "property-card-label", 69303, 19, true); 1734 WriteAttributeValue(" ", 69322, bolig.PurchaseAgreementSigned ? "small" : "", 69323, 47, false); 1735 WriteAttributeValue(" ", 69370, "d-flex", 69371, 7, true); 1736 WriteAttributeValue(" ", 69377, "align-items-center", 69378, 19, true); 1737 EndWriteAttribute(); 1738 WriteLiteral(">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"25\" height=\"25\" viewBox=\"0 0 25 25\" fill=\"none\">\r\n <circle cx=\"12.5\" cy=\"12.5\" r=\"10.5\""); 1739 BeginWriteAttribute("fill", " fill=\"", 69593, "\"", 69612, 1); 1740 WriteAttributeValue("", 69600, match.Color, 69600, 12, false); 1741 EndWriteAttribute(); 1742 BeginWriteAttribute("stroke", " stroke=\"", 69613, "\"", 69635, 1); 1743 WriteAttributeValue("", 69622, match.Stroke, 69622, 13, false); 1744 EndWriteAttribute(); 1745 WriteLiteral(" stroke-width=\"4\" />\r\n </svg>\r\n "); 1746 Write(Translate(match.Key, match.Default)); 1747 WriteLiteral("\r\n </div>\r\n"); 1748 } 1749 WriteLiteral(" </div>\r\n <div class=\"property-card-info d-flex\">\r\n <span>"); 1750 Write(propCategory); 1751 WriteLiteral("</span>\r\n <div class=\"detail-separator\"></div>\r\n <span>"); 1752 Write(bolig.Areal); 1753 WriteLiteral(" "); 1754 Write(Translate("Custom.Propertypage.Units.SquareMeters", "m&sup2;")); 1755 WriteLiteral("</span>\r\n <div class=\"detail-separator\"></div>\r\n"); 1756 if (!bolig.Solgt && !bolig.PurchaseAgreementSigned) 1757 { 1758 if (isRental) 1759 { 1760 WriteLiteral(" <span> "); 1761 Write(property.GetInteger("Ecom:Product:Field.xEjendomBoligUdlejningLejeMaaned").ToString("#,##0")); 1762 WriteLiteral(" "); 1763 Write(Translate("Custom.PropertyCard.RentPerMonth", "pr. md.")); 1764 WriteLiteral(" </span>\r\n"); 1765 } 1766 else 1767 { 1768 WriteLiteral(" <span> kr. "); 1769 Write(bolig.Pris.ToString("#,##0")); 1770 WriteLiteral(" </span>\r\n"); 1771 } 1772 WriteLiteral(" <div class=\"detail-separator\"></div>\r\n"); 1773 } 1774 1775 var scenarioNumber = property.GetString("Ecom:Product:Field.EnergyLabelScenarioNumber"); 1776 var savings = property.GetInteger("Ecom:Product:Field.EnergyLabelSavings"); 1777 var energyLink = property.GetString("Ecom:Product:Field.EnergyLabelLink"); 1778 WriteLiteral("\r\n <div"); 1779 BeginWriteAttribute("class", " class=\"", 71192, "\"", 71259, 2); 1780 WriteAttributeValue("", 71200, "energylabel", 71200, 11, true); 1781 WriteAttributeValue(" ", 71211, scenarioNumber == "2" ? "energy__hover" : "", 71212, 47, false); 1782 EndWriteAttribute(); 1783 WriteLiteral("\r\n data-energylabel=\""); 1784 Write(Dynamicweb.Core.Encoders.HtmlEncoder.HtmlAttributeEncode(bolig.EnergyLabel)); 1785 WriteLiteral("\">\r\n"); 1786 if (scenarioNumber == "2") 1787 { 1788 WriteLiteral(" <span id=\"energi-testgruppe-information\" class=\"tooltiptext\">\r\n"); 1789 if (savings > 0) 1790 { 1791 Write(string.Format(Translate("Smartpage:Boligvisning.Energimærketekst1-1", "OBS: du kan spare {0} årligt ved at renovere denne bolig - {1}"), savings.ToString("#,##0"), "")); 1792 WriteLiteral(" <a target=\"_blank\""); 1793 BeginWriteAttribute("href", " href=\"", 71902, "\"", 71996, 2); 1794 WriteAttributeValue("", 71909, energyLink, 71909, 13, false); 1795 WriteAttributeValue("", 71922, "&utm_source=realmaeglerne&utm_medium=energimaerke&utm_campaign=testgruppe1", 71922, 74, true); 1796 EndWriteAttribute(); 1797 WriteLiteral(">"); 1798 Write(Translate("Custom.Propertypage.EnergyLabel.Tooltip.Linktext", "klik her")); 1799 WriteLiteral("</a>\r\n"); 1800 } 1801 else 1802 { 1803 Write(string.Format(Translate("Smartpage:Boligvisning.Energimærketekst1-2", "OBS: du kan energi renovere denne bolig {0}"), "")); 1804 WriteLiteral(" <a target=\"_blank\""); 1805 BeginWriteAttribute("href", " href=\"", 72400, "\"", 72494, 2); 1806 WriteAttributeValue("", 72407, energyLink, 72407, 13, false); 1807 WriteAttributeValue("", 72420, "&utm_source=realmaeglerne&utm_medium=energimaerke&utm_campaign=testgruppe1", 72420, 74, true); 1808 EndWriteAttribute(); 1809 WriteLiteral(">"); 1810 Write(Translate("Custom.Propertypage.EnergyLabel.Tooltip.Linktext", "klik her")); 1811 WriteLiteral("</a>\r\n"); 1812 } 1813 WriteLiteral(" </span>\r\n"); 1814 } 1815 WriteLiteral(" </div>\r\n </div>\r\n <div class=\"property-card-button\">\r\n <a"); 1816 BeginWriteAttribute("href", " href=\"", 72801, "\"", 72858, 2); 1817 WriteAttributeValue("", 72808, bolig.LinkUrl, 72808, 14, false); 1818 WriteAttributeValue("", 72822, isRental ? "?Udlejning=true" : "", 72822, 36, false); 1819 EndWriteAttribute(); 1820 BeginWriteAttribute("class", " class=\"", 72859, "\"", 72919, 3); 1821 WriteAttributeValue("", 72867, "btn", 72867, 3, true); 1822 WriteAttributeValue(" ", 72870, "btn-primary", 72871, 12, true); 1823 WriteAttributeValue(" ", 72882, bolig.AndenMaegler ? "grey" : "", 72884, 35, false); 1824 EndWriteAttribute(); 1825 WriteLiteral(" target=\"_blank\">\r\n"); 1826 if (bolig.AndenMaegler) 1827 { 1828 Write(Translate("Custom.PropertyList.ViewPropertyButton.External", "Anden mægler")); 1829 1830 } 1831 else 1832 { 1833 Write(Translate("Custom.PropertyList.ViewPropertyButton", "Se bolig")); 1834 1835 } 1836 WriteLiteral(" <img height=\"20px\" width=\"20px\""); 1837 BeginWriteAttribute("src", " src=\"", 73383, "\"", 73425, 1); 1838 WriteAttributeValue("", 73389, iconPath + "icon-arrow-right.svg", 73389, 36, false); 1839 EndWriteAttribute(); 1840 WriteLiteral(" />\r\n </a>\r\n </div>\r\n </div>\r\n </div>\r\n"); 1841 } 1842 1843 string FormatTime(string time) => time?.Length >= 5 ? time.Substring(0, 5) : (time ?? string.Empty); 1844 1845 } 1846 } 1847 #pragma warning restore 1591 1848

1 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 @using RealEstate.User; 3 @using Dynamicweb.Ecommerce.Products; 4 5 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 6 @using Dynamicweb.Content.Items; 7 8 @functions{ 9 void RenderErhvervsTypeCheckboxes(string productGroupFilter) 10 { 11 <div class="col-xs-6 col-md-4"> 12 <div class="checkbox"> 13 <label> 14 <input type="checkbox" name="propertytype" value="bolig/erhverv, kombineret erhverv og bolig, byejendom (kontor, butik, beboelse)" /> 15 <span>Bolig/erhverv</span> 16 </label> 17 </div> 18 <div class="checkbox"> 19 <label> 20 <input type="checkbox" name="propertytype" value="erhvervsgrund" /> 21 <span>Erhvervsgrund</span> 22 </label> 23 </div> 24 <div class="checkbox"> 25 <label> 26 <input type="checkbox" name="propertytype" value="boligudlejning" /> 27 <span>Boligudlejningsejendom</span> 28 </label> 29 </div> 30 <div class="checkbox"> 31 <label> 32 <input type="checkbox" name="propertytype" value="kontor, klinik, kontorhotel, showroom, undervisningslokaler" /> 33 <span>Kontor</span> 34 </label> 35 </div> 36 </div> 37 <div class="col-xs-6 col-md-4"> 38 <div class="checkbox"> 39 <label> 40 <input type="checkbox" name="propertytype" value="butik / detail, butik / detailhandel" /> 41 <span>Butik/detailhandel</span> 42 </label> 43 </div> 44 <div class="checkbox"> 45 <label> 46 <input type="checkbox" name="propertytype" value="industri / logistik, håndværk, industri, kontor / lager, logistik" /> 47 <span>Produktion/lager</span> 48 </label> 49 </div> 50 <div class="checkbox"> 51 <label> 52 <input type="checkbox" name="propertytype" value="hotel - kursusejendom, restaurant" /> 53 <span>Hotel og restaurant</span> 54 </label> 55 </div> 56 <div class="checkbox"> 57 <label> 58 <input type="checkbox" name="propertytype" value="projekt ejendom" /> 59 <span>Projektejendom</span> 60 </label> 61 </div> 62 </div> 63 <div class="col-xs-6 col-md-4"> 64 <div class="checkbox"> 65 <label> 66 <input type="checkbox" name="propertytype" value="andet" /> 67 <span>Andet</span> 68 </label> 69 </div> 70 </div> 71 72 <input type="hidden" name="propertycategory" value="erhverv, udlejning" /> 73 <input type="hidden" name="filtrering" value="@productGroupFilter" /> 74 } 75 void RenderBoligtypeCheckboxes() 76 { 77 <div class="col-6 col-md-4"> 78 <div class="checkbox"> 79 <label> 80 <input type="checkbox" name="propertytype" value="villa" /> 81 <span>Villa</span> 82 </label> 83 </div> 84 <div class="checkbox"> 85 <label> 86 <input type="checkbox" name="propertytype" value="rækkehus" /> 87 <span>Rækkehus</span> 88 </label> 89 </div> 90 <div class="checkbox"> 91 <label> 92 <input type="checkbox" name="propertytype" value="villalejlighed" /> 93 <span>Villalejlighed</span> 94 </label> 95 </div> 96 <div class="checkbox"> 97 <label> 98 <input type="checkbox" name="propertytype" value="andelsbolig" /> 99 <span>Andelsbolig</span> 100 </label> 101 </div> 102 </div> 103 <div class="col-6 col-md-4"> 104 <div class="checkbox"> 105 <label> 106 <input type="checkbox" name="propertytype" value="fritidshus, fritidsbolig" /> 107 <span>Fritidsbolig</span> 108 </label> 109 </div> 110 <div class="checkbox"> 111 <label> 112 <input type="checkbox" name="propertytype" value="ejerlejlighed" class="specialOption" data-disable-slider="#grundareal" data-disable-slider-ranges="#grundarealmin,#grundarealmax" /> 113 <span>Ejerlejlighed</span> 114 </label> 115 </div> 116 <div class="checkbox"> 117 <label> 118 <input type="checkbox" name="propertytype" value="helårsgrund" class="specialOption" data-disable-slider="#boligareal,#roomsslider" data-disable-slider-ranges="#boligarealmin,#boligarealmax,#roomsmin" /> 119 <span>Helårsgrund</span> 120 </label> 121 </div> 122 <div class="checkbox"> 123 <label> 124 <input type="checkbox" name="propertytype" value="fritidsgrund" class="specialOption" data-disable-slider="#boligareal,#roomsslider" data-disable-slider-ranges="#boligarealmin,#boligarealmax,#roomsmin" /> 125 <span>Fritidsgrund</span> 126 </label> 127 </div> 128 </div> 129 <div class="col-6 col-md-4"> 130 <div class="checkbox"> 131 <label> 132 <input type="checkbox" name="propertytype" value="landejendom, lystejendom" class="specialOption" data-disable-checkbox="true" /> 133 <span>Landejendom</span> 134 </label> 135 </div> 136 <div class="checkbox"> 137 <label> 138 <input type="checkbox" name="propertytype" value="erhverv" class="specialOption" data-disable-checkbox="true" data-disable-slider="#roomsslider" data-disable-slider-ranges="#roomsmin" /> 139 <span>Erhverv</span> 140 </label> 141 </div> 142 </div> 143 } 144 145 void RenderChecked(string queryString) 146 { 147 if (Dynamicweb.Context.Current.Request.QueryString["propertytype"] == queryString) 148 { 149 @("checked") 150 } 151 } 152 153 void RenderBoligtypeCheckboxesDropdown() 154 { 155 Dictionary<string, string> propertyTypes = new Dictionary<string, string>(){ 156 { "Villa", "villa" }, { "Rækkehus", "rækkehus" }, { "Villalejlighed", "villalejlighed" }, 157 { "Andelsbolig", "andelsbolig" } 158 }; 159 foreach (KeyValuePair<string, string> type in propertyTypes) 160 { 161 bool ischecked = false; 162 string[] propertytypeSplit = new string[0]; 163 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["propertytype"])) 164 { 165 propertytypeSplit = Dynamicweb.Context.Current.Request.QueryString["propertytype"].Split(','); 166 } 167 foreach (var propertytypeParams in propertytypeSplit) 168 { 169 if (propertytypeParams == type.Value) 170 { 171 ischecked = true; 172 } 173 } 174 <li> 175 <label class="checkbox-container d-flex"> 176 @Translate("Smartpage:Search.DropDown." + type.Key + "", "" + type.Key + "") 177 <input type="checkbox" name="propertytype" value="@type.Value" class="js-input-check datavalue js-datavalue js-count" data-val="@type.Key" onchange="submitFilter()" checked="@ischecked" /> 178 <span class="checkmark grey"></span> 179 </label> 180 </li> 181 } 182 183 Dictionary<string, string> propertyTypes2 = new Dictionary<string, string>(){ 184 { "Fritidsbolig", "fritidshus, fritidsbolig" }, { "Ejerlejlighed", "ejerlejlighed" }, { "Helårsgrund", "helårsgrund" }, 185 { "Fritidsgrund", "fritidsgrund" }, { "Landejendom", "landejendom, lystejendom" } 186 }; 187 foreach (KeyValuePair<string, string> type in propertyTypes2) 188 { 189 bool ischecked = false; 190 string[] propertytypeSplit2 = new string[0]; 191 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["propertytype"])) 192 { 193 propertytypeSplit2 = Dynamicweb.Context.Current.Request.QueryString["propertytype"].Split(','); 194 } 195 foreach (var propertytypeParams in propertytypeSplit2) 196 { 197 if (propertytypeParams == type.Value) 198 { 199 ischecked = true; 200 } 201 } 202 <li> 203 <label class="checkbox-container d-flex"> 204 @Translate("Smartpage:Search.DropDown." + type.Key + "", "" + type.Key + "") 205 @if (type.Value == "ejerlejlighed") 206 { 207 <input type="checkbox" name="propertytype" value="@type.Value" class="js-input-check datavalue" data-disable-slider="#grundareal" data-disable-slider-ranges="#grundarealmin,#grundarealmax" data-val="@type.Key" onchange="submitFilter()" checked="@ischecked" /> 208 } 209 else if (type.Value == "helårsgrund") 210 { 211 <input type="checkbox" name="propertytype" value="@type.Value" class="js-input-check datavalue" data-disable-slider="#boligareal,#roomsslider" data-disable-slider-ranges="#boligarealmin,#boligarealmax,#roomsmin" data-val="@type.Key" onchange="submitFilter()" checked="@ischecked" /> 212 } 213 else if (type.Value == "fritidsgrund") 214 { 215 <input type="checkbox" name="propertytype" value="@type.Value" class="js-input-check datavalue" data-disable-slider="#boligareal,#roomsslider" data-disable-slider-ranges="#boligarealmin,#boligarealmax,#roomsmin" data-val="@type.Key" onchange="submitFilter()" checked="@ischecked" /> 216 } 217 else 218 { 219 <input type="checkbox" name="propertytype" value="@type.Value" class="js-input-check datavalue" data-val="@type.Key" onchange="submitFilter()" checked="@ischecked" /> 220 } 221 <span class="checkmark grey"></span> 222 </label> 223 </li> 224 } 225 } 226 227 void RenderBoligTypeErhverv(bool submitOnChange = false, bool frontpage = false) 228 { 229 Dictionary<string, string> erhverType = new Dictionary<string, string>(){ 230 { "Kontor", "OwnUseOffices" }, { "Lager + Produktion", "OwnUseStoresAndProductions" }, { "Detailhandel", "OwnUseRetailAndStores" }, 231 { "Grunde", "OwnUseParcel" }, { "Andre typer", "OwnUseOtherTypes" }, { "Hotel + Restaurant", "OwnUseHotelsAndRestaurants" } 232 }; 233 var submitonchange = ""; 234 if (submitOnChange) 235 { 236 submitonchange = "onchange='submitFilter()'"; 237 } 238 239 foreach (KeyValuePair<string, string> type in erhverType) 240 { 241 string ischecked = ""; 242 string[] olineParamsSplit = new string[0]; 243 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["olinecategory"])) 244 { 245 olineParamsSplit = Dynamicweb.Context.Current.Request.QueryString["olinecategory"].Split(','); 246 } 247 foreach (var olineParams in olineParamsSplit) 248 { 249 if (olineParams == type.Value) 250 { 251 ischecked = "checked"; 252 } 253 } 254 255 <li> 256 <label class="checkbox-container d-flex"> 257 @Translate("Smartpage:Search.DropDown." + type.Key + "", "" + type.Key + "") 258 <input type="checkbox" name="olinecategory" value="@type.Value" class="js-input-check datavalue" data-val="@type.Key" @submitonchange @ischecked /> 259 <span class="checkmark grey"></span> 260 </label> 261 </li> 262 } 263 } 264 265 void RenderBoligTypeErhvervInvest(bool submitOnChange = false) 266 { 267 Dictionary<string, string> erhverType = new Dictionary<string, string>(){ 268 { "Kontor", "Kontor" }, { "Lager + Produktion", "InvestmentStoresAndProductions" }, { "Boligudlejning", "InvestmentHousingRental" }, 269 { "Detailhandel", "InvestmentRetailAndStores" }, { "Grunde", "InvestmentParcel" }, { "Hotel + Restaurant", "InvestmentHotelsAndRestaurants" }, { "Andre typer", "InvestmentOtherTypes" } 270 }; 271 272 foreach (KeyValuePair<string, string> type in erhverType) 273 { 274 bool ischecked = false; 275 string[] olineParamsSplit = new string[0]; 276 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["olinecategory"])) 277 { 278 olineParamsSplit = Dynamicweb.Context.Current.Request.QueryString["olinecategory"].Split(','); 279 } 280 foreach (var olineParams in olineParamsSplit) 281 { 282 if (olineParams == type.Value) 283 { 284 ischecked = true; 285 } 286 } 287 288 <li> 289 <label class="checkbox-container"> 290 @Translate("Smartpage:Search.DropDown." + type.Key + "", "" + type.Key + "") 291 <input type="checkbox" name="olinecategory" value="@type.Value" class="js-input-check datavalue" data-val="@type.Key" onchange="submitFilter()" checked="@ischecked" /> 292 <span class="checkmark grey"></span> 293 </label> 294 </li> 295 } 296 } 297 int GetWebsiteSettingsPageId(string pageSysName) 298 { 299 int sideId = 0; 300 301 var pw = Dynamicweb.Frontend.PageView.Current(); 302 303 string settingsItemId = "1"; 304 305 if ((pw.Area.Item.ContainsKey("Type") && pw.Area.Item["Type"].ToString() == "bone") || Dynamicweb.Context.Current.Request.QueryString["bone"] == "true") 306 { 307 settingsItemId = "2"; 308 } 309 310 var settingsItem = ItemManager.Storage.GetById("Delte_Egenskaber", settingsItemId); 311 312 if (settingsItem == null || !settingsItem.ContainsKey(pageSysName)) 313 { 314 return sideId; 315 } 316 317 string boligsideLink = settingsItem[pageSysName] as String; 318 string linkPrefix = "Default.aspx?ID="; 319 320 if (!String.IsNullOrEmpty(boligsideLink) && boligsideLink.ToLower().StartsWith(linkPrefix.ToLower())) 321 { 322 Int32.TryParse(boligsideLink.Substring(linkPrefix.Length), out sideId); 323 } 324 325 return sideId; 326 } 327 328 int GetPageSettingsPageId(string pageSysName) 329 { 330 int sideId = 0; 331 332 var pw = Dynamicweb.Frontend.PageView.Current(); 333 334 if (pw.Page == null || pw.Page.PropertyItem == null || !pw.Page.PropertyItem.ContainsKey(pageSysName)) 335 { 336 return sideId; 337 } 338 339 string boligsideLink = pw.Page.PropertyItem[pageSysName] as String; 340 string linkPrefix = "Default.aspx?ID="; 341 342 if (!String.IsNullOrEmpty(boligsideLink) && boligsideLink.ToLower().StartsWith(linkPrefix.ToLower())) 343 { 344 Int32.TryParse(boligsideLink.Substring(linkPrefix.Length), out sideId); 345 } 346 347 return sideId; 348 } 349 void RenderMobileSelectBox(string name, int max, int step, string className, string inputname) 350 { 351 <select class="form-control d-block d-lg-none mb-10 @className" onchange="submitFilter()" name="@inputname"> 352 <option selected="true" disabled="disabled">@Translate("Smartpage:Search.Placeholder." + name + "", "" + name + "")</option> 353 354 @for (var i = 0; i <= max; i += step) 355 { 356 var selected = string.Empty; 357 var current = string.Empty; 358 if (i == max) 359 { 360 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString[inputname]) && Dynamicweb.Context.Current.Request.QueryString[inputname] == Convert.ToString(i)) 361 { 362 <option value="@i" data-value='@Convert.ToInt32(i).ToString("N0")' selected="selected">@Convert.ToInt32(i).ToString("N0")+</option> 363 } 364 else 365 { 366 <option value="@i" data-value='@Convert.ToInt32(i).ToString("N0")'>@Convert.ToInt32(i).ToString("N0")+</option> 367 } 368 } 369 else 370 { 371 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString[inputname]) && Dynamicweb.Context.Current.Request.QueryString[inputname] == Convert.ToString(i)) 372 { 373 <option value="@i" data-value='@Convert.ToInt32(i).ToString("N0")' selected="selected">@Convert.ToInt32(i).ToString("N0")</option> 374 } 375 else 376 { 377 <option value="@i" data-value='@Convert.ToInt32(i).ToString("N0")'>@Convert.ToInt32(i).ToString("N0")</option> 378 } 379 } 380 } 381 </select> 382 } 383 384 void RenderTopFilter(string parameter) 385 { 386 if (parameter == "pricemin" || parameter == "pricemax") 387 { 388 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["pricemin"])) 389 { 390 if (parameter == "pricemin") 391 { 392 @("<div class='search-terms' id='priceFilter'>") 393 @("Pris ") @Dynamicweb.Context.Current.Request[parameter] 394 } 395 396 else 397 { 398 @(" - ") @Dynamicweb.Context.Current.Request[parameter] @(" kr.") <i class="fa fa-times ml-2 pointer" onclick="removeParams(this)" data-tag="pricemin,pricemax"></i> 399 @("</div>") 400 } 401 } 402 } 403 404 else if (parameter == "subsidymin" || parameter == "subsidymax") 405 { 406 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["subsidymin"])) 407 { 408 if (parameter == "subsidymin") 409 { 410 @("<div class='search-terms' id='subsidyFilter'>") 411 @("Årlig leje ") @Dynamicweb.Context.Current.Request[parameter] 412 } 413 414 else 415 { 416 @(" - ") @Dynamicweb.Context.Current.Request[parameter] @(" kr.") <i class="fa fa-times ml-2 pointer" onclick="removeParams(this)" data-tag="subsidymin,subsidymax"></i> 417 @("</div>") 418 } 419 } 420 } 421 else if (parameter == "etagearealmin" || parameter == "etagearealmax") 422 { 423 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["etagearealmin"])) 424 { 425 if (parameter == "etagearealmin") 426 { 427 @("<div class='search-terms' id='etagearealFilter'>") 428 @("Etageareal ") @Dynamicweb.Context.Current.Request[parameter] 429 } 430 431 else 432 { 433 @(" - ") @Dynamicweb.Context.Current.Request[parameter] @(" kvm.") <i class="fa fa-times ml-2 pointer" onclick="removeParams(this)" data-tag="etagearealmin,etagearealmax"></i> 434 @("</div>") 435 } 436 } 437 } 438 439 else if (parameter == "grundarealmin" || parameter == "grundarealmax") 440 { 441 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["grundarealmin"])) 442 { 443 if (parameter == "grundarealmin") 444 { 445 @("<div class='search-terms' id='grundarealFilter'>") 446 @("Grundareal ") @Dynamicweb.Context.Current.Request[parameter] 447 } 448 449 else 450 { 451 @(" - ") @Dynamicweb.Context.Current.Request[parameter] @(" kvm.") <i class="fa fa-times ml-2 pointer" onclick="removeParams(this)" data-tag="grundarealmin,grundarealmax"></i> 452 @("</div>") 453 } 454 } 455 } 456 457 else if (parameter == "subsidykvmmin" || parameter == "subsidykvmmax") 458 { 459 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["subsidykvmmin"])) 460 { 461 if (parameter == "subsidykvmmin") 462 { 463 @("<div class='search-terms' id='subsidykvmFilter'>") 464 @("Årlig leje kvm ") @Dynamicweb.Context.Current.Request[parameter] 465 } 466 467 else 468 { 469 @(" - ") @Dynamicweb.Context.Current.Request[parameter] @(" kr.") <i class="fa fa-times ml-2 pointer" onclick="removeParams(this)" data-tag="subsidykvmmin,subsidykvmmax"></i> 470 @("</div>") 471 } 472 } 473 } 474 475 else if (parameter == "olinecategory") 476 { 477 478 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["olinecategory"])) 479 { 480 Dictionary<string, string> erhverType = new Dictionary<string, string>(){ 481 {"OwnUseOffices", "Kontor" }, { "OwnUseStoresAndProductions","Lager + Produktion" }, { "OwnUseRetailAndStores","Detailhandel" }, 482 { "OwnUseParcel", "Grunde" }, { "OwnUseHotelsAndRestaurants", "Hotel + Restaurant" }, { "OwnUseOtherTypes", "Andre typer"}, 483 { "Kontor", "Kontor" }, { "InvestmentStoresAndProductions", "Lager + Produktion" }, { "InvestmentHousingRental", "Boligudlejning" }, 484 { "InvestmentRetailAndStores", "Detailhandel" }, { "InvestmentParcel", "Grunde" }, { "InvestmentHotelsAndRestaurants", "Hotel + Restaurant" }, { "InvestmentOtherTypes", "Andre typer" } 485 }; 486 487 488 foreach (var er in erhverType) 489 { 490 if (Dynamicweb.Context.Current.Request[parameter].Contains(er.Key)) 491 { 492 <div class="search-terms" id="@parameter"> 493 @er.Value <i class="fa fa-times ml-2 pointer" onclick="removeParams(this)" data-tag="@parameter" data-val="@er.Key"></i> 494 </div> 495 } 496 } 497 } 498 } 499 else if (parameter == "search") 500 { 501 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["search"])) 502 { 503 <div class="search-terms" id="@parameter"> 504 @Dynamicweb.Context.Current.Request[parameter] <i class="fa fa-times ml-2 pointer" onclick="removeParams(this)" data-tag="@parameter"></i> 505 </div> 506 } 507 } 508 else 509 { 510 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request[parameter])) 511 { 512 Dictionary<string, string> 513 ubudsform = new Dictionary<string, string> 514 (){ 515 {"salg", "Salg" }, { "leje","Leje" } 516 }; 517 518 foreach (var er in ubudsform) 519 { 520 if (Dynamicweb.Context.Current.Request[parameter].Contains(er.Key)) 521 { 522 <div class="search-terms" id="@parameter"> 523 @er.Value <i class="fa fa-times ml-2 pointer" onclick="removeParams(this)" data-tag="@parameter" data-val="@er.Key"></i> 524 </div> 525 } 526 } 527 528 529 } 530 } 531 } 532 533 void RenderSelectValue(string dropdownname, string dropdownvalue, string queryString) 534 { 535 var selected = ""; 536 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString[queryString]) && Dynamicweb.Context.Current.Request.QueryString[queryString] == dropdownvalue) 537 { 538 selected = "selected"; 539 } 540 541 var current = string.Format("<option value='" + dropdownvalue + "'>" + dropdownname + "</option>", selected); 542 543 @current 544 } 545 546 void RenderSearchForHousing(int searchPageId, string querySearch, string querySearchNameAttr, string queryZipCodeFrom, string queryZipCodeTo, string template, Item SettingsItem, string cssClasses = "") 547 { 548 <div class="main-search-form frontpage @cssClasses"> 549 <div class="dropdown-overlay"></div> 550 <div class="row mb-3 align-items-center"> 551 <div class="col-xs-12 col-md-3 border-right"> 552 <h3>@Translate("Smartpage:Search.Søg bolig", "Søg bolig")</h3> 553 </div> 554 <div class="col-xs-12 col-md-9 home-count d-none d-md-block"> 555 <span class="search-count" id="searchCounter">0</span> <span>@Translate("Smartpage:Search.BoligerTilSalg", "Boliger til salg")</span> 556 </div> 557 </div> 558 559 <form id="main-search-frontpage" class="searchbar-wrapper" action="/Default.aspx" method="GET"> 560 <input type="hidden" name="ID" value='@searchPageId' id="searchPageId-frontpage" disabled="disabled" /> 561 <div class="row form-wrapper no-gutters"> 562 563 <div class="col-xs-12 col-md-5 col-searchbar"> 564 <div class="searchbar"> 565 <input type="text" name="@querySearchNameAttr" id="searchfield-frontpage" class="search-input" placeholder="Postnummer, by, vej eller sagsnummer" tabindex="1" value="@Dynamicweb.Core.Encoders.HtmlEncoder.HtmlAttributeEncode(querySearch)" /> 566 <input type="hidden" id="zipcodefrom-frontpage" name="zipcodefrom" value="@Dynamicweb.Core.Encoders.HtmlEncoder.HtmlAttributeEncode(queryZipCodeFrom)" /> 567 <input type="hidden" id="zipcodeto-frontpage" name="zipcodeto" value="@Dynamicweb.Core.Encoders.HtmlEncoder.HtmlAttributeEncode(queryZipCodeTo)" /> 568 </div> 569 </div> 570 <div class="col-xs-12 col-md-5"> 571 <div class="row no-gutters"> 572 <div class="col-xs-12 col-md-6 input-col"> 573 <div class="dropdown w-overlay"> 574 <button class="btn btn-dropdown dropdown-toggle reverse position-absolute-md" type="button" id="Boligtype-frontpage" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> 575 @Translate("Smartpage:Search.Boligtype", "Boligtype") 576 </button> 577 <div class="dropdown-menu box-shadow bolig-dropdown-container" aria-labelledby="Boligtype"> 578 <ul class="bolig-dropdown list-unstyled"> 579 @{ 580 RenderBoligtypeCheckboxesDropdown(); 581 } 582 </ul> 583 <span class="border-fat"></span> 584 <button class="btn btn-primary js-close-dropdown">@Translate("Smartpage:Search.Anvend", "Anvend")</button> 585 </div> 586 587 </div> 588 589 </div> 590 <div class="col-xs-12 col-md-6 input-col"> 591 <div class="dropdown w-overlay"> 592 <button class="btn btn-dropdown dropdown-toggle reverse position-absolute-md" type="button" id="Pris-frontpage" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> 593 @Translate("Smartpage:Search.Pris", "Pris") 594 </button> 595 <div class="dropdown-menu box-shadow dropdown-price" aria-labelledby="Pris"> 596 <input type="text" class="form-control mb-10 js-auto-thousand js-pricemin-frontpage-input" placeholder='@Translate("Smartpage:Search.Placeholder.MinPris","Min. pris")' /> 597 <select class="form-control js-pricemin-frontpage-select js-input-min-select mb-10"> 598 <option selected="true" disabled="disabled">@Translate("Smartpage:Search.Placeholder.MinPris", "Min. pris")</option> 599 @for (var i = 0; i <= 10000000; i += 100000) 600 { 601 if (i == 10000000) 602 { 603 <option value="@i" data-value='@Convert.ToInt32(i).ToString("N0")+'>@Convert.ToInt32(i).ToString("N0")+</option> 604 } 605 else 606 { 607 <option value="@i" data-value='@Convert.ToInt32(i).ToString("N0")'>@Convert.ToInt32(i).ToString("N0")</option> 608 } 609 } 610 </select> 611 <input type="hidden" id="pricemin-frontpage" name="pricemin" /> 612 613 <input type="text" class="form-control js-auto-thousand js-pricemax-frontpage-input" placeholder='@Translate("Smartpage:Search.Placeholder.MaxPris","Max. pris")' /> 614 <select class="form-control js-pricemax-frontpage-select js-input-max-select"> 615 <option selected="true" disabled="disabled">@Translate("Smartpage:Search.Placeholder.MaxPris", "Max. pris")</option> 616 @for (var i = 0; i <= 10000000; i += 100000) 617 { 618 if (i == 10000000) 619 { 620 <option value="@i" data-value='@Convert.ToInt32(i).ToString("N0")+'>@Convert.ToInt32(i).ToString("N0")+</option> 621 } 622 else 623 { 624 <option value="@i" data-value='@Convert.ToInt32(i).ToString("N0")'>@Convert.ToInt32(i).ToString("N0")</option> 625 } 626 } 627 </select> 628 <input type="hidden" id="pricemax-frontpage" name="pricemax" /> 629 <button class="btn btn-primary js-close-dropdown mt-3">@Translate("Smartpage:Search.Anvend", "Anvend")</button> 630 </div> 631 </div> 632 </div> 633 </div> 634 </div> 635 <div class="col-xs-12 col-md-2 d-none d-md-block"> 636 <button type="submit" class="btn btn-block btn-search"><i class="fa fa-search"></i> @Translate("Smartpage:Search.Søg", "Søg")</button> 637 </div> 638 </div> 639 640 <div class="row moresearch-btn no-gutters"> 641 <div class="col-sm-12"> 642 <div class="row align-items-center no-gutters"> 643 <div class="col-12 col-md-4"> 644 <button class="btn-blank js-search-collapse" type="button" data-toggle="collapse" data-target="#moreSearch" aria-expanded="false" aria-controls="moreSearch"> 645 <span class="moreSearch-text"><i class="fas fa-plus open-close"></i> <span class="not-open">@Translate("Smartpage:Search.Flere søgemuligheder", "Flere søgemuligheder")</span> <span class="open"><span class="js-filter-count">0</span> @Translate("Smartpage:Search.FiltreAnvendt", "filtre anvendt") </span></span> 646 </button> 647 </div> 648 <div class="col-6 col-md-2 mb-xs-4"> 649 <a class="js-reset reset-btn">@Translate("Smartpage:Search.NulstilValg", "Nulstil valg")</a> 650 </div> 651 </div> 652 653 <div class="collapse" id="moreSearch"> 654 <h4 class="mt-20"><b>@Translate("Smartpage:Search.Bolig", "Bolig")</b></h4> 655 <div class="row align-items-end mb-30"> 656 <div class="col-12 col-sm-6 col-lg-3 mb-3 mb-lg-0"> 657 <div class="filter-container row"> 658 <label class="d-block col-12">@Translate("Smartpage:Search.Boligareal", "Boligareal")</label> 659 <div class="col-6 pr-sm-0 pr-2"> 660 <input type="text" name="boligarealmin" id="boligarealmin-frontpage" class="form-control js-boligarealmin-frontpage-input js-count" placeholder='@Translate("Smartpage:Search.Placeholder.Minm2","Min. m2")' /> 661 <select class="form-control js-boligarealmin-frontpage-select js-count"> 662 <option selected="true" disabled="disabled">@Translate("Smartpage:Search.Placeholder.Minm2", "Min. m2")</option> 663 @for (var i = 0; i <= 300; i += 10) 664 { 665 if (i == 300) 666 { 667 <option value="@i">@i+</option> 668 } 669 else 670 { 671 <option value="@i">@i</option> 672 } 673 } 674 </select> 675 </div> 676 <div class="col-6 pl-sm-0 pl-2"> 677 <input type="text" name="boligarealmax" id="boligarealmax-frontpage" class="form-control js-boligarealmax-frontpage-input js-count" placeholder='@Translate("Smartpage:Search.Placeholder.Maxm2","Max. m2")' /> 678 <select class="form-control js-boligarealmax-frontpage-select js-count"> 679 <option selected="true" disabled="disabled">@Translate("Smartpage:Search.Placeholder.Maxm2", "Max. m2")</option> 680 @for (var i = 0; i <= 300; i += 10) 681 { 682 if (i == 300) 683 { 684 <option value="@i">@i+</option> 685 } 686 else 687 { 688 <option value="@i">@i</option> 689 } 690 } 691 </select> 692 </div> 693 </div> 694 </div> 695 <div class="col-12 col-sm-6 col-lg-3 mb-3 mb-lg-0"> 696 <div class="filter-container row"> 697 <label class="d-block col-12">@Translate("Smartpage:Search.Grundareal", "Grundareal")</label> 698 <div class="col-6 pr-sm-0 pr-2"> 699 <input type="text" name="grundarealmin" id="grundarealmin-frontpage" class="form-control js-grundarealmin-frontpage-input js-count" placeholder='@Translate("Smartpage:Search.Placeholder.Minm2","Min. m2")' /> 700 <select class="form-control js-grundarealmin-frontpage-select js-count"> 701 <option selected="true" disabled="disabled">@Translate("Smartpage:Search.Placeholder.Minm2", "Min. m2")</option> 702 @for (var i = 0; i <= 10000; i += 100) 703 { 704 if (i == 10000) 705 { 706 <option value="@i">@i+</option> 707 } 708 else 709 { 710 <option value="@i">@i</option> 711 } 712 } 713 </select> 714 </div> 715 <div class="col-6 pl-sm-0 pl-2"> 716 <input type="text" name="grundarealmax" id="grundarealmax-frontpage" class="form-control js-grundarealmax-frontpage-input js-count" placeholder='@Translate("Smartpage:Search.Placeholder.Maxm2","Max. m2")' /> 717 <select class="form-control js-grundarealmax-frontpage-select js-count"> 718 <option selected="true" disabled="disabled">@Translate("Smartpage:Search.Placeholder.Maxm2", "Max. m2")</option> 719 @for (var i = 0; i <= 10000; i += 100) 720 { 721 if (i == 10000) 722 { 723 <option value="@i">@i+</option> 724 } 725 else 726 { 727 <option value="@i">@i</option> 728 } 729 } 730 </select> 731 </div> 732 </div> 733 </div> 734 <div class="col-12 col-sm-6 col-lg-3 mb-3 mb-lg-0"> 735 <div class="filter-container row"> 736 <label class="d-block col-12">Antal rum</label> 737 738 <div class="col-6 pr-sm-0 pr-2"> 739 <select name="roomsmin" id="roomsmin-frontpage" class="form-control reverse js-count"> 740 <option selected="true" disabled="disabled">@Translate("Smartpage:Search.Placeholder.Min", "Min")</option> 741 <option value="1">1</option> 742 <option value="2">2</option> 743 <option value="3">3</option> 744 <option value="4">4</option> 745 <option value="5+">5+</option> 746 </select> 747 </div> 748 <div class="col-6 pl-sm-0 pl-2"> 749 <select name="roomsmax" id="roomsmax-frontpage" class="form-control reverse js-count"> 750 <option selected="true" disabled="disabled">@Translate("Smartpage:Search.Placeholder.Max", "Max")</option> 751 <option value="1">1</option> 752 <option value="2">2</option> 753 <option value="3">3</option> 754 <option value="4">4</option> 755 <option value="5+">@Translate("Smartpage:Rooms.5", "5")</option> 756 </select> 757 </div> 758 </div> 759 </div> 760 <div class="col-12 col-sm-6 col-lg-3 mb-3 mb-lg-0"> 761 <div class="row"> 762 <div class="col-12"> 763 <div class="filter-container"> 764 <label class="d-block">Energimærke</label> 765 <select name="energylabel" id="energylabel-frontpage" class="form-control reverse js-count"> 766 <option disabled selected="selected">@Translate("Smartpage:Search.Vælg", "Vælg")</option> 767 <option value="01">G</option> 768 <option value="02">F</option> 769 <option value="03">E</option> 770 <option value="04">D</option> 771 <option value="05">C</option> 772 <option value="06">B</option> 773 <option value="07">A</option> 774 <option value="08">A2010</option> 775 <option value="09">A2015</option> 776 <option value="10">A2020+</option> 777 </select> 778 </div> 779 </div> 780 </div> 781 </div> 782 <div class="col-12 col-sm-6 col-lg-3 mt-3"> 783 <h4 class=""><b>@Translate("Smartpage:Search.Økonomi", "Økonomi")</b></h4> 784 <div class="filter-container row"> 785 <label class="d-block col-12">@Translate("Smartpage:Search.Ejerudgift/boligydelse pr. måned", "Ejerudgift/boligydelse pr. måned")</label> 786 <div class="col-6 pr-sm-0 pr-2"> 787 <input type="text" name="subsidymin" id="subsidymin-frontpage" class="form-control js-subsidymin-frontpage-input js-count" placeholder='@Translate("Smartpage:Search.Placeholder.MinDKK","Min. DKK")' /> 788 <select class="form-control js-subsidymin-frontpage-select js-count"> 789 <option selected="true" disabled="disabled">@Translate("Smartpage:Search.Placeholder.MinDKK", "Min. DKK")</option> 790 @for (var i = 0; i <= 25000; i += 1250) 791 { 792 if (i == 25000) 793 { 794 <option>@Convert.ToInt32(i).ToString("N0")+</option> 795 } 796 else 797 { 798 <option>@Convert.ToInt32(i).ToString("N0")</option> 799 } 800 } 801 </select> 802 </div> 803 <div class="col-6 pl-sm-0 pl-2"> 804 <input type="text" name="subsidymax" id="subsidymax-frontpage" class="form-control js-subsidymax-frontpage-input js-count" placeholder='@Translate("Smartpage:Search.Placeholder.MaxDKK","Max. DKK")' /> 805 <select class="form-control js-subsidymax-frontpage-select js-count"> 806 <option selected="true" disabled="disabled">@Translate("Smartpage:Search.Placeholder.MaxDKK", "Max. DKK")</option> 807 @for (var i = 0; i <= 25000; i += 1250) 808 { 809 if (i == 25000) 810 { 811 <option value="@Convert.ToInt32(i)">@Convert.ToInt32(i).ToString("N0")+</option> 812 } 813 else 814 { 815 <option value="@Convert.ToInt32(i)">@Convert.ToInt32(i).ToString("N0")</option> 816 } 817 } 818 </select> 819 </div> 820 </div> 821 </div> 822 <div class="col-12 col-sm-6 col-lg-4 offset-lg-5 mt-3 mt-sm-0"> 823 <button type="submit" class="btn btn-block btn-search"><i class="fa fa-search"></i> @Translate("Smartpage:Search.AnvendFiltre", "Anvend filtre")</button> 824 </div> 825 </div> 826 </div> 827 </div> 828 </div> 829 830 <div class="row d-block d-md-none form-wrapper no-gutters"> 831 <div class="col-xs-12 col-md-2"> 832 <button type="submit" class="btn btn-block btn-search btn-mobile-search">@Translate("Smartpage:Search.SøgBolig", "Søg Bolig")<i class="fa fa-search cta-icon"></i></button> 833 </div> 834 </div> 835 </form> 836 <div class="front-page-actions d-md-none"> 837 <div> 838 <button class="btn btn-block btn-search btn-mobile-search js-search-mobile">@Translate("Smartpage:Search.SøgBolig", "Søg Bolig")<i class="fa fa-search cta-icon"></i></button> 839 </div> 840 <div> 841 @{ 842 string brokerSearchId = SettingsItem != null ? Dynamicweb.Core.Converter.ToString(SettingsItem["Maeglersogning"]).Replace("Default.aspx?Id=", "") : ""; 843 string ctaText = Translate("Smartpage.Frontpage.Mobile.FindBroker", "FIND EJENDOMSMÆGLER"); 844 <form method="GET" action="/Default.aspx"> 845 <input name="id" value="@brokerSearchId" type="hidden" /> 846 <div class="icon-wrapper-wclick"> 847 <i class="fas fa-search ta-submit-on-icon-click"></i> 848 <input class="box-cta-input ta-postnummer ta-submit-on-select ta-submit-on-enter" name="q" type="text" placeholder="@ctaText" onfocus="this.placeholder = ''" onblur="this.placeholder='@ctaText'" /> 849 </div> 850 </form> 851 } 852 </div> 853 <div> 854 <a href="javascript:panelSalgsvurdering('Hovedmenu')" class="btn btn-orange btn-block">@Translate("Smartpage:Frontpage.Mobile.GetFreeAppraisal", "BESTIL GRATIS VURDERING")<i class="cta-icon fa fa-angle-right"></i></a> 855 </div> 856 </div> 857 </div> 858 859 } 860 Custom.Integration.Brokers.Models.BrokerEmployee GetBrokerFromCurrentProduct() 861 { 862 string productId = Dynamicweb.Context.Current.Request["ProductId"]; 863 864 if (string.IsNullOrWhiteSpace(productId)) 865 { 866 return null; 867 } 868 869 var propertyProduct = Dynamicweb.Ecommerce.Services.Products.GetProductById(productId, string.Empty, true); 870 if (propertyProduct == null) 871 { 872 return null; 873 } 874 875 string employee = Dynamicweb.Core.Converter.ToString( 876 Dynamicweb.Ecommerce.Services.Products.GetProductFieldValue(propertyProduct, "xAktoererMaeglerKontaktEmail") 877 ); 878 string storeId = Dynamicweb.Core.Converter.ToString( 879 Dynamicweb.Ecommerce.Services.Products.GetProductFieldValue(propertyProduct, "xButikID") 880 ); 881 882 if (string.IsNullOrWhiteSpace(employee) || string.IsNullOrWhiteSpace(storeId)) 883 { 884 return null; 885 } 886 887 return Custom.Integration.Brokers.Search.GetEmployee(storeId, employee); 888 } 889 890 string GetAgentTitleFromCurrentProduct() 891 { 892 var propBroker = GetBrokerFromCurrentProduct(); 893 894 if (propBroker?.Broker == null) 895 { 896 return string.Empty; 897 } 898 899 if (!string.IsNullOrEmpty(propBroker.Broker.CompanyName)) 900 { 901 return propBroker.Broker.CompanyName; 902 } 903 904 return propBroker.Broker.Name ?? string.Empty; 905 } 906 907 string GetMasterBrokerUrlFromCurrentProduct() 908 { 909 var propBroker = GetBrokerFromCurrentProduct(); 910 911 var itemId = propBroker?.Broker?.ItemId; 912 var itemType = propBroker?.Broker?.ItemType; 913 914 if (string.IsNullOrWhiteSpace(itemId) || string.IsNullOrWhiteSpace(itemType)) 915 { 916 return string.Empty; 917 } 918 var brokerItem = Dynamicweb.Content.Items.ItemManager.Storage.GetById(itemType, itemId); 919 920 if (brokerItem == null) 921 { 922 return string.Empty; 923 } 924 925 var websiteId = Dynamicweb.Core.Converter.ToInt32(brokerItem["WebsiteId"]); 926 var page = Dynamicweb.Content.Services.Pages.GetFirstPageForArea(websiteId); 927 return Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("Default.aspx?Id=" + page?.ID); 928 } 929 930 // === Video link helpers (used by the property page) === 931 932 // True when the link points directly at a video file we can play in a <video> element. Everything else is iframed. 933 bool IsDirectVideoFile(string url) 934 { 935 if (string.IsNullOrWhiteSpace(url)) { return false; } 936 937 // Strip query/fragment before checking the file extension. 938 string path = url.Split('?', '#')[0]; 939 string[] directExtensions = { ".mp4", ".webm", ".ogg", ".ogv", ".mov", ".m4v" }; 940 foreach (var ext in directExtensions) 941 { 942 if (path.EndsWith(ext, StringComparison.InvariantCultureIgnoreCase)) { return true; } 943 } 944 return false; 945 } 946 947 string GetYouTubeId(string url) 948 { 949 if (string.IsNullOrWhiteSpace(url)) { return string.Empty; } 950 951 string[] patterns = { @"youtu\.be/([^?&/]+)", @"[?&]v=([^?&]+)", @"/embed/([^?&/]+)", @"/shorts/([^?&/]+)" }; 952 foreach (var pattern in patterns) 953 { 954 var match = System.Text.RegularExpressions.Regex.Match(url, pattern); 955 if (match.Success) { return match.Groups[1].Value; } 956 } 957 958 return string.Empty; 959 } 960 961 string GetVimeoId(string url) 962 { 963 if (string.IsNullOrWhiteSpace(url)) { return string.Empty; } 964 var match = System.Text.RegularExpressions.Regex.Match(url, @"vimeo\.com/(?:.*?/)?(\d+)"); 965 return match.Success ? match.Groups[1].Value : string.Empty; 966 } 967 968 string GetVimeoHash(string url) 969 { 970 if (string.IsNullOrWhiteSpace(url)) { return string.Empty; } 971 // Unlisted videos carry a privacy hash: vimeo.com/{id}/{hash} 972 var match = System.Text.RegularExpressions.Regex.Match(url, @"vimeo\.com/(?:.*?/)?\d+/(\w+)"); 973 return match.Success ? match.Groups[1].Value : string.Empty; 974 } 975 976 // Builds the iframe src for a non-file link. YouTube/Vimeo share links are rewritten to their embeddable form 977 // (their pages block framing); every other link (Matterport, CR3, already-embeddable pages) is used as-is. 978 string BuildEmbedUrl(string url, bool background) 979 { 980 if (string.IsNullOrWhiteSpace(url)) { return string.Empty; } 981 982 if (url.Contains("youtube", StringComparison.InvariantCultureIgnoreCase) || url.Contains("youtu.be", StringComparison.InvariantCultureIgnoreCase)) 983 { 984 string id = GetYouTubeId(url); 985 if (!string.IsNullOrEmpty(id)) 986 { 987 string baseUrl = "https://www.youtube-nocookie.com/embed/" + id; 988 return background 989 ? baseUrl + "?autoplay=1&mute=1&loop=1&playlist=" + id + "&controls=0&playsinline=1&rel=0" 990 : baseUrl + "?rel=0"; 991 } 992 } 993 else if (url.Contains("vimeo", StringComparison.InvariantCultureIgnoreCase)) 994 { 995 string id = GetVimeoId(url); 996 if (!string.IsNullOrEmpty(id)) 997 { 998 string baseUrl = "https://player.vimeo.com/video/" + id; 999 var queryParams = new List<string>(); 1000 string hash = GetVimeoHash(url); 1001 if (!string.IsNullOrEmpty(hash)) { queryParams.Add("h=" + hash); } 1002 if (background) { queryParams.Add("background=1"); } 1003 return queryParams.Count > 0 ? baseUrl + "?" + string.Join("&", queryParams) : baseUrl; 1004 } 1005 } 1006 1007 // Matterport, CR3 and any already-embeddable link frame as-is. 1008 return url; 1009 } 1010 } 1011 1012 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 1013 @using Dynamicweb.Ecommerce.Products; 1014 @using RealMaeglerne.Dynamicweb; 1015 @using RealMaeglerne.Dynamicweb.Models; 1016 @using RealMaeglerne.Library; 1017 @using RealMaeglerne.Library.Models; 1018 1019 @using System.Text.RegularExpressions 1020 1021 @functions{ 1022 public class WrapMethods 1023 { 1024 //Gets the contrasting color 1025 public static string getContrastYIQ(string hexcolor) 1026 { 1027 if (hexcolor != "") 1028 { 1029 hexcolor = Regex.Replace(hexcolor, "[^0-9a-zA-Z]+", ""); 1030 1031 int r = Convert.ToByte(hexcolor.Substring(0, 2), 16); 1032 int g = Convert.ToByte(hexcolor.Substring(2, 2), 16); 1033 int b = Convert.ToByte(hexcolor.Substring(4, 2), 16); 1034 int yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000; 1035 1036 if (yiq >= 128) 1037 { 1038 return "black"; 1039 } 1040 else 1041 { 1042 return "white"; 1043 } 1044 } 1045 else 1046 { 1047 return "black"; 1048 } 1049 } 1050 1051 1052 //Truncate text 1053 public static string Truncate (string value, int count, bool strip=true) 1054 { 1055 if (strip == true){ 1056 value = StripHtmlTagByCharArray(value); 1057 } 1058 1059 if (value.Length > count) 1060 { 1061 value = value.Substring(0, count - 1) + "..."; 1062 } 1063 1064 return value; 1065 } 1066 1067 //Truncate Reverse 1068 public static string TruncateReverse (string value, int count) 1069 { 1070 if (value.Length > count) 1071 { 1072 value = value.Substring(count, value.Length); 1073 } 1074 return value; 1075 } 1076 1077 1078 //Strip text from HTML 1079 public static string StripHtmlTagByCharArray(string htmlString) 1080 { 1081 char[] array = new char[htmlString.Length]; 1082 int arrayIndex = 0; 1083 bool inside = false; 1084 1085 for (int i = 0; i < htmlString.Length; i++) 1086 { 1087 char let = htmlString[i]; 1088 if (let == '<') 1089 { 1090 inside = true; 1091 continue; 1092 } 1093 if (let == '>') 1094 { 1095 inside = false; 1096 continue; 1097 } 1098 if (!inside) 1099 { 1100 array[arrayIndex] = let; 1101 arrayIndex++; 1102 } 1103 } 1104 return new string(array, 0, arrayIndex); 1105 } 1106 1107 //Make the correct count of columns 1108 public static string ColumnMaker(int Col, string ScreenSize) 1109 { 1110 string Columns = ""; 1111 1112 switch (Col) 1113 { 1114 case 1: 1115 Columns = "col-"+ScreenSize+"-12"; 1116 break; 1117 1118 case 2: 1119 Columns = "col-"+ScreenSize+"-6"; 1120 break; 1121 1122 case 3: 1123 Columns = "col-"+ScreenSize+"-4"; 1124 break; 1125 1126 case 4: 1127 Columns = "col-"+ScreenSize+"-3"; 1128 break; 1129 1130 default: 1131 Columns = "col-"+ScreenSize+"-3"; 1132 break; 1133 } 1134 1135 return Columns; 1136 } 1137 1138 1139 private string Custom(string firstoption, string secondoption) 1140 { 1141 if (firstoption == "custom") 1142 { 1143 return secondoption; 1144 } 1145 else 1146 { 1147 return firstoption; 1148 } 1149 } 1150 } 1151 } 1152 1153 @functions { 1154 void RenderBoligList(List<LoopItem> boliglist) 1155 { 1156 int propertyIndex = GetInteger("Ecom:ProductList.CurrentPage") > 0 ? (GetInteger("Ecom:ProductList.CurrentPage") - 1) * GetInteger("Ecom:ProductList.PageSize") : 0; 1157 foreach (LoopItem bolig in boliglist) 1158 { 1159 RenderPropertyCard(bolig, propertyIndex); 1160 propertyIndex++; 1161 } 1162 } 1163 1164 void RenderPropertyCard(LoopItem property, int propertyIndex, int? itemsPerPage = null) 1165 { 1166 int? pageNum = itemsPerPage != null ? (propertyIndex / itemsPerPage) + 1 : null; 1167 string fallbackImage = "/Files/Templates/Designs/rm/assets/images/na-real.png"; 1168 string iconPath = "/Files/Templates/Designs/rm/assets/images/svg/"; 1169 var boligManager = new RealMaeglerne.Library.BoligManager(Pageview); 1170 RealMaeglerne.Library.Models.Bolig bolig = boligManager.CreateBolig(property, true); 1171 1172 bool isRental = bolig.UdbudsForm.Equals("Leje", StringComparison.InvariantCultureIgnoreCase); 1173 string propCategory = isRental 1174 ? Translate("Custom.Property.Rental.PropertyCategory", "Lejebolig") 1175 : (!string.IsNullOrWhiteSpace(bolig.EjendomstypeDisplay) ? bolig.EjendomstypeDisplay : bolig.Ejendomskategori); 1176 1177 List<RealMaeglerne.Library.Models.Bolig.CaseAsset> allImages = bolig.ImagesOfProperty.Take(3).ToList(); 1178 1179 if (bolig.AndenMaegler) 1180 { 1181 var image = bolig.ImageUrl; 1182 1183 if (!string.IsNullOrEmpty(image)) 1184 { 1185 allImages.Add(new Bolig.CaseAsset() { ImageXs = image, ImageSm = image, ImageMd = image, ImageLg = image, ImageXl = image }); 1186 } 1187 else 1188 { 1189 allImages.Add(new Bolig.CaseAsset() { ImageXs = fallbackImage, ImageSm = fallbackImage, ImageMd = fallbackImage, ImageLg = fallbackImage, ImageXl = fallbackImage }); 1190 } 1191 } 1192 else 1193 { 1194 while (allImages.Count < 3) 1195 { 1196 allImages.Add(new Bolig.CaseAsset() { ImageXs = fallbackImage, ImageSm = fallbackImage, ImageMd = fallbackImage, ImageLg = fallbackImage, ImageXl = fallbackImage }); 1197 } 1198 } 1199 1200 int totalImageCount = allImages.Count; 1201 <div property-card class="property-card js-property-card" data-is-rental="@(isRental ? "true" : "false")" @(pageNum != null ? $"data-page=\"{pageNum}\"" : "")> 1202 <!-- Hidden radio buttons for image navigation --> 1203 @for (int imgIndex = 1; imgIndex <= totalImageCount; imgIndex++) 1204 { 1205 <input type="radio" 1206 name="card-@propertyIndex-images" 1207 id="card-@propertyIndex-img-@imgIndex" 1208 class="image-radio d-none" 1209 @(imgIndex == 1 ? "checked" : "")> 1210 } 1211 1212 <div class="property-card-images-wrapper"> 1213 @{ 1214 int currentImageIndex = 1; 1215 } 1216 @foreach (var image in allImages) 1217 { 1218 <a href="@bolig.LinkUrl@(isRental ? "?Udlejning=true" : "")" target="_blank" class="property-image js-property-image" data-image="@currentImageIndex"> 1219 <img src="@fallbackImage" data-src="@image.ImageMd" alt="@bolig.Adresse" /> 1220 1221 @if (totalImageCount > 1) 1222 { 1223 <div class="property-card-images-indicators"> 1224 <label for="card-@propertyIndex-img-1" 1225 class="property-card-images-indicator js-property-card-images-indicator" 1226 aria-label="@Translate("Custom.Propertypage.FirstIndicatorLabel","Første billede")"> 1227 </label> 1228 <label for="card-@propertyIndex-img-2" 1229 class="property-card-images-indicator js-property-card-images-indicator" 1230 aria-label="@Translate("Custom.Propertypage.SecondIndicatorLabel","Andet billede")"> 1231 </label> 1232 <label for="card-@propertyIndex-img-3" 1233 class="property-card-images-indicator js-property-card-images-indicator" 1234 aria-label="@Translate("Custom.Propertypage.ThirdIndicatorLabel","Tredie billede")"> 1235 </label> 1236 </div> 1237 } 1238 </a> 1239 currentImageIndex++; 1240 } 1241 @if (bolig.AabentHus && !bolig.Solgt && !bolig.PurchaseAgreementSigned) 1242 { 1243 var upcomingOpenHouses = boligManager.KommendeAabnehuse(bolig); 1244 1245 if (upcomingOpenHouses != null) 1246 { 1247 bool hasSignUp = upcomingOpenHouses.Any(oh => oh.Tilmelding); 1248 var primaryOpenHouse = upcomingOpenHouses.FirstOrDefault(); 1249 1250 if (primaryOpenHouse != null) 1251 { 1252 <div class="open-house position-absolute d-flex" role="region" aria-label="@Dynamicweb.Core.Encoders.HtmlEncoder.HtmlAttributeEncode(Translate("Custom:Accessibility.OpenHouseInfo", "Åbent hus information"))"> 1253 <div class="open-house-dates d-flex align-items-center"> 1254 <div class="d-flex flex-column align-items-end"> 1255 <div class="section-header mb-0"> 1256 @Translate("Custom.PropertyList.OpenHouseSection.Header", "Åbent hus") 1257 @if (hasSignUp) 1258 { 1259 <span class="signup">@Translate("Custom.PropertyList.OpenHouseSection.Header.Singup.PostFix", " med tilmelding")</span> 1260 } 1261 </div> 1262 <div class="open-house-text"> 1263 <span class="">@primaryOpenHouse.Dato.ToString("d. MMM", Pageview.Area.CultureInfo)</span> 1264 1265 @if (!string.IsNullOrEmpty(primaryOpenHouse.TidspunktFormateret)) 1266 { 1267 <div class="d-inline-block"> 1268 @Translate("Custom.Propertypage.OpenHouseSection.Kl", "kl.") @FormatTime(primaryOpenHouse.FraKlokken) - @FormatTime(primaryOpenHouse.TilKlokken) 1269 </div> 1270 } 1271 </div> 1272 1273 </div> 1274 1275 @if (hasSignUp) 1276 { 1277 <div class="property-card-button"> 1278 <a class="btn btn-primary" href="@bolig.LinkUrl" target="_blank"> 1279 @Translate("Custom.Propertypage.OpenHouseSection.SignupButton.Label", "Tilmeld") 1280 </a> 1281 </div> 1282 } 1283 </div> 1284 </div> 1285 } 1286 } 1287 } 1288 </div> 1289 <div class="property-card-info-wrapper d-flex flex-column"> 1290 <div class="d-flex justify-content-between w-100"> 1291 <a href="@bolig.LinkUrl@(isRental ? "?Udlejning=true" : "")" target="_blank" class="property-card-address d-flex flex-column"> 1292 <div>@bolig.Adresse</div> 1293 <div>@bolig.PostAdresse</div> 1294 </a> 1295 @{ 1296 var labels = new (bool Condition, string Color, string Stroke, string Key, string Default)[] 1297 { 1298 (bolig.Solgt && isRental, "#C50000", "#FFB3B3", "Custom.PropertyList.Label.Leased", "Udlejet"), 1299 (bolig.Solgt, "#C50000", "#FFB3B3", "Custom.PropertyList.Label.Sold", "Solgt"), 1300 (bolig.PurchaseAgreementSigned, "#003761", "#5A6B77", "Custom.PropertyList.Label.PurchaseAgreementSigned", "Købsaftale <br/> underskrevet"), 1301 (bolig.Nyhed, "#DE8344", "#F9CBAB", "Custom.PropertyList.Label.New", "Ny"), 1302 (bolig.NyPris, "#DE8344", "#F9CBAB", "Custom.PropertyList.Label.NewPrice", "Ny pris") 1303 }; 1304 1305 var match = labels.FirstOrDefault(l => l.Condition); 1306 1307 } 1308 1309 @if (match.Condition) 1310 { 1311 <div class="property-card-label @(bolig.PurchaseAgreementSigned ? "small" : "") d-flex align-items-center"> 1312 <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 25 25" fill="none"> 1313 <circle cx="12.5" cy="12.5" r="10.5" fill="@match.Color" stroke="@match.Stroke" stroke-width="4" /> 1314 </svg> 1315 @Translate(match.Key, match.Default) 1316 </div> 1317 } 1318 </div> 1319 <div class="property-card-info d-flex"> 1320 <span>@propCategory</span> 1321 <div class="detail-separator"></div> 1322 <span>@bolig.Areal @Translate("Custom.Propertypage.Units.SquareMeters", "m&sup2;")</span> 1323 <div class="detail-separator"></div> 1324 @if (!bolig.Solgt && !bolig.PurchaseAgreementSigned) 1325 { 1326 if (isRental) 1327 { 1328 <span> @property.GetInteger("Ecom:Product:Field.xEjendomBoligUdlejningLejeMaaned").ToString("#,##0") @Translate("Custom.PropertyCard.RentPerMonth", "pr. md.") </span> 1329 } 1330 else 1331 { 1332 <span> kr. @bolig.Pris.ToString("#,##0") </span> 1333 } 1334 <div class="detail-separator"></div> 1335 } 1336 @{ 1337 var scenarioNumber = property.GetString("Ecom:Product:Field.EnergyLabelScenarioNumber"); 1338 var savings = property.GetInteger("Ecom:Product:Field.EnergyLabelSavings"); 1339 var energyLink = property.GetString("Ecom:Product:Field.EnergyLabelLink"); 1340 } 1341 1342 <div class="energylabel @(scenarioNumber == "2" ? "energy__hover" : "")" 1343 data-energylabel="@Dynamicweb.Core.Encoders.HtmlEncoder.HtmlAttributeEncode(bolig.EnergyLabel)"> 1344 @if (scenarioNumber == "2") 1345 { 1346 <span id="energi-testgruppe-information" class="tooltiptext"> 1347 @if (savings > 0) 1348 { 1349 @string.Format(Translate("Smartpage:Boligvisning.Energimærketekst1-1", "OBS: du kan spare {0} årligt ved at renovere denne bolig - {1}"), savings.ToString("#,##0"), "") 1350 <a target="_blank" href="@(energyLink)&utm_source=realmaeglerne&utm_medium=energimaerke&utm_campaign=testgruppe1">@Translate("Custom.Propertypage.EnergyLabel.Tooltip.Linktext", "klik her")</a> 1351 } 1352 else 1353 { 1354 @string.Format(Translate("Smartpage:Boligvisning.Energimærketekst1-2", "OBS: du kan energi renovere denne bolig {0}"), "") 1355 <a target="_blank" href="@(energyLink)&utm_source=realmaeglerne&utm_medium=energimaerke&utm_campaign=testgruppe1">@Translate("Custom.Propertypage.EnergyLabel.Tooltip.Linktext", "klik her")</a> 1356 } 1357 </span> 1358 } 1359 </div> 1360 </div> 1361 <div class="property-card-button"> 1362 <a href="@bolig.LinkUrl@(isRental ? "?Udlejning=true" : "")" class="btn btn-primary @(bolig.AndenMaegler ? "grey" : "")" target="_blank"> 1363 @if (bolig.AndenMaegler) 1364 { 1365 @Translate("Custom.PropertyList.ViewPropertyButton.External", "Anden mægler") 1366 } 1367 else 1368 { 1369 @Translate("Custom.PropertyList.ViewPropertyButton", "Se bolig") 1370 } 1371 <img height="20px" width="20px" src="@(iconPath + "icon-arrow-right.svg")" /> 1372 </a> 1373 </div> 1374 </div> 1375 </div> 1376 } 1377 1378 string FormatTime(string time) => time?.Length >= 5 ? time.Substring(0, 5) : (time ?? string.Empty); 1379 1380 } 1381 1382 1383 1384 @{ 1385 IEnumerable<Product> boliglistFavorites = Enumerable.Empty<Product>();; 1386 try { 1387 boliglistFavorites = RealEstate.User.Helper.GetFavorites(); 1388 } catch { 1389 // Ignore 1390 } 1391 } 1392 <section class="bolig-list my-favorites"> 1393 <div class="container"> 1394 @if(boliglistFavorites != null && boliglistFavorites.Any()) { 1395 <div class="list list-favorites row"> 1396 @{ 1397 RenderBoligList(boliglistFavorites); 1398 } 1399 </div> 1400 } else { 1401 <div class="row"> 1402 <div class="col-xs-12 text-center"> 1403 <h2>@(Translate("no_favorites_yet", "Du har endnu ingen gemte boliger"))</h2> 1404 <br /><br /> 1405 </div> 1406 </div> 1407 } 1408 </div> 1409 </section> 1410
Dit RealMæglerne

Log ind på RealMæglernes Boligagent

Med Mit RealMæglerne er det nemt at følge boligmarkedet. Leder du efter nyt, kan du gemme dine favorit boliger og målrette din søgning ned til mindste detalje. Skal du sælge, kan du løbende følge interessen for din bolig og meget mere.


Kontakt Mægler

Din bolig

* Der samles ingen personlige oplysninger uden dit udtrykkelige samtykke. Ved at klikke på denne checkboks giver du dit samtykke til, at dine data samles og behandles af RealMæglerne A/S for at kunne kontakte dig. Du kan til enhver tid tilbagekalde dit samtykke. For at gøre dette skal du blot sende en meddelelse til info@realmaeglerne.dk. Læs mere på privatlivspolitikkerne.

Tilmeld til åbent hus

Adresse:
Dato:
Tidspunkt:

Kontakt Mægler

* Der samles ingen personlige oplysninger uden dit udtrykkelige samtykke. Ved at klikke på denne checkboks giver du dit samtykke til, at dine data samles og behandles af RealMæglerne A/S for at kunne kontakte dig. Du kan til enhver tid tilbagekalde dit samtykke. For at gøre dette skal du blot sende en meddelelse til info@realmaeglerne.dk. Læs mere på privatlivspolitikkerne.

Bestil gratis salgsvurdering

Din bolig

Send salgsvurdering til:

Vælg mægler

* Der samles ingen personlige oplysninger uden dit udtrykkelige samtykke. Ved at klikke på denne checkboks giver du dit samtykke til, at dine data samles og behandles af RealMæglerne A/S for at kunne kontakte dig. Du kan til enhver tid tilbagekalde dit samtykke. For at gøre dette skal du blot sende en meddelelse til info@realmaeglerne.dk. Læs mere på privatlivspolitikkerne.

Bestil gratis salgsvurdering

Din bolig

Send salgsvurdering til:

Vælg mægler

* Der samles ingen personlige oplysninger uden dit udtrykkelige samtykke. Ved at klikke på denne checkboks giver du dit samtykke til, at dine data samles og behandles af RealMæglerne A/S for at kunne kontakte dig. Du kan til enhver tid tilbagekalde dit samtykke. For at gøre dette skal du blot sende en meddelelse til info@realmaeglerne.dk. Læs mere på privatlivspolitikkerne.