Hvad leder du efter?

Error executing template "Designs/Rideforbund/QueryPublisher/ResultsRiderHorse.cshtml"
System.InvalidOperationException: Timeout expired.  The timeout period elapsed prior to obtaining a connection from the pool.  This may have occurred because all pooled connections were in use and max pool size was reached.
   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.Open()
   at Dynamicweb.Data.DatabaseConnectionProvider.CreateConnection(Boolean open)
   at Dynamicweb.Data.Database.CreateConnection()
   at Dynamicweb.Data.Database.CreateDataReader(CommandBuilder commandBuilder, IDbConnection connection, IDbTransaction transaction, Int32 commandTimeout)
   at Dynamicweb.Content.Data.PageRepository.GetPage(Int32 id)
   at DanskRideForbund.Observer.GlobalTagsObserver.OnNotify(String notification, NotificationArgs args) in D:\a\1\s\Application\CustomModules\Observer\GlobalTagsObserver.cs:line 37
   at Dynamicweb.Extensibility.Notifications.NotificationManager.Notify(String notification, NotificationArgs eventArgs)
   at Dynamicweb.Frontend.PageView.GetGlobalTemplateTags()
   at Dynamicweb.Frontend.XmlNavigation.InitializeXmlDoc()
   at Dynamicweb.Frontend.XmlNavigation.MakeXml(Int32 parentId, Int32 levelStart, Int32 levelStop, Expand expand, Int32 selectedAreaId)
   at Dynamicweb.Frontend.XmlNavigation.GetNavigationHtml(Int32 parentId, Int32 levelStart, Int32 levelStop, Expand expand, String name, String xsltPath, Int32 selectedAreaId, Boolean sitemapMode, NameValueCollection settings, NameValueCollection attributes, IncludeMode mode)
   at Dynamicweb.Frontend.XmlNavigation.GetNavigationHtml(NameValueCollection settings, NameValueCollection attributes)
   at CompiledRazorTemplates.Dynamic.RazorEngine_bf54b5c0cd55491b916e623cda51a701.Execute() in D:\dynamicweb.net\Solutions\Dansk Ride Forbund\Files\Templates\Designs\Rideforbund\QueryPublisher\ResultsRiderHorse.cshtml:line 767
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 @using System.Data; 3 @using System.Text.RegularExpressions; 4 @using Dynamicweb; 5 @using Dynamicweb.Core; 6 @using Dynamicweb.Data; 7 @using Dynamicweb.Frontend; 8 @using Dynamicweb.Environment; 9 @using DanskRideForbund.DataSync.Common.Enum; 10 @using DanskRideForbund.Indexing.InMemoryDictionaryProvider; 11 12 @using Dynamicweb; 13 @using Dynamicweb.Frontend; 14 @using System.Text.RegularExpressions; 15 @using Dynamicweb.Environment.Web; 16 17 @functions { 18 string getPageUrl(string url, string parameters = "") 19 { 20 return SearchEngineFriendlyURLs.GetFriendlyUrl(url.TrimStart('/') + (!string.IsNullOrEmpty(parameters) ? (!parameters.StartsWith("&") ? "&" : "") + parameters.Replace(" ", "+") : "")); 21 } 22 23 string getPageUrlById(int id = 0, string parameters = "") 24 { 25 return getPageUrl("Default.aspx?Id=" + (id > 0 ? id : Pageview.Page.ID), parameters); 26 } 27 28 string getPageUrlByNavigationTag(string tagName, string parameters = "", bool useFriendlyUrl = true) 29 { 30 var url = "Default.aspx?Id=" + GetPageIdByNavigationTag(tagName); 31 32 if (string.IsNullOrEmpty(url)) return ""; 33 else if (useFriendlyUrl) return getPageUrl(url, parameters); 34 else return "/" + url.TrimStart('/') + (!string.IsNullOrEmpty(parameters) ? (!parameters.StartsWith("&") ? "&" : "") + parameters.Replace(" ", "+") : ""); 35 } 36 37 string getLogoutUrl(bool useRedirect = true) 38 { 39 return "/Admin/Public/extranetlogoff.aspx" + (useRedirect ? "?RedirectUrl=" + Pageview.SearchFriendlyUrl : ""); 40 } 41 42 string getTranslate(string text, string defaultValue) 43 { 44 return Translate(Regex.Replace(text, "[^A-Za-z0-9:.]", ""), defaultValue); 45 } 46 47 public Dynamicweb.Environment.Cookie GetReturnCookie(string cookieName) 48 { 49 Dynamicweb.Environment.Cookie returnCookie = null; 50 if (Dynamicweb.Context.Current.Response.Cookies[cookieName] != null) 51 { 52 Dynamicweb.Environment.Cookie indexCookie = Dynamicweb.Context.Current.Response.Cookies[cookieName]; 53 if (indexCookie.Values != null && indexCookie.Values.Count > 0) 54 { 55 returnCookie = indexCookie; 56 } 57 } 58 return returnCookie; 59 } 60 } 61 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 62 @using System.Web; 63 @using Dynamicweb; 64 @using Dynamicweb.Core; 65 @using Dynamicweb.Environment; 66 @using DanskRideForbund.Domain.Core; 67 @using DanskRideForbund.DataSync.Common.Enum; 68 @using DanskRideForbund.BusinessLayer.Provider; 69 @using DanskRideForbund.Translations; 70 71 @functions 72 { 73 const bool useCommaSeparatedParamArrayValues = true; 74 const char queryValueArrayDelimiter = ','; 75 76 bool RequestParamContainsValue(string param, string value) 77 { 78 return Context.Current.Request.HasRequest(param) && (useCommaSeparatedParamArrayValues ? Context.Current.Request.QueryString[param].Split(queryValueArrayDelimiter).Contains(value) : Context.Current.Request.QueryString[param].Contains(value)); 79 } 80 81 string AddOrUpdateUrlParamValue(string absoluteUrl, string param, string newValue) 82 { 83 if (absoluteUrl == null) absoluteUrl = Context.Current.Request.Url.ToString(); 84 Uri uri = new Uri(absoluteUrl); 85 var qParts = HttpUtility.ParseQueryString(uri.Query); 86 qParts[param] = newValue; 87 return uri.AbsolutePath + "?" + qParts.ToString(); //url.AbsolutePath only returns the path portion of the URL(/ mypage.aspx); prepend url.Scheme(http) + Uri.SchemeDelimiter(://) + url.Authority 88 } 89 90 string GetPaginatedLink(int pageNum) 91 { 92 return AddOrUpdateUrlParamValue(null, "pageNum", pageNum.ToString()); 93 } 94 95 string GetTranslator(string method = "", string value = "") 96 { 97 if (!string.IsNullOrEmpty(method) && !string.IsNullOrEmpty(value)) 98 { 99 if (method == "RegionIds" || method == "RegionId") 100 { 101 return Translator.GetRegionDescription(value); 102 } 103 else if (method == "DistrictIds" || method == "DistrictId") 104 { 105 return Translator.GetDistrictDescription(value); 106 } 107 else if (method == "OfficialGroups") 108 { 109 return Translator.GetOfficialGroupDescription(value); 110 } 111 else if (method == "HorseName") 112 { 113 return value; 114 } 115 } 116 117 return Translate("SmartPage:Event." + method + "." + value, value); 118 } 119 } 120 121 @helper renderFacetEndDate(DateTime? startDate = null, DateTime? endDate = null) 122 { 123 string cookieName = "DateFilter"; 124 startDate = Context.Current.Request.HasRequest("from") ? Context.Current.Request.GetDate("from") : (startDate ?? DateTime.MinValue); 125 endDate = Context.Current.Request.HasRequest("to") ? Context.Current.Request.GetDate("to") : (endDate ?? DateTime.MinValue); 126 127 Dynamicweb.Environment.Cookie dateCookie = GetReturnCookie(cookieName); 128 if(dateCookie != null) 129 { 130 if (dateCookie.Values.AllKeys != null) 131 { 132 if (dateCookie.Values.AllKeys.Contains("from") && dateCookie.Values.AllKeys.Contains("to")) 133 { 134 startDate = DateTime.Parse(Context.Current.Response.Cookies[cookieName].Values["from"]); 135 endDate = DateTime.Parse(Context.Current.Response.Cookies[cookieName].Values["to"]); 136 } 137 } 138 } 139 140 <div class="form-group"> 141 <label class="label-lg" for="">@Translate("SmartPage:DatePicker.FacetName", "Dato")</label> 142 <div class="row no-gutters align-items-center"> 143 <div class="col"> 144 <div class="input-group input-group-sm"> 145 <div class="input-group-prepend"> 146 <span class="input-group-text"><i class="fas fa-calendar-alt"></i></span> 147 </div> 148 <input type="text" class="form-control form-control-sm js-datepicker js-onchange-submit" name="from" value="@(startDate != DateTime.MinValue ? startDate.Value.ToShortDateString() : "")" placeholder='@Translate("SmartPage:DatePicker.FromDate", "Fra dato")' /> 149 </div> 150 </div> 151 <div class="col-1 text-center">-</div> 152 <div class="col"> 153 <div class="input-group input-group-sm"> 154 <div class="input-group-prepend"> 155 <span class="input-group-text"><i class="fas fa-calendar-alt"></i></span> 156 </div> 157 <input type="text" class="form-control form-control-sm js-datepicker js-onchange-submit" name="to" value="@(endDate != DateTime.MinValue ? endDate.Value.ToShortDateString() : "")" placeholder='@Translate("SmartPage:DatePicker.ToDate", "Til dato")' /> 158 </div> 159 </div> 160 </div> 161 </div> 162 } 163 164 @helper renderFacetGroups(bool showOptionCount = false) 165 { 166 var index = 1; 167 string cookieName = "FacetFilter"; 168 169 Dynamicweb.Environment.Cookie cookie = GetReturnCookie(cookieName); 170 171 foreach (var facetGroup in GetLoop("FacetGroups")) 172 { 173 var facets = facetGroup.GetLoop("Facets"); 174 175 foreach (var facet in facets.Where(i => i.GetString("Facet.RenderType") != "DistrictCheckboxes")) 176 { 177 var showFacetOptionCount = facet.GetString("Facet.Type") == "Term" ? false : showOptionCount; 178 179 <div class="form-group"> 180 <label class="label-lg" for="">@Translate("SmartPage:Event." + facet.GetString("Facet.Name"), facet.GetString("Facet.Name"))</label> 181 @foreach (var option in facet.GetLoop("FacetOptions").OrderBy(o => o.GetString("FacetOption.Value"))) 182 { 183 var optionLabel = GetTranslator(facet.GetString("Facet.Field"), option.GetString("FacetOption.Value")); 184 bool isSelected = false; 185 186 if (facet.GetString("Facet.RenderType") == "ResultsCheckboxes" && option.GetString("FacetOption.Value") == "RankingPoints" && !Converter.ToBoolean(Pageview.Area.Item["EnableRankingSystem"])) 187 { 188 continue; 189 } 190 191 if (facet.GetString("Facet.RenderType") == "RegionCheckboxes") 192 { 193 var facetChild = facets.FirstOrDefault(i => i.GetString("Facet.RenderType") == "DistrictCheckboxes"); 194 if (facetChild != null) 195 { 196 var districtProvider = new DistrictProvider(HttpContext.Current.Server, DataArea.Go); 197 var districts = districtProvider.GetDistrictsByRegionIdCached(option.GetString("FacetOption.Value")).Select(i => i.DistrictId).ToArray(); 198 199 foreach (var optionChild in facetChild.GetLoop("FacetOptions").Where(i => districts.Contains(i.GetString("FacetOption.Value")))) 200 { 201 if (optionChild.GetBoolean("FacetOption.Selected")) 202 { 203 isSelected = optionChild.GetBoolean("FacetOption.Selected"); 204 } 205 } 206 } 207 208 if (!isSelected) 209 { 210 isSelected = option.GetBoolean("FacetOption.Selected"); 211 } 212 } 213 else 214 { 215 isSelected = option.GetBoolean("FacetOption.Selected"); 216 217 if (cookie != null && cookie.Values != null) 218 { 219 string value = cookie.Values[facet.GetString("Facet.QueryParameter")]; 220 221 if (!string.IsNullOrEmpty(value) && !string.IsNullOrEmpty(option.GetString("FacetOption.Value"))) 222 { 223 if (value.Contains(option.GetString("FacetOption.Value"))) 224 { 225 isSelected = true; 226 } 227 else 228 { 229 isSelected = false; 230 } 231 } 232 } 233 } 234 235 <div class="form-check"> 236 <input type="checkbox" class="form-check-input js-onchange-submit js-onchange-uncheck" id="@("option-" + index)" name="@facet.GetString("Facet.QueryParameter")" value="@option.GetString("FacetOption.Value")" checked="@isSelected" /> 237 <label class="form-check-label" for="@("option-" + (index++))"> 238 @optionLabel 239 @if (showFacetOptionCount) 240 { 241 <span class="count">(@option.GetValue("FacetOption.Count"))</span> 242 } 243 </label> 244 </div> 245 246 if (isSelected && facet.GetString("Facet.RenderType") == "RegionCheckboxes") 247 { 248 var facetChild = facets.FirstOrDefault(i => i.GetString("Facet.RenderType") == "DistrictCheckboxes"); 249 if (facetChild != null) 250 { 251 var districtProvider = new DistrictProvider(HttpContext.Current.Server, DataArea.Go); 252 var districts = districtProvider.GetDistrictsByRegionIdCached(option.GetString("FacetOption.Value")).Select(i => i.DistrictId).ToArray(); 253 254 foreach (var optionChild in facetChild.GetLoop("FacetOptions").Where(i => districts.Contains(i.GetString("FacetOption.Value")))) 255 { 256 var optionChildLabel = GetTranslator(facetChild.GetString("Facet.Field"), optionChild.GetString("FacetOption.Value")); 257 258 <div class="form-check form-check-child"> 259 <input type="checkbox" class="form-check-input js-onchange-submit" id="@("option-" + index)" name="@facetChild.GetString("Facet.QueryParameter")" value="@optionChild.GetString("FacetOption.Value")" checked="@optionChild.GetBoolean("FacetOption.Selected")" /> 260 <label class="form-check-label" for="@("option-" + (index++))"> 261 @optionChildLabel 262 @if (showFacetOptionCount) 263 { 264 <span class="count">(@optionChild.GetValue("FacetOption.Count"))</span> 265 } 266 </label> 267 </div> 268 } 269 } 270 } 271 } 272 </div> 273 } 274 } 275 } 276 277 @helper renderAccordionRider(int registerStep = 1, string attrName = "rider") 278 { 279 var riderLoop = GetLoop("RiderLoop"); 280 281 <div class="accordion js-accordion js-checkmark" id="accordion-rider"> 282 <h4> 283 <span class="d-inline-block bullet" data-toggle="tooltip" data-trigger="click" data-placement="top" data-html="true" title="@GetString("SmartPage:Event.Rider.HelperText")">@registerStep</span> 284 @Translate("SmartPage:Event.ChooseRider", "Vælg rytter/person") 285 <span class="checkmark d-none"><i class="fas fa-check text-success"></i></span> 286 </h4> 287 <div class="form-group m-0"> 288 <label class="accordion-toggle" data-toggle="collapse" data-target="#collapseFavRider" aria-expanded="true" aria-controls="collapseFavRider"><i class="@("fas fa-chevron-" + (riderLoop.Any() ? "down" : "right"))"></i> @Translate("SmartPage:Event.ChooseFromRiders", "Vælg fra Mine Ryttere")</label> 289 <div id="collapseFavRider" class="@("collapse" + (riderLoop.Any() ? " show" : ""))" aria-labelledby="collapseFavRider" data-parent="#accordion-rider"> 290 <div class="mb-3"> 291 <select class="form-control form-control-sm select2-single js-select2" id="search-for-rider" name="@attrName" data-placeholder="@Translate("SmartPage:Event.ChooseOption", "Vælg...")" data-select2-MinimumResultsForSearch="-1" data-select2-AllowClear="true"> 292 @foreach (var i in riderLoop) 293 { 294 <option value="@i.GetString("SmartPage:RiderId")" selected="@i.GetBoolean("SmartPage:IsDefault")">@i.GetString("SmartPage:RiderName")</option> 295 } 296 </select> 297 </div> 298 </div> 299 </div> 300 <div class="form-group m-0"> 301 <label class="accordion-toggle" data-toggle="collapse" data-target="#collapseAllRiders" aria-expanded="true" aria-controls="collapseAllRiders"><i class="@("fas fa-chevron-" + (!riderLoop.Any() ? "down" : "right"))"></i> @Translate("SmartPage:Event.ChooseFromAllRiders", "Vælg blandt alle ryttere/personer")</label> 302 <div id="collapseAllRiders" class="@("collapse" + (!riderLoop.Any() ? " show" : ""))" aria-labelledby="collapseAllRiders" data-parent="#accordion-rider"> 303 <select class="form-control form-control-sm select2-single js-select2" id="search-all-rider" name="@attrName" data-placeholder="@Translate("SmartPage:Event.Rider.ChooseOption", "Indtast email eller DRF-nummer")" data-select2-provider="/services/ProfileService.asmx/GetRiderSuggestions?Rider=true"></select> 304 </div> 305 </div> 306 </div> 307 } 308 309 @helper renderAccordionHorse(int registerStep = 1, string attrName = "horse") 310 { 311 var horseLoop = GetLoop("HorseLoop"); 312 313 <div class="accordion js-accordion js-checkmark" id="accordion-horse"> 314 <h4> 315 <span class="d-inline-block bullet" data-toggle="tooltip" data-trigger="click" data-placement="top" data-html="true" title="@GetString("SmartPage:Event.Horse.HelperText")">@registerStep</span> 316 @Translate("SmartPage:Event.ChooseHorse", "Vælg hest") 317 <span class="checkmark d-none"><i class="fas fa-check text-success"></i></span> 318 </h4> 319 <div class="form-group m-0"> 320 <label class="accordion-toggle" data-toggle="collapse" data-target="#collapseFavHorse" aria-expanded="true" aria-controls="collapseFavHorse"><i class="@("fas fa-chevron-" + (horseLoop.Any() ? "down" : "right"))"></i> @Translate("SmartPage:Event.ChooseFromHorses", "Vælg fra Mine Heste")</label> 321 <div id="collapseFavHorse" class="@("collapse" + (horseLoop.Any() ? " show" : ""))" aria-labelledby="collapseFavHorse" data-parent="#accordion-horse"> 322 <div class="mb-3"> 323 <select class="form-control form-control-sm select2-single js-select2" id="search-for-horse" name="@attrName" data-placeholder="@Translate("SmartPage:Event.ChooseOption", "Vælg...")" data-select2-MinimumResultsForSearch="-1" data-select2-AllowClear="true"> 324 @foreach (var i in horseLoop) 325 { 326 <option value="@i.GetString("SmartPage:HorseId")" selected="@i.GetBoolean("SmartPage:IsDefault")">@i.GetString("SmartPage:HorseName") (@i.GetString("SmartPage:HorseDisplayId"))</option> 327 } 328 </select> 329 </div> 330 </div> 331 </div> 332 <div class="form-group m-0"> 333 <label class="accordion-toggle" data-toggle="collapse" data-target="#collapseAllHorses" aria-expanded="true" aria-controls="collapseAllHorses"><i class="@("fas fa-chevron-" + (!horseLoop.Any() ? "down" : "right"))"></i> @Translate("SmartPage:Event.ChooseFromAllHorses", "Vælg blandt alle heste")</label> 334 <div id="collapseAllHorses" class="@("collapse" + (!horseLoop.Any() ? " show" : ""))" aria-labelledby="collapseAllHorses" data-parent="#accordion-horse"> 335 <select class="form-control form-control-sm select2-single js-select2" id="search-all-horse" name="@attrName" data-placeholder="@Translate("SmartPage:Event.Horse.ChooseOption", "Indtast Id nummer")" data-select2-provider="/services/ProfileService.asmx/GetHorseSuggestions?Horse=true"></select> 336 </div> 337 </div> 338 </div> 339 } 340 341 @helper renderAccordionClub(int registerStep = 1, string attrName = "club") 342 { 343 var clubLoop = GetLoop("ClubLoop"); 344 345 <div class="accordion js-accordion js-checkmark" id="accordion-club"> 346 <h4> 347 <span class="d-inline-block bullet" data-toggle="tooltip" data-trigger="click" data-placement="top" data-html="true" title="@GetString("SmartPage:Event.Club.HelperText")">@registerStep</span> 348 @Translate("SmartPage:Event.ChooseClub", "Vælg klub") 349 <span class="checkmark d-none"><i class="fas fa-check text-success"></i></span> 350 </h4> 351 <div class="form-group m-0"> 352 <label class="accordion-toggle" data-toggle="collapse" data-target="#collapseFavClub" aria-expanded="true" aria-controls="collapseFavClub"><i class="@("fas fa-chevron-" + (clubLoop.Any() ? "down" : "right"))"></i> @Translate("SmartPage:Event.ChooseFromClubs", "Vælg fra Mine Klubber")</label> 353 <div id="collapseFavClub" class="@("collapse" + (clubLoop.Any() ? " show" : ""))" aria-labelledby="collapseFavClub" data-parent="#accordion-club"> 354 <div class="mb-3"> 355 <select class="form-control form-control-sm select2-single mb-3 js-select2" id="search-for-club" name="@attrName" data-placeholder="@Translate("SmartPage:Event.ChooseOption", "Vælg...")" data-select2-MinimumResultsForSearch="-1" data-select2-AllowClear="true"> 356 @foreach (var i in clubLoop) 357 { 358 <option value="@i.GetString("SmartPage:ClubId")" selected="@i.GetBoolean("SmartPage:IsDefault")">@i.GetString("SmartPage:ClubName")</option> 359 } 360 </select> 361 </div> 362 </div> 363 </div> 364 <div class="form-group m-0"> 365 <label class="accordion-toggle" data-toggle="collapse" data-target="#collapseAllClubs" aria-expanded="true" aria-controls="collapseAllClubs"><i class="@("fas fa-chevron-" + (!clubLoop.Any() ? "down" : "right"))"></i> @Translate("SmartPage:Event.ChooseFromAllClubs", "Vælg blandt alle klubber")</label> 366 <div id="collapseAllClubs" class="@("collapse" + (!clubLoop.Any() ? " show" : ""))" aria-labelledby="collapseAllClubs" data-parent="#accordion-club"> 367 <select class="form-control form-control-sm select2-single js-select2" id="search-all-club" name="@attrName" data-placeholder="@Translate("SmartPage:Event.Club.ChooseOption", "Indtast navn/fork")" data-select2-provider="@getPageUrlByNavigationTag("ClubSearchPage", "Club=true")"></select> 368 </div> 369 </div> 370 </div> 371 } 372 373 @helper renderAccordionComment(int registerStep = 1, string attrName = "comment") 374 { 375 <div> 376 <h4> 377 <span class="d-inline-block bullet" data-toggle="tooltip" data-trigger="click" data-placement="top" data-html="true" title="@GetString("SmartPage:Event.Club.HelperText")">@registerStep</span> 378 @Translate("SmartPage:Event.ChooseComments", "Bemærkning") 379 </h4> 380 <textarea class="form-control form-control-sm js-maxlength js-validate" id="comment" name="comment" maxlength="255" data-maxlength="#js-maxlength" data-validation-message="Du har indtastet et ugyldigt tegn i bemærknings feltet. Fjern tegnet og prøv igen."></textarea> 381 <span class="help-inline maxlength">Tegn tilbage <span id="js-maxlength"></span></span> 382 </div> 383 } 384 385 @helper renderPagination(int _pagecount, int _currentpage) 386 { 387 var groupAmount = 5; 388 var isDotsPrinted = false; 389 390 @*<ul class="pagination"> 391 <li class="page-item disabled"> 392 <a class="page-link" href="#" tabindex="-1">Previous</a> 393 </li> 394 <li class="page-item"><a class="page-link" href="#">1</a></li> 395 <li class="page-item active"> 396 <a class="page-link" href="#">2 <span class="sr-only">(current)</span></a> 397 </li> 398 <li class="page-item"><a class="page-link" href="#">3</a></li> 399 <li class="page-item"> 400 <a class="page-link" href="#">Next</a> 401 </li> 402 </ul>*@ 403 404 if (_pagecount > 1) 405 { 406 <ul class="pagination pagination-sm"> 407 @{ 408 if (_currentpage > 1) 409 { 410 <li class="page-item"><a href="@GetPaginatedLink(_currentpage - 1)" class="page-link">&lt; Forrige</a></li> 411 } 412 413 for (int i = 1; i <= _pagecount; i++) 414 { 415 if (i != _currentpage) 416 { 417 if (i == 1 || (i >= (_currentpage - 2) && (i < _currentpage || i <= groupAmount)) || (i <= (_currentpage + 2) && (i > _currentpage || i >= (_pagecount - groupAmount))) || i == _pagecount) 418 { 419 <li class="page-item"><a href="@GetPaginatedLink(i)" class="page-link" data-page="@i">@i</a></li> 420 } 421 else if (!isDotsPrinted) 422 { 423 <li class="page-item disabled"><span class="page-link">..</span></li> 424 isDotsPrinted = true; 425 } 426 } 427 else 428 { 429 <li class="page-item active"><a href="@GetPaginatedLink(i)" class="page-link" data-page="@i">@i</a></li> 430 isDotsPrinted = false; 431 } 432 } 433 434 if (_currentpage < _pagecount) 435 { 436 <li class="page-item"><a href="@GetPaginatedLink(_currentpage + 1)" class="page-link">Næste &gt;</a></li> 437 } 438 } 439 </ul> 440 } 441 } 442 443 @helper renderPageSizeDropdown(string _attributeId, int _currentPageSize, List<int> _availablePageSizes, bool showOptionAll) 444 { 445 var url = Converter.ToString(Context.Current.Request.RawUrl); 446 url = QueryHelper.ReplaceQueryStringParam(url, "pagenum", "1"); 447 <div class="pagination-size"> 448 <select class="form-control form-control-sm js-select2 js-onchange-href" id='@_attributeId' name="pagesize" autocomplete="off" data-select2-minimumResultsForSearch="-1"> 449 @foreach (var size in _availablePageSizes) 450 { 451 <option value="@QueryHelper.ReplaceQueryStringParam(url, "pagesize", Converter.ToString(size))" selected="@(size == _currentPageSize)">@string.Format(Translate("SmartPage:PageSize.Item", "vis {0}"), size)</option> 452 } 453 @if (showOptionAll) 454 { 455 <option value="@QueryHelper.ReplaceQueryStringParam(url, "pagesize", Converter.ToString(999999))" selected="@(999999 == _currentPageSize)">@Translate("SmartPage:PageSize.AllItems", "vis alle")</option> 456 } 457 </select> 458 </div> 459 } 460 461 @helper renderOrderByDropdown(string _attributeId, Dictionary<string, string> _availableOrderbys) 462 { 463 var urlPath = System.Web.HttpContext.Current.Request.Url.PathAndQuery; 464 465 <div class="pagination-orderby"> 466 @Translate("Smartpage:GlobalHelper.OrderBy.Label", "Sorter efter:")&nbsp;&nbsp; 467 </div> 468 <div class="pagination-orderby"> 469 <select class="form-control form-control-sm js-select2 js-onchange-href" id='@_attributeId' name="orderby" autocomplete="off" data-select2-minimumResultsForSearch="-1"> 470 @foreach (var option in _availableOrderbys) 471 { 472 <option value="@option.Value" selected="@(urlPath.ToLower() == option.Value.ToLower())">@option.Key</option> 473 } 474 </select> 475 </div> 476 } 477 478 @functions { 479 string displayMode(string defaultMode = "table") 480 { 481 if (!string.IsNullOrEmpty(Context.Current.Request.GetString("display-mode"))) 482 { 483 Context.Current.Session["SmartPage:Event.DisplayMode"] = Context.Current.Request.GetString("display-mode"); 484 } 485 else if (string.IsNullOrEmpty(Converter.ToString(Context.Current.Session["SmartPage:Event.DisplayMode"]))) 486 { 487 Context.Current.Session["SmartPage:Event.DisplayMode"] = defaultMode; 488 } 489 490 return Converter.ToString(Context.Current.Session["SmartPage:Event.DisplayMode"]); 491 } 492 } 493 494 @helper renderDisplayMode(string mode = "table") // options: 'table' and 'grid' 495 { 496 var url = Converter.ToString(Context.Current.Request.RawUrl); 497 498 <div class="list-display-type btn-group" role="group" aria-label="Display mode"> 499 <a href='@QueryHelper.ReplaceQueryStringParam(url, "display-mode", "table")' class="btn btn-secondary btn-sm" disabled="@(mode == "table")"><i class="fas fa-bars"></i></a> 500 <a href='@QueryHelper.ReplaceQueryStringParam(url, "display-mode", "grid")' class="btn btn-secondary btn-sm" disabled="@(mode == "grid")"><i class="fas fa-th"></i></a> 501 </div> 502 } 503 @functions 504 { 505 public class Modal 506 { 507 public string id { get; set; } 508 public string header { get; set; } 509 public string message { get; set; } 510 public List<ModalOption> options { get; set; } 511 } 512 513 public class ModalOption 514 { 515 public string name { set; get; } 516 public string href { set; get; } 517 public Dictionary<string, string> form { set; get; } 518 public string style { set; get; } 519 public bool dismiss { set; get; } 520 public Dictionary<string, string> attributes { set; get; } = new Dictionary<string, string>(); 521 } 522 } 523 524 @helper RenderModal(Modal settings) 525 { 526 <div class="modal fade" id="@settings.id" tabindex="-1" role="dialog" aria-labelledby="@(settings.id + "Label")" aria-hidden="true"> 527 <div class="modal-dialog modal-dialog-centered" role="document"> 528 <div class="modal-content"> 529 <div class="modal-header"> 530 @if (!string.IsNullOrEmpty(settings.header)) 531 { 532 <h5 class="modal-title" id="@(settings.id + "Label")">@settings.header</h5> 533 } 534 <button type="button" class="close" data-dismiss="modal" aria-label="@Translate("Smartpage:Modal.Close", "Close")"> 535 <span aria-hidden="true">&times;</span> 536 </button> 537 </div> 538 @if (!string.IsNullOrEmpty(settings.message)) 539 { 540 <div class="modal-body"> 541 @settings.message 542 </div> 543 } 544 @if (settings.options != null && settings.options.Count() > 0) 545 { 546 <div class="modal-footer"> 547 @foreach (ModalOption option in settings.options) 548 { 549 var optionStyle = "btn" + (!string.IsNullOrEmpty(option.style) ? " " + option.style : " btn-secondary"); 550 551 if (!string.IsNullOrEmpty(option.href)) 552 { 553 if (option.form != null) 554 { 555 <form method="post" action="@option.href"> 556 @foreach (var i in option.form) 557 { 558 <input type="hidden" name="@i.Key" value="@i.Value" /> 559 } 560 <button type="submit" class="@optionStyle">@option.name</button> 561 </form> 562 } 563 else 564 { 565 <a href="@option.href" class="@optionStyle">@option.name</a> 566 } 567 } 568 else 569 { 570 <button type="button" class="@optionStyle" data-dismiss="@(option.dismiss ? "modal" : "")" @{ foreach (var att in option.attributes) { @(" data-" + att.Key + "=\"" + Dynamicweb.Core.Encoders.HtmlEncoder.HtmlAttributeEncode(att.Value) + "\"") } }>@option.name</button> 571 } 572 } 573 </div> 574 } 575 </div> 576 </div> 577 </div> 578 } 579 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 580 @using Dynamicweb; 581 @using Dynamicweb.Environment; 582 583 @*TODO: Set translation *@ 584 585 @functions 586 { 587 public class HorsesFacet 588 { 589 public string AnimalAccount { get; set; } 590 public string HorseName { get; set; } 591 public int Count { get; set; } 592 } 593 } 594 595 @helper RenderResultSearchBox() 596 { 597 var requestQ = Context.Current.Request.GetString("q"); 598 var requestClub = Context.Current.Request.GetString("club"); 599 var requestClubId = Context.Current.Request.GetString("clubid"); 600 601 if (!string.IsNullOrEmpty(requestClub)) 602 { 603 if (!string.IsNullOrEmpty(requestClubId)) 604 { 605 <input type="hidden" class="js-select2-remove" name="ClubId" value="@requestClubId" /> 606 } 607 608 <input type="hidden" class="js-select2-remove" name="Club" value="@requestClub" /> 609 } 610 611 <fieldset class="filter"> 612 <legend class="header">@Translate("SmartPage:ResultHelper.SearchLegend", "Søg")</legend> 613 <div class="p-3"> 614 <div class="form-group"> 615 <select class="form-control form-control-sm js-select2" id="search-for-result" name="q" data-placeholder="@Translate("SmartPage:Course.SearchDefault", "Arrangør/fork/navn")" data-select2-provider="@getPageUrlByNavigationTag("ResultSearchPage")" required="@true"> 616 @if (!string.IsNullOrEmpty(requestClub)) 617 { 618 <option value="@requestClub" selected="@true">@requestClub</option> 619 } 620 else if (!string.IsNullOrEmpty(requestQ)) 621 { 622 <option value="@requestQ" selected="@true">@requestQ</option> 623 } 624 </select> 625 </div> 626 <div class="mt-2 text-right"> 627 <a href='@getPageUrlById()' class="btn btn-secondary btn-sm float-left" title="">@Translate("SmartPage:ResultHelper.ClearFilter", "Nulstil kalender")</a> 628 <button type="submit" class="btn btn-primary btn-sm" id="search-result-button">@Translate("SmartPage:ResultHelper.SearchButton", "Go!")</button> 629 </div> 630 </div> 631 </fieldset> 632 } 633 634 @helper RenderRiderHorseSearchBox(List<LoopItem> results, bool disabled = false) 635 { 636 <fieldset class="filter"> 637 <legend class="header">@Translate("SmartPage:ResultHelper.SearchLegend", "Søg")</legend> 638 <div class="p-3"> 639 <div class="form-group"> 640 @RenderRiderFormGroup(results, disabled) 641 </div> 642 <div class="form-group mt-2"> 643 @RenderHorseFormGroup(results, disabled) 644 </div> 645 <div class="mt-2 text-right"> 646 <a href='@getPageUrlById()' class="btn btn-secondary btn-sm float-left" title="">@Translate("SmartPage:Rider.ClearSearch", "Nulstil søgning")</a> 647 <button type="submit" class="btn btn-primary search-button btn-sm" id="search-result-riderhorse-button">@Translate("SmartPage:Event.Result.SearchButton", "Go!")</button> 648 @if (!string.IsNullOrWhiteSpace(HttpContext.Current.Request.QueryString.Get("Rider"))) 649 { 650 <button type="button" class="btn btn-secondary btn-toggle-filters btn-sm mt-2 d-sm-none js-show-filters">@Translate("Vis alle filtre")</button> 651 } 652 </div> 653 </div> 654 </fieldset> 655 } 656 657 @helper RenderRiderFormGroup(List<LoopItem> results, bool disabled = false) 658 { 659 var requestRider = HttpUtility.UrlDecode(Context.Current.Request.GetString("rider")); 660 var requestRiderId = Context.Current.Request.GetString("riderid"); 661 662 <input type="hidden" class="js-select2-clear" name="Rider" value="@requestRider" autocomplete="off" /> 663 664 <label for="search-for-rider">@Translate("Smartpage:ResultPageRiderHorse.Rider", "Rytter")</label> 665 <select class="form-control form-control-sm js-select2" id="search-for-rider" name="RiderId" placeholder="@Translate("SmartPage:Event.Rider.SearchDefault", "Navn eller DRF-nummer")" data-select2-provider="/services/ProfileService.asmx/GetRiderSuggestions?Rider=true" disabled="@disabled"> 666 @if (!string.IsNullOrEmpty(requestRider) && !string.IsNullOrEmpty(requestRiderId)) 667 { 668 <option value="@requestRiderId" selected="@true">@requestRider</option> 669 } 670 </select> 671 } 672 673 @helper RenderHorseFormGroup(List<LoopItem> results, bool disabled = false) 674 { 675 var requestHorse = HttpUtility.UrlDecode(Context.Current.Request.GetString("horse")); 676 var requestHorseId = Context.Current.Request.GetString("horseid"); 677 678 <input type="hidden" class="js-select2-clear" name="Horse" value="@requestHorse" autocomplete="off" /> 679 680 <label for="search-for-horse">@Translate("Smartpage:ResultPageRiderHorse.Horse", "Hest")</label> 681 <select class="form-control form-control-sm js-select2" id="search-for-horse" name="HorseId" placeholder="@Translate("SmartPage:Event.Horse.SearchDefault", "Navn eller id-nummer")" data-select2-provider="/services/ProfileService.asmx/GetHorseSuggestions?Horse=true" disabled="@disabled"> 682 @if (!string.IsNullOrEmpty(requestHorse) && !string.IsNullOrEmpty(requestHorseId)) 683 { 684 <option value="@requestHorseId" selected="@true">@requestHorse</option> 685 } 686 </select> 687 } 688 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 689 690 @helper RenderNewsColumn(int amountOfArticlesToRender = 3, bool hideOnMobile = false) 691 { 692 var newsPageLink = $"/Default.aspx?ID={GetPageIdByNavigationTag("NewsList")}"; 693 var newsDataUrl = $"/Default.aspx?ID={GetPageIdByNavigationTag("NewsColumns")}&Redirect=False"; 694 695 <div class="js-news-row news-column shadow @(hideOnMobile ? "d-none d-sm-block" : "")" data-newsurl="@newsDataUrl" data-pagesize="@amountOfArticlesToRender"> 696 <div class="news-column-header d-flex flex-column flex-sm-row align-items-start align-items-sm-center justify-content-between text-white p-3"> 697 <h3 class="my-0 my-sm-1"><span class="font-weight-bold mr-1">@Translate("Nyheder fra")</span>@Translate("Dansk RideForbund")</h3> 698 <a href="@newsPageLink" class="text-white">@Translate("Flere nyheder")</a> 699 </div> 700 <div class="p-3"> 701 @for (int i = 0; i < amountOfArticlesToRender; i++) 702 { 703 <div class="js-drf-article news-column-article d-flex flex-column" data-index="@i"> 704 <div class="d-flex justify-content-between gap"> 705 <div class="news-column-article-desc js-news-articledesc d-flex flex-column"> 706 <div class="mb-1 skeleton skeleton-text skeleton-date"></div> 707 <div class="mb-1 skeleton skeleton-text"></div> 708 <div class="mb-1 skeleton skeleton-text"></div> 709 </div> 710 <div class="news-column-article-img js-news-articleimage skeleton"></div> 711 </div> 712 <hr /> 713 </div> 714 } 715 </div> 716 </div> 717 } 718 719 @functions 720 { 721 Dictionary<string, string> translateCache = new Dictionary<string, string>(); 722 Regex rgx = new Regex("(?<={{).*?(?=}})", RegexOptions.Compiled); 723 724 public string replaceTranslateInString(string input = "") 725 { 726 foreach (Match match in rgx.Matches(input)) 727 { 728 var translation = ""; 729 var occurrence = match.ToString(); 730 731 if (!translateCache.TryGetValue(occurrence, out translation)) 732 { 733 translation = Translate(occurrence, ".."); 734 translateCache.Add(occurrence, translation); 735 } 736 737 if (!string.IsNullOrEmpty(translation)) 738 { 739 input = input.Replace("{{" + occurrence + "}}", translation); 740 } 741 } 742 743 return input; 744 } 745 } 746 747 @{ 748 var requestRider = Context.Current.Request.GetString("rider"); 749 var requestHorse = Context.Current.Request.GetString("horse"); 750 var isSearch = (!string.IsNullOrEmpty(requestRider) || !string.IsNullOrEmpty(requestHorse)); 751 var results = GetLoop("QueryResultItem"); 752 var resultCount = results.Count; 753 var resultIndex = 1; 754 List<int> resultsPageSizes = new List<int>() { { 30 }, { 60 }, { 90 } }; 755 } 756 757 <div class="row"> 758 <h1 class="col-12">@Pageview.CurrentParagraph.Header <span id="entries-total">@(isSearch && GetInteger("QueryResult.TotalCount") > 0 ? string.Format("({0})", GetInteger("QueryResult.TotalCount")) : "")</span></h1> 759 </div> 760 <div class="row"> 761 <div class="col-md-3 sidebar"> 762 <form class="js-form-facets" method="GET" action="@getPageUrlById()" data-form-empty="#js-form-empty"> 763 <div class="shadow"> 764 @RenderRiderHorseSearchBox(results) 765 </div> 766 <div class="submenu"> 767 @RenderNavigation(new { ParentTag = "results", StartLevel = 3, EndLevel = 3, Template = "SubMenu.xslt", ExpandMode = "all", Style = "shadow pt-2", Heading = "Find andre resultater", HeadingStyle = "h4" }) 768 </div> 769 @if (isSearch) 770 { 771 <div class="shadow p-3 d-none d-sm-block js-facets"> 772 @renderFacetEndDate() 773 @renderFacetGroups(true) 774 @if (Pageview.Device == Dynamicweb.Frontend.Devices.DeviceType.Mobile && !string.IsNullOrWhiteSpace(HttpContext.Current.Request.QueryString.Get("Rider"))) 775 { 776 <button type="button" class="btn btn-secondary btn-toggle-filters btn-sm mt-2 js-hide-filters d-none">@Translate("Luk alle filtre")</button> 777 } 778 </div> 779 } 780 </form> 781 @*<script>googletag.cmd.push(function() { 782 var YBmapping = googletag.sizeMapping().addSize([1320, 0], [300, 250]).addSize([0, 0], []).build(); 783 googletag.defineSlot('/21809957681/22594984617/Lagardere/drf/rideforbund.dk/rectangle_1', [[300, 250]], 'div-gpt-ad-rectangle_1').defineSizeMapping(YBmapping).addService(googletag.pubads()); 784 googletag.enableServices(); 785 });</script> 786 <div id='div-gpt-ad-rectangle_1'> 787 <script>googletag.cmd.push(function() { 788 googletag.display('div-gpt-ad-rectangle_1'); 789 });</script> 790 </div>*@ 791 792 <div id="div-gpt-ad-rectangle_1" class="ad-box"></div> 793 <script> 794 window.Quickwrap.cmd.push(function () { 795 window.Quickwrap.display("div-gpt-ad-rectangle_1") 796 }) 797 </script> 798 799 800 </div> 801 <div class="col-md-9"> 802 <div class="row"> 803 <div class="col-12 col-md-6"> 804 @RenderNewsColumn(2, true) 805 </div> 806 <div class="col-12 col-md-6"> 807 @RenderSnippet("dwbanner") 808 </div> 809 </div> 810 811 @if (isSearch) 812 { 813 if (results.Any()) 814 { 815 <div class="pagination-container pagination-top result-rider-horse"> 816 @renderPagination(GetInteger("DwPaging.PageCount"), GetInteger("DwPaging.CurrentPage")) 817 @renderPageSizeDropdown("pagesize-top", GetInteger("DwPaging.PageSize"), resultsPageSizes, true) 818 </div> 819 <table class="table table-condensed table-hover table-striped shadow"> 820 <thead> 821 <tr> 822 <th>@Translate("SmartPage:Event.Result.Date", "Dato")</th> 823 <th>@Translate("SmartPage:Event.Result.RiderHorse", "Rytter & Hest")</th> 824 <th>@Translate("SmartPage:Event.Result.EventClass", "Stævne & Klasse")</th> 825 <th>@Translate("SmartPage:Event.Result.ResultClassification", "Resultat & Kat. point")</th> 826 <th>@Translate("SmartPage:Event.Result.Ranking", "Placering")</th> 827 </tr> 828 </thead> 829 <tbody> 830 @foreach (LoopItem i in results) 831 { 832 var riderLink = getPageUrlByNavigationTag("RiderPage", "RiderId=" + i.GetString("RelationAccount")); 833 var horseLink = getPageUrlByNavigationTag("HorsePage", "HorseId=" + i.GetString("AnimalAccount")); 834 var resultLink = getPageUrlByNavigationTag("ResultPage", "EventId=" + i.GetString("EventId")); 835 var sectionLink = getPageUrlByNavigationTag("ResultSectionPage", "EventId=" + i.GetString("EventId") + "&SectionId=" + i.GetString("SectionId")); 836 837 <tr> 838 <td>@i.GetDate("EventDate").ToShortDateString()</td> 839 <td> 840 <div><a href='@riderLink' title="">@i.GetString("RiderName")</a></div> 841 <div><a href='@horseLink' title="">@i.GetString("HorseName")</a></div> 842 </td> 843 <td> 844 <div><a href='@resultLink' title="">@i.GetString("EventName")</a></div> 845 <div> 846 <a href="@sectionLink" title=""> 847 @Translate("Smartpage.Result.Discipline." + i.GetString("MainSection"), i.GetString("MainSection")) @i.GetString("SectionName") 848 @(!string.IsNullOrEmpty(i.GetString("SubSectionProgram")) ? string.Format("- {0}", i.GetString("SubSectionProgram")) : "") 849 @(!string.IsNullOrEmpty(i.GetString("SectionLevel")) ? string.Format("({0})", i.GetString("SectionLevel")) : "") 850 @(!string.IsNullOrEmpty(i.GetString("DifficultyLevel")) ? string.Format("({0})", i.GetString("DifficultyLevel")) : "") 851 </a> 852 </div> 853 </td> 854 <td> 855 <div>@replaceTranslateInString(i.GetString("ResultStr"))</div> 856 <div>@i.GetString("ClassificationPoints")</div> 857 </td> 858 <td> 859 @if (i.GetInteger("Ranking") > 0) 860 { 861 @i.GetString("Ranking") 862 if (!i.GetBoolean("IsB0")) 863 { 864 var rankSrc = "/files/images/rosetter/0" + i.GetString("Ranking") + ".png"; 865 866 switch (i.GetInteger("Ranking")) 867 { 868 case 1: 869 case 2: 870 case 3: 871 <img src="@rankSrc" alt="@i.GetString("Ranking")" /> 872 break; 873 874 default: 875 <img src="/files/images/rosetter/04-.png" alt="@i.GetString("Ranking")" /> 876 break; 877 } 878 } 879 else 880 { 881 <img src="/files/images/rosetter/B0.png" alt="Ingen fejl" /> 882 } 883 } 884 </td> 885 </tr> 886 if (resultIndex == 5) 887 { 888 <tr> 889 <td colspan="5" class="ad-banner"> 890 @if (Pageview.Device == Dynamicweb.Frontend.Devices.DeviceType.Mobile) 891 { 892 @*<script> 893 googletag.cmd.push(function () { 894 var YBmapping = googletag.sizeMapping().addSize([0, 0], [300, 250]).addSize([768, 0], []).build(); 895 googletag.defineSlot('/21809957681/22594984617/Lagardere/drf/rideforbund.dk/mobile_1', [[300, 250]], 'div-gpt-ad-mobile_1').defineSizeMapping(YBmapping).addService(googletag.pubads()); 896 googletag.enableServices(); 897 });</script> 898 <div id='div-gpt-ad-mobile_1'> 899 <script> 900 googletag.cmd.push(function () { 901 googletag.display('div-gpt-ad-mobile_1'); 902 });</script> 903 </div>*@ 904 905 <div id="div-gpt-ad-mobile_1" class="ad-box js-copy-here"></div> 906 <script> 907 window.Quickwrap.cmd.push(function () { 908 window.Quickwrap.display("div-gpt-ad-mobile_1"); 909 }) 910 </script> 911 912 } 913 else 914 { 915 @*<script> 916 googletag.cmd.push(function () { 917 var YBmapping = googletag.sizeMapping().addSize([930, 0], [[930, 180], [728, 90]]).addSize([768, 0], [[728, 90]]).addSize([0, 0], []).build(); 918 googletag.defineSlot('/21809957681/22594984617/Lagardere/drf/rideforbund.dk/billboard_1', [[930, 180], [728, 90]], 'div-gpt-ad-billboard_1').defineSizeMapping(YBmapping).addService(googletag.pubads()); 919 googletag.enableServices(); 920 }); 921 </script> 922 <div id='div-gpt-ad-billboard_1'> 923 <script> 924 googletag.cmd.push(function () { 925 googletag.display('div-gpt-ad-billboard_1'); 926 }); 927 </script> 928 </div>*@ 929 930 <div id="div-gpt-ad-billboard_1" class="ad-box js-copy-here"></div> 931 <script> 932 window.Quickwrap.cmd.push(function () { 933 window.Quickwrap.display("div-gpt-ad-billboard_1"); 934 }) 935 </script> 936 } 937 </td> 938 </tr> 939 } 940 resultIndex++; 941 } 942 @if (resultCount < 5) 943 { 944 <tr> 945 <td colspan="5" class="ad-banner"> 946 @if (Pageview.Device == Dynamicweb.Frontend.Devices.DeviceType.Mobile) 947 { 948 @*<script> 949 googletag.cmd.push(function () { 950 var YBmapping = googletag.sizeMapping().addSize([0, 0], [300, 250]).addSize([768, 0], []).build(); 951 googletag.defineSlot('/21809957681/22594984617/Lagardere/drf/rideforbund.dk/mobile_1', [[300, 250]], 'div-gpt-ad-mobile_1').defineSizeMapping(YBmapping).addService(googletag.pubads()); 952 googletag.enableServices(); 953 });</script> 954 <div id='div-gpt-ad-mobile_1'> 955 <script> 956 googletag.cmd.push(function () { 957 googletag.display('div-gpt-ad-mobile_1'); 958 });</script> 959 </div>*@ 960 961 <div id="div-gpt-ad-mobile_1" class="ad-box js-copy-here"></div> 962 <script> 963 window.Quickwrap.cmd.push(function () { 964 window.Quickwrap.display("div-gpt-ad-mobile_1"); 965 }) 966 </script> 967 968 } 969 else 970 { 971 @*<script> 972 googletag.cmd.push(function () { 973 var YBmapping = googletag.sizeMapping().addSize([930, 0], [[930, 180], [728, 90]]).addSize([768, 0], [[728, 90]]).addSize([0, 0], []).build(); 974 googletag.defineSlot('/21809957681/22594984617/Lagardere/drf/rideforbund.dk/billboard_1', [[930, 180], [728, 90]], 'div-gpt-ad-billboard_1').defineSizeMapping(YBmapping).addService(googletag.pubads()); 975 googletag.enableServices(); 976 }); 977 </script> 978 <div id='div-gpt-ad-billboard_1'> 979 <script> 980 googletag.cmd.push(function () { 981 googletag.display('div-gpt-ad-billboard_1'); 982 }); 983 </script> 984 </div>*@ 985 986 <div id="div-gpt-ad-billboard_1" class="ad-box js-copy-here"></div> 987 <script> 988 window.Quickwrap.cmd.push(function () { 989 window.Quickwrap.display("div-gpt-ad-billboard_1"); 990 }) 991 </script> 992 } 993 </td> 994 </tr> 995 } 996 </tbody> 997 </table> 998 <div class="pagination-container pagination-bottom"> 999 @renderPagination(GetInteger("DwPaging.PageCount"), GetInteger("DwPaging.CurrentPage")) 1000 @renderPageSizeDropdown("pagesize-bottom", GetInteger("DwPaging.PageSize"), resultsPageSizes, true) 1001 </div> 1002 } 1003 else 1004 { 1005 <div class="content shadow"> 1006 @Translate("SmartPage:Event.Result.NoResults", "Der blev ikke fundet resultater ud fra din søgning") 1007 </div> 1008 } 1009 } 1010 else 1011 { 1012 <div class="content shadow"> 1013 @Pageview.CurrentParagraph.Text 1014 </div> 1015 } 1016 </div> 1017 </div> 1018 1019 @RenderModal(new Modal() 1020 { 1021 id = "js-form-empty", 1022 header = Translate("SmartPage:ResultsRiderHorse.Modal.Empty.Heading", "Du skal udfylde enten rytter eller hest"), 1023 message = Translate("SmartPage:ResultsRiderHorse.Modal.Empty.Message", "Du skal angive en rytter eller en hest."), 1024 options = new List<ModalOption> { 1025 new ModalOption() 1026 { 1027 name = Translate("SmartPage:Close", "Luk"), 1028 dismiss = true 1029 } 1030 } 1031 })