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