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 41: 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_19e128449b974c18862959c56a2aa470 : 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\r\n"); 30 31 IEnumerable<Product> boliglistFavorites = Enumerable.Empty<Product>();; 32 try { 33 boliglistFavorites = RealEstate.User.Helper.GetFavorites(); 34 } catch { 35 // Ignore 36 } 37 WriteLiteral("<section class=\"bolig-list my-favorites\">\r\n\t<div class=\"container\">\r\n"); 38 if(boliglistFavorites != null && boliglistFavorites.Any()) { 39 WriteLiteral("\t\t\t<div class=\"list list-favorites row\">\r\n"); 40 41 RenderBoligList(boliglistFavorites); 42 WriteLiteral("\t </div>\r\n"); 43 } else { 44 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>"); 45 Write(Translate("no_favorites_yet", "Du har endnu ingen gemte boliger")); 46 WriteLiteral("</h2>\r\n <br /><br />\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n"); 47 } 48 WriteLiteral("\t</div>\r\n</section>\r\n"); 49 } 50 #pragma warning restore 1998 51 52 void RenderErhvervsTypeCheckboxes(string productGroupFilter) 53 { 54 WriteLiteral(@" <div class=""col-xs-6 col-md-4""> 55 <div class=""checkbox""> 56 <label> 57 <input type=""checkbox"" name=""propertytype"" value=""bolig/erhverv, kombineret erhverv og bolig, byejendom (kontor, butik, beboelse)"" /> 58 <span>Bolig/erhverv</span> 59 </label> 60 </div> 61 <div class=""checkbox""> 62 <label> 63 <input type=""checkbox"" name=""propertytype"" value=""erhvervsgrund"" /> 64 <span>Erhvervsgrund</span> 65 </label> 66 </div> 67 <div class=""checkbox""> 68 <label> 69 <input type=""checkbox"" name=""propertytype"" value=""boligudlejning"" /> 70 <span>Boligudlejningsejendom</span> 71 </label> 72 </div> 73 <div class=""checkbox""> 74 <label> 75 <input type=""checkbox"" name=""propertytype"" value=""kontor, klinik, kontorhotel, showroom, under"); 76 WriteLiteral(@"visningslokaler"" /> 77 <span>Kontor</span> 78 </label> 79 </div> 80 </div> 81 <div class=""col-xs-6 col-md-4""> 82 <div class=""checkbox""> 83 <label> 84 <input type=""checkbox"" name=""propertytype"" value=""butik / detail, butik / detailhandel"" /> 85 <span>Butik/detailhandel</span> 86 </label> 87 </div> 88 <div class=""checkbox""> 89 <label> 90 <input type=""checkbox"" name=""propertytype"" value=""industri / logistik, håndværk, industri, kontor / lager, logistik"" /> 91 <span>Produktion/lager</span> 92 </label> 93 </div> 94 <div class=""checkbox""> 95 <label> 96 <input type=""checkbox"" name=""propertytype"" value=""hotel - kursusejendom, restaurant"" /> 97 <span>Hotel og restaurant</span> 98 </label> 99 </div> 100 <div c"); 101 WriteLiteral(@"lass=""checkbox""> 102 <label> 103 <input type=""checkbox"" name=""propertytype"" value=""projekt ejendom"" /> 104 <span>Projektejendom</span> 105 </label> 106 </div> 107 </div> 108 <div class=""col-xs-6 col-md-4""> 109 <div class=""checkbox""> 110 <label> 111 <input type=""checkbox"" name=""propertytype"" value=""andet"" /> 112 <span>Andet</span> 113 </label> 114 </div> 115 </div> 116 "); 117 WriteLiteral(" <input type=\"hidden\" name=\"propertycategory\" value=\"erhverv, udlejning\" />\r\n <input type=\"hidden\" name=\"filtrering\""); 118 BeginWriteAttribute("value", " value=\"", 3142, "\"", 3169, 1); 119 WriteAttributeValue("", 3150, productGroupFilter, 3150, 19, false); 120 EndWriteAttribute(); 121 WriteLiteral(" />\r\n"); 122 } 123 void RenderBoligtypeCheckboxes() 124 { 125 WriteLiteral(@" <div class=""col-6 col-md-4""> 126 <div class=""checkbox""> 127 <label> 128 <input type=""checkbox"" name=""propertytype"" value=""villa"" /> 129 <span>Villa</span> 130 </label> 131 </div> 132 <div class=""checkbox""> 133 <label> 134 <input type=""checkbox"" name=""propertytype"" value=""rækkehus"" /> 135 <span>Rækkehus</span> 136 </label> 137 </div> 138 <div class=""checkbox""> 139 <label> 140 <input type=""checkbox"" name=""propertytype"" value=""villalejlighed"" /> 141 <span>Villalejlighed</span> 142 </label> 143 </div> 144 <div class=""checkbox""> 145 <label> 146 <input type=""checkbox"" name=""propertytype"" value=""andelsbolig"" /> 147 <span>Andelsbolig</span> 148 </label> 149 </div> 150 </div> 151 <div class=""co"); 152 WriteLiteral(@"l-6 col-md-4""> 153 <div class=""checkbox""> 154 <label> 155 <input type=""checkbox"" name=""propertytype"" value=""fritidshus, fritidsbolig"" /> 156 <span>Fritidsbolig</span> 157 </label> 158 </div> 159 <div class=""checkbox""> 160 <label> 161 <input type=""checkbox"" name=""propertytype"" value=""ejerlejlighed"" class=""specialOption"" data-disable-slider=""#grundareal"" data-disable-slider-ranges=""#grundarealmin,#grundarealmax"" /> 162 <span>Ejerlejlighed</span> 163 </label> 164 </div> 165 <div class=""checkbox""> 166 <label> 167 <input type=""checkbox"" name=""propertytype"" value=""helårsgrund"" class=""specialOption"" data-disable-slider=""#boligareal,#roomsslider"" data-disable-slider-ranges=""#boligarealmin,#boligarealmax,#roomsmin"" /> 168 <span>Helårsgrund</span> 169 </label> 170 </div> 171 <div "); 172 WriteLiteral(@"class=""checkbox""> 173 <label> 174 <input type=""checkbox"" name=""propertytype"" value=""fritidsgrund"" class=""specialOption"" data-disable-slider=""#boligareal,#roomsslider"" data-disable-slider-ranges=""#boligarealmin,#boligarealmax,#roomsmin"" /> 175 <span>Fritidsgrund</span> 176 </label> 177 </div> 178 </div> 179 <div class=""col-6 col-md-4""> 180 <div class=""checkbox""> 181 <label> 182 <input type=""checkbox"" name=""propertytype"" value=""landejendom, lystejendom"" class=""specialOption"" data-disable-checkbox=""true"" /> 183 <span>Landejendom</span> 184 </label> 185 </div> 186 <div class=""checkbox""> 187 <label> 188 <input type=""checkbox"" name=""propertytype"" value=""erhverv"" class=""specialOption"" data-disable-checkbox=""true"" data-disable-slider=""#roomsslider"" data-disable-slider-ranges=""#roomsmin"" /> 189 <span>Erhverv<"); 190 WriteLiteral("/span>\r\n </label>\r\n </div>\r\n </div>\r\n"); 191 } 192 193 void RenderChecked(string queryString) 194 { 195 if (Dynamicweb.Context.Current.Request.QueryString["propertytype"] == queryString) 196 { 197 Write("checked"); 198 199 } 200 } 201 202 void RenderBoligtypeCheckboxesDropdown() 203 { 204 Dictionary<string, string> propertyTypes = new Dictionary<string, string>(){ 205 { "Villa", "villa" }, { "Rækkehus", "rækkehus" }, { "Villalejlighed", "villalejlighed" }, 206 { "Andelsbolig", "andelsbolig" } 207 }; 208 foreach (KeyValuePair<string, string> type in propertyTypes) 209 { 210 bool ischecked = false; 211 string[] propertytypeSplit = new string[0]; 212 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["propertytype"])) 213 { 214 propertytypeSplit = Dynamicweb.Context.Current.Request.QueryString["propertytype"].Split(','); 215 } 216 foreach (var propertytypeParams in propertytypeSplit) 217 { 218 if (propertytypeParams == type.Value) 219 { 220 ischecked = true; 221 } 222 } 223 WriteLiteral(" <li>\r\n <label class=\"checkbox-container d-flex\">\r\n "); 224 Write(Translate("Smartpage:Search.DropDown." + type.Key + "", "" + type.Key + "")); 225 WriteLiteral("\r\n <input type=\"checkbox\" name=\"propertytype\""); 226 BeginWriteAttribute("value", " value=\"", 7765, "\"", 7784, 1); 227 WriteAttributeValue("", 7773, type.Value, 7773, 11, false); 228 EndWriteAttribute(); 229 WriteLiteral(" class=\"js-input-check datavalue js-datavalue js-count\" data-val=\""); 230 Write(type.Key); 231 WriteLiteral("\" onchange=\"submitFilter()\""); 232 BeginWriteAttribute("checked", " checked=\"", 7887, "\"", 7907, 1); 233 WriteAttributeValue("", 7897, ischecked, 7897, 10, false); 234 EndWriteAttribute(); 235 WriteLiteral(" />\r\n <span class=\"checkmark grey\"></span>\r\n </label>\r\n </li>\r\n"); 236 } 237 238 WriteLiteral(" <li>\r\n <label class=\"checkbox-container d-flex\">\r\n "); 239 Write(Translate("Smartpage:Search.DropDown.Blandet Bolig/Erhverv", "Blandet Bolig/Erhverv")); 240 WriteLiteral("\r\n"); 241 242 bool blboligcheck = false; 243 if (Dynamicweb.Context.Current.Request.QueryString["propertycategory"] == "Blandet Bolig/Erhverv") 244 { 245 blboligcheck = true; 246 } 247 WriteLiteral(" <input type=\"checkbox\" name=\"propertycategory\" value=\"Blandet Bolig/Erhverv\" class=\"specialOption js-input-check js-datavalue js-count\" data-disable-checkbox=\"true\" data-disable-slider=\"#roomsslider\" data-disable-slider-ranges=\"#roomsmin\""); 248 BeginWriteAttribute("checked", " checked=\"", 8740, "\"", 8763, 1); 249 WriteAttributeValue("", 8750, blboligcheck, 8750, 13, false); 250 EndWriteAttribute(); 251 WriteLiteral(" />\r\n <span class=\"checkmark grey\"></span>\r\n </label>\r\n </li>\r\n"); 252 253 Dictionary<string, string> propertyTypes2 = new Dictionary<string, string>(){ 254 { "Fritidsbolig", "fritidshus, fritidsbolig" }, { "Ejerlejlighed", "ejerlejlighed" }, { "Helårsgrund", "helårsgrund" }, 255 { "Fritidsgrund", "fritidsgrund" }, { "Landejendom", "landejendom, lystejendom" } 256 }; 257 foreach (KeyValuePair<string, string> type in propertyTypes2) 258 { 259 bool ischecked = false; 260 string[] propertytypeSplit2 = new string[0]; 261 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["propertytype"])) 262 { 263 propertytypeSplit2 = Dynamicweb.Context.Current.Request.QueryString["propertytype"].Split(','); 264 } 265 foreach (var propertytypeParams in propertytypeSplit2) 266 { 267 if (propertytypeParams == type.Value) 268 { 269 ischecked = true; 270 } 271 } 272 WriteLiteral(" <li>\r\n <label class=\"checkbox-container d-flex\">\r\n "); 273 Write(Translate("Smartpage:Search.DropDown." + type.Key + "", "" + type.Key + "")); 274 WriteLiteral("\r\n"); 275 if (type.Value == "ejerlejlighed") 276 { 277 WriteLiteral(" <input type=\"checkbox\" name=\"propertytype\""); 278 BeginWriteAttribute("value", " value=\"", 10164, "\"", 10183, 1); 279 WriteAttributeValue("", 10172, type.Value, 10172, 11, false); 280 EndWriteAttribute(); 281 WriteLiteral(" class=\"js-input-check datavalue\" data-disable-slider=\"#grundareal\" data-disable-slider-ranges=\"#grundarealmin,#grundarealmax\" data-val=\""); 282 Write(type.Key); 283 WriteLiteral("\" onchange=\"submitFilter()\""); 284 BeginWriteAttribute("checked", " checked=\"", 10357, "\"", 10377, 1); 285 WriteAttributeValue("", 10367, ischecked, 10367, 10, false); 286 EndWriteAttribute(); 287 WriteLiteral(" />\r\n"); 288 } 289 else if (type.Value == "helårsgrund") 290 { 291 WriteLiteral(" <input type=\"checkbox\" name=\"propertytype\""); 292 BeginWriteAttribute("value", " value=\"", 10554, "\"", 10573, 1); 293 WriteAttributeValue("", 10562, type.Value, 10562, 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=\"", 10770, "\"", 10790, 1); 299 WriteAttributeValue("", 10780, ischecked, 10780, 10, false); 300 EndWriteAttribute(); 301 WriteLiteral(" />\r\n"); 302 } 303 else if (type.Value == "fritidsgrund") 304 { 305 WriteLiteral(" <input type=\"checkbox\" name=\"propertytype\""); 306 BeginWriteAttribute("value", " value=\"", 10968, "\"", 10987, 1); 307 WriteAttributeValue("", 10976, type.Value, 10976, 11, false); 308 EndWriteAttribute(); 309 WriteLiteral(" class=\"js-input-check datavalue\" data-disable-slider=\"#boligareal,#roomsslider\" data-disable-slider-ranges=\"#boligarealmin,#boligarealmax,#roomsmin\" data-val=\""); 310 Write(type.Key); 311 WriteLiteral("\" onchange=\"submitFilter()\""); 312 BeginWriteAttribute("checked", " checked=\"", 11184, "\"", 11204, 1); 313 WriteAttributeValue("", 11194, ischecked, 11194, 10, false); 314 EndWriteAttribute(); 315 WriteLiteral(" />\r\n"); 316 } 317 else 318 { 319 WriteLiteral(" <input type=\"checkbox\" name=\"propertytype\""); 320 BeginWriteAttribute("value", " value=\"", 11348, "\"", 11367, 1); 321 WriteAttributeValue("", 11356, type.Value, 11356, 11, false); 322 EndWriteAttribute(); 323 WriteLiteral(" class=\"js-input-check datavalue\" data-val=\""); 324 Write(type.Key); 325 WriteLiteral("\" onchange=\"submitFilter()\""); 326 BeginWriteAttribute("checked", " checked=\"", 11448, "\"", 11468, 1); 327 WriteAttributeValue("", 11458, ischecked, 11458, 10, false); 328 EndWriteAttribute(); 329 WriteLiteral(" />\r\n"); 330 } 331 WriteLiteral(" <span class=\"checkmark grey\"></span>\r\n </label>\r\n </li>\r\n"); 332 } 333 } 334 335 void RenderBoligTypeErhverv(bool submitOnChange = false, bool frontpage = false) 336 { 337 Dictionary<string, string> erhverType = new Dictionary<string, string>(){ 338 { "Kontor", "OwnUseOffices" }, { "Lager + Produktion", "OwnUseStoresAndProductions" }, { "Detailhandel", "OwnUseRetailAndStores" }, 339 { "Grunde", "OwnUseParcel" }, { "Andre typer", "OwnUseOtherTypes" }, { "Hotel + Restaurant", "OwnUseHotelsAndRestaurants" } 340 }; 341 var submitonchange = ""; 342 if (submitOnChange) 343 { 344 submitonchange = "onchange='submitFilter()'"; 345 } 346 347 foreach (KeyValuePair<string, string> type in erhverType) 348 { 349 string ischecked = ""; 350 string[] olineParamsSplit = new string[0]; 351 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["olinecategory"])) 352 { 353 olineParamsSplit = Dynamicweb.Context.Current.Request.QueryString["olinecategory"].Split(','); 354 } 355 foreach (var olineParams in olineParamsSplit) 356 { 357 if (olineParams == type.Value) 358 { 359 ischecked = "checked"; 360 } 361 } 362 363 WriteLiteral(" <li>\r\n <label class=\"checkbox-container d-flex\">\r\n "); 364 Write(Translate("Smartpage:Search.DropDown." + type.Key + "", "" + type.Key + "")); 365 WriteLiteral("\r\n <input type=\"checkbox\" name=\"olinecategory\""); 366 BeginWriteAttribute("value", " value=\"", 13112, "\"", 13131, 1); 367 WriteAttributeValue("", 13120, type.Value, 13120, 11, false); 368 EndWriteAttribute(); 369 WriteLiteral(" class=\"js-input-check datavalue\" data-val=\""); 370 Write(type.Key); 371 WriteLiteral("\" "); 372 Write(submitonchange); 373 WriteLiteral(" "); 374 Write(ischecked); 375 WriteLiteral(" />\r\n <span class=\"checkmark grey\"></span>\r\n </label>\r\n </li>\r\n"); 376 } 377 378 379 bool ischeckedpropertycat = false; 380 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["propertycategory"])) 381 { 382 if (Dynamicweb.Context.Current.Request.QueryString["propertycategory"] == "Blandet Bolig/Erhverv") 383 { 384 ischeckedpropertycat = true; 385 } 386 } 387 WriteLiteral(" <li>\r\n <label class=\"checkbox-container\">\r\n "); 388 Write(Translate("Smartpage:Search.DropDown.Blandet Bolig/Erhverv", "Blandet Bolig/Erhverv")); 389 WriteLiteral("\r\n <input type=\"checkbox\" name=\"propertycategory\" value=\"Blandet Bolig/Erhverv\" class=\"js-input-check datavalue\" data-val=\"Blandet Bolig/Erhverv\" onchange=\"submitFilter()\""); 390 BeginWriteAttribute("checked", " checked=\"", 14044, "\"", 14075, 1); 391 WriteAttributeValue("", 14054, ischeckedpropertycat, 14054, 21, false); 392 EndWriteAttribute(); 393 WriteLiteral(" />\r\n <span class=\"checkmark grey\"></span>\r\n </label>\r\n </li>\r\n"); 394 } 395 396 void RenderBoligTypeErhvervInvest(bool submitOnChange = false) 397 { 398 Dictionary<string, string> erhverType = new Dictionary<string, string>(){ 399 { "Kontor", "Kontor" }, { "Lager + Produktion", "InvestmentStoresAndProductions" }, { "Boligudlejning", "InvestmentHousingRental" }, 400 { "Detailhandel", "InvestmentRetailAndStores" }, { "Grunde", "InvestmentParcel" }, { "Hotel + Restaurant", "InvestmentHotelsAndRestaurants" }, { "Andre typer", "InvestmentOtherTypes" } 401 }; 402 403 foreach (KeyValuePair<string, string> type in erhverType) 404 { 405 bool ischecked = false; 406 string[] olineParamsSplit = new string[0]; 407 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["olinecategory"])) 408 { 409 olineParamsSplit = Dynamicweb.Context.Current.Request.QueryString["olinecategory"].Split(','); 410 } 411 foreach (var olineParams in olineParamsSplit) 412 { 413 if (olineParams == type.Value) 414 { 415 ischecked = true; 416 } 417 } 418 419 WriteLiteral(" <li>\r\n <label class=\"checkbox-container\">\r\n "); 420 Write(Translate("Smartpage:Search.DropDown." + type.Key + "", "" + type.Key + "")); 421 WriteLiteral("\r\n <input type=\"checkbox\" name=\"olinecategory\""); 422 BeginWriteAttribute("value", " value=\"", 15562, "\"", 15581, 1); 423 WriteAttributeValue("", 15570, type.Value, 15570, 11, false); 424 EndWriteAttribute(); 425 WriteLiteral(" class=\"js-input-check datavalue\" data-val=\""); 426 Write(type.Key); 427 WriteLiteral("\" onchange=\"submitFilter()\""); 428 BeginWriteAttribute("checked", " checked=\"", 15662, "\"", 15682, 1); 429 WriteAttributeValue("", 15672, ischecked, 15672, 10, false); 430 EndWriteAttribute(); 431 WriteLiteral(" />\r\n <span class=\"checkmark grey\"></span>\r\n </label>\r\n </li>\r\n"); 432 } 433 } 434 int GetWebsiteSettingsPageId(string pageSysName) 435 { 436 int sideId = 0; 437 438 var pw = Dynamicweb.Frontend.PageView.Current(); 439 440 string settingsItemId = "1"; 441 442 if ((pw.Area.Item.ContainsKey("Type") && pw.Area.Item["Type"].ToString() == "bone") || Dynamicweb.Context.Current.Request.QueryString["bone"] == "true") 443 { 444 settingsItemId = "2"; 445 } 446 447 var settingsItem = ItemManager.Storage.GetById("Delte_Egenskaber", settingsItemId); 448 449 if (settingsItem == null || !settingsItem.ContainsKey(pageSysName)) 450 { 451 return sideId; 452 } 453 454 string boligsideLink = settingsItem[pageSysName] as String; 455 string linkPrefix = "Default.aspx?ID="; 456 457 if (!String.IsNullOrEmpty(boligsideLink) && boligsideLink.ToLower().StartsWith(linkPrefix.ToLower())) 458 { 459 Int32.TryParse(boligsideLink.Substring(linkPrefix.Length), out sideId); 460 } 461 462 return sideId; 463 } 464 465 int GetPageSettingsPageId(string pageSysName) 466 { 467 int sideId = 0; 468 469 var pw = Dynamicweb.Frontend.PageView.Current(); 470 471 if (pw.Page == null || pw.Page.PropertyItem == null || !pw.Page.PropertyItem.ContainsKey(pageSysName)) 472 { 473 return sideId; 474 } 475 476 string boligsideLink = pw.Page.PropertyItem[pageSysName] as String; 477 string linkPrefix = "Default.aspx?ID="; 478 479 if (!String.IsNullOrEmpty(boligsideLink) && boligsideLink.ToLower().StartsWith(linkPrefix.ToLower())) 480 { 481 Int32.TryParse(boligsideLink.Substring(linkPrefix.Length), out sideId); 482 } 483 484 return sideId; 485 } 486 void RenderMobileSelectBox(string name, int max, int step, string className, string inputname) 487 { 488 WriteLiteral(" <select"); 489 BeginWriteAttribute("class", " class=\"", 17625, "\"", 17680, 5); 490 WriteAttributeValue("", 17633, "form-control", 17633, 12, true); 491 WriteAttributeValue(" ", 17645, "d-block", 17646, 8, true); 492 WriteAttributeValue(" ", 17653, "d-lg-none", 17654, 10, true); 493 WriteAttributeValue(" ", 17663, "mb-10", 17664, 6, true); 494 WriteAttributeValue(" ", 17669, className, 17670, 10, false); 495 EndWriteAttribute(); 496 WriteLiteral(" onchange=\"submitFilter()\""); 497 BeginWriteAttribute("name", " name=\"", 17707, "\"", 17724, 1); 498 WriteAttributeValue("", 17714, inputname, 17714, 10, false); 499 EndWriteAttribute(); 500 WriteLiteral(">\r\n <option selected=\"true\" disabled=\"disabled\">"); 501 Write(Translate("Smartpage:Search.Placeholder." + name + "", "" + name + "")); 502 WriteLiteral("</option>\r\n\r\n"); 503 for (var i = 0; i <= max; i += step) 504 { 505 var selected = string.Empty; 506 var current = string.Empty; 507 if (i == max) 508 { 509 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString[inputname]) && Dynamicweb.Context.Current.Request.QueryString[inputname] == Convert.ToString(i)) 510 { 511 WriteLiteral(" <option"); 512 BeginWriteAttribute("value", " value=\"", 18320, "\"", 18330, 1); 513 WriteAttributeValue("", 18328, i, 18328, 2, false); 514 EndWriteAttribute(); 515 WriteLiteral(" data-value=\'"); 516 Write(Convert.ToInt32(i).ToString("N0")); 517 WriteLiteral("\' selected=\"selected\">"); 518 Write(Convert.ToInt32(i).ToString("N0")); 519 WriteLiteral("+</option>\r\n"); 520 } 521 else 522 { 523 WriteLiteral(" <option"); 524 BeginWriteAttribute("value", " value=\"", 18549, "\"", 18559, 1); 525 WriteAttributeValue("", 18557, i, 18557, 2, false); 526 EndWriteAttribute(); 527 WriteLiteral(" data-value=\'"); 528 Write(Convert.ToInt32(i).ToString("N0")); 529 WriteLiteral("\'>"); 530 Write(Convert.ToInt32(i).ToString("N0")); 531 WriteLiteral("+</option>\r\n"); 532 } 533 } 534 else 535 { 536 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString[inputname]) && Dynamicweb.Context.Current.Request.QueryString[inputname] == Convert.ToString(i)) 537 { 538 WriteLiteral(" <option"); 539 BeginWriteAttribute("value", " value=\"", 18983, "\"", 18993, 1); 540 WriteAttributeValue("", 18991, i, 18991, 2, false); 541 EndWriteAttribute(); 542 WriteLiteral(" data-value=\'"); 543 Write(Convert.ToInt32(i).ToString("N0")); 544 WriteLiteral("\' selected=\"selected\">"); 545 Write(Convert.ToInt32(i).ToString("N0")); 546 WriteLiteral("</option>\r\n"); 547 } 548 else 549 { 550 WriteLiteral(" <option"); 551 BeginWriteAttribute("value", " value=\"", 19211, "\"", 19221, 1); 552 WriteAttributeValue("", 19219, i, 19219, 2, false); 553 EndWriteAttribute(); 554 WriteLiteral(" data-value=\'"); 555 Write(Convert.ToInt32(i).ToString("N0")); 556 WriteLiteral("\'>"); 557 Write(Convert.ToInt32(i).ToString("N0")); 558 WriteLiteral("</option>\r\n"); 559 } 560 } 561 } 562 WriteLiteral(" </select>\r\n"); 563 } 564 565 void RenderTopFilter(string parameter) 566 { 567 if (parameter == "pricemin" || parameter == "pricemax") 568 { 569 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["pricemin"])) 570 { 571 if (parameter == "pricemin") 572 { 573 Write("<div class='search-terms' id='priceFilter'>"); 574 Write("Pris "); 575 Write(Dynamicweb.Context.Current.Request[parameter]); 576 577 } 578 579 else 580 { 581 Write(" - "); 582 Write(Dynamicweb.Context.Current.Request[parameter]); 583 Write(" kr."); 584 WriteLiteral(" <i class=\"fa fa-times ml-2 pointer\" onclick=\"removeParams(this)\" data-tag=\"pricemin,pricemax\"></i>\r\n"); 585 Write("</div>"); 586 587 } 588 } 589 } 590 591 else if (parameter == "subsidymin" || parameter == "subsidymax") 592 { 593 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["subsidymin"])) 594 { 595 if (parameter == "subsidymin") 596 { 597 Write("<div class='search-terms' id='subsidyFilter'>"); 598 Write("Årlig leje "); 599 Write(Dynamicweb.Context.Current.Request[parameter]); 600 601 } 602 603 else 604 { 605 Write(" - "); 606 Write(Dynamicweb.Context.Current.Request[parameter]); 607 Write(" kr."); 608 WriteLiteral(" <i class=\"fa fa-times ml-2 pointer\" onclick=\"removeParams(this)\" data-tag=\"subsidymin,subsidymax\"></i>\r\n"); 609 Write("</div>"); 610 611 } 612 } 613 } 614 else if (parameter == "etagearealmin" || parameter == "etagearealmax") 615 { 616 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["etagearealmin"])) 617 { 618 if (parameter == "etagearealmin") 619 { 620 Write("<div class='search-terms' id='etagearealFilter'>"); 621 Write("Etageareal "); 622 Write(Dynamicweb.Context.Current.Request[parameter]); 623 624 } 625 626 else 627 { 628 Write(" - "); 629 Write(Dynamicweb.Context.Current.Request[parameter]); 630 Write(" kvm."); 631 WriteLiteral(" <i class=\"fa fa-times ml-2 pointer\" onclick=\"removeParams(this)\" data-tag=\"etagearealmin,etagearealmax\"></i>\r\n"); 632 Write("</div>"); 633 634 } 635 } 636 } 637 638 else if (parameter == "grundarealmin" || parameter == "grundarealmax") 639 { 640 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["grundarealmin"])) 641 { 642 if (parameter == "grundarealmin") 643 { 644 Write("<div class='search-terms' id='grundarealFilter'>"); 645 Write("Grundareal "); 646 Write(Dynamicweb.Context.Current.Request[parameter]); 647 648 } 649 650 else 651 { 652 Write(" - "); 653 Write(Dynamicweb.Context.Current.Request[parameter]); 654 Write(" kvm."); 655 WriteLiteral(" <i class=\"fa fa-times ml-2 pointer\" onclick=\"removeParams(this)\" data-tag=\"grundarealmin,grundarealmax\"></i>\r\n"); 656 Write("</div>"); 657 658 } 659 } 660 } 661 662 else if (parameter == "subsidykvmmin" || parameter == "subsidykvmmax") 663 { 664 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["subsidykvmmin"])) 665 { 666 if (parameter == "subsidykvmmin") 667 { 668 Write("<div class='search-terms' id='subsidykvmFilter'>"); 669 Write("Årlig leje kvm "); 670 Write(Dynamicweb.Context.Current.Request[parameter]); 671 672 } 673 674 else 675 { 676 Write(" - "); 677 Write(Dynamicweb.Context.Current.Request[parameter]); 678 Write(" kr."); 679 WriteLiteral(" <i class=\"fa fa-times ml-2 pointer\" onclick=\"removeParams(this)\" data-tag=\"subsidykvmmin,subsidykvmmax\"></i>\r\n"); 680 Write("</div>"); 681 682 } 683 } 684 } 685 686 else if (parameter == "olinecategory") 687 { 688 689 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["olinecategory"])) 690 { 691 Dictionary<string, string> erhverType = new Dictionary<string, string>(){ 692 {"OwnUseOffices", "Kontor" }, { "OwnUseStoresAndProductions","Lager + Produktion" }, { "OwnUseRetailAndStores","Detailhandel" }, 693 { "OwnUseParcel", "Grunde" }, { "OwnUseHotelsAndRestaurants", "Hotel + Restaurant" }, { "OwnUseOtherTypes", "Andre typer"}, 694 { "Kontor", "Kontor" }, { "InvestmentStoresAndProductions", "Lager + Produktion" }, { "InvestmentHousingRental", "Boligudlejning" }, 695 { "InvestmentRetailAndStores", "Detailhandel" }, { "InvestmentParcel", "Grunde" }, { "InvestmentHotelsAndRestaurants", "Hotel + Restaurant" }, { "InvestmentOtherTypes", "Andre typer" } 696 }; 697 698 699 foreach (var er in erhverType) 700 { 701 if (Dynamicweb.Context.Current.Request[parameter].Contains(er.Key)) 702 { 703 WriteLiteral(" <div class=\"search-terms\""); 704 BeginWriteAttribute("id", " id=\"", 24391, "\"", 24406, 1); 705 WriteAttributeValue("", 24396, parameter, 24396, 10, false); 706 EndWriteAttribute(); 707 WriteLiteral(">\r\n "); 708 Write(er.Value); 709 WriteLiteral(" <i class=\"fa fa-times ml-2 pointer\" onclick=\"removeParams(this)\" data-tag=\""); 710 Write(parameter); 711 WriteLiteral("\" data-val=\""); 712 Write(er.Key); 713 WriteLiteral("\"></i>\r\n </div>\r\n"); 714 } 715 } 716 } 717 } 718 else if (parameter == "propertycategory") 719 { 720 721 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["propertycategory"])) 722 { 723 Dictionary<string, string> erhverType = new Dictionary<string, string>(){ 724 { "propertycategory", "Blandet Bolig/Erhverv" } 725 }; 726 727 foreach (var er in erhverType) 728 { 729 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request[parameter]) && Dynamicweb.Context.Current.Request[parameter] == er.Value) 730 { 731 WriteLiteral(" <div class=\"search-terms\""); 732 BeginWriteAttribute("id", " id=\"", 25312, "\"", 25327, 1); 733 WriteAttributeValue("", 25317, parameter, 25317, 10, false); 734 EndWriteAttribute(); 735 WriteLiteral(">\r\n "); 736 Write(er.Value); 737 WriteLiteral(" <i class=\"fa fa-times ml-2 pointer\" onclick=\"removeParams(this)\" data-tag=\""); 738 Write(parameter); 739 WriteLiteral("\" data-val=\""); 740 Write(er.Key); 741 WriteLiteral("\"></i>\r\n </div>\r\n"); 742 } 743 } 744 } 745 } 746 else if (parameter == "search") 747 { 748 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["search"])) 749 { 750 WriteLiteral(" <div class=\"search-terms\""); 751 BeginWriteAttribute("id", " id=\"", 25775, "\"", 25790, 1); 752 WriteAttributeValue("", 25780, parameter, 25780, 10, false); 753 EndWriteAttribute(); 754 WriteLiteral(">\r\n "); 755 Write(Dynamicweb.Context.Current.Request[parameter]); 756 WriteLiteral(" <i class=\"fa fa-times ml-2 pointer\" onclick=\"removeParams(this)\" data-tag=\""); 757 Write(parameter); 758 WriteLiteral("\"></i>\r\n </div>\r\n"); 759 } 760 } 761 else 762 { 763 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request[parameter])) 764 { 765 Dictionary<string, string> 766 ubudsform = new Dictionary<string, string> 767 (){ 768 {"salg", "Salg" }, { "leje","Leje" } 769 }; 770 771 foreach (var er in ubudsform) 772 { 773 if (Dynamicweb.Context.Current.Request[parameter].Contains(er.Key)) 774 { 775 WriteLiteral(" <div class=\"search-terms\""); 776 BeginWriteAttribute("id", " id=\"", 26939, "\"", 26954, 1); 777 WriteAttributeValue("", 26944, parameter, 26944, 10, false); 778 EndWriteAttribute(); 779 WriteLiteral(">\r\n "); 780 Write(er.Value); 781 WriteLiteral(" <i class=\"fa fa-times ml-2 pointer\" onclick=\"removeParams(this)\" data-tag=\""); 782 Write(parameter); 783 WriteLiteral("\" data-val=\""); 784 Write(er.Key); 785 WriteLiteral("\"></i>\r\n </div>\r\n"); 786 } 787 } 788 789 790 } 791 } 792 } 793 794 void RenderSelectValue(string dropdownname, string dropdownvalue, string queryString) 795 { 796 var selected = ""; 797 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString[queryString]) && Dynamicweb.Context.Current.Request.QueryString[queryString] == dropdownvalue) 798 { 799 selected = "selected"; 800 } 801 802 var current = string.Format("<option value='" + dropdownvalue + "'>" + dropdownname + "</option>", selected); 803 804 Write(current); 805 806 } 807 808 void RenderSearchForHousing(int searchPageId, string querySearch, string querySearchNameAttr, string queryZipCodeFrom, string queryZipCodeTo, string template, Item SettingsItem, string cssClasses = "") 809 { 810 WriteLiteral(" <div"); 811 BeginWriteAttribute("class", " class=\"", 27958, "\"", 28004, 3); 812 WriteAttributeValue("", 27966, "main-search-form", 27966, 16, true); 813 WriteAttributeValue(" ", 27982, "frontpage", 27983, 10, true); 814 WriteAttributeValue(" ", 27992, cssClasses, 27993, 11, false); 815 EndWriteAttribute(); 816 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>"); 817 Write(Translate("Smartpage:Search.Søg bolig", "Søg bolig")); 818 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>"); 819 Write(Translate("Smartpage:Search.BoligerTilSalg", "Boliger til salg")); 820 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\""); 821 BeginWriteAttribute("value", " value=\'", 28719, "\'", 28740, 1); 822 WriteAttributeValue("", 28727, searchPageId, 28727, 13, false); 823 EndWriteAttribute(); 824 WriteLiteral(@" id=""searchPageId-frontpage"" disabled=""disabled"" /> 825 <div class=""row form-wrapper no-gutters""> 826 827 <div class=""col-xs-12 col-md-5 col-searchbar""> 828 <div class=""searchbar""> 829 <input type=""text"""); 830 BeginWriteAttribute("name", " name=\"", 29018, "\"", 29045, 1); 831 WriteAttributeValue("", 29025, querySearchNameAttr, 29025, 20, false); 832 EndWriteAttribute(); 833 WriteLiteral(" id=\"searchfield-frontpage\" class=\"search-input\" placeholder=\"Postnummer, by, vej eller sagsnummer\" tabindex=\"1\""); 834 BeginWriteAttribute("value", " value=\"", 29158, "\"", 29236, 1); 835 WriteAttributeValue("", 29166, Dynamicweb.Core.Encoders.HtmlEncoder.HtmlAttributeEncode(querySearch), 29166, 70, false); 836 EndWriteAttribute(); 837 WriteLiteral(" />\r\n <input type=\"hidden\" id=\"zipcodefrom-frontpage\" name=\"zipcodefrom\""); 838 BeginWriteAttribute("value", " value=\"", 29336, "\"", 29419, 1); 839 WriteAttributeValue("", 29344, Dynamicweb.Core.Encoders.HtmlEncoder.HtmlAttributeEncode(queryZipCodeFrom), 29344, 75, false); 840 EndWriteAttribute(); 841 WriteLiteral(" />\r\n <input type=\"hidden\" id=\"zipcodeto-frontpage\" name=\"zipcodeto\""); 842 BeginWriteAttribute("value", " value=\"", 29515, "\"", 29596, 1); 843 WriteAttributeValue("", 29523, Dynamicweb.Core.Encoders.HtmlEncoder.HtmlAttributeEncode(queryZipCodeTo), 29523, 73, false); 844 EndWriteAttribute(); 845 WriteLiteral(@" /> 846 </div> 847 </div> 848 <div class=""col-xs-12 col-md-5""> 849 <div class=""row no-gutters""> 850 <div class=""col-xs-12 col-md-6 input-col""> 851 <div class=""dropdown w-overlay""> 852 <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""> 853 "); 854 Write(Translate("Smartpage:Search.Boligtype", "Boligtype")); 855 WriteLiteral(@" 856 </button> 857 <div class=""dropdown-menu box-shadow bolig-dropdown-container"" aria-labelledby=""Boligtype""> 858 <ul class=""bolig-dropdown list-unstyled""> 859 "); 860 861 RenderBoligtypeCheckboxesDropdown(); 862 WriteLiteral(" </ul>\r\n <span class=\"border-fat\"></span>\r\n <button class=\"btn btn-primary js-close-dropdown\">"); 863 Write(Translate("Smartpage:Search.Anvend", "Anvend")); 864 WriteLiteral(@"</button> 865 </div> 866 867 </div> 868 869 </div> 870 <div class=""col-xs-12 col-md-6 input-col""> 871 <div class=""dropdown w-overlay""> 872 <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""> 873 "); 874 Write(Translate("Smartpage:Search.Pris", "Pris")); 875 WriteLiteral(@" 876 </button> 877 <div class=""dropdown-menu box-shadow dropdown-price"" aria-labelledby=""Pris""> 878 <input type=""text"" class=""form-control mb-10 js-auto-thousand js-pricemin-frontpage-input"""); 879 BeginWriteAttribute("placeholder", " placeholder=\'", 31775, "\'", 31851, 1); 880 WriteAttributeValue("", 31789, Translate("Smartpage:Search.Placeholder.MinPris","Min. pris"), 31789, 62, false); 881 EndWriteAttribute(); 882 WriteLiteral(" />\r\n <select class=\"form-control js-pricemin-frontpage-select js-input-min-select mb-10\">\r\n <option selected=\"true\" disabled=\"disabled\">"); 883 Write(Translate("Smartpage:Search.Placeholder.MinPris", "Min. pris")); 884 WriteLiteral("</option>\r\n"); 885 for (var i = 0; i <= 10000000; i += 100000) 886 { 887 if (i == 10000000) 888 { 889 WriteLiteral(" <option"); 890 BeginWriteAttribute("value", " value=\"", 32460, "\"", 32470, 1); 891 WriteAttributeValue("", 32468, i, 32468, 2, false); 892 EndWriteAttribute(); 893 WriteLiteral(" data-value=\'"); 894 Write(Convert.ToInt32(i).ToString("N0")); 895 WriteLiteral("+\'>"); 896 Write(Convert.ToInt32(i).ToString("N0")); 897 WriteLiteral("+</option>\r\n"); 898 } 899 else 900 { 901 WriteLiteral(" <option"); 902 BeginWriteAttribute("value", " value=\"", 32782, "\"", 32792, 1); 903 WriteAttributeValue("", 32790, i, 32790, 2, false); 904 EndWriteAttribute(); 905 WriteLiteral(" data-value=\'"); 906 Write(Convert.ToInt32(i).ToString("N0")); 907 WriteLiteral("\'>"); 908 Write(Convert.ToInt32(i).ToString("N0")); 909 WriteLiteral("</option>\r\n"); 910 } 911 } 912 WriteLiteral(@" </select> 913 <input type=""hidden"" id=""pricemin-frontpage"" name=""pricemin"" /> 914 915 <input type=""text"" class=""form-control js-auto-thousand js-pricemax-frontpage-input"""); 916 BeginWriteAttribute("placeholder", " placeholder=\'", 33267, "\'", 33343, 1); 917 WriteAttributeValue("", 33281, Translate("Smartpage:Search.Placeholder.MaxPris","Max. pris"), 33281, 62, false); 918 EndWriteAttribute(); 919 WriteLiteral(" />\r\n <select class=\"form-control js-pricemax-frontpage-select js-input-max-select\">\r\n <option selected=\"true\" disabled=\"disabled\">"); 920 Write(Translate("Smartpage:Search.Placeholder.MaxPris", "Max. pris")); 921 WriteLiteral("</option>\r\n"); 922 for (var i = 0; i <= 10000000; i += 100000) 923 { 924 if (i == 10000000) 925 { 926 WriteLiteral(" <option"); 927 BeginWriteAttribute("value", " value=\"", 33946, "\"", 33956, 1); 928 WriteAttributeValue("", 33954, i, 33954, 2, false); 929 EndWriteAttribute(); 930 WriteLiteral(" data-value=\'"); 931 Write(Convert.ToInt32(i).ToString("N0")); 932 WriteLiteral("+\'>"); 933 Write(Convert.ToInt32(i).ToString("N0")); 934 WriteLiteral("+</option>\r\n"); 935 } 936 else 937 { 938 WriteLiteral(" <option"); 939 BeginWriteAttribute("value", " value=\"", 34268, "\"", 34278, 1); 940 WriteAttributeValue("", 34276, i, 34276, 2, false); 941 EndWriteAttribute(); 942 WriteLiteral(" data-value=\'"); 943 Write(Convert.ToInt32(i).ToString("N0")); 944 WriteLiteral("\'>"); 945 Write(Convert.ToInt32(i).ToString("N0")); 946 WriteLiteral("</option>\r\n"); 947 } 948 } 949 WriteLiteral(" </select>\r\n <input type=\"hidden\" id=\"pricemax-frontpage\" name=\"pricemax\" />\r\n <button class=\"btn btn-primary js-close-dropdown mt-3\">"); 950 Write(Translate("Smartpage:Search.Anvend", "Anvend")); 951 WriteLiteral(@"</button> 952 </div> 953 </div> 954 </div> 955 </div> 956 </div> 957 <div class=""col-xs-12 col-md-2 d-none d-md-block""> 958 <button type=""submit"" class=""btn btn-block btn-search""><i class=""fa fa-search""></i> "); 959 Write(Translate("Smartpage:Search.Søg", "Søg")); 960 WriteLiteral(@"</button> 961 </div> 962 </div> 963 964 <div class=""row moresearch-btn no-gutters""> 965 <div class=""col-sm-12""> 966 <div class=""row align-items-center no-gutters""> 967 <div class=""col-12 col-md-4""> 968 <button class=""btn-blank js-search-collapse"" type=""button"" data-toggle=""collapse"" data-target=""#moreSearch"" aria-expanded=""false"" aria-controls=""moreSearch""> 969 <span class=""moreSearch-text""><i class=""fas fa-plus open-close""></i> <span class=""not-open"">"); 970 Write(Translate("Smartpage:Search.Flere søgemuligheder", "Flere søgemuligheder")); 971 WriteLiteral("</span> <span class=\"open\"><span class=\"js-filter-count\">0</span> "); 972 Write(Translate("Smartpage:Search.FiltreAnvendt", "filtre anvendt")); 973 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\">"); 974 Write(Translate("Smartpage:Search.NulstilValg", "Nulstil valg")); 975 WriteLiteral("</a>\r\n </div>\r\n </div>\r\n\r\n <div class=\"collapse\" id=\"moreSearch\">\r\n <h4 class=\"mt-20\"><b>"); 976 Write(Translate("Smartpage:Search.Bolig", "Bolig")); 977 WriteLiteral(@"</b></h4> 978 <div class=""row align-items-end mb-30""> 979 <div class=""col-12 col-sm-6 col-lg-3 mb-3 mb-lg-0""> 980 <div class=""filter-container row""> 981 <label class=""d-block col-12"">"); 982 Write(Translate("Smartpage:Search.Boligareal", "Boligareal")); 983 WriteLiteral(@"</label> 984 <div class=""col-6 pr-sm-0 pr-2""> 985 <input type=""text"" name=""boligarealmin"" id=""boligarealmin-frontpage"" class=""form-control js-boligarealmin-frontpage-input js-count"""); 986 BeginWriteAttribute("placeholder", " placeholder=\'", 37144, "\'", 37216, 1); 987 WriteAttributeValue("", 37158, Translate("Smartpage:Search.Placeholder.Minm2","Min. m2"), 37158, 58, false); 988 EndWriteAttribute(); 989 WriteLiteral(" />\r\n <select class=\"form-control js-boligarealmin-frontpage-select js-count\">\r\n <option selected=\"true\" disabled=\"disabled\">"); 990 Write(Translate("Smartpage:Search.Placeholder.Minm2", "Min. m2")); 991 WriteLiteral("</option>\r\n"); 992 for (var i = 0; i <= 300; i += 10) 993 { 994 if (i == 300) 995 { 996 WriteLiteral(" <option"); 997 BeginWriteAttribute("value", " value=\"", 37823, "\"", 37833, 1); 998 WriteAttributeValue("", 37831, i, 37831, 2, false); 999 EndWriteAttribute(); 1000 WriteLiteral(">"); 1001 Write(i); 1002 WriteLiteral("+</option>\r\n"); 1003 } 1004 else 1005 { 1006 WriteLiteral(" <option"); 1007 BeginWriteAttribute("value", " value=\"", 38080, "\"", 38090, 1); 1008 WriteAttributeValue("", 38088, i, 38088, 2, false); 1009 EndWriteAttribute(); 1010 WriteLiteral(">"); 1011 Write(i); 1012 WriteLiteral("</option>\r\n"); 1013 } 1014 } 1015 WriteLiteral(@" </select> 1016 </div> 1017 <div class=""col-6 pl-sm-0 pl-2""> 1018 <input type=""text"" name=""boligarealmax"" id=""boligarealmax-frontpage"" class=""form-control js-boligarealmax-frontpage-input js-count"""); 1019 BeginWriteAttribute("placeholder", " placeholder=\'", 38563, "\'", 38635, 1); 1020 WriteAttributeValue("", 38577, Translate("Smartpage:Search.Placeholder.Maxm2","Max. m2"), 38577, 58, false); 1021 EndWriteAttribute(); 1022 WriteLiteral(" />\r\n <select class=\"form-control js-boligarealmax-frontpage-select js-count\">\r\n <option selected=\"true\" disabled=\"disabled\">"); 1023 Write(Translate("Smartpage:Search.Placeholder.Maxm2", "Max. m2")); 1024 WriteLiteral("</option>\r\n"); 1025 for (var i = 0; i <= 300; i += 10) 1026 { 1027 if (i == 300) 1028 { 1029 WriteLiteral(" <option"); 1030 BeginWriteAttribute("value", " value=\"", 39242, "\"", 39252, 1); 1031 WriteAttributeValue("", 39250, i, 39250, 2, false); 1032 EndWriteAttribute(); 1033 WriteLiteral(">"); 1034 Write(i); 1035 WriteLiteral("+</option>\r\n"); 1036 } 1037 else 1038 { 1039 WriteLiteral(" <option"); 1040 BeginWriteAttribute("value", " value=\"", 39499, "\"", 39509, 1); 1041 WriteAttributeValue("", 39507, i, 39507, 2, false); 1042 EndWriteAttribute(); 1043 WriteLiteral(">"); 1044 Write(i); 1045 WriteLiteral("</option>\r\n"); 1046 } 1047 } 1048 WriteLiteral(@" </select> 1049 </div> 1050 </div> 1051 </div> 1052 <div class=""col-12 col-sm-6 col-lg-3 mb-3 mb-lg-0""> 1053 <div class=""filter-container row""> 1054 <label class=""d-block col-12"">"); 1055 Write(Translate("Smartpage:Search.Grundareal", "Grundareal")); 1056 WriteLiteral(@"</label> 1057 <div class=""col-6 pr-sm-0 pr-2""> 1058 <input type=""text"" name=""grundarealmin"" id=""grundarealmin-frontpage"" class=""form-control js-grundarealmin-frontpage-input js-count"""); 1059 BeginWriteAttribute("placeholder", " placeholder=\'", 40358, "\'", 40430, 1); 1060 WriteAttributeValue("", 40372, Translate("Smartpage:Search.Placeholder.Minm2","Min. m2"), 40372, 58, false); 1061 EndWriteAttribute(); 1062 WriteLiteral(" />\r\n <select class=\"form-control js-grundarealmin-frontpage-select js-count\">\r\n <option selected=\"true\" disabled=\"disabled\">"); 1063 Write(Translate("Smartpage:Search.Placeholder.Minm2", "Min. m2")); 1064 WriteLiteral("</option>\r\n"); 1065 for (var i = 0; i <= 10000; i += 100) 1066 { 1067 if (i == 10000) 1068 { 1069 WriteLiteral(" <option"); 1070 BeginWriteAttribute("value", " value=\"", 41042, "\"", 41052, 1); 1071 WriteAttributeValue("", 41050, i, 41050, 2, false); 1072 EndWriteAttribute(); 1073 WriteLiteral(">"); 1074 Write(i); 1075 WriteLiteral("+</option>\r\n"); 1076 } 1077 else 1078 { 1079 WriteLiteral(" <option"); 1080 BeginWriteAttribute("value", " value=\"", 41299, "\"", 41309, 1); 1081 WriteAttributeValue("", 41307, i, 41307, 2, false); 1082 EndWriteAttribute(); 1083 WriteLiteral(">"); 1084 Write(i); 1085 WriteLiteral("</option>\r\n"); 1086 } 1087 } 1088 WriteLiteral(@" </select> 1089 </div> 1090 <div class=""col-6 pl-sm-0 pl-2""> 1091 <input type=""text"" name=""grundarealmax"" id=""grundarealmax-frontpage"" class=""form-control js-grundarealmax-frontpage-input js-count"""); 1092 BeginWriteAttribute("placeholder", " placeholder=\'", 41782, "\'", 41854, 1); 1093 WriteAttributeValue("", 41796, Translate("Smartpage:Search.Placeholder.Maxm2","Max. m2"), 41796, 58, false); 1094 EndWriteAttribute(); 1095 WriteLiteral(" />\r\n <select class=\"form-control js-grundarealmax-frontpage-select js-count\">\r\n <option selected=\"true\" disabled=\"disabled\">"); 1096 Write(Translate("Smartpage:Search.Placeholder.Maxm2", "Max. m2")); 1097 WriteLiteral("</option>\r\n"); 1098 for (var i = 0; i <= 10000; i += 100) 1099 { 1100 if (i == 10000) 1101 { 1102 WriteLiteral(" <option"); 1103 BeginWriteAttribute("value", " value=\"", 42466, "\"", 42476, 1); 1104 WriteAttributeValue("", 42474, i, 42474, 2, false); 1105 EndWriteAttribute(); 1106 WriteLiteral(">"); 1107 Write(i); 1108 WriteLiteral("+</option>\r\n"); 1109 } 1110 else 1111 { 1112 WriteLiteral(" <option"); 1113 BeginWriteAttribute("value", " value=\"", 42723, "\"", 42733, 1); 1114 WriteAttributeValue("", 42731, i, 42731, 2, false); 1115 EndWriteAttribute(); 1116 WriteLiteral(">"); 1117 Write(i); 1118 WriteLiteral("</option>\r\n"); 1119 } 1120 } 1121 WriteLiteral(@" </select> 1122 </div> 1123 </div> 1124 </div> 1125 <div class=""col-12 col-sm-6 col-lg-3 mb-3 mb-lg-0""> 1126 <div class=""filter-container row""> 1127 <label class=""d-block col-12"">Antal rum</label> 1128 1129 <div class=""col-6 pr-sm-0 pr-2""> 1130 <select name=""roomsmin"" id=""roomsmin-frontpage"" class=""form-control reverse js-count""> 1131 <option selected=""true"" disabled=""disabled"">"); 1132 Write(Translate("Smartpage:Search.Placeholder.Min", "Min")); 1133 WriteLiteral(@"</option> 1134 <option value=""1"">1</option> 1135 <option value=""2"">2</option> 1136 <option value=""3"">3</option> 1137 <option value=""4"">4</option> 1138 <option value=""5+"">5+</option> 1139 </select> 1140 </div> 1141 <div class=""col-6 pl-sm-0 pl-2""> 1142 <select name=""roomsmax"" id=""roomsmax-frontpage"" class=""form-control reverse js-count""> 1143 <option selected=""true"" disabled=""disabled"">"); 1144 Write(Translate("Smartpage:Search.Placeholder.Max", "Max")); 1145 WriteLiteral(@"</option> 1146 <option value=""1"">1</option> 1147 <option value=""2"">2</option> 1148 <option value=""3"">3</option> 1149 <option value=""4"">4</option> 1150 <option value=""5+"">"); 1151 Write(Translate("Smartpage:Rooms.5", "5")); 1152 WriteLiteral(@"</option> 1153 </select> 1154 </div> 1155 </div> 1156 </div> 1157 <div class=""col-12 col-sm-6 col-lg-3 mb-3 mb-lg-0""> 1158 <div class=""row""> 1159 <div class=""col-12""> 1160 <div class=""filter-container""> 1161 <label class=""d-block"">Energimærke</label> 1162 <select name=""energylabel"" id=""energylabel-frontpage"" class=""form-control reverse js-count""> 1163 <option disabled selected=""selected"">"); 1164 Write(Translate("Smartpage:Search.Vælg", "Vælg")); 1165 WriteLiteral(@"</option> 1166 <option value=""01"">G</option> 1167 <option value=""02"">F</option> 1168 <option value=""03"">E</option> 1169 <option value=""04"">D</option> 1170 <option value=""05"">C</option> 1171 <option value=""06"">B</option> 1172 <option value=""07"">A</option> 1173 <option value=""08"">A2010</option> 1174 <option value=""09"">A2015</option> 1175 <option value=""10"">A2020+</option> 1176 </select> 1177 </div> 1178 </div> 1179 "); 1180 WriteLiteral(" </div>\r\n </div>\r\n <div class=\"col-12 col-sm-6 col-lg-3 mt-3\">\r\n <h4"); 1181 BeginWriteAttribute("class", " class=\"", 46978, "\"", 46986, 0); 1182 EndWriteAttribute(); 1183 WriteLiteral("><b>"); 1184 Write(Translate("Smartpage:Search.Økonomi", "Økonomi")); 1185 WriteLiteral("</b></h4>\r\n <div class=\"filter-container row\">\r\n <label class=\"d-block col-12\">"); 1186 Write(Translate("Smartpage:Search.Ejerudgift/boligydelse pr. måned", "Ejerudgift/boligydelse pr. måned")); 1187 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\""); 1188 BeginWriteAttribute("placeholder", " placeholder=\'", 47542, "\'", 47616, 1); 1189 WriteAttributeValue("", 47556, Translate("Smartpage:Search.Placeholder.MinDKK","Min. DKK"), 47556, 60, false); 1190 EndWriteAttribute(); 1191 WriteLiteral(" />\r\n <select class=\"form-control js-subsidymin-frontpage-select js-count\">\r\n <option selected=\"true\" disabled=\"disabled\">"); 1192 Write(Translate("Smartpage:Search.Placeholder.MinDKK", "Min. DKK")); 1193 WriteLiteral("</option>\r\n"); 1194 for (var i = 0; i <= 25000; i += 1250) 1195 { 1196 if (i == 25000) 1197 { 1198 WriteLiteral(" <option>"); 1199 Write(Convert.ToInt32(i).ToString("N0")); 1200 WriteLiteral("+</option>\r\n"); 1201 } 1202 else 1203 { 1204 WriteLiteral(" <option>"); 1205 Write(Convert.ToInt32(i).ToString("N0")); 1206 WriteLiteral("</option>\r\n"); 1207 } 1208 } 1209 WriteLiteral(@" </select> 1210 </div> 1211 <div class=""col-6 pl-sm-0 pl-2""> 1212 <input type=""text"" name=""subsidymax"" id=""subsidymax-frontpage"" class=""form-control js-subsidymax-frontpage-input js-count"""); 1213 BeginWriteAttribute("placeholder", " placeholder=\'", 49001, "\'", 49075, 1); 1214 WriteAttributeValue("", 49015, Translate("Smartpage:Search.Placeholder.MaxDKK","Max. DKK"), 49015, 60, false); 1215 EndWriteAttribute(); 1216 WriteLiteral(" />\r\n <select class=\"form-control js-subsidymax-frontpage-select js-count\">\r\n <option selected=\"true\" disabled=\"disabled\">"); 1217 Write(Translate("Smartpage:Search.Placeholder.MaxDKK", "Max. DKK")); 1218 WriteLiteral("</option>\r\n"); 1219 for (var i = 0; i <= 25000; i += 1250) 1220 { 1221 if (i == 25000) 1222 { 1223 WriteLiteral(" <option"); 1224 BeginWriteAttribute("value", " value=\"", 49687, "\"", 49714, 1); 1225 WriteAttributeValue("", 49695, Convert.ToInt32(i), 49695, 19, false); 1226 EndWriteAttribute(); 1227 WriteLiteral(">"); 1228 Write(Convert.ToInt32(i).ToString("N0")); 1229 WriteLiteral("+</option>\r\n"); 1230 } 1231 else 1232 { 1233 WriteLiteral(" <option"); 1234 BeginWriteAttribute("value", " value=\"", 49993, "\"", 50020, 1); 1235 WriteAttributeValue("", 50001, Convert.ToInt32(i), 50001, 19, false); 1236 EndWriteAttribute(); 1237 WriteLiteral(">"); 1238 Write(Convert.ToInt32(i).ToString("N0")); 1239 WriteLiteral("</option>\r\n"); 1240 } 1241 } 1242 WriteLiteral(@" </select> 1243 </div> 1244 </div> 1245 </div> 1246 <div class=""col-12 col-sm-6 col-lg-4 offset-lg-5 mt-3 mt-sm-0""> 1247 <button type=""submit"" class=""btn btn-block btn-search""><i class=""fa fa-search""></i> "); 1248 Write(Translate("Smartpage:Search.AnvendFiltre", "Anvend filtre")); 1249 WriteLiteral(@"</button> 1250 </div> 1251 </div> 1252 </div> 1253 </div> 1254 </div> 1255 1256 <div class=""row d-block d-md-none form-wrapper no-gutters""> 1257 <div class=""col-xs-12 col-md-2""> 1258 <button type=""submit"" class=""btn btn-block btn-search btn-mobile-search"">"); 1259 Write(Translate("Smartpage:Search.SøgBolig", "Søg Bolig")); 1260 WriteLiteral(@"<i class=""fa fa-search cta-icon""></i></button> 1261 </div> 1262 </div> 1263 </form> 1264 <div class=""front-page-actions d-md-none""> 1265 <div> 1266 <button class=""btn btn-block btn-search btn-mobile-search js-search-mobile"">"); 1267 Write(Translate("Smartpage:Search.SøgBolig", "Søg Bolig")); 1268 WriteLiteral("<i class=\"fa fa-search cta-icon\"></i></button>\r\n </div>\r\n <div>\r\n"); 1269 1270 string brokerSearchId = SettingsItem != null ? Dynamicweb.Core.Converter.ToString(SettingsItem["Maeglersogning"]).Replace("Default.aspx?Id=", "") : ""; 1271 string ctaText = Translate("Smartpage.Frontpage.Mobile.FindBroker", "FIND EJENDOMSMÆGLER"); 1272 WriteLiteral(" <form method=\"GET\" action=\"/Default.aspx\">\r\n <input name=\"id\""); 1273 BeginWriteAttribute("value", " value=\"", 51963, "\"", 51986, 1); 1274 WriteAttributeValue("", 51971, brokerSearchId, 51971, 15, false); 1275 EndWriteAttribute(); 1276 WriteLiteral(@" type=""hidden"" /> 1277 <div class=""icon-wrapper-wclick""> 1278 <i class=""fas fa-search ta-submit-on-icon-click""></i> 1279 <input class=""box-cta-input ta-postnummer ta-submit-on-select ta-submit-on-enter"" name=""q"" type=""text"""); 1280 BeginWriteAttribute("placeholder", " placeholder=\"", 52290, "\"", 52312, 1); 1281 WriteAttributeValue("", 52304, ctaText, 52304, 8, false); 1282 EndWriteAttribute(); 1283 WriteLiteral(" onfocus=\"this.placeholder = \'\'\""); 1284 BeginWriteAttribute("onblur", " onblur=\"", 52345, "\"", 52381, 3); 1285 WriteAttributeValue("", 52354, "this.placeholder=\'", 52354, 18, true); 1286 WriteAttributeValue("", 52372, ctaText, 52372, 8, false); 1287 WriteAttributeValue("", 52380, "\'", 52380, 1, true); 1288 EndWriteAttribute(); 1289 WriteLiteral(" />\r\n </div>\r\n </form>\r\n"); 1290 WriteLiteral(" </div>\r\n <div>\r\n <a href=\"javascript:panelSalgsvurdering(\'Hovedmenu\')\" class=\"btn btn-orange btn-block\">"); 1291 Write(Translate("Smartpage:Frontpage.Mobile.GetFreeAppraisal", "BESTIL GRATIS VURDERING")); 1292 WriteLiteral("<i class=\"cta-icon fa fa-angle-right\"></i></a>\r\n </div>\r\n </div>\r\n </div>\r\n"); 1293 1294 } 1295 Custom.Integration.Brokers.Models.BrokerEmployee GetBrokerFromCurrentProduct() 1296 { 1297 string productId = Dynamicweb.Context.Current.Request["ProductId"]; 1298 1299 if (string.IsNullOrWhiteSpace(productId)) 1300 { 1301 return null; 1302 } 1303 1304 var propertyProduct = Dynamicweb.Ecommerce.Services.Products.GetProductById(productId, string.Empty, true); 1305 if (propertyProduct == null) 1306 { 1307 return null; 1308 } 1309 1310 string employee = Dynamicweb.Core.Converter.ToString( 1311 Dynamicweb.Ecommerce.Services.Products.GetProductFieldValue(propertyProduct, "xAktoererMaeglerKontaktEmail") 1312 ); 1313 string storeId = Dynamicweb.Core.Converter.ToString( 1314 Dynamicweb.Ecommerce.Services.Products.GetProductFieldValue(propertyProduct, "xButikID") 1315 ); 1316 1317 if (string.IsNullOrWhiteSpace(employee) || string.IsNullOrWhiteSpace(storeId)) 1318 { 1319 return null; 1320 } 1321 1322 return Custom.Integration.Brokers.Search.GetEmployee(storeId, employee); 1323 } 1324 1325 string GetAgentTitleFromCurrentProduct() 1326 { 1327 var propBroker = GetBrokerFromCurrentProduct(); 1328 1329 if (propBroker?.Broker == null) 1330 { 1331 return string.Empty; 1332 } 1333 1334 if (!string.IsNullOrEmpty(propBroker.Broker.CompanyName)) 1335 { 1336 return propBroker.Broker.CompanyName; 1337 } 1338 1339 return propBroker.Broker.Name ?? string.Empty; 1340 } 1341 1342 string GetMasterBrokerUrlFromCurrentProduct() 1343 { 1344 var propBroker = GetBrokerFromCurrentProduct(); 1345 1346 var itemId = propBroker?.Broker?.ItemId; 1347 var itemType = propBroker?.Broker?.ItemType; 1348 1349 if (string.IsNullOrWhiteSpace(itemId) || string.IsNullOrWhiteSpace(itemType)) 1350 { 1351 return string.Empty; 1352 } 1353 var brokerItem = Dynamicweb.Content.Items.ItemManager.Storage.GetById(itemType, itemId); 1354 1355 if (brokerItem == null) 1356 { 1357 return string.Empty; 1358 } 1359 1360 var websiteId = Dynamicweb.Core.Converter.ToInt32(brokerItem["WebsiteId"]); 1361 var page = Dynamicweb.Content.Services.Pages.GetFirstPageForArea(websiteId); 1362 return Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("Default.aspx?Id=" + page?.ID); 1363 } 1364 1365 public class WrapMethods 1366 { 1367 //Gets the contrasting color 1368 public static string getContrastYIQ(string hexcolor) 1369 { 1370 if (hexcolor != "") 1371 { 1372 hexcolor = Regex.Replace(hexcolor, "[^0-9a-zA-Z]+", ""); 1373 1374 int r = Convert.ToByte(hexcolor.Substring(0, 2), 16); 1375 int g = Convert.ToByte(hexcolor.Substring(2, 2), 16); 1376 int b = Convert.ToByte(hexcolor.Substring(4, 2), 16); 1377 int yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000; 1378 1379 if (yiq >= 128) 1380 { 1381 return "black"; 1382 } 1383 else 1384 { 1385 return "white"; 1386 } 1387 } 1388 else 1389 { 1390 return "black"; 1391 } 1392 } 1393 1394 1395 //Truncate text 1396 public static string Truncate (string value, int count, bool strip=true) 1397 { 1398 if (strip == true){ 1399 value = StripHtmlTagByCharArray(value); 1400 } 1401 1402 if (value.Length > count) 1403 { 1404 value = value.Substring(0, count - 1) + "..."; 1405 } 1406 1407 return value; 1408 } 1409 1410 //Truncate Reverse 1411 public static string TruncateReverse (string value, int count) 1412 { 1413 if (value.Length > count) 1414 { 1415 value = value.Substring(count, value.Length); 1416 } 1417 return value; 1418 } 1419 1420 1421 //Strip text from HTML 1422 public static string StripHtmlTagByCharArray(string htmlString) 1423 { 1424 char[] array = new char[htmlString.Length]; 1425 int arrayIndex = 0; 1426 bool inside = false; 1427 1428 for (int i = 0; i < htmlString.Length; i++) 1429 { 1430 char let = htmlString[i]; 1431 if (let == '<') 1432 { 1433 inside = true; 1434 continue; 1435 } 1436 if (let == '>') 1437 { 1438 inside = false; 1439 continue; 1440 } 1441 if (!inside) 1442 { 1443 array[arrayIndex] = let; 1444 arrayIndex++; 1445 } 1446 } 1447 return new string(array, 0, arrayIndex); 1448 } 1449 1450 //Make the correct count of columns 1451 public static string ColumnMaker(int Col, string ScreenSize) 1452 { 1453 string Columns = ""; 1454 1455 switch (Col) 1456 { 1457 case 1: 1458 Columns = "col-"+ScreenSize+"-12"; 1459 break; 1460 1461 case 2: 1462 Columns = "col-"+ScreenSize+"-6"; 1463 break; 1464 1465 case 3: 1466 Columns = "col-"+ScreenSize+"-4"; 1467 break; 1468 1469 case 4: 1470 Columns = "col-"+ScreenSize+"-3"; 1471 break; 1472 1473 default: 1474 Columns = "col-"+ScreenSize+"-3"; 1475 break; 1476 } 1477 1478 return Columns; 1479 } 1480 1481 1482 private string Custom(string firstoption, string secondoption) 1483 { 1484 if (firstoption == "custom") 1485 { 1486 return secondoption; 1487 } 1488 else 1489 { 1490 return firstoption; 1491 } 1492 } 1493 } 1494 1495 void RenderBoligList(List<LoopItem> boliglist) 1496 { 1497 int propertyIndex = GetInteger("Ecom:ProductList.CurrentPage") > 0 ? (GetInteger("Ecom:ProductList.CurrentPage") - 1) * GetInteger("Ecom:ProductList.PageSize") : 0; 1498 foreach (LoopItem bolig in boliglist) 1499 { 1500 RenderPropertyCard(bolig, propertyIndex); 1501 propertyIndex++; 1502 } 1503 } 1504 1505 void RenderPropertyCard(LoopItem property, int propertyIndex, int? itemsPerPage = null) 1506 { 1507 int? pageNum = itemsPerPage != null ? (propertyIndex / itemsPerPage) + 1 : null; 1508 string fallbackImage = "/Files/Templates/Designs/rm/assets/images/na-real.png"; 1509 string iconPath = "/Files/Templates/Designs/rm/assets/images/svg/"; 1510 var boligManager = new RealMaeglerne.Library.BoligManager(Pageview); 1511 RealMaeglerne.Library.Models.Bolig bolig = boligManager.CreateBolig(property, true); 1512 1513 string propCategory = bolig.Ejendomskategori; 1514 bool isRental = bolig.UdbudsForm.Equals("Leje", StringComparison.InvariantCultureIgnoreCase); 1515 1516 List<RealMaeglerne.Library.Models.Bolig.CaseAsset> allImages = bolig.ImagesOfProperty.Take(3).ToList(); 1517 1518 if (bolig.AndenMaegler) 1519 { 1520 var image = bolig.ImageUrl; 1521 1522 if (!string.IsNullOrEmpty(image)) 1523 { 1524 allImages.Add(new Bolig.CaseAsset() { ImageXs = image, ImageSm = image, ImageMd = image, ImageLg = image, ImageXl = image }); 1525 } 1526 else 1527 { 1528 allImages.Add(new Bolig.CaseAsset() { ImageXs = fallbackImage, ImageSm = fallbackImage, ImageMd = fallbackImage, ImageLg = fallbackImage, ImageXl = fallbackImage }); 1529 } 1530 } 1531 else 1532 { 1533 while (allImages.Count < 3) 1534 { 1535 allImages.Add(new Bolig.CaseAsset() { ImageXs = fallbackImage, ImageSm = fallbackImage, ImageMd = fallbackImage, ImageLg = fallbackImage, ImageXl = fallbackImage }); 1536 } 1537 } 1538 1539 int totalImageCount = allImages.Count; 1540 WriteLiteral(" <div property-card class=\"property-card\" data-is-rental=\""); 1541 Write(isRental ? "true" : "false"); 1542 WriteLiteral("\" "); 1543 Write(pageNum != null ? $"data-page=\"{pageNum}\"" : ""); 1544 WriteLiteral(">\r\n <!-- Hidden radio buttons for image navigation -->\r\n"); 1545 for (int imgIndex = 1; imgIndex <= totalImageCount; imgIndex++) 1546 { 1547 WriteLiteral(" <input type=\"radio\""); 1548 BeginWriteAttribute("name", "\r\n name=\"", 61530, "\"", 61587, 3); 1549 WriteAttributeValue("", 61561, "card-", 61561, 5, true); 1550 WriteAttributeValue("", 61566, propertyIndex, 61566, 14, false); 1551 WriteAttributeValue("", 61580, "-images", 61580, 7, true); 1552 EndWriteAttribute(); 1553 BeginWriteAttribute("id", "\r\n id=\"", 61588, "\"", 61650, 4); 1554 WriteAttributeValue("", 61617, "card-", 61617, 5, true); 1555 WriteAttributeValue("", 61622, propertyIndex, 61622, 14, false); 1556 WriteAttributeValue("", 61636, "-img-", 61636, 5, true); 1557 WriteAttributeValue("", 61641, imgIndex, 61641, 9, false); 1558 EndWriteAttribute(); 1559 WriteLiteral("\r\n class=\"image-radio d-none\"\r\n "); 1560 Write(imgIndex == 1 ? "checked" : ""); 1561 WriteLiteral(">\r\n"); 1562 } 1563 WriteLiteral("\r\n <div class=\"property-card-images-wrapper\">\r\n"); 1564 1565 int currentImageIndex = 1; 1566 foreach (var image in allImages) 1567 { 1568 WriteLiteral(" <a"); 1569 BeginWriteAttribute("href", " href=\"", 62015, "\"", 62072, 2); 1570 WriteAttributeValue("", 62022, bolig.LinkUrl, 62022, 14, false); 1571 WriteAttributeValue("", 62036, isRental ? "?Udlejning=true" : "", 62036, 36, false); 1572 EndWriteAttribute(); 1573 WriteLiteral(" target=\"_blank\" class=\"property-image\" data-image=\""); 1574 Write(currentImageIndex); 1575 WriteLiteral("\">\r\n <img"); 1576 BeginWriteAttribute("src", " src=\"", 62175, "\"", 62195, 1); 1577 WriteAttributeValue("", 62181, image.ImageMd, 62181, 14, false); 1578 EndWriteAttribute(); 1579 BeginWriteAttribute("alt", " alt=\"", 62196, "\"", 62216, 1); 1580 WriteAttributeValue("", 62202, bolig.Adresse, 62202, 14, false); 1581 EndWriteAttribute(); 1582 WriteLiteral(" />\r\n\r\n"); 1583 if (totalImageCount > 1) 1584 { 1585 WriteLiteral(" <div class=\"property-card-images-indicators\">\r\n <label"); 1586 BeginWriteAttribute("for", " for=\"", 62415, "\"", 62446, 3); 1587 WriteAttributeValue("", 62421, "card-", 62421, 5, true); 1588 WriteAttributeValue("", 62426, propertyIndex, 62426, 14, false); 1589 WriteAttributeValue("", 62440, "-img-1", 62440, 6, true); 1590 EndWriteAttribute(); 1591 WriteLiteral("\r\n class=\"property-card-images-indicator\""); 1592 BeginWriteAttribute("aria-label", "\r\n aria-label=\"", 62526, "\"", 62649, 1); 1593 WriteAttributeValue("", 62579, Translate("Custom.Propertypage.FirstIndicatorLabel","Første billede"), 62579, 70, false); 1594 EndWriteAttribute(); 1595 WriteLiteral(">\r\n </label>\r\n <label"); 1596 BeginWriteAttribute("for", " for=\"", 62733, "\"", 62764, 3); 1597 WriteAttributeValue("", 62739, "card-", 62739, 5, true); 1598 WriteAttributeValue("", 62744, propertyIndex, 62744, 14, false); 1599 WriteAttributeValue("", 62758, "-img-2", 62758, 6, true); 1600 EndWriteAttribute(); 1601 WriteLiteral("\r\n class=\"property-card-images-indicator\""); 1602 BeginWriteAttribute("aria-label", "\r\n aria-label=\"", 62844, "\"", 62967, 1); 1603 WriteAttributeValue("", 62897, Translate("Custom.Propertypage.SecondIndicatorLabel","Andet billede"), 62897, 70, false); 1604 EndWriteAttribute(); 1605 WriteLiteral(">\r\n </label>\r\n <label"); 1606 BeginWriteAttribute("for", " for=\"", 63051, "\"", 63082, 3); 1607 WriteAttributeValue("", 63057, "card-", 63057, 5, true); 1608 WriteAttributeValue("", 63062, propertyIndex, 63062, 14, false); 1609 WriteAttributeValue("", 63076, "-img-3", 63076, 6, true); 1610 EndWriteAttribute(); 1611 WriteLiteral("\r\n class=\"property-card-images-indicator\""); 1612 BeginWriteAttribute("aria-label", "\r\n aria-label=\"", 63162, "\"", 63285, 1); 1613 WriteAttributeValue("", 63215, Translate("Custom.Propertypage.ThirdIndicatorLabel","Tredie billede"), 63215, 70, false); 1614 EndWriteAttribute(); 1615 WriteLiteral(">\r\n </label>\r\n </div>\r\n"); 1616 } 1617 WriteLiteral(" </a>\r\n"); 1618 currentImageIndex++; 1619 } 1620 if (bolig.AabentHus) 1621 { 1622 var upcomingOpenHouses = boligManager.KommendeAabnehuse(bolig); 1623 1624 if (upcomingOpenHouses != null) 1625 { 1626 bool hasSignUp = upcomingOpenHouses.Any(oh => oh.Tilmelding); 1627 var primaryOpenHouse = upcomingOpenHouses.FirstOrDefault(); 1628 1629 if (primaryOpenHouse != null) 1630 { 1631 WriteLiteral(" <div class=\"open-house position-absolute d-flex\" role=\"region\""); 1632 BeginWriteAttribute("aria-label", " aria-label=\"", 64048, "\"", 64192, 1); 1633 WriteAttributeValue("", 64061, Dynamicweb.Core.Encoders.HtmlEncoder.HtmlAttributeEncode(Translate("Custom:Accessibility.OpenHouseInfo", "Åbent hus information")), 64061, 131, false); 1634 EndWriteAttribute(); 1635 WriteLiteral(@"> 1636 <div class=""open-house-dates d-flex align-items-center""> 1637 <div class=""d-flex flex-column align-items-end""> 1638 <div class=""section-header mb-0""> 1639 "); 1640 Write(Translate("Custom.PropertyList.OpenHouseSection.Header", "Åbent hus")); 1641 WriteLiteral("\r\n"); 1642 if (hasSignUp) 1643 { 1644 WriteLiteral(" <span class=\"signup\">"); 1645 Write(Translate("Custom.PropertyList.OpenHouseSection.Header.Singup.PostFix", " med tilmelding")); 1646 WriteLiteral("</span>\r\n"); 1647 } 1648 WriteLiteral(" </div>\r\n <div class=\"open-house-text\">\r\n <span"); 1649 BeginWriteAttribute("class", " class=\"", 65055, "\"", 65063, 0); 1650 EndWriteAttribute(); 1651 WriteLiteral(">"); 1652 Write(primaryOpenHouse.Dato.ToString("d. MMM", Pageview.Area.CultureInfo)); 1653 WriteLiteral("</span>\r\n\r\n"); 1654 if (!string.IsNullOrEmpty(primaryOpenHouse.TidspunktFormateret)) 1655 { 1656 WriteLiteral(" <div class=\"d-inline-block\">\r\n "); 1657 Write(Translate("Custom.Propertypage.OpenHouseSection.Kl", "kl.")); 1658 WriteLiteral(" "); 1659 Write(FormatTime(primaryOpenHouse.FraKlokken)); 1660 WriteLiteral(" - "); 1661 Write(FormatTime(primaryOpenHouse.TilKlokken)); 1662 WriteLiteral("\r\n </div>\r\n"); 1663 } 1664 WriteLiteral(" </div>\r\n\r\n </div>\r\n\r\n"); 1665 if (hasSignUp) 1666 { 1667 WriteLiteral(" <div class=\"property-card-button\">\r\n <a class=\"btn btn-primary\""); 1668 BeginWriteAttribute("href", " href=\"", 66015, "\"", 66036, 1); 1669 WriteAttributeValue("", 66022, bolig.LinkUrl, 66022, 14, false); 1670 EndWriteAttribute(); 1671 WriteLiteral(" target=\"_blank\">\r\n "); 1672 Write(Translate("Custom.Propertypage.OpenHouseSection.SignupButton.Label", "Tilmeld")); 1673 WriteLiteral("\r\n </a>\r\n </div>\r\n"); 1674 } 1675 WriteLiteral(" </div>\r\n </div>\r\n"); 1676 } 1677 } 1678 } 1679 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"); 1680 BeginWriteAttribute("href", " href=\"", 66651, "\"", 66708, 2); 1681 WriteAttributeValue("", 66658, bolig.LinkUrl, 66658, 14, false); 1682 WriteAttributeValue("", 66672, isRental ? "?Udlejning=true" : "", 66672, 36, false); 1683 EndWriteAttribute(); 1684 WriteLiteral(" target=\"_blank\" class=\"property-card-address d-flex flex-column\">\r\n <div>"); 1685 Write(bolig.Adresse); 1686 WriteLiteral("</div>\r\n <div>"); 1687 Write(bolig.PostAdresse); 1688 WriteLiteral("</div>\r\n </a>\r\n"); 1689 1690 var labels = new (bool Condition, string Color, string Stroke, string Key, string Default)[] 1691 { 1692 (bolig.Solgt && isRental, "#C50000", "#FFB3B3", "Custom.PropertyList.Label.Leased", "Udlejet"), 1693 (bolig.Solgt, "#C50000", "#FFB3B3", "Custom.PropertyList.Label.Sold", "Solgt"), 1694 (bolig.PurchaseAgreementSigned, "#003761", "#5A6B77", "Custom.PropertyList.Label.PurchaseAgreementSigned", "Købsaftale <br/> underskrevet"), 1695 (bolig.Nyhed, "#DE8344", "#F9CBAB", "Custom.PropertyList.Label.New", "Ny"), 1696 (bolig.NyPris, "#DE8344", "#F9CBAB", "Custom.PropertyList.Label.NewPrice", "Ny pris") 1697 }; 1698 1699 var match = labels.FirstOrDefault(l => l.Condition); 1700 1701 WriteLiteral("\r\n"); 1702 if (match.Condition) 1703 { 1704 WriteLiteral(" <div"); 1705 BeginWriteAttribute("class", " class=\"", 67931, "\"", 68032, 4); 1706 WriteAttributeValue("", 67939, "property-card-label", 67939, 19, true); 1707 WriteAttributeValue(" ", 67958, bolig.PurchaseAgreementSigned ? "small" : "", 67959, 47, false); 1708 WriteAttributeValue(" ", 68006, "d-flex", 68007, 7, true); 1709 WriteAttributeValue(" ", 68013, "align-items-center", 68014, 19, true); 1710 EndWriteAttribute(); 1711 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\""); 1712 BeginWriteAttribute("fill", " fill=\"", 68229, "\"", 68248, 1); 1713 WriteAttributeValue("", 68236, match.Color, 68236, 12, false); 1714 EndWriteAttribute(); 1715 BeginWriteAttribute("stroke", " stroke=\"", 68249, "\"", 68271, 1); 1716 WriteAttributeValue("", 68258, match.Stroke, 68258, 13, false); 1717 EndWriteAttribute(); 1718 WriteLiteral(" stroke-width=\"4\" />\r\n </svg>\r\n "); 1719 Write(Translate(match.Key, match.Default)); 1720 WriteLiteral("\r\n </div>\r\n"); 1721 } 1722 WriteLiteral(" </div>\r\n <div class=\"property-card-info d-flex\">\r\n <span>"); 1723 Write(propCategory); 1724 WriteLiteral("</span>\r\n <div class=\"detail-separator\"></div>\r\n <span>"); 1725 Write(bolig.Areal); 1726 WriteLiteral(" "); 1727 Write(Translate("Custom.Propertypage.Units.SquareMeters", "m²")); 1728 WriteLiteral("</span>\r\n <div class=\"detail-separator\"></div>\r\n"); 1729 if (!bolig.Solgt && !bolig.PurchaseAgreementSigned) 1730 { 1731 WriteLiteral(" <span>kr. "); 1732 Write(bolig.Pris.ToString("#,##0")); 1733 WriteLiteral("</span>\r\n <div class=\"detail-separator\"></div>\r\n"); 1734 } 1735 1736 var scenarioNumber = property.GetString("Ecom:Product:Field.EnergyLabelScenarioNumber"); 1737 var savings = property.GetInteger("Ecom:Product:Field.EnergyLabelSavings"); 1738 var energyLink = property.GetString("Ecom:Product:Field.EnergyLabelLink"); 1739 WriteLiteral("\r\n <div"); 1740 BeginWriteAttribute("class", " class=\"", 69449, "\"", 69516, 2); 1741 WriteAttributeValue("", 69457, "energylabel", 69457, 11, true); 1742 WriteAttributeValue(" ", 69468, scenarioNumber == "2" ? "energy__hover" : "", 69469, 47, false); 1743 EndWriteAttribute(); 1744 WriteLiteral("\r\n data-energylabel=\""); 1745 Write(Dynamicweb.Core.Encoders.HtmlEncoder.HtmlAttributeEncode(bolig.EnergyLabel)); 1746 WriteLiteral("\">\r\n"); 1747 if (scenarioNumber == "2") 1748 { 1749 WriteLiteral(" <span id=\"energi-testgruppe-information\" class=\"tooltiptext\">\r\n"); 1750 if (savings > 0) 1751 { 1752 Write(string.Format(Translate("Smartpage:Boligvisning.Energimærketekst1-1", "OBS: du kan spare {0} årligt ved at renovere denne bolig - {1}"), savings.ToString("#,##0"), "")); 1753 WriteLiteral(" <a target=\"_blank\""); 1754 BeginWriteAttribute("href", " href=\"", 70159, "\"", 70253, 2); 1755 WriteAttributeValue("", 70166, energyLink, 70166, 13, false); 1756 WriteAttributeValue("", 70179, "&utm_source=realmaeglerne&utm_medium=energimaerke&utm_campaign=testgruppe1", 70179, 74, true); 1757 EndWriteAttribute(); 1758 WriteLiteral(">"); 1759 Write(Translate("Custom.Propertypage.EnergyLabel.Tooltip.Linktext", "klik her")); 1760 WriteLiteral("</a>\r\n"); 1761 } 1762 else 1763 { 1764 Write(string.Format(Translate("Smartpage:Boligvisning.Energimærketekst1-2", "OBS: du kan energi renovere denne bolig {0}"), "")); 1765 WriteLiteral(" <a target=\"_blank\""); 1766 BeginWriteAttribute("href", " href=\"", 70657, "\"", 70751, 2); 1767 WriteAttributeValue("", 70664, energyLink, 70664, 13, false); 1768 WriteAttributeValue("", 70677, "&utm_source=realmaeglerne&utm_medium=energimaerke&utm_campaign=testgruppe1", 70677, 74, true); 1769 EndWriteAttribute(); 1770 WriteLiteral(">"); 1771 Write(Translate("Custom.Propertypage.EnergyLabel.Tooltip.Linktext", "klik her")); 1772 WriteLiteral("</a>\r\n"); 1773 } 1774 WriteLiteral(" </span>\r\n"); 1775 } 1776 WriteLiteral(" </div>\r\n </div>\r\n <div class=\"property-card-button\">\r\n <a"); 1777 BeginWriteAttribute("href", " href=\"", 71058, "\"", 71115, 2); 1778 WriteAttributeValue("", 71065, bolig.LinkUrl, 71065, 14, false); 1779 WriteAttributeValue("", 71079, isRental ? "?Udlejning=true" : "", 71079, 36, false); 1780 EndWriteAttribute(); 1781 BeginWriteAttribute("class", " class=\"", 71116, "\"", 71176, 3); 1782 WriteAttributeValue("", 71124, "btn", 71124, 3, true); 1783 WriteAttributeValue(" ", 71127, "btn-primary", 71128, 12, true); 1784 WriteAttributeValue(" ", 71139, bolig.AndenMaegler ? "grey" : "", 71141, 35, false); 1785 EndWriteAttribute(); 1786 WriteLiteral(" target=\"_blank\">\r\n"); 1787 if (bolig.AndenMaegler) 1788 { 1789 Write(Translate("Custom.PropertyList.ViewPropertyButton.External", "Anden mægler")); 1790 1791 } 1792 else 1793 { 1794 Write(Translate("Custom.PropertyList.ViewPropertyButton", "Se bolig")); 1795 1796 } 1797 WriteLiteral(" <img height=\"20px\" width=\"20px\""); 1798 BeginWriteAttribute("src", " src=\"", 71640, "\"", 71682, 1); 1799 WriteAttributeValue("", 71646, iconPath + "icon-arrow-right.svg", 71646, 36, false); 1800 EndWriteAttribute(); 1801 WriteLiteral(" />\r\n </a>\r\n </div>\r\n </div>\r\n </div>\r\n"); 1802 } 1803 1804 string FormatTime(string time) => time?.Length >= 5 ? time.Substring(0, 5) : (time ?? string.Empty); 1805 1806 } 1807 } 1808 #pragma warning restore 1591 1809
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 <li> 184 <label class="checkbox-container d-flex"> 185 @Translate("Smartpage:Search.DropDown.Blandet Bolig/Erhverv", "Blandet Bolig/Erhverv") 186 @{ 187 bool blboligcheck = false; 188 } 189 @if (Dynamicweb.Context.Current.Request.QueryString["propertycategory"] == "Blandet Bolig/Erhverv") 190 { 191 blboligcheck = true; 192 } 193 <input type="checkbox" name="propertycategory" value="Blandet Bolig/Erhverv" class="specialOption js-input-check js-datavalue js-count" data-disable-checkbox="true" data-disable-slider="#roomsslider" data-disable-slider-ranges="#roomsmin" checked="@blboligcheck" /> 194 <span class="checkmark grey"></span> 195 </label> 196 </li> 197 198 Dictionary<string, string> propertyTypes2 = new Dictionary<string, string>(){ 199 { "Fritidsbolig", "fritidshus, fritidsbolig" }, { "Ejerlejlighed", "ejerlejlighed" }, { "Helårsgrund", "helårsgrund" }, 200 { "Fritidsgrund", "fritidsgrund" }, { "Landejendom", "landejendom, lystejendom" } 201 }; 202 foreach (KeyValuePair<string, string> type in propertyTypes2) 203 { 204 bool ischecked = false; 205 string[] propertytypeSplit2 = new string[0]; 206 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["propertytype"])) 207 { 208 propertytypeSplit2 = Dynamicweb.Context.Current.Request.QueryString["propertytype"].Split(','); 209 } 210 foreach (var propertytypeParams in propertytypeSplit2) 211 { 212 if (propertytypeParams == type.Value) 213 { 214 ischecked = true; 215 } 216 } 217 <li> 218 <label class="checkbox-container d-flex"> 219 @Translate("Smartpage:Search.DropDown." + type.Key + "", "" + type.Key + "") 220 @if (type.Value == "ejerlejlighed") 221 { 222 <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" /> 223 } 224 else if (type.Value == "helårsgrund") 225 { 226 <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" /> 227 } 228 else if (type.Value == "fritidsgrund") 229 { 230 <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" /> 231 } 232 else 233 { 234 <input type="checkbox" name="propertytype" value="@type.Value" class="js-input-check datavalue" data-val="@type.Key" onchange="submitFilter()" checked="@ischecked" /> 235 } 236 <span class="checkmark grey"></span> 237 </label> 238 </li> 239 } 240 } 241 242 void RenderBoligTypeErhverv(bool submitOnChange = false, bool frontpage = false) 243 { 244 Dictionary<string, string> erhverType = new Dictionary<string, string>(){ 245 { "Kontor", "OwnUseOffices" }, { "Lager + Produktion", "OwnUseStoresAndProductions" }, { "Detailhandel", "OwnUseRetailAndStores" }, 246 { "Grunde", "OwnUseParcel" }, { "Andre typer", "OwnUseOtherTypes" }, { "Hotel + Restaurant", "OwnUseHotelsAndRestaurants" } 247 }; 248 var submitonchange = ""; 249 if (submitOnChange) 250 { 251 submitonchange = "onchange='submitFilter()'"; 252 } 253 254 foreach (KeyValuePair<string, string> type in erhverType) 255 { 256 string ischecked = ""; 257 string[] olineParamsSplit = new string[0]; 258 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["olinecategory"])) 259 { 260 olineParamsSplit = Dynamicweb.Context.Current.Request.QueryString["olinecategory"].Split(','); 261 } 262 foreach (var olineParams in olineParamsSplit) 263 { 264 if (olineParams == type.Value) 265 { 266 ischecked = "checked"; 267 } 268 } 269 270 <li> 271 <label class="checkbox-container d-flex"> 272 @Translate("Smartpage:Search.DropDown." + type.Key + "", "" + type.Key + "") 273 <input type="checkbox" name="olinecategory" value="@type.Value" class="js-input-check datavalue" data-val="@type.Key" @submitonchange @ischecked /> 274 <span class="checkmark grey"></span> 275 </label> 276 </li> 277 } 278 279 280 bool ischeckedpropertycat = false; 281 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["propertycategory"])) 282 { 283 if (Dynamicweb.Context.Current.Request.QueryString["propertycategory"] == "Blandet Bolig/Erhverv") 284 { 285 ischeckedpropertycat = true; 286 } 287 } 288 <li> 289 <label class="checkbox-container"> 290 @Translate("Smartpage:Search.DropDown.Blandet Bolig/Erhverv", "Blandet Bolig/Erhverv") 291 <input type="checkbox" name="propertycategory" value="Blandet Bolig/Erhverv" class="js-input-check datavalue" data-val="Blandet Bolig/Erhverv" onchange="submitFilter()" checked="@ischeckedpropertycat" /> 292 <span class="checkmark grey"></span> 293 </label> 294 </li> 295 } 296 297 void RenderBoligTypeErhvervInvest(bool submitOnChange = false) 298 { 299 Dictionary<string, string> erhverType = new Dictionary<string, string>(){ 300 { "Kontor", "Kontor" }, { "Lager + Produktion", "InvestmentStoresAndProductions" }, { "Boligudlejning", "InvestmentHousingRental" }, 301 { "Detailhandel", "InvestmentRetailAndStores" }, { "Grunde", "InvestmentParcel" }, { "Hotel + Restaurant", "InvestmentHotelsAndRestaurants" }, { "Andre typer", "InvestmentOtherTypes" } 302 }; 303 304 foreach (KeyValuePair<string, string> type in erhverType) 305 { 306 bool ischecked = false; 307 string[] olineParamsSplit = new string[0]; 308 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["olinecategory"])) 309 { 310 olineParamsSplit = Dynamicweb.Context.Current.Request.QueryString["olinecategory"].Split(','); 311 } 312 foreach (var olineParams in olineParamsSplit) 313 { 314 if (olineParams == type.Value) 315 { 316 ischecked = true; 317 } 318 } 319 320 <li> 321 <label class="checkbox-container"> 322 @Translate("Smartpage:Search.DropDown." + type.Key + "", "" + type.Key + "") 323 <input type="checkbox" name="olinecategory" value="@type.Value" class="js-input-check datavalue" data-val="@type.Key" onchange="submitFilter()" checked="@ischecked" /> 324 <span class="checkmark grey"></span> 325 </label> 326 </li> 327 } 328 } 329 int GetWebsiteSettingsPageId(string pageSysName) 330 { 331 int sideId = 0; 332 333 var pw = Dynamicweb.Frontend.PageView.Current(); 334 335 string settingsItemId = "1"; 336 337 if ((pw.Area.Item.ContainsKey("Type") && pw.Area.Item["Type"].ToString() == "bone") || Dynamicweb.Context.Current.Request.QueryString["bone"] == "true") 338 { 339 settingsItemId = "2"; 340 } 341 342 var settingsItem = ItemManager.Storage.GetById("Delte_Egenskaber", settingsItemId); 343 344 if (settingsItem == null || !settingsItem.ContainsKey(pageSysName)) 345 { 346 return sideId; 347 } 348 349 string boligsideLink = settingsItem[pageSysName] as String; 350 string linkPrefix = "Default.aspx?ID="; 351 352 if (!String.IsNullOrEmpty(boligsideLink) && boligsideLink.ToLower().StartsWith(linkPrefix.ToLower())) 353 { 354 Int32.TryParse(boligsideLink.Substring(linkPrefix.Length), out sideId); 355 } 356 357 return sideId; 358 } 359 360 int GetPageSettingsPageId(string pageSysName) 361 { 362 int sideId = 0; 363 364 var pw = Dynamicweb.Frontend.PageView.Current(); 365 366 if (pw.Page == null || pw.Page.PropertyItem == null || !pw.Page.PropertyItem.ContainsKey(pageSysName)) 367 { 368 return sideId; 369 } 370 371 string boligsideLink = pw.Page.PropertyItem[pageSysName] as String; 372 string linkPrefix = "Default.aspx?ID="; 373 374 if (!String.IsNullOrEmpty(boligsideLink) && boligsideLink.ToLower().StartsWith(linkPrefix.ToLower())) 375 { 376 Int32.TryParse(boligsideLink.Substring(linkPrefix.Length), out sideId); 377 } 378 379 return sideId; 380 } 381 void RenderMobileSelectBox(string name, int max, int step, string className, string inputname) 382 { 383 <select class="form-control d-block d-lg-none mb-10 @className" onchange="submitFilter()" name="@inputname"> 384 <option selected="true" disabled="disabled">@Translate("Smartpage:Search.Placeholder." + name + "", "" + name + "")</option> 385 386 @for (var i = 0; i <= max; i += step) 387 { 388 var selected = string.Empty; 389 var current = string.Empty; 390 if (i == max) 391 { 392 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString[inputname]) && Dynamicweb.Context.Current.Request.QueryString[inputname] == Convert.ToString(i)) 393 { 394 <option value="@i" data-value='@Convert.ToInt32(i).ToString("N0")' selected="selected">@Convert.ToInt32(i).ToString("N0")+</option> 395 } 396 else 397 { 398 <option value="@i" data-value='@Convert.ToInt32(i).ToString("N0")'>@Convert.ToInt32(i).ToString("N0")+</option> 399 } 400 } 401 else 402 { 403 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString[inputname]) && Dynamicweb.Context.Current.Request.QueryString[inputname] == Convert.ToString(i)) 404 { 405 <option value="@i" data-value='@Convert.ToInt32(i).ToString("N0")' selected="selected">@Convert.ToInt32(i).ToString("N0")</option> 406 } 407 else 408 { 409 <option value="@i" data-value='@Convert.ToInt32(i).ToString("N0")'>@Convert.ToInt32(i).ToString("N0")</option> 410 } 411 } 412 } 413 </select> 414 } 415 416 void RenderTopFilter(string parameter) 417 { 418 if (parameter == "pricemin" || parameter == "pricemax") 419 { 420 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["pricemin"])) 421 { 422 if (parameter == "pricemin") 423 { 424 @("<div class='search-terms' id='priceFilter'>") 425 @("Pris ") @Dynamicweb.Context.Current.Request[parameter] 426 } 427 428 else 429 { 430 @(" - ") @Dynamicweb.Context.Current.Request[parameter] @(" kr.") <i class="fa fa-times ml-2 pointer" onclick="removeParams(this)" data-tag="pricemin,pricemax"></i> 431 @("</div>") 432 } 433 } 434 } 435 436 else if (parameter == "subsidymin" || parameter == "subsidymax") 437 { 438 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["subsidymin"])) 439 { 440 if (parameter == "subsidymin") 441 { 442 @("<div class='search-terms' id='subsidyFilter'>") 443 @("Årlig leje ") @Dynamicweb.Context.Current.Request[parameter] 444 } 445 446 else 447 { 448 @(" - ") @Dynamicweb.Context.Current.Request[parameter] @(" kr.") <i class="fa fa-times ml-2 pointer" onclick="removeParams(this)" data-tag="subsidymin,subsidymax"></i> 449 @("</div>") 450 } 451 } 452 } 453 else if (parameter == "etagearealmin" || parameter == "etagearealmax") 454 { 455 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["etagearealmin"])) 456 { 457 if (parameter == "etagearealmin") 458 { 459 @("<div class='search-terms' id='etagearealFilter'>") 460 @("Etageareal ") @Dynamicweb.Context.Current.Request[parameter] 461 } 462 463 else 464 { 465 @(" - ") @Dynamicweb.Context.Current.Request[parameter] @(" kvm.") <i class="fa fa-times ml-2 pointer" onclick="removeParams(this)" data-tag="etagearealmin,etagearealmax"></i> 466 @("</div>") 467 } 468 } 469 } 470 471 else if (parameter == "grundarealmin" || parameter == "grundarealmax") 472 { 473 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["grundarealmin"])) 474 { 475 if (parameter == "grundarealmin") 476 { 477 @("<div class='search-terms' id='grundarealFilter'>") 478 @("Grundareal ") @Dynamicweb.Context.Current.Request[parameter] 479 } 480 481 else 482 { 483 @(" - ") @Dynamicweb.Context.Current.Request[parameter] @(" kvm.") <i class="fa fa-times ml-2 pointer" onclick="removeParams(this)" data-tag="grundarealmin,grundarealmax"></i> 484 @("</div>") 485 } 486 } 487 } 488 489 else if (parameter == "subsidykvmmin" || parameter == "subsidykvmmax") 490 { 491 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["subsidykvmmin"])) 492 { 493 if (parameter == "subsidykvmmin") 494 { 495 @("<div class='search-terms' id='subsidykvmFilter'>") 496 @("Årlig leje kvm ") @Dynamicweb.Context.Current.Request[parameter] 497 } 498 499 else 500 { 501 @(" - ") @Dynamicweb.Context.Current.Request[parameter] @(" kr.") <i class="fa fa-times ml-2 pointer" onclick="removeParams(this)" data-tag="subsidykvmmin,subsidykvmmax"></i> 502 @("</div>") 503 } 504 } 505 } 506 507 else if (parameter == "olinecategory") 508 { 509 510 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["olinecategory"])) 511 { 512 Dictionary<string, string> erhverType = new Dictionary<string, string>(){ 513 {"OwnUseOffices", "Kontor" }, { "OwnUseStoresAndProductions","Lager + Produktion" }, { "OwnUseRetailAndStores","Detailhandel" }, 514 { "OwnUseParcel", "Grunde" }, { "OwnUseHotelsAndRestaurants", "Hotel + Restaurant" }, { "OwnUseOtherTypes", "Andre typer"}, 515 { "Kontor", "Kontor" }, { "InvestmentStoresAndProductions", "Lager + Produktion" }, { "InvestmentHousingRental", "Boligudlejning" }, 516 { "InvestmentRetailAndStores", "Detailhandel" }, { "InvestmentParcel", "Grunde" }, { "InvestmentHotelsAndRestaurants", "Hotel + Restaurant" }, { "InvestmentOtherTypes", "Andre typer" } 517 }; 518 519 520 foreach (var er in erhverType) 521 { 522 if (Dynamicweb.Context.Current.Request[parameter].Contains(er.Key)) 523 { 524 <div class="search-terms" id="@parameter"> 525 @er.Value <i class="fa fa-times ml-2 pointer" onclick="removeParams(this)" data-tag="@parameter" data-val="@er.Key"></i> 526 </div> 527 } 528 } 529 } 530 } 531 else if (parameter == "propertycategory") 532 { 533 534 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["propertycategory"])) 535 { 536 Dictionary<string, string> erhverType = new Dictionary<string, string>(){ 537 { "propertycategory", "Blandet Bolig/Erhverv" } 538 }; 539 540 foreach (var er in erhverType) 541 { 542 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request[parameter]) && Dynamicweb.Context.Current.Request[parameter] == er.Value) 543 { 544 <div class="search-terms" id="@parameter"> 545 @er.Value <i class="fa fa-times ml-2 pointer" onclick="removeParams(this)" data-tag="@parameter" data-val="@er.Key"></i> 546 </div> 547 } 548 } 549 } 550 } 551 else if (parameter == "search") 552 { 553 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["search"])) 554 { 555 <div class="search-terms" id="@parameter"> 556 @Dynamicweb.Context.Current.Request[parameter] <i class="fa fa-times ml-2 pointer" onclick="removeParams(this)" data-tag="@parameter"></i> 557 </div> 558 } 559 } 560 else 561 { 562 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request[parameter])) 563 { 564 Dictionary<string, string> 565 ubudsform = new Dictionary<string, string> 566 (){ 567 {"salg", "Salg" }, { "leje","Leje" } 568 }; 569 570 foreach (var er in ubudsform) 571 { 572 if (Dynamicweb.Context.Current.Request[parameter].Contains(er.Key)) 573 { 574 <div class="search-terms" id="@parameter"> 575 @er.Value <i class="fa fa-times ml-2 pointer" onclick="removeParams(this)" data-tag="@parameter" data-val="@er.Key"></i> 576 </div> 577 } 578 } 579 580 581 } 582 } 583 } 584 585 void RenderSelectValue(string dropdownname, string dropdownvalue, string queryString) 586 { 587 var selected = ""; 588 if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString[queryString]) && Dynamicweb.Context.Current.Request.QueryString[queryString] == dropdownvalue) 589 { 590 selected = "selected"; 591 } 592 593 var current = string.Format("<option value='" + dropdownvalue + "'>" + dropdownname + "</option>", selected); 594 595 @current 596 } 597 598 void RenderSearchForHousing(int searchPageId, string querySearch, string querySearchNameAttr, string queryZipCodeFrom, string queryZipCodeTo, string template, Item SettingsItem, string cssClasses = "") 599 { 600 <div class="main-search-form frontpage @cssClasses"> 601 <div class="dropdown-overlay"></div> 602 <div class="row mb-3 align-items-center"> 603 <div class="col-xs-12 col-md-3 border-right"> 604 <h3>@Translate("Smartpage:Search.Søg bolig", "Søg bolig")</h3> 605 </div> 606 <div class="col-xs-12 col-md-9 home-count d-none d-md-block"> 607 <span class="search-count" id="searchCounter">0</span> <span>@Translate("Smartpage:Search.BoligerTilSalg", "Boliger til salg")</span> 608 </div> 609 </div> 610 611 <form id="main-search-frontpage" class="searchbar-wrapper" action="/Default.aspx" method="GET"> 612 <input type="hidden" name="ID" value='@searchPageId' id="searchPageId-frontpage" disabled="disabled" /> 613 <div class="row form-wrapper no-gutters"> 614 615 <div class="col-xs-12 col-md-5 col-searchbar"> 616 <div class="searchbar"> 617 <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)" /> 618 <input type="hidden" id="zipcodefrom-frontpage" name="zipcodefrom" value="@Dynamicweb.Core.Encoders.HtmlEncoder.HtmlAttributeEncode(queryZipCodeFrom)" /> 619 <input type="hidden" id="zipcodeto-frontpage" name="zipcodeto" value="@Dynamicweb.Core.Encoders.HtmlEncoder.HtmlAttributeEncode(queryZipCodeTo)" /> 620 </div> 621 </div> 622 <div class="col-xs-12 col-md-5"> 623 <div class="row no-gutters"> 624 <div class="col-xs-12 col-md-6 input-col"> 625 <div class="dropdown w-overlay"> 626 <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"> 627 @Translate("Smartpage:Search.Boligtype", "Boligtype") 628 </button> 629 <div class="dropdown-menu box-shadow bolig-dropdown-container" aria-labelledby="Boligtype"> 630 <ul class="bolig-dropdown list-unstyled"> 631 @{ 632 RenderBoligtypeCheckboxesDropdown(); 633 } 634 </ul> 635 <span class="border-fat"></span> 636 <button class="btn btn-primary js-close-dropdown">@Translate("Smartpage:Search.Anvend", "Anvend")</button> 637 </div> 638 639 </div> 640 641 </div> 642 <div class="col-xs-12 col-md-6 input-col"> 643 <div class="dropdown w-overlay"> 644 <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"> 645 @Translate("Smartpage:Search.Pris", "Pris") 646 </button> 647 <div class="dropdown-menu box-shadow dropdown-price" aria-labelledby="Pris"> 648 <input type="text" class="form-control mb-10 js-auto-thousand js-pricemin-frontpage-input" placeholder='@Translate("Smartpage:Search.Placeholder.MinPris","Min. pris")' /> 649 <select class="form-control js-pricemin-frontpage-select js-input-min-select mb-10"> 650 <option selected="true" disabled="disabled">@Translate("Smartpage:Search.Placeholder.MinPris", "Min. pris")</option> 651 @for (var i = 0; i <= 10000000; i += 100000) 652 { 653 if (i == 10000000) 654 { 655 <option value="@i" data-value='@Convert.ToInt32(i).ToString("N0")+'>@Convert.ToInt32(i).ToString("N0")+</option> 656 } 657 else 658 { 659 <option value="@i" data-value='@Convert.ToInt32(i).ToString("N0")'>@Convert.ToInt32(i).ToString("N0")</option> 660 } 661 } 662 </select> 663 <input type="hidden" id="pricemin-frontpage" name="pricemin" /> 664 665 <input type="text" class="form-control js-auto-thousand js-pricemax-frontpage-input" placeholder='@Translate("Smartpage:Search.Placeholder.MaxPris","Max. pris")' /> 666 <select class="form-control js-pricemax-frontpage-select js-input-max-select"> 667 <option selected="true" disabled="disabled">@Translate("Smartpage:Search.Placeholder.MaxPris", "Max. pris")</option> 668 @for (var i = 0; i <= 10000000; i += 100000) 669 { 670 if (i == 10000000) 671 { 672 <option value="@i" data-value='@Convert.ToInt32(i).ToString("N0")+'>@Convert.ToInt32(i).ToString("N0")+</option> 673 } 674 else 675 { 676 <option value="@i" data-value='@Convert.ToInt32(i).ToString("N0")'>@Convert.ToInt32(i).ToString("N0")</option> 677 } 678 } 679 </select> 680 <input type="hidden" id="pricemax-frontpage" name="pricemax" /> 681 <button class="btn btn-primary js-close-dropdown mt-3">@Translate("Smartpage:Search.Anvend", "Anvend")</button> 682 </div> 683 </div> 684 </div> 685 </div> 686 </div> 687 <div class="col-xs-12 col-md-2 d-none d-md-block"> 688 <button type="submit" class="btn btn-block btn-search"><i class="fa fa-search"></i> @Translate("Smartpage:Search.Søg", "Søg")</button> 689 </div> 690 </div> 691 692 <div class="row moresearch-btn no-gutters"> 693 <div class="col-sm-12"> 694 <div class="row align-items-center no-gutters"> 695 <div class="col-12 col-md-4"> 696 <button class="btn-blank js-search-collapse" type="button" data-toggle="collapse" data-target="#moreSearch" aria-expanded="false" aria-controls="moreSearch"> 697 <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> 698 </button> 699 </div> 700 <div class="col-6 col-md-2 mb-xs-4"> 701 <a class="js-reset reset-btn">@Translate("Smartpage:Search.NulstilValg", "Nulstil valg")</a> 702 </div> 703 </div> 704 705 <div class="collapse" id="moreSearch"> 706 <h4 class="mt-20"><b>@Translate("Smartpage:Search.Bolig", "Bolig")</b></h4> 707 <div class="row align-items-end mb-30"> 708 <div class="col-12 col-sm-6 col-lg-3 mb-3 mb-lg-0"> 709 <div class="filter-container row"> 710 <label class="d-block col-12">@Translate("Smartpage:Search.Boligareal", "Boligareal")</label> 711 <div class="col-6 pr-sm-0 pr-2"> 712 <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")' /> 713 <select class="form-control js-boligarealmin-frontpage-select js-count"> 714 <option selected="true" disabled="disabled">@Translate("Smartpage:Search.Placeholder.Minm2", "Min. m2")</option> 715 @for (var i = 0; i <= 300; i += 10) 716 { 717 if (i == 300) 718 { 719 <option value="@i">@i+</option> 720 } 721 else 722 { 723 <option value="@i">@i</option> 724 } 725 } 726 </select> 727 </div> 728 <div class="col-6 pl-sm-0 pl-2"> 729 <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")' /> 730 <select class="form-control js-boligarealmax-frontpage-select js-count"> 731 <option selected="true" disabled="disabled">@Translate("Smartpage:Search.Placeholder.Maxm2", "Max. m2")</option> 732 @for (var i = 0; i <= 300; i += 10) 733 { 734 if (i == 300) 735 { 736 <option value="@i">@i+</option> 737 } 738 else 739 { 740 <option value="@i">@i</option> 741 } 742 } 743 </select> 744 </div> 745 </div> 746 </div> 747 <div class="col-12 col-sm-6 col-lg-3 mb-3 mb-lg-0"> 748 <div class="filter-container row"> 749 <label class="d-block col-12">@Translate("Smartpage:Search.Grundareal", "Grundareal")</label> 750 <div class="col-6 pr-sm-0 pr-2"> 751 <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")' /> 752 <select class="form-control js-grundarealmin-frontpage-select js-count"> 753 <option selected="true" disabled="disabled">@Translate("Smartpage:Search.Placeholder.Minm2", "Min. m2")</option> 754 @for (var i = 0; i <= 10000; i += 100) 755 { 756 if (i == 10000) 757 { 758 <option value="@i">@i+</option> 759 } 760 else 761 { 762 <option value="@i">@i</option> 763 } 764 } 765 </select> 766 </div> 767 <div class="col-6 pl-sm-0 pl-2"> 768 <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")' /> 769 <select class="form-control js-grundarealmax-frontpage-select js-count"> 770 <option selected="true" disabled="disabled">@Translate("Smartpage:Search.Placeholder.Maxm2", "Max. m2")</option> 771 @for (var i = 0; i <= 10000; i += 100) 772 { 773 if (i == 10000) 774 { 775 <option value="@i">@i+</option> 776 } 777 else 778 { 779 <option value="@i">@i</option> 780 } 781 } 782 </select> 783 </div> 784 </div> 785 </div> 786 <div class="col-12 col-sm-6 col-lg-3 mb-3 mb-lg-0"> 787 <div class="filter-container row"> 788 <label class="d-block col-12">Antal rum</label> 789 790 <div class="col-6 pr-sm-0 pr-2"> 791 <select name="roomsmin" id="roomsmin-frontpage" class="form-control reverse js-count"> 792 <option selected="true" disabled="disabled">@Translate("Smartpage:Search.Placeholder.Min", "Min")</option> 793 <option value="1">1</option> 794 <option value="2">2</option> 795 <option value="3">3</option> 796 <option value="4">4</option> 797 <option value="5+">5+</option> 798 </select> 799 </div> 800 <div class="col-6 pl-sm-0 pl-2"> 801 <select name="roomsmax" id="roomsmax-frontpage" class="form-control reverse js-count"> 802 <option selected="true" disabled="disabled">@Translate("Smartpage:Search.Placeholder.Max", "Max")</option> 803 <option value="1">1</option> 804 <option value="2">2</option> 805 <option value="3">3</option> 806 <option value="4">4</option> 807 <option value="5+">@Translate("Smartpage:Rooms.5", "5")</option> 808 </select> 809 </div> 810 </div> 811 </div> 812 <div class="col-12 col-sm-6 col-lg-3 mb-3 mb-lg-0"> 813 <div class="row"> 814 <div class="col-12"> 815 <div class="filter-container"> 816 <label class="d-block">Energimærke</label> 817 <select name="energylabel" id="energylabel-frontpage" class="form-control reverse js-count"> 818 <option disabled selected="selected">@Translate("Smartpage:Search.Vælg", "Vælg")</option> 819 <option value="01">G</option> 820 <option value="02">F</option> 821 <option value="03">E</option> 822 <option value="04">D</option> 823 <option value="05">C</option> 824 <option value="06">B</option> 825 <option value="07">A</option> 826 <option value="08">A2010</option> 827 <option value="09">A2015</option> 828 <option value="10">A2020+</option> 829 </select> 830 </div> 831 </div> 832 </div> 833 </div> 834 <div class="col-12 col-sm-6 col-lg-3 mt-3"> 835 <h4 class=""><b>@Translate("Smartpage:Search.Økonomi", "Økonomi")</b></h4> 836 <div class="filter-container row"> 837 <label class="d-block col-12">@Translate("Smartpage:Search.Ejerudgift/boligydelse pr. måned", "Ejerudgift/boligydelse pr. måned")</label> 838 <div class="col-6 pr-sm-0 pr-2"> 839 <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")' /> 840 <select class="form-control js-subsidymin-frontpage-select js-count"> 841 <option selected="true" disabled="disabled">@Translate("Smartpage:Search.Placeholder.MinDKK", "Min. DKK")</option> 842 @for (var i = 0; i <= 25000; i += 1250) 843 { 844 if (i == 25000) 845 { 846 <option>@Convert.ToInt32(i).ToString("N0")+</option> 847 } 848 else 849 { 850 <option>@Convert.ToInt32(i).ToString("N0")</option> 851 } 852 } 853 </select> 854 </div> 855 <div class="col-6 pl-sm-0 pl-2"> 856 <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")' /> 857 <select class="form-control js-subsidymax-frontpage-select js-count"> 858 <option selected="true" disabled="disabled">@Translate("Smartpage:Search.Placeholder.MaxDKK", "Max. DKK")</option> 859 @for (var i = 0; i <= 25000; i += 1250) 860 { 861 if (i == 25000) 862 { 863 <option value="@Convert.ToInt32(i)">@Convert.ToInt32(i).ToString("N0")+</option> 864 } 865 else 866 { 867 <option value="@Convert.ToInt32(i)">@Convert.ToInt32(i).ToString("N0")</option> 868 } 869 } 870 </select> 871 </div> 872 </div> 873 </div> 874 <div class="col-12 col-sm-6 col-lg-4 offset-lg-5 mt-3 mt-sm-0"> 875 <button type="submit" class="btn btn-block btn-search"><i class="fa fa-search"></i> @Translate("Smartpage:Search.AnvendFiltre", "Anvend filtre")</button> 876 </div> 877 </div> 878 </div> 879 </div> 880 </div> 881 882 <div class="row d-block d-md-none form-wrapper no-gutters"> 883 <div class="col-xs-12 col-md-2"> 884 <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> 885 </div> 886 </div> 887 </form> 888 <div class="front-page-actions d-md-none"> 889 <div> 890 <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> 891 </div> 892 <div> 893 @{ 894 string brokerSearchId = SettingsItem != null ? Dynamicweb.Core.Converter.ToString(SettingsItem["Maeglersogning"]).Replace("Default.aspx?Id=", "") : ""; 895 string ctaText = Translate("Smartpage.Frontpage.Mobile.FindBroker", "FIND EJENDOMSMÆGLER"); 896 <form method="GET" action="/Default.aspx"> 897 <input name="id" value="@brokerSearchId" type="hidden" /> 898 <div class="icon-wrapper-wclick"> 899 <i class="fas fa-search ta-submit-on-icon-click"></i> 900 <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'" /> 901 </div> 902 </form> 903 } 904 </div> 905 <div> 906 <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> 907 </div> 908 </div> 909 </div> 910 911 } 912 Custom.Integration.Brokers.Models.BrokerEmployee GetBrokerFromCurrentProduct() 913 { 914 string productId = Dynamicweb.Context.Current.Request["ProductId"]; 915 916 if (string.IsNullOrWhiteSpace(productId)) 917 { 918 return null; 919 } 920 921 var propertyProduct = Dynamicweb.Ecommerce.Services.Products.GetProductById(productId, string.Empty, true); 922 if (propertyProduct == null) 923 { 924 return null; 925 } 926 927 string employee = Dynamicweb.Core.Converter.ToString( 928 Dynamicweb.Ecommerce.Services.Products.GetProductFieldValue(propertyProduct, "xAktoererMaeglerKontaktEmail") 929 ); 930 string storeId = Dynamicweb.Core.Converter.ToString( 931 Dynamicweb.Ecommerce.Services.Products.GetProductFieldValue(propertyProduct, "xButikID") 932 ); 933 934 if (string.IsNullOrWhiteSpace(employee) || string.IsNullOrWhiteSpace(storeId)) 935 { 936 return null; 937 } 938 939 return Custom.Integration.Brokers.Search.GetEmployee(storeId, employee); 940 } 941 942 string GetAgentTitleFromCurrentProduct() 943 { 944 var propBroker = GetBrokerFromCurrentProduct(); 945 946 if (propBroker?.Broker == null) 947 { 948 return string.Empty; 949 } 950 951 if (!string.IsNullOrEmpty(propBroker.Broker.CompanyName)) 952 { 953 return propBroker.Broker.CompanyName; 954 } 955 956 return propBroker.Broker.Name ?? string.Empty; 957 } 958 959 string GetMasterBrokerUrlFromCurrentProduct() 960 { 961 var propBroker = GetBrokerFromCurrentProduct(); 962 963 var itemId = propBroker?.Broker?.ItemId; 964 var itemType = propBroker?.Broker?.ItemType; 965 966 if (string.IsNullOrWhiteSpace(itemId) || string.IsNullOrWhiteSpace(itemType)) 967 { 968 return string.Empty; 969 } 970 var brokerItem = Dynamicweb.Content.Items.ItemManager.Storage.GetById(itemType, itemId); 971 972 if (brokerItem == null) 973 { 974 return string.Empty; 975 } 976 977 var websiteId = Dynamicweb.Core.Converter.ToInt32(brokerItem["WebsiteId"]); 978 var page = Dynamicweb.Content.Services.Pages.GetFirstPageForArea(websiteId); 979 return Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("Default.aspx?Id=" + page?.ID); 980 } 981 } 982 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 983 @using Dynamicweb.Ecommerce.Products; 984 @using RealMaeglerne.Dynamicweb; 985 @using RealMaeglerne.Dynamicweb.Models; 986 @using RealMaeglerne.Library; 987 @using RealMaeglerne.Library.Models; 988 989 @using System.Text.RegularExpressions 990 991 @functions{ 992 public class WrapMethods 993 { 994 //Gets the contrasting color 995 public static string getContrastYIQ(string hexcolor) 996 { 997 if (hexcolor != "") 998 { 999 hexcolor = Regex.Replace(hexcolor, "[^0-9a-zA-Z]+", ""); 1000 1001 int r = Convert.ToByte(hexcolor.Substring(0, 2), 16); 1002 int g = Convert.ToByte(hexcolor.Substring(2, 2), 16); 1003 int b = Convert.ToByte(hexcolor.Substring(4, 2), 16); 1004 int yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000; 1005 1006 if (yiq >= 128) 1007 { 1008 return "black"; 1009 } 1010 else 1011 { 1012 return "white"; 1013 } 1014 } 1015 else 1016 { 1017 return "black"; 1018 } 1019 } 1020 1021 1022 //Truncate text 1023 public static string Truncate (string value, int count, bool strip=true) 1024 { 1025 if (strip == true){ 1026 value = StripHtmlTagByCharArray(value); 1027 } 1028 1029 if (value.Length > count) 1030 { 1031 value = value.Substring(0, count - 1) + "..."; 1032 } 1033 1034 return value; 1035 } 1036 1037 //Truncate Reverse 1038 public static string TruncateReverse (string value, int count) 1039 { 1040 if (value.Length > count) 1041 { 1042 value = value.Substring(count, value.Length); 1043 } 1044 return value; 1045 } 1046 1047 1048 //Strip text from HTML 1049 public static string StripHtmlTagByCharArray(string htmlString) 1050 { 1051 char[] array = new char[htmlString.Length]; 1052 int arrayIndex = 0; 1053 bool inside = false; 1054 1055 for (int i = 0; i < htmlString.Length; i++) 1056 { 1057 char let = htmlString[i]; 1058 if (let == '<') 1059 { 1060 inside = true; 1061 continue; 1062 } 1063 if (let == '>') 1064 { 1065 inside = false; 1066 continue; 1067 } 1068 if (!inside) 1069 { 1070 array[arrayIndex] = let; 1071 arrayIndex++; 1072 } 1073 } 1074 return new string(array, 0, arrayIndex); 1075 } 1076 1077 //Make the correct count of columns 1078 public static string ColumnMaker(int Col, string ScreenSize) 1079 { 1080 string Columns = ""; 1081 1082 switch (Col) 1083 { 1084 case 1: 1085 Columns = "col-"+ScreenSize+"-12"; 1086 break; 1087 1088 case 2: 1089 Columns = "col-"+ScreenSize+"-6"; 1090 break; 1091 1092 case 3: 1093 Columns = "col-"+ScreenSize+"-4"; 1094 break; 1095 1096 case 4: 1097 Columns = "col-"+ScreenSize+"-3"; 1098 break; 1099 1100 default: 1101 Columns = "col-"+ScreenSize+"-3"; 1102 break; 1103 } 1104 1105 return Columns; 1106 } 1107 1108 1109 private string Custom(string firstoption, string secondoption) 1110 { 1111 if (firstoption == "custom") 1112 { 1113 return secondoption; 1114 } 1115 else 1116 { 1117 return firstoption; 1118 } 1119 } 1120 } 1121 } 1122 1123 @functions { 1124 void RenderBoligList(List<LoopItem> boliglist) 1125 { 1126 int propertyIndex = GetInteger("Ecom:ProductList.CurrentPage") > 0 ? (GetInteger("Ecom:ProductList.CurrentPage") - 1) * GetInteger("Ecom:ProductList.PageSize") : 0; 1127 foreach (LoopItem bolig in boliglist) 1128 { 1129 RenderPropertyCard(bolig, propertyIndex); 1130 propertyIndex++; 1131 } 1132 } 1133 1134 void RenderPropertyCard(LoopItem property, int propertyIndex, int? itemsPerPage = null) 1135 { 1136 int? pageNum = itemsPerPage != null ? (propertyIndex / itemsPerPage) + 1 : null; 1137 string fallbackImage = "/Files/Templates/Designs/rm/assets/images/na-real.png"; 1138 string iconPath = "/Files/Templates/Designs/rm/assets/images/svg/"; 1139 var boligManager = new RealMaeglerne.Library.BoligManager(Pageview); 1140 RealMaeglerne.Library.Models.Bolig bolig = boligManager.CreateBolig(property, true); 1141 1142 string propCategory = bolig.Ejendomskategori; 1143 bool isRental = bolig.UdbudsForm.Equals("Leje", StringComparison.InvariantCultureIgnoreCase); 1144 1145 List<RealMaeglerne.Library.Models.Bolig.CaseAsset> allImages = bolig.ImagesOfProperty.Take(3).ToList(); 1146 1147 if (bolig.AndenMaegler) 1148 { 1149 var image = bolig.ImageUrl; 1150 1151 if (!string.IsNullOrEmpty(image)) 1152 { 1153 allImages.Add(new Bolig.CaseAsset() { ImageXs = image, ImageSm = image, ImageMd = image, ImageLg = image, ImageXl = image }); 1154 } 1155 else 1156 { 1157 allImages.Add(new Bolig.CaseAsset() { ImageXs = fallbackImage, ImageSm = fallbackImage, ImageMd = fallbackImage, ImageLg = fallbackImage, ImageXl = fallbackImage }); 1158 } 1159 } 1160 else 1161 { 1162 while (allImages.Count < 3) 1163 { 1164 allImages.Add(new Bolig.CaseAsset() { ImageXs = fallbackImage, ImageSm = fallbackImage, ImageMd = fallbackImage, ImageLg = fallbackImage, ImageXl = fallbackImage }); 1165 } 1166 } 1167 1168 int totalImageCount = allImages.Count; 1169 <div property-card class="property-card" data-is-rental="@(isRental ? "true" : "false")" @(pageNum != null ? $"data-page=\"{pageNum}\"" : "")> 1170 <!-- Hidden radio buttons for image navigation --> 1171 @for (int imgIndex = 1; imgIndex <= totalImageCount; imgIndex++) 1172 { 1173 <input type="radio" 1174 name="card-@propertyIndex-images" 1175 id="card-@propertyIndex-img-@imgIndex" 1176 class="image-radio d-none" 1177 @(imgIndex == 1 ? "checked" : "")> 1178 } 1179 1180 <div class="property-card-images-wrapper"> 1181 @{ 1182 int currentImageIndex = 1; 1183 } 1184 @foreach (var image in allImages) 1185 { 1186 <a href="@bolig.LinkUrl@(isRental ? "?Udlejning=true" : "")" target="_blank" class="property-image" data-image="@currentImageIndex"> 1187 <img src="@image.ImageMd" alt="@bolig.Adresse" /> 1188 1189 @if (totalImageCount > 1) 1190 { 1191 <div class="property-card-images-indicators"> 1192 <label for="card-@propertyIndex-img-1" 1193 class="property-card-images-indicator" 1194 aria-label="@Translate("Custom.Propertypage.FirstIndicatorLabel","Første billede")"> 1195 </label> 1196 <label for="card-@propertyIndex-img-2" 1197 class="property-card-images-indicator" 1198 aria-label="@Translate("Custom.Propertypage.SecondIndicatorLabel","Andet billede")"> 1199 </label> 1200 <label for="card-@propertyIndex-img-3" 1201 class="property-card-images-indicator" 1202 aria-label="@Translate("Custom.Propertypage.ThirdIndicatorLabel","Tredie billede")"> 1203 </label> 1204 </div> 1205 } 1206 </a> 1207 currentImageIndex++; 1208 } 1209 @if (bolig.AabentHus) 1210 { 1211 var upcomingOpenHouses = boligManager.KommendeAabnehuse(bolig); 1212 1213 if (upcomingOpenHouses != null) 1214 { 1215 bool hasSignUp = upcomingOpenHouses.Any(oh => oh.Tilmelding); 1216 var primaryOpenHouse = upcomingOpenHouses.FirstOrDefault(); 1217 1218 if (primaryOpenHouse != null) 1219 { 1220 <div class="open-house position-absolute d-flex" role="region" aria-label="@Dynamicweb.Core.Encoders.HtmlEncoder.HtmlAttributeEncode(Translate("Custom:Accessibility.OpenHouseInfo", "Åbent hus information"))"> 1221 <div class="open-house-dates d-flex align-items-center"> 1222 <div class="d-flex flex-column align-items-end"> 1223 <div class="section-header mb-0"> 1224 @Translate("Custom.PropertyList.OpenHouseSection.Header", "Åbent hus") 1225 @if (hasSignUp) 1226 { 1227 <span class="signup">@Translate("Custom.PropertyList.OpenHouseSection.Header.Singup.PostFix", " med tilmelding")</span> 1228 } 1229 </div> 1230 <div class="open-house-text"> 1231 <span class="">@primaryOpenHouse.Dato.ToString("d. MMM", Pageview.Area.CultureInfo)</span> 1232 1233 @if (!string.IsNullOrEmpty(primaryOpenHouse.TidspunktFormateret)) 1234 { 1235 <div class="d-inline-block"> 1236 @Translate("Custom.Propertypage.OpenHouseSection.Kl", "kl.") @FormatTime(primaryOpenHouse.FraKlokken) - @FormatTime(primaryOpenHouse.TilKlokken) 1237 </div> 1238 } 1239 </div> 1240 1241 </div> 1242 1243 @if (hasSignUp) 1244 { 1245 <div class="property-card-button"> 1246 <a class="btn btn-primary" href="@bolig.LinkUrl" target="_blank"> 1247 @Translate("Custom.Propertypage.OpenHouseSection.SignupButton.Label", "Tilmeld") 1248 </a> 1249 </div> 1250 } 1251 </div> 1252 </div> 1253 } 1254 } 1255 } 1256 </div> 1257 <div class="property-card-info-wrapper d-flex flex-column"> 1258 <div class="d-flex justify-content-between w-100"> 1259 <a href="@bolig.LinkUrl@(isRental ? "?Udlejning=true" : "")" target="_blank" class="property-card-address d-flex flex-column"> 1260 <div>@bolig.Adresse</div> 1261 <div>@bolig.PostAdresse</div> 1262 </a> 1263 @{ 1264 var labels = new (bool Condition, string Color, string Stroke, string Key, string Default)[] 1265 { 1266 (bolig.Solgt && isRental, "#C50000", "#FFB3B3", "Custom.PropertyList.Label.Leased", "Udlejet"), 1267 (bolig.Solgt, "#C50000", "#FFB3B3", "Custom.PropertyList.Label.Sold", "Solgt"), 1268 (bolig.PurchaseAgreementSigned, "#003761", "#5A6B77", "Custom.PropertyList.Label.PurchaseAgreementSigned", "Købsaftale <br/> underskrevet"), 1269 (bolig.Nyhed, "#DE8344", "#F9CBAB", "Custom.PropertyList.Label.New", "Ny"), 1270 (bolig.NyPris, "#DE8344", "#F9CBAB", "Custom.PropertyList.Label.NewPrice", "Ny pris") 1271 }; 1272 1273 var match = labels.FirstOrDefault(l => l.Condition); 1274 1275 } 1276 1277 @if (match.Condition) 1278 { 1279 <div class="property-card-label @(bolig.PurchaseAgreementSigned ? "small" : "") d-flex align-items-center"> 1280 <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 25 25" fill="none"> 1281 <circle cx="12.5" cy="12.5" r="10.5" fill="@match.Color" stroke="@match.Stroke" stroke-width="4" /> 1282 </svg> 1283 @Translate(match.Key, match.Default) 1284 </div> 1285 } 1286 </div> 1287 <div class="property-card-info d-flex"> 1288 <span>@propCategory</span> 1289 <div class="detail-separator"></div> 1290 <span>@bolig.Areal @Translate("Custom.Propertypage.Units.SquareMeters", "m²")</span> 1291 <div class="detail-separator"></div> 1292 @if (!bolig.Solgt && !bolig.PurchaseAgreementSigned) 1293 { 1294 <span>kr. @bolig.Pris.ToString("#,##0")</span> 1295 <div class="detail-separator"></div> 1296 } 1297 @{ 1298 var scenarioNumber = property.GetString("Ecom:Product:Field.EnergyLabelScenarioNumber"); 1299 var savings = property.GetInteger("Ecom:Product:Field.EnergyLabelSavings"); 1300 var energyLink = property.GetString("Ecom:Product:Field.EnergyLabelLink"); 1301 } 1302 1303 <div class="energylabel @(scenarioNumber == "2" ? "energy__hover" : "")" 1304 data-energylabel="@Dynamicweb.Core.Encoders.HtmlEncoder.HtmlAttributeEncode(bolig.EnergyLabel)"> 1305 @if (scenarioNumber == "2") 1306 { 1307 <span id="energi-testgruppe-information" class="tooltiptext"> 1308 @if (savings > 0) 1309 { 1310 @string.Format(Translate("Smartpage:Boligvisning.Energimærketekst1-1", "OBS: du kan spare {0} årligt ved at renovere denne bolig - {1}"), savings.ToString("#,##0"), "") 1311 <a target="_blank" href="@(energyLink)&utm_source=realmaeglerne&utm_medium=energimaerke&utm_campaign=testgruppe1">@Translate("Custom.Propertypage.EnergyLabel.Tooltip.Linktext", "klik her")</a> 1312 } 1313 else 1314 { 1315 @string.Format(Translate("Smartpage:Boligvisning.Energimærketekst1-2", "OBS: du kan energi renovere denne bolig {0}"), "") 1316 <a target="_blank" href="@(energyLink)&utm_source=realmaeglerne&utm_medium=energimaerke&utm_campaign=testgruppe1">@Translate("Custom.Propertypage.EnergyLabel.Tooltip.Linktext", "klik her")</a> 1317 } 1318 </span> 1319 } 1320 </div> 1321 </div> 1322 <div class="property-card-button"> 1323 <a href="@bolig.LinkUrl@(isRental ? "?Udlejning=true" : "")" class="btn btn-primary @(bolig.AndenMaegler ? "grey" : "")" target="_blank"> 1324 @if (bolig.AndenMaegler) 1325 { 1326 @Translate("Custom.PropertyList.ViewPropertyButton.External", "Anden mægler") 1327 } 1328 else 1329 { 1330 @Translate("Custom.PropertyList.ViewPropertyButton", "Se bolig") 1331 } 1332 <img height="20px" width="20px" src="@(iconPath + "icon-arrow-right.svg")" /> 1333 </a> 1334 </div> 1335 </div> 1336 </div> 1337 } 1338 1339 string FormatTime(string time) => time?.Length >= 5 ? time.Substring(0, 5) : (time ?? string.Empty); 1340 1341 } 1342 1343 1344 @{ 1345 IEnumerable<Product> boliglistFavorites = Enumerable.Empty<Product>();; 1346 try { 1347 boliglistFavorites = RealEstate.User.Helper.GetFavorites(); 1348 } catch { 1349 // Ignore 1350 } 1351 } 1352 <section class="bolig-list my-favorites"> 1353 <div class="container"> 1354 @if(boliglistFavorites != null && boliglistFavorites.Any()) { 1355 <div class="list list-favorites row"> 1356 @{ 1357 RenderBoligList(boliglistFavorites); 1358 } 1359 </div> 1360 } else { 1361 <div class="row"> 1362 <div class="col-xs-12 text-center"> 1363 <h2>@(Translate("no_favorites_yet", "Du har endnu ingen gemte boliger"))</h2> 1364 <br /><br /> 1365 </div> 1366 </div> 1367 } 1368 </div> 1369 </section> 1370