Apply
Error executing template "/Designs/Kwpn/Paragraph/HorseDatabase.cshtml"
System.IO.IOException: The process cannot access the file 'D:\inetpub\wwwroot\www.kwpn.nl\Files\Templates\Designs\Kwpn\Translations.xml' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Dynamicweb.Rendering.Translation.Source.WriteDocument(XmlDocument document)
at Dynamicweb.Rendering.Translation.Source.Save()
at Dynamicweb.Rendering.Translation.Source.UpdateTranslationSource(Source source, IEnumerable`1 newKeys, String designName, IEnumerable`1 cultures)
at Dynamicweb.Rendering.Template.TranslateText(String text, String defaultValue, String cultureName)
at Dynamicweb.Rendering.TemplateBase`1.Translate(String text)
at CompiledRazorTemplates.Dynamic.RazorEngine_a1a5a60f732646d58195a2a213cf1546.Execute() in D:\inetpub\wwwroot\www.kwpn.nl\Files\Templates\Designs\Kwpn\Paragraph\HorseDatabase.cshtml:line 3393
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 @using System 2 @using System.Linq 3 @using System.Text 4 @using Kwpn.Models.Constants 5 @using Kwpn.Repository.Helpers 6 @using Kwpn.Models.ApiModels @*Kwpn.Models.ApiModels is referenced because it is used in included pages - do not remove*@ 7 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 8 @functions { 9 string CreateHorseInfoTableRow(string label, string value, bool? capitalizeValue = false) 10 { 11 var capitalize = false; 12 if (capitalizeValue.HasValue && capitalizeValue.Value) 13 { 14 capitalize = true; 15 value = value.ToLower(); 16 } 17 var result = new StringBuilder(); 18 result.AppendLine("<div class=\"row\">"); 19 result.AppendFormat("<div class=\"col-xs-5 col-md-4\"><span class=\"label\">{0}</span></div>", label); 20 result.AppendFormat("<div class=\"col-xs-7 col-md-8\"><span class=\"value{0}\">{1}</span></div>", capitalize ? " capitalize" : "", string.IsNullOrWhiteSpace(value) ? "-" : value); 21 result.AppendLine("</div>"); 22 return result.ToString(); 23 } 24 25 string CreateInfoTableRow( 26 int sortNr, 27 string leftColumnValue, 28 string rightColumnValue, 29 bool? isHeader = false, 30 bool? capitalizeLeftColumn = false, 31 bool? capitilizeRightColumn = false, 32 bool boldLeftColumn = false, 33 bool colspanOnRightEmpty = false) 34 { 35 var capitalizeLeft = false; 36 var capitalizeRight = false; 37 38 var mod = "0"; 39 if (sortNr % 2 == 0) { mod = "1"; } 40 41 if (isHeader.HasValue && isHeader.Value) 42 { 43 leftColumnValue = string.Format("<b>{0}</b>", leftColumnValue.ToUpper()); 44 rightColumnValue = string.Format("<b>{0}</b>", rightColumnValue.ToUpper()); 45 capitalizeLeft = false; 46 capitalizeRight = false; 47 } 48 else 49 { 50 if (capitalizeLeftColumn.HasValue && capitalizeLeftColumn.Value) 51 { 52 capitalizeLeft = true; 53 leftColumnValue = leftColumnValue.ToLower(); 54 } 55 else 56 { 57 capitalizeLeft = false; 58 } 59 if (capitilizeRightColumn.HasValue && capitilizeRightColumn.Value) 60 { 61 capitalizeRight = true; 62 rightColumnValue = rightColumnValue.ToLower(); 63 } 64 else 65 { 66 capitalizeRight = false; 67 } 68 } 69 if (boldLeftColumn) 70 { 71 leftColumnValue = string.Format("<b>{0}</b>", leftColumnValue); 72 } 73 var result = new StringBuilder(); 74 result.AppendFormat("<div class=\"row mod-{0}\">", mod); 75 if (string.IsNullOrWhiteSpace(rightColumnValue) && colspanOnRightEmpty) 76 { 77 result.AppendFormat("<div class=\"col-xs-12\"><span class=\"leftValue{0}\">{1}</span></div>", capitalizeLeft ? " capitalize" : "", string.IsNullOrWhiteSpace(leftColumnValue) ? "-" : leftColumnValue); 78 } 79 else 80 { 81 result.AppendFormat("<div class=\"col-xs-5 col-md-4\"><span class=\"leftValue{0}\">{1}</span></div>", capitalizeLeft ? " capitalize" : "", string.IsNullOrWhiteSpace(leftColumnValue) ? "-" : leftColumnValue); 82 result.AppendFormat("<div class=\"col-xs-7 col-md-8\"><span class=\"rightValue{0}\">{1}</span></div>", capitalizeRight ? " capitalize" : "", string.IsNullOrWhiteSpace(rightColumnValue) ? "-" : rightColumnValue); 83 } 84 85 result.AppendLine("</div>"); 86 return result.ToString(); 87 } 88 89 } 90 @{ 91 var culture = GetGlobalValue("Global:Area.LongLang"); 92 var language = GetGlobalValue("Global:Area.Lang"); 93 94 var currentDatabaseUser = Kwpn.Repository.Repositories.KwpnUsers.CurrentUser(); 95 96 var pageService = new Dynamicweb.Content.PageService(); 97 var showGeneral = true; 98 99 // SEO: seoPage is used as base url for virtual pageviews 100 var seoPage = GetGlobalValue("Global:Pageview.Url"); 101 if (seoPage.Contains("?")) 102 { 103 seoPage = seoPage.Split('?')[0]; 104 } 105 106 // get animal code from querystring or form post, sample value: p-000306 107 var animalCode = System.Web.HttpContext.Current.Request.QueryString.Get(Translate("Horse", "Horse")); 108 if (string.IsNullOrWhiteSpace(animalCode)) { animalCode = System.Web.HttpContext.Current.Request.Form.Get(Translate("Horse", "Horse")); } 109 110 // get action from querystring or form post, sample value: evenementaanmelding 111 var actionParameter = "action"; 112 if (culture.Equals("nl-nl", StringComparison.InvariantCultureIgnoreCase)) { actionParameter = "actie"; } 113 var action = System.Web.HttpContext.Current.Request.QueryString.Get(actionParameter); 114 if (string.IsNullOrWhiteSpace(action)) { action = System.Web.HttpContext.Current.Request.Form.Get(actionParameter); } 115 116 // get action item id from querystring or form post: 117 var actionIdParameter = "actionid"; 118 if (culture.Equals("nl-nl", StringComparison.InvariantCultureIgnoreCase)) { actionIdParameter = "actieid"; } 119 var actionId = System.Web.HttpContext.Current.Request.QueryString.Get(actionIdParameter); 120 if (string.IsNullOrWhiteSpace(actionId)) { actionId = System.Web.HttpContext.Current.Request.Form.Get(actionIdParameter); } 121 122 // check redirect (for some features the user must be logged in) 123 LoginHelper.AuthorizeForDatabasePageContent(culture, action, actionId, animalCode); 124 125 var memberhipPageId = AreaHelper.GetAreaItemStringValueBySystemName(Kwpn.Models.Constants.StringConstants.PageIdSystemNames.BecomeMemberPageId); 126 127 128 var isCupEvent = action != null && action.Equals(Translate("ActionLink_SignUp_CupEvent"), StringComparison.OrdinalIgnoreCase); // cup events can have registrations for non kwpn horses 129 var noHorseNeeded = isCupEvent; 130 131 // actions (these values determine if an action is shown) 132 var horseHasMemberContentOverride = HorseHelper.HorseHasMemberContentOverride(animalCode); 133 var actionShow = false; 134 var actionRequestBreedingAdvice = false; 135 var actionSignUpInspectionEvent = false; 136 var actionSignUpCupEvent = isCupEvent; 137 var actionReportDeceasedHorse = false; 138 var actionRequestContinuedPassport = false; 139 var actionRequestDuplicate = false; 140 var actionRegisterHorseToName = false; 141 var actionRegisterEmbryo = false; 142 var actionRegisterFoal = false; 143 var actionReportHorseSold = false; 144 var actionVeterinarianRequestResearch = false; 145 var actionRequestGenomicBreedingValueTest = false; 146 var actionSellViaMarketplace = false; 147 var actionInbreedingCalculation = false; 148 var actionRequestPredicates = false; 149 var actionGetStallionAdvice = false; 150 var isMyHorse = false; 151 var isMyHorseAndConfirmed = false; 152 var isMare = false; 153 var isAlive = false; 154 var isApprovedStud = false; 155 var isBredByMe = false; 156 var isAvailableForResearch = false; 157 var showGeneticProfileBasedOnRegister = false; 158 var showGeneticProfileBasedOnOwnerSettings = true; 159 var hasBreeders = false; 160 var horseName = ""; 161 List<Kwpn.Models.ApiModels.PersonModel> breeders = null; 162 163 if (LoginHelper.MyKwpnIsOffline()) 164 { 165 <div class="break-grid content-container"> 166 <div class="break-grid-background"> 167 <div class="in-grid"> 168 <div class="row"> 169 <div class="col-xs-12 col-md-7"> 170 @Translate("MyKwpnIsOffline", "The back office is offline.") 171 </div> 172 </div> 173 </div> 174 </div> 175 </div> 176 } 177 else if (string.IsNullOrWhiteSpace(animalCode) && !noHorseNeeded) 178 { 179 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 180 <div class="break-grid content-container page-content-aside horse-search"> 181 @{ 182 var searchMyHorsesOnly = false; // this value is set by Kwpn.Repository.Helpers.SearchIntroHelper.GetSearchIntro 183 var searchTitle = Translate("SearchDatabaseFor", "Search database for"); 184 185 // get search form intro based on action 186 var formTitle = ""; 187 var formIntro = ""; 188 if (!string.IsNullOrWhiteSpace(action)) 189 { 190 formIntro = Kwpn.Repository.Helpers.SearchIntroHelper.GetSearchIntro( 191 action, 192 actionId, 193 GetGlobalValue("Global:Area.LongLang"), 194 out formTitle, 195 out searchMyHorsesOnly); 196 197 if (searchMyHorsesOnly) 198 { 199 searchTitle = Translate("SearchMyHorsesFor", "Search my horses for"); 200 } 201 202 } 203 204 var horsePageUrl = GetGlobalValue("Global:Pageview.Url.Raw"); 205 if (horsePageUrl.Contains("?")) 206 { 207 horsePageUrl = string.Format("{0}&{1}=", horsePageUrl, Translate("Horse", "Horse")); 208 } 209 else 210 { 211 horsePageUrl = string.Format("{0}?{1}=", horsePageUrl, Translate("Horse", "Horse")); 212 } 213 214 // if action is only for alive horses, then set hideShowDeceasedOption to false 215 var hideShowDeceasedOption = !string.IsNullOrWhiteSpace(action) && (bool)action.Equals(Translate("ActionLink_Request_Duplicate", "Duplicate"), StringComparison.InvariantCultureIgnoreCase); 216 217 bool isResearchAdd = !string.IsNullOrWhiteSpace(action) && (bool)action.Equals(Translate("ActionLink_Request_GenomeBreedingValueTest", "GenomeBreedingValue"), StringComparison.InvariantCultureIgnoreCase); 218 219 bool userisveterinarian = Kwpn.Repository.Helpers.UserHelper.CheckIfVeterinarian(); 220 221 bool isRegisterHorse = !string.IsNullOrWhiteSpace(action) && (bool)action.Equals(Translate("ActionLink_Register_HorseToName", "RegisterHorse"), StringComparison.InvariantCultureIgnoreCase); 222 223 if (searchMyHorsesOnly) 224 { 225 <div class="break-grid content-container hidden" id="refreshcontainer"> 226 <div class="break-grid-background"> 227 <div class="in-grid"> 228 <div class="row"> 229 <div class="col-xs-12 col-md-7"> 230 <i class='fa fa-refresh fa-spin fa-3x fa-fw'></i><span class="reloading-text">@Translate("HorseListReloading", "One moment please. We are fetching your horses from our back-end system.")</span> 231 </div> 232 </div> 233 </div> 234 </div> 235 </div> 236 } 237 } 238 239 @*SEARCH*@ 240 <div class="break-grid-background" id="horse-search-search"> 241 <div class="in-grid"> 242 <div class="row"> 243 <div class="background-head-aside-xs"> 244 245 <div class="background-head-xs"> 246 <div class="page-header"> 247 <div class="col-xs-12"> 248 <div class="row"> 249 <div class="col-xs-12"> 250 <h1>@searchTitle:</h1> 251 @if (!string.IsNullOrWhiteSpace(formIntro)) 252 { 253 <p>@formIntro</p> 254 } 255 </div> 256 </div> 257 </div> 258 </div> 259 </div> 260 261 <div class="background-aside-xs"> 262 <aside class="col-xs-12 col-md-4 col-md-push-8"> 263 264 @*MEMBERSHIP CALL TO ACTION*@ 265 @*<div class="page-aside"> 266 @if (!Kwpn.Repository.Helpers.LoginHelper.CurrentUserIsLoggedIn()) 267 { 268 var becomeMemberPageId = Kwpn.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Kwpn.Models.Constants.StringConstants.PageIdSystemNames.BecomeMemberPageId); 269 if (!string.IsNullOrWhiteSpace(becomeMemberPageId)) 270 { 271 var becomeMemberPageUrl = string.Format("/Default.aspx?ID={0}", becomeMemberPageId); 272 <h2 id="become-member-list-header" data-childId="become-member-list" class="notactive"><span>@Translate("NoAccount?", "No KWPN Account?")</span></h2> 273 <ul id="become-member-list" class="aside-content notactive"> 274 <li><a href='@becomeMemberPageUrl'>@Translate("BecomeMemberNow", "Become a member now")</a></li> 275 </ul> 276 } 277 } 278 </div>*@ 279 280 <!-- /204473129/DatabaseZoekfunctie/Banner1 --> 281 <div id='div-gpt-ad-banner1-1' class="google-container google-container--size--b google-container--center google-container--margin-top"> 282 <script> 283 googletag.cmd.push(function () { googletag.display('div-gpt-ad-banner1-1'); }); 284 </script> 285 </div> 286 287 </aside> 288 </div> 289 290 </div> 291 292 <article class="col-xs-12 col-md-7 col-md-pull-4 page-content"> 293 @if (!searchMyHorsesOnly) 294 { 295 <div class="w-section inverse"> 296 <div class="w-box sign-in-wr bg-5"> 297 <div class="form-body"> 298 <div class="row"> 299 <div class="col-xs-12" id="DatabaseSearchForm"> 300 301 <div class="form-inline"> 302 303 <input type="radio" name="SearchTypeSelector" id="SearchTypeSelector_LifeNumber" value="LifeNumber" @((userisveterinarian || isRegisterHorse) ? "checked=\"checked\"" : "") /> 304 <label for="SearchTypeSelector_LifeNumber" class="radio-label">@Translate("DatabaseSearchForm_ChipLifeNumber", "Chip- or Life number")</label> 305 306 <br /> 307 308 <input type="radio" name="SearchTypeSelector" id="SearchTypeSelector_Pedigree" value="Pedigree" /> 309 <label for="SearchTypeSelector_Pedigree" class="radio-label">@Translate("DatabaseSearchForm_Pedigree", "Pedigree")</label> 310 311 <br /> 312 313 <input type="radio" name="SearchTypeSelector" id="SearchTypeSelector_FreeSearch" value="FreeSearch" @(!(userisveterinarian || isRegisterHorse) ? "checked=\"checked\"" : "") /> 314 <label for="SearchTypeSelector_FreeSearch" class="radio-label">@Translate("DatabaseSearchForm_FreeSearch", "Free search / studs")</label> 315 316 <br /> 317 318 <input type="radio" name="SearchTypeSelector" id="SearchTypeSelector_Database" value="Database" /> 319 <label for="SearchTypeSelector_Database" class="radio-label">@Translate("DatabaseSearchForm_Database", "Stud database")</label> 320 321 <br /> 322 323 <input type="radio" name="SearchTypeSelector" id="SearchTypeSelector_BreedingValues" value="BreedingValues" /> 324 <label for="SearchTypeSelector_BreedingValues" class="radio-label">@Translate("DatabaseSearchForm_BreedingValues", "Breeding values")</label> 325 326 </div> 327 328 329 </div> 330 </div> 331 </div> 332 333 @*CHIP/LIFENUMBER SEARCH*@ 334 <div id="DatabaseSearchForm_LifeNumber" class="form-body horse-search-form hidden"> 335 <form name="DatabaseSearchForm_LifeNumberForm" id="DatabaseSearchForm_LifeNumberForm"> 336 <div class="row"> 337 <div class="col-xs-12"> 338 339 @*CHIP/LIFENUMBER*@ 340 <div class="form-inline"> 341 <label class="control-label col-xs-12 col-md-4" 342 for="DatabaseSearchForm_LifeNumber_LifeNumber">@Translate("DatabaseSearchForm_ChipLifeNumber", "Chip- or Life number")</label> 343 <input type="text" 344 class="form-control hide-hints" 345 id="DatabaseSearchForm_LifeNumber_LifeNumber" 346 name="DatabaseSearchForm_LifeNumber_LifeNumber" 347 value="" 348 required /> 349 </div> 350 351 @*SUBMIT*@ 352 <button type="submit" 353 class="btn btn-search-submit" 354 id="DatabaseSearchForm_LifeNumber_Submit"> 355 @Translate("Search", "Search") 356 </button> 357 358 </div> 359 </div> 360 </form> 361 </div> 362 363 @*PEDIGREE SEARCH*@ 364 <div id="DatabaseSearchForm_Pedigree" class="form-body horse-search-form hidden"> 365 <form name="DatabaseSearchForm_PedigreeForm" id="DatabaseSearchForm_PedigreeForm"> 366 <div class="row"> 367 <div class="col-xs-12"> 368 369 @*FATHER*@ 370 <div class="form-inline"> 371 <label class="control-label col-xs-12 col-md-4" 372 for="DatabaseSearchForm_PedigreeForm_Father">@Translate("FathersName", "Father")</label> 373 <input type="text" 374 class="form-control hide-hints" 375 id="DatabaseSearchForm_PedigreeForm_Father" 376 name="DatabaseSearchForm_PedigreeForm_Father" 377 value="" 378 required /> 379 </div> 380 381 @*MOTHERSFATHER*@ 382 <div class="form-inline"> 383 <label class="control-label col-xs-12 col-md-4" 384 for="DatabaseSearchForm_PedigreeForm_MothersFather">@Translate("MothersFathersName", "Mothers father")</label> 385 <input type="text" 386 class="form-control hide-hints" 387 id="DatabaseSearchForm_PedigreeForm_MothersFather" 388 name="DatabaseSearchForm_PedigreeForm_MothersFather" 389 value="" 390 required /> 391 </div> 392 393 @*YEAROFBIRTH*@ 394 <div class="form-inline"> 395 <label class="control-label col-xs-12 col-md-4" 396 for="DatabaseSearchForm_PedigreeForm_YearOfBirth">@Translate("YearOfBirth", "Year of birth")</label> 397 <input type="text" 398 class="form-control" 399 id="DatabaseSearchForm_PedigreeForm_YearOfBirth" 400 name="DatabaseSearchForm_PedigreeForm_YearOfBirth" 401 value="" 402 pattern="^\d{4}$" /> 403 </div> 404 405 @*DECEASED HORSES*@ 406 @if (!hideShowDeceasedOption) 407 { 408 <div class="form-inline"> 409 <label class="control-label col-xs-12 col-md-4">@Translate("ShowDeceasedHorses", "Show deceased horses")</label> 410 <input type="checkbox" 411 id="DatabaseSearchForm_PedigreeForm_ShowDeceasedHorses" 412 name="DatabaseSearchForm_PedigreeForm_ShowDeceasedHorses" 413 value="true" /> 414 <label for="DatabaseSearchForm_PedigreeForm_ShowDeceasedHorses" class="normal">@Translate("ShowDeceasedHorses_YesNo", "yes/no")</label> 415 </div> 416 } 417 418 @*SUBMIT*@ 419 <button type="submit" class="btn btn-search-submit" id="DatabaseSearchForm_Pedigree_Submit">@Translate("Search", "Search")</button> 420 </div> 421 </div> 422 </form> 423 </div> 424 425 @*FREE SEARCH*@ 426 <div id="DatabaseSearchForm_FreeSearch" class="form-body horse-search-form hidden"> 427 <form name="DatabaseSearchForm_FreeSearchForm" id="DatabaseSearchForm_FreeSearchForm"> 428 <div class="row"> 429 <div class="col-xs-12"> 430 431 @*SEARCH FOR*@ 432 <div class="form-inline"> 433 <label class="control-label col-xs-12 col-md-4" 434 for="DatabaseSearchForm_FreeSearchForm_Key">@Translate("SearchFor", "Search for")</label> 435 <input type="text" 436 class="form-control hide-hints" 437 id="DatabaseSearchForm_FreeSearchForm_Key" 438 name="DatabaseSearchForm_FreeSearchForm_Key" 439 value="" 440 placeholder="@Translate("SearchForPlaceholder", "(sports) name, father, mother, mothers father")" 441 required /> 442 </div> 443 444 @*BREEDING DIRECTION*@ 445 <div class="form-inline"> 446 <label class="control-label col-xs-12 col-md-4">@Translate("BreedingDirection", "Breeding direction")</label> 447 448 <div class="input-group"> 449 450 <input type="checkbox" 451 name="DatabaseSearchForm_FreeSearchForm_BreedingDirection" 452 id="DatabaseSearchForm_FreeSearchForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Dressuur" 453 value="@Kwpn.Models.Enumerations.BreedingDirection.Dressuur" /> 454 <label for="DatabaseSearchForm_FreeSearchForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Dressuur" class="normal">@Translate("Dressage", "Dressage")</label> 455 456 <br /> 457 458 <input type="checkbox" 459 name="DatabaseSearchForm_FreeSearchForm_BreedingDirection" 460 id="DatabaseSearchForm_FreeSearchForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Gelders_paard" 461 value="@Kwpn.Models.Enumerations.BreedingDirection.Gelders_paard" /> 462 <label for="DatabaseSearchForm_FreeSearchForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Gelders_paard" class="normal">@Translate("Geldinghorse", "Geldinghorse")</label> 463 464 <br /> 465 466 <input type="checkbox" 467 name="DatabaseSearchForm_FreeSearchForm_BreedingDirection" 468 id="DatabaseSearchForm_FreeSearchForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Springen" 469 value="@Kwpn.Models.Enumerations.BreedingDirection.Springen" /> 470 <label for="DatabaseSearchForm_FreeSearchForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Springen" class="normal">@Translate("Jumping", "Jumping")</label> 471 472 <br /> 473 474 <input type="checkbox" 475 name="DatabaseSearchForm_FreeSearchForm_BreedingDirection" 476 id="DatabaseSearchForm_FreeSearchForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Tuigpaard" 477 value="@Kwpn.Models.Enumerations.BreedingDirection.Tuigpaard" /> 478 <label for="DatabaseSearchForm_FreeSearchForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Tuigpaard" class="normal">@Translate("HarnessHorse", "Harness horse")</label> 479 <br /> 480 <input type="checkbox" 481 name="DatabaseSearchForm_FreeSearchForm_BreedingDirection" 482 id="DatabaseSearchForm_FreeSearchForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Rijpaard" 483 value="@Kwpn.Models.Enumerations.BreedingDirection.Rijpaard" /> 484 <label for="DatabaseSearchForm_FreeSearchForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Rijpaard" class="normal">@Translate("RidingHorse", "Riding horse")</label> 485 486 </div> 487 488 </div> 489 490 @*YEAROFBIRTH*@ 491 <div class="form-inline"> 492 <label class="control-label col-xs-12 col-md-4" 493 for="DatabaseSearchForm_FreeSearchForm_YearOfBirth">@Translate("YearOfBirth", "Year of birth")</label> 494 <input type="text" 495 class="form-control" 496 id="DatabaseSearchForm_FreeSearchForm_YearOfBirth" 497 name="DatabaseSearchForm_FreeSearchForm_YearOfBirth" 498 value="" 499 pattern="^\d{4}$" /> 500 </div> 501 502 503 @*DECEASED HORSES*@ 504 @if (!hideShowDeceasedOption) 505 { 506 <div class="form-inline"> 507 <label class="control-label col-xs-12 col-md-4">@Translate("ShowDeceasedHorses", "Show deceased horses")</label> 508 <input type="checkbox" 509 id="DatabaseSearchForm_FreeSearchForm_ShowDeceasedHorses" 510 name="DatabaseSearchForm_FreeSearchForm_ShowDeceasedHorses" 511 value="true" /> 512 <label for="DatabaseSearchForm_FreeSearchForm_ShowDeceasedHorses" class="normal">@Translate("ShowDeceasedHorses_YesNo", "yes/no")</label> 513 </div> 514 } 515 516 517 @*SUBMIT*@ 518 <button type="submit" class="btn btn-search-submit" id="DatabaseSearchForm_FreeSearch_Submit">@Translate("FreeSearch", "Search in all our horses")</button> 519 </div> 520 </div> 521 </form> 522 523 <div class="row"> 524 <div class="col-xs-12"> 525 <div class="google-container google-container--size--a google-container--center google-container--margin-top"> 526 <!--onderstaande afbeelding moet worden verwijderd en vervangen worden door google admanager data--> 527 </div> 528 </div> 529 </div> 530 </div> 531 532 @*DATABASE SEARCH*@ 533 <div id="DatabaseSearchForm_Database" class="form-body horse-search-form hidden"> 534 <form name="DatabaseSearchForm_DatabaseForm" id="DatabaseSearchForm_DatabaseForm"> 535 <div class="row"> 536 <div class="col-xs-12"> 537 538 @*SEARCH FOR*@ 539 <div class="form-inline"> 540 <label class="control-label col-xs-12 col-md-4" 541 for="DatabaseSearchForm_DatabaseForm_Key">@Translate("SearchFor", "Search for")<i class="fa fa-asterisk fixed" aria-hidden="true"></i></label> 542 <input type="text" 543 class="form-control hide-hints" 544 id="DatabaseSearchForm_DatabaseForm_Key" 545 name="DatabaseSearchForm_DatabaseForm_Key" 546 value="" 547 placeholder="@Translate("SearchForPlaceholder", "(sports) name, father, mother, mothers father")" 548 required /> 549 </div> 550 551 @*BREEDING DIRECTION*@ 552 <div class="form-inline"> 553 <label class="control-label col-xs-12 col-md-4">@Translate("BreedingDirection", "Breeding direction")<i class="fa fa-asterisk fixed" aria-hidden="true"></i></label> 554 555 <div class="input-group"> 556 <fieldset data-checkbox-list="DatabaseSearchForm_DatabaseForm_BreedingDirection" 557 data-checkbox-list-dependencies="DatabaseSearchForm_DatabaseForm_Key"> 558 559 <input type="checkbox" 560 name="DatabaseSearchForm_DatabaseForm_BreedingDirection" 561 id="DatabaseSearchForm_DatabaseForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Dressuur" 562 value="@Kwpn.Models.Enumerations.BreedingDirection.Dressuur" 563 required /> 564 <label for="DatabaseSearchForm_DatabaseForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Dressuur" class="normal">@Translate("Dressage", "Dressage")</label> 565 566 <br /> 567 568 <input type="checkbox" 569 name="DatabaseSearchForm_DatabaseForm_BreedingDirection" 570 id="DatabaseSearchForm_DatabaseForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Gelders_paard" 571 value="@Kwpn.Models.Enumerations.BreedingDirection.Gelders_paard" 572 required /> 573 <label for="DatabaseSearchForm_DatabaseForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Gelders_paard" class="normal">@Translate("Geldinghorse", "Geldinghorse")</label> 574 575 <br /> 576 577 <input type="checkbox" 578 name="DatabaseSearchForm_DatabaseForm_BreedingDirection" 579 id="DatabaseSearchForm_DatabaseForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Springen" 580 value="@Kwpn.Models.Enumerations.BreedingDirection.Springen" 581 required /> 582 <label for="DatabaseSearchForm_DatabaseForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Springen" class="normal">@Translate("Jumping", "Jumping")</label> 583 584 <br /> 585 586 <input type="checkbox" 587 name="DatabaseSearchForm_DatabaseForm_BreedingDirection" 588 id="DatabaseSearchForm_DatabaseForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Tuigpaard" 589 value="@Kwpn.Models.Enumerations.BreedingDirection.Tuigpaard" 590 required /> 591 <label for="DatabaseSearchForm_DatabaseForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Tuigpaard" class="normal">@Translate("HarnessHorse", "Harness horse")</label> 592 <br /> 593 <input type="checkbox" 594 name="DatabaseSearchForm_DatabaseForm_BreedingDirection" 595 id="DatabaseSearchForm_DatabaseForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Rijpaard" 596 value="@Kwpn.Models.Enumerations.BreedingDirection.Rijpaard" 597 required /> 598 <label for="DatabaseSearchForm_DatabaseForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Rijpaard" class="normal">@Translate("RidingHorse", "Riding horse")</label> 599 </fieldset> 600 </div> 601 602 </div> 603 604 @*YEAROFBIRTH*@ 605 <div class="form-inline"> 606 <label class="control-label col-xs-12 col-md-4" 607 for="DatabaseSearchForm_DatabaseForm_YearOfBirth">@Translate("YearOfBirth", "Year of birth")</label> 608 <input type="text" 609 class="form-control" 610 id="DatabaseSearchForm_DatabaseForm_YearOfBirth" 611 name="DatabaseSearchForm_DatabaseForm_YearOfBirth" 612 value="" 613 pattern="^\d{4}$" /> 614 </div> 615 616 @*DECEASED HORSES*@ 617 @if (!hideShowDeceasedOption) 618 { 619 <div class="form-inline"> 620 <label class="control-label col-xs-12 col-md-4">@Translate("ShowDeceasedHorses", "Show deceased horses")</label> 621 <input type="checkbox" 622 id="DatabaseSearchForm_DatabaseForm_ShowDeceasedHorses" 623 name="DatabaseSearchForm_DatabaseForm_ShowDeceasedHorses" 624 value="true" /> 625 <label for="DatabaseSearchForm_DatabaseForm_ShowDeceasedHorses" class="normal">@Translate("ShowDeceasedHorses_YesNo", "yes/no")</label> 626 </div> 627 } 628 629 @*APPROVED STUDS*@ 630 <input type="hidden" id="DatabaseSearchForm_DatabaseForm_ApprovedStuds" name="DatabaseSearchForm_DatabaseForm_ApprovedStuds" value="true" /> 631 632 @*SUBMIT*@ 633 <button type="submit" class="btn btn-search-submit" id="DatabaseSearchForm_Database_Submit">@Translate("StudSearch", "Stud search")</button> 634 635 <div class="form-inline"> 636 <br /><small><i class="fa fa-asterisk fixed" aria-hidden="true"></i><i class="fa fa-asterisk fixed" aria-hidden="true"></i> @Translate("RequiredFieldOfTwoHorseSearch", "At least one is required")</small> 637 </div> 638 639 @*ALL STUDS*@ 640 <small>@Translate("ShowAllStudsIntro", "Get all approved stallions by using the link below:")</small> 641 <br /> 642 <a href="javascript:void(0);" id="btn-all-studs" class="orange_arrow_link">@Translate("ShowAllStuds", "Show all studs")</a> 643 </div> 644 </div> 645 </form> 646 </div> 647 648 649 650 @*BREEDING VALUES SEARCH*@ 651 <div id="DatabaseSearchForm_BreedingValues" class="form-body horse-search-form hidden"> 652 653 <p id="breedingValuesAdditionalText" class="hidden"> 654 @Translate("DatabaseSearchForm_BreedingValuesAdditionalText", "") 655 </p> 656 657 <form name="DatabaseSearchForm_BreedingValuesForm" id="DatabaseSearchForm_BreedingValuesForm"> 658 659 <div class="row hidden" id="DatabaseSearchForm_BreedingValuesForm_ReSearch"> 660 <div class="col-xs-12"> 661 <label class="control-label col-sm-4">&nbsp;</label> 662 <div class="breedingValueResearchButtonContainer"> 663 <button>@Translate("BreedingValuesReUse", "Re-use previous breeding value settings")</button> 664 <br /> 665 <br /> 666 <span>@Translate("BreedingValuesReUseOr", "Or")</span> 667 <br /> 668 <br /> 669 </div> 670 671 </div> 672 </div> 673 674 <div class="row"> 675 <div class="col-xs-12"> 676 677 <div class="form-group"> 678 <div class="form-inline not-in-form"> 679 <label class="control-label col-sm-4" for="DatabaseSearchForm_BreedingValues_BreedingDirection">@Translate("BreedingDirection", "Breeding direction")</label> 680 <select class="form-control hide-hints" id="DatabaseSearchForm_BreedingValues_BreedingDirection" name="DatabaseSearchForm_BreedingValues_BreedingDirection" required> 681 <option value="" selected>@Translate("Select")</option> 682 <option value="FOKR-000005">@Translate("Fokrichting_RPGP", "Riding horse / Gelderlander")</option> 683 <option value="FOKR-000007">@Translate("Fokrichting_TP", "Harness horse")</option> 684 </select> 685 </div> 686 </div> 687 688 <div class="form-group" id="list-breeding-values"></div> 689 690 691 @*SUBMIT*@ 692 <button type="submit" 693 class="btn btn-search-submit" 694 id="DatabaseSearchForm_BreedingValues_Submit"> 695 @Translate("Search", "Search") 696 </button> 697 698 </div> 699 </div> 700 </form> 701 </div> 702 703 </div> 704 </div> 705 706 } 707 </article> 708 709 </div> 710 </div> 711 </div> 712 713 @*RESULTS*@ 714 <div class="break-grid-background hidden" id="horse-search-results"> 715 <div class="in-grid"> 716 <div class="row"> 717 <div class="background-head-aside-xs"> 718 <div class="background-head-xs"> 719 <div class="page-header"> 720 <div class="col-xs-12"> 721 722 @if (searchMyHorsesOnly) 723 { 724 // show form intro based on action 725 <div class="row"> 726 <div class="col-xs-12"> 727 <span id="searched-for"></span> 728 <div id="search-result-count" data-default="@Translate("ZeroResults", "0 results")">@Translate("ZeroResults", "0 results")</div> 729 @{ 730 // show search form intro 731 if (!string.IsNullOrWhiteSpace(formTitle)) 732 { 733 <h1>@formTitle</h1> 734 if (!string.IsNullOrWhiteSpace(formTitle)) 735 { 736 <p>@formIntro</p> 737 } 738 } 739 else 740 { 741 <h1>@searchTitle:</h1> 742 } 743 } 744 </div> 745 </div> 746 } 747 else 748 { 749 // show search result header 750 <div class="row"> 751 <div class="col-xs-12 col-md-8"> 752 <div id="search-result-count" data-default="@Translate("ZeroResults", "0 results")">@Translate("ZeroResults", "0 results")</div> 753 <h1>@Translate("SearchResultsFor", "Search results for"): <span id="searched-for"></span></h1> 754 </div> 755 <div class="col-xs-12 col-md-4"> 756 <a href="javascript:void(0);" id="search-again" class="orange_arrow_link pull-right">@Translate("SearchAgain", "Search again")</a> 757 </div> 758 </div> 759 } 760 </div> 761 </div> 762 </div> 763 </div> 764 765 <article class="col-xs-12 page-content"> 766 <div class="row hidden" id="horseSearchResults"> 767 768 <div id="tooManyResults" class="col-xs-12 col-md-7 hidden"> 769 <p>@Translate("TooManySearchResults2", "Your search gave <span id='horseListCounter2'></span> results, of which we show the first 100.")</p> 770 </div> 771 772 <div id="noResults" class="col-xs-12 col-md-7 hidden">@Translate("ZeroResultsText", "Your search gave no results")</div> 773 774 <div id="refine" class="col-xs-12 col-md-7 hidden">@Translate("RefineSearch", "To many results found, please refine your search.")</div> 775 776 <div class="col-xs-12 form-body" id="result-filter"> 777 778 <div class="row resultStyling"> 779 780 @if (searchMyHorsesOnly) 781 { 782 // show filter for attributes, just like the "my horses" page 783 <div class="col-xs-12 col-md-6"> 784 <div class="form-inline"> 785 <label class="control-label">@Translate("Attributes", "Attributes")</label><br /> 786 <input type="text" class="form-control" id="horsesFilter" placeholder='@Translate("FilterByAttributes", "Filter by attributes")' /> 787 </div> 788 </div> 789 <div class="col-xs-12 col-md-6"> 790 <a href="#" id="refresh-list-link"><i class="fa fa-refresh"></i> <abbr title="@Translate("Action_RefreshMyHorsesDataAbbr", "When refreshing the horse list we will fetch your horses from our back-end system. This may take a while.")">@Translate("Action_RefreshMyHorsesData", "Refresh my horses list")</abbr></a> 791 </div> 792 } 793 else 794 { 795 // show extended search options 796 <div class="col-xs-12 col-md-4"> 797 798 <div class="form-inline"> 799 <label class="control-label">@Translate("Attributes", "Attributes")</label><br /> 800 <input type="text" class="form-control" id="horsesFilter" placeholder='@Translate("FilterByAttributes", "Filter by attributes")' /> 801 </div> 802 803 <div class="form-inline selectdiv" id="yearOfApproval"> 804 <label class="control-label" for="horseFilterByYearOfApproval">@Translate("YearOfApproval", "Year of approval")</label> 805 <select class="form-control" name="horseFilterByYearOfApproval" id="horseFilterByYearOfApproval"> 806 <option value="">@Translate("Select", "Select")</option> 807 @for (int i = DateTime.Today.Year - 25; i <= DateTime.Today.Year; i++) 808 { 809 <option value="@i">@i</option> 810 } 811 </select> 812 </div> 813 814 <div class="form-inline" id="approvedStud"> 815 <label class="control-label">@Translate("AcknowledgedStud", "Acknowledged stud")</label><br /> 816 <input type="checkbox" name="horseFilterByAcknowledged" id="horseFilterByAcknowledged" /> 817 <label for="horseFilterByAcknowledged" class="normal">@Translate("Apply", "Apply")</label> 818 </div> 819 820 </div> 821 822 <div class="col-xs-12 col-md-4"> 823 <div class="form-inline hidden" id="color-filter"> 824 <label class="control-label">@Translate("Color", "Color")</label><br /> 825 <div id="color-filter-items"></div> 826 </div> 827 </div> 828 829 <div class="col-xs-12 col-md-4"> 830 831 <div class="form-inline" id="gender-filter"> 832 <label class="control-label h2">@Translate("Gender", "Gender")</label><br /> 833 <div id="gender-filter-items"></div> 834 </div> 835 836 <div class="form-inline selectdiv" id="startingletter-filter"> 837 <label class="control-label h2">@Translate("StartingLetter", "Starting letter")</label><br /> 838 <select class="form-control" name="horseFilterByStartingLetter" id="horseFilterByStartingLetter"> 839 <option value="none" selected="selected">@Translate("Select", "Select")</option> 840 @for (char c = 'A'; c <= 'Z'; c++) 841 { 842 <option value="@c">@c</option> 843 } 844 </select> 845 </div> 846 847 </div> 848 849 } 850 851 </div> 852 853 </div> 854 855 <div class="col-xs-12" id="result-filter-reset"> 856 <a href="javascript:void(0);" id="resetFilterButton" class="orange_arrow_link pull-right">@Translate("ResetFilter", "Reset filter")</a> 857 <br /> 858 <br /> 859 </div> 860 861 <div class="col-xs-12"> 862 <div class="table-responsive"> 863 <table id="horsesTable"> 864 <caption>@Translate("SearchResultIntro", "Click on the name of the horse to continue:")</caption> 865 <thead> 866 <tr> 867 <th data-sortOn="Gender" data-sortBy="Asc"><span class="hidden-xs hidden-sm">@Translate("Gender", "Gender")<i class="fa"></i></span></th> 868 <th data-sortOn="Name" data-sortBy="Asc">@Translate("Name", "Name")<i class="fa"></i></th> 869 <th data-sortOn="Lifenumber" data-sortBy="Asc">@Translate("LifeNumber_Short", "Life nr")<i class="fa"></i></th> 870 <th data-sortOn="Register" data-sortBy="Asc">@Translate("Register", "Register")<i class="fa"></i></th> 871 <th data-sortOn="Color" data-sortBy="Asc">@Translate("Color", "Color")<i class="fa"></i></th> 872 <th data-sortOn="Father" data-sortBy="Asc">@Translate("FathersName", "Father") x @Translate("MothersFathersName", "Mothers father")<i class="fa"></i></th> 873 </tr> 874 </thead> 875 </table> 876 </div> 877 </div> 878 </div> 879 </article> 880 </div> 881 </div> 882 </div> 883 </div> 884 885 @SnippetStart("JavascriptsBottom") 886 <script> 887 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_Horse_Search", "horse-search").UrlEncode()).ToLower()"); 888 </script> 889 <script id="listHorseTemplate" type="text/html"> 890 <tr class="${ClassName} clickable" onclick="document.location.href = '@horsePageUrl${HorseCode}';"> 891 <td class="nowrap"> 892 <i class="fa ${GenderClass}"></i><span class="hidden-xs hidden-sm"> ${GenderAbbr}</span> 893 {{if !IsAlive}} 894 <div class="fa-death" data-toggle="tooltip" title="@Translate("Deceased", "Deceased").JsEncode().ToUpper()"></div> 895 {{/if}} 896 {{if IsApprovedStud}} 897 <div class="fa-approved-stud" data-toggle="tooltip" title="@Translate("IsApprovedStud", "Is an approved stud").JsEncode().ToUpper()"></div> 898 {{/if}} 899 </td> 900 <td>${AnimalName}</td> 901 <td>${Lifenumber}{{if LifenumberComplete != Lifenumber}}<br /><span class='small'>${LifenumberComplete}</span>{{/if}}</td> 902 <td>${Register}</td> 903 <td>${Color}</td> 904 <td><span class="nowrap">${Father}</span> x <span class="nowrap">${MothersFather}</span></td> 905 </tr> 906 </script> 907 <script id="listSelectHorseTemplate" type="text/html"> 908 <tr class="${ClassName} horseRow clickable" data-horseCode="${HorseCode}"> 909 <td class="nowrap"> 910 <i class="fa ${GenderClass}"></i><span class="hidden-xs hidden-sm"> ${GenderAbbr}</span> 911 {{if !IsAlive}} 912 <div class="fa-death" data-toggle="tooltip" title="@Translate("Deceased", "Deceased").JsEncode().ToUpper()"></div> 913 {{/if}} 914 {{if IsApprovedStud}} 915 <div class="fa-approved-stud" data-toggle="tooltip" title="@Translate("IsApprovedStud", "Is an approved stud").JsEncode().ToUpper()"></div> 916 {{/if}} 917 </td> 918 <td>${AnimalName}</td> 919 <td>${Lifenumber}{{if LifenumberComplete != Lifenumber}}<br /><span class='small'>${LifenumberComplete}</span>{{/if}}</td> 920 <td>${Register}</td> 921 <td>${Color}</td> 922 <td><span class="nowrap">${Father}</span> x <span class="nowrap">${MothersFather}</span></td> 923 </tr> 924 </script> 925 <script id="valuesTemplate" type="text/html"> 926 <div class="form-group"> 927 <h3>${Type} <span class="toggler" data-identifyer="${TypeId}" data-typeclass="breeding-values-content"><i class="fa fa-plus"></i></span></h3> 928 <div class="breeding-values-content" id="${TypeId}"> 929 {{each(i,breedingValue) lstBreedingValues}} 930 <div class="form-inline "> 931 <label class="control-label col-sm-4" for="${breedingValue.BreedingValuecode}"> 932 ${breedingValue.Description}{{if breedingValue.Minimum != null && breedingValue.Maximum != null}}<br /><span class="minmax">${breedingValue.Minimum} - ${breedingValue.Maximum}</span>{{/if}} 933 </label> 934 <div class="selectdiv"> 935 <select class="form-control hide-hints input-sm" data-predicate="${breedingValue.BreedingValuecode}"> 936 <option value="gt">&gt;</option> 937 <option value="lt">&lt;</option> 938 <option value="et">=</option> 939 </select> 940 </div> 941 <input type="number" class="form-control hide-hints input-sm" min="0" id="${breedingValue.BreedingValuecode}" name="${breedingValue.BreedingValuecode}" value="" /> 942 </div> 943 {{/each}} 944 </div> 945 <br /> 946 </div> 947 </script> 948 <script> 949 950 var sortOn = "Weight"; 951 var sortBy = "Asc"; 952 var searchApi = ""; 953 var filterYear = 0; 954 var filterAcknowledgedStud = false; 955 var filterColor = "none"; 956 var filterGender = "none"; 957 var filterStartingLetter = "none"; 958 var clickedButtonId = ""; 959 var clickedButtonResetValue = ""; 960 961 $(function () { 962 var fieldsetSelector 963 $('fieldset[data-checkbox-list]') 964 .innovadisCheckboxList() 965 .on('changed', function (event, hasChecked) { 966 $('input[name=DatabaseSearchForm_DatabaseForm_Key]').prop('required', !hasChecked); 967 }); 968 }); 969 970 $(document).ready(function () { 971 972 @if (searchMyHorsesOnly) { 973 <text> 974 $("#refresh-list-link").off("click").on("click", function (e) { 975 e.preventDefault(); 976 $("#horse-search-search").addClass("hidden"); 977 $("#horse-search-results").addClass("hidden"); 978 $("#refreshcontainer").removeClass("hidden"); 979 var refreshHorse = "/kwpnwebapi/horses/refreshmyhorses/@culture"; 980 $.ajax(refreshHorse).always(function () { 981 window.location.href = "@System.Web.HttpContext.Current.Request.RawUrl"; 982 }); 983 return false; 984 }); 985 </text> 986 } 987 988 // show initial form 989 ShowHideForm(); 990 991 // change form 992 $("input[name=SearchTypeSelector]").change(function () { 993 ShowHideForm(); 994 }); 995 996 $("#search-again").click(function () { 997 $(".horse-search-form").addClass("hidden"); // hide all form fields 998 $("#horse-search-search").removeClass("hidden"); // show form type options 999 $("#horse-search-results").addClass("hidden"); // hide results 1000 $("input[name=SearchTypeSelector]").prop('checked', false); 1001 ResetSearchFields() // clear previous search values 1002 ResetFilters(); // reset filter + sort options to default 1003 1004 // pre-select free search option 1005 $("#SearchTypeSelector_FreeSearch").prop("checked", true); 1006 $("#DatabaseSearchForm_FreeSearch").removeClass("hidden"); 1007 1008 return false; 1009 }); 1010 1011 $("#resetFilterButton") 1012 .click(function () { 1013 ResetFilters(); 1014 SearchHorses(); 1015 }); 1016 1017 // force orange borders 1018 $(".hide-hints").change(function () { 1019 $(this).removeClass("hide-hints"); 1020 }); 1021 1022 // form submits 1023 $("#DatabaseSearchForm_LifeNumber_Submit").click(function () { 1024 1025 $("#DatabaseSearchForm_LifeNumber .hide-hints").removeClass("hide-hints"); 1026 1027 if ($("#DatabaseSearchForm_LifeNumberForm")[0].checkValidity()) { 1028 1029 var lifeNumber = $("#DatabaseSearchForm_LifeNumber_LifeNumber").val(); 1030 1031 // show loading icon in buttom 1032 var lifeNumberSubmitButtonText = $("#DatabaseSearchForm_LifeNumber_Submit").html(); 1033 $("#DatabaseSearchForm_LifeNumber_Submit").html(lifeNumberSubmitButtonText + " <i class='fa fa-spinner fa-spin'></i>"); 1034 clickedButtonId = "DatabaseSearchForm_LifeNumber_Submit"; 1035 clickedButtonResetValue = lifeNumberSubmitButtonText; 1036 1037 // disable button 1038 $("#DatabaseSearchForm_LifeNumber_Submit").prop('disabled', true); 1039 1040 //set 'searched for' value 1041 $("#searched-for").html(lifeNumber); 1042 1043 //kwpnwebapi/horses/search/{culture}/{chipOrLifeNumber} 1044 searchApi = "/kwpnwebapi/horses/search/@GetGlobalValue("Global:Area.LongLang")/" + lifeNumber; 1045 1046 SearchHorses(); 1047 1048 // no filter 1049 $("#result-filter-reset").hide(); 1050 $("#yearOfApproval").hide(); 1051 $("#approvedStud").hide(); 1052 $("#gender-filter").show(); 1053 $("#startingletter-filter").hide(); 1054 1055 //seo 1056 SEO.trackPageView("@string.Format("{0}/{1}/{2}/", 1057 seoPage, 1058 Translate("SEO_TrackPageviewPage_Database_Horse_Search", "horse-search").UrlEncode().ToLower(), 1059 Translate("DatabaseSearchForm_ChipLifeNumber", "Chip- or Life number").Replace(" ", "-").UrlEncode().ToLower())" + lifeNumber.toLowerCase()); 1060 1061 return false; 1062 } 1063 }); 1064 1065 $("#DatabaseSearchForm_Pedigree_Submit").click(function () { 1066 1067 $("#DatabaseSearchForm_Pedigree .hide-hints").removeClass("hide-hints"); 1068 1069 if ($("#DatabaseSearchForm_PedigreeForm")[0].checkValidity()) { 1070 1071 // show loading icon in buttom 1072 var pedigreeSubmitButtonText = $("#DatabaseSearchForm_Pedigree_Submit").html(); 1073 $("#DatabaseSearchForm_Pedigree_Submit").html(pedigreeSubmitButtonText + " <i class='fa fa-spinner fa-spin'></i>"); 1074 clickedButtonId = "DatabaseSearchForm_Pedigree_Submit"; 1075 clickedButtonResetValue = pedigreeSubmitButtonText; 1076 1077 // disable button 1078 $("#DatabaseSearchForm_Pedigree_Submit").prop('disabled', true); 1079 1080 // get values 1081 var year = parseInt($("#DatabaseSearchForm_PedigreeForm_YearOfBirth").val()); 1082 var father = $("#DatabaseSearchForm_PedigreeForm_Father").val(); 1083 var mothersFather = $("#DatabaseSearchForm_PedigreeForm_MothersFather").val(); 1084 1085 // set 'searched for' value 1086 var pedigree = father + " x " + mothersFather; 1087 $("#searched-for").html(pedigree); 1088 1089 1090 // set search api url 1091 searchApi = "/kwpnwebapi/horses/search/@GetGlobalValue("Global:Area.LongLang")/" + father + "/" + mothersFather + "/" + year + "/" + $("#DatabaseSearchForm_PedigreeForm_ShowDeceasedHorses").is(':checked'); 1092 1093 // search 1094 SearchHorses(); 1095 1096 $("#yearOfApproval").hide(); 1097 $("#approvedStud").hide(); 1098 $("#gender-filter").show(); 1099 $("#startingletter-filter").hide(); 1100 1101 //seo 1102 SEO.trackPageView("@string.Format("{0}/{1}/{2}/", 1103 seoPage, 1104 Translate("SEO_TrackPageviewPage_Database_Horse_Search", "horse-search").UrlEncode().ToLower(), 1105 Translate("DatabaseSearchForm_Pedigree", "Pedigree").Replace(" ", "-").UrlEncode().ToLower())" + father.toLowerCase() + "/" + mothersFather.toLowerCase() + "/" + year.toString().toLowerCase() + "/" + $("#DatabaseSearchForm_PedigreeForm_ShowDeceasedHorses").is(':checked')); 1106 1107 1108 return false; 1109 } 1110 }); 1111 1112 $("#DatabaseSearchForm_FreeSearch_Submit").click(function () { 1113 1114 $("#DatabaseSearchForm_FreeSearch .hide-hints").removeClass("hide-hints"); 1115 1116 if ($("#DatabaseSearchForm_FreeSearchForm")[0].checkValidity()) { 1117 1118 // show loading icon in buttom 1119 var freeSearchSubmitButtonText = $("#DatabaseSearchForm_FreeSearch_Submit").html(); 1120 $("#DatabaseSearchForm_FreeSearch_Submit").html(freeSearchSubmitButtonText + " <i class='fa fa-spinner fa-spin'></i>"); 1121 clickedButtonId = "DatabaseSearchForm_FreeSearch_Submit"; 1122 clickedButtonResetValue = freeSearchSubmitButtonText; 1123 1124 // disable button 1125 $("#DatabaseSearchForm_FreeSearch_Submit").prop('disabled', true); 1126 1127 // get values 1128 var breedingDirection = []; 1129 breedingDirection.push("Dummy"); //prevent empty string 1130 if ($("#DatabaseSearchForm_FreeSearchForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Dressuur").is(':checked')) { 1131 breedingDirection.push("@Kwpn.Models.Enumerations.EquisBreedingDirection.FOKR_000001.ToString("G")"); 1132 } 1133 if ($("#DatabaseSearchForm_FreeSearchForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Gelders_paard").is(':checked')) { 1134 breedingDirection.push("@Kwpn.Models.Enumerations.EquisBreedingDirection.FOKR_000002.ToString("G")"); 1135 } 1136 if ($("#DatabaseSearchForm_FreeSearchForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Springen").is(':checked')) { 1137 breedingDirection.push("@Kwpn.Models.Enumerations.EquisBreedingDirection.FOKR_000006.ToString("G")"); 1138 } 1139 if ($("#DatabaseSearchForm_FreeSearchForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Tuigpaard").is(':checked')) { 1140 breedingDirection.push("@Kwpn.Models.Enumerations.EquisBreedingDirection.FOKR_000007.ToString("G")"); 1141 } 1142 if ($("#DatabaseSearchForm_FreeSearchForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Rijpaard").is(':checked')) { 1143 breedingDirection.push("@Kwpn.Models.Enumerations.EquisBreedingDirection.FOKR_000005.ToString("G")"); 1144 } 1145 var year = parseInt($("#DatabaseSearchForm_FreeSearchForm_YearOfBirth").val()); 1146 1147 1148 $("#searched-for").html($("#DatabaseSearchForm_FreeSearchForm_Key").val()); 1149 1150 // set search api url 1151 searchApi = "/kwpnwebapi/horses/searchtext/@GetGlobalValue("Global:Area.LongLang")/false/" + $("#DatabaseSearchForm_FreeSearchForm_Key").val() + "/" + breedingDirection + "/" + year + "/" + $("#DatabaseSearchForm_FreeSearchForm_ShowDeceasedHorses").is(':checked') + "/false"; 1152 1153 // search 1154 SearchHorses(); 1155 $("#yearOfApproval").hide(); 1156 $("#approvedStud").hide(); 1157 $("#gender-filter").show(); 1158 $("#startingletter-filter").hide(); 1159 1160 //seo 1161 SEO.trackPageView("@string.Format("{0}/{1}/{2}/", 1162 seoPage, 1163 Translate("SEO_TrackPageviewPage_Database_Horse_Search", "horse-search").UrlEncode().ToLower(), 1164 Translate("DatabaseSearchForm_FreeSearch", "Free search / studs").Replace(" ", "-").UrlEncode().ToLower())" + $("#DatabaseSearchForm_FreeSearchForm_Key").val().toLowerCase() + "/" + breedingDirection + "/" + year.toString().toLowerCase() + "/" + $("#DatabaseSearchForm_FreeSearchForm_ShowDeceasedHorses").is(':checked')); 1165 1166 return false; 1167 } 1168 }); 1169 1170 $("#DatabaseSearchForm_Database_Submit").click(function () { 1171 1172 $("#DatabaseSearchForm_Database .hide-hints").removeClass("hide-hints"); 1173 1174 if ($("#DatabaseSearchForm_DatabaseForm")[0].checkValidity()) { 1175 1176 // show loading icon in buttom 1177 var databaseSubmitButtonText = $("#DatabaseSearchForm_Database_Submit").html(); 1178 $("#DatabaseSearchForm_Database_Submit").html(databaseSubmitButtonText + " <i class='fa fa-spinner fa-spin'></i>"); 1179 clickedButtonId = "DatabaseSearchForm_Database_Submit"; 1180 clickedButtonResetValue = databaseSubmitButtonText; 1181 1182 // disable button 1183 $("#DatabaseSearchForm_Database_Submit").prop('disabled', true); 1184 1185 //get 'searched for' value 1186 var key = $("#DatabaseSearchForm_DatabaseForm_Key").val(); 1187 1188 var searchedFor = key; 1189 if (key === "") { 1190 key = "Dummy"; //prevent empty string 1191 } 1192 var noKeyword = (searchedFor === "" || searchedFor.toLowerCase() === "dummy"); 1193 1194 // get values 1195 var breedingDirection = []; 1196 if ($("#DatabaseSearchForm_DatabaseForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Dressuur").is(':checked')) { 1197 breedingDirection.push("@Kwpn.Models.Enumerations.EquisBreedingDirection.FOKR_000001.ToString("G")"); 1198 if (noKeyword) { 1199 // no search term, show searched breeding direction as 'searched for' 1200 if (searchedFor !== "") { searchedFor += ", "; } 1201 searchedFor += "@Translate("Dressage", "Dressage")"; 1202 } 1203 } 1204 if ($("#DatabaseSearchForm_DatabaseForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Gelders_paard").is(':checked')) { 1205 breedingDirection.push("@Kwpn.Models.Enumerations.EquisBreedingDirection.FOKR_000002.ToString("G")"); 1206 if (noKeyword) { 1207 // no search term, show searched breeding direction as 'searched for' 1208 if (searchedFor !== "") { searchedFor += ", "; } 1209 searchedFor += "@Translate("Geldinghorse", "Geldinghorse")"; 1210 } 1211 } 1212 if ($("#DatabaseSearchForm_DatabaseForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Springen").is(':checked')) { 1213 breedingDirection.push("@Kwpn.Models.Enumerations.EquisBreedingDirection.FOKR_000006.ToString("G")"); 1214 if (noKeyword) { 1215 // no search term, show searched breeding direction as 'searched for' 1216 if (searchedFor !== "") { searchedFor += ", "; } 1217 searchedFor += "@Translate("Jumping", "Jumping")"; 1218 } 1219 } 1220 if ($("#DatabaseSearchForm_DatabaseForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Tuigpaard").is(':checked')) { 1221 breedingDirection.push("@Kwpn.Models.Enumerations.EquisBreedingDirection.FOKR_000007.ToString("G")"); 1222 if (noKeyword) { 1223 // no search term, show searched breeding direction as 'searched for' 1224 if (searchedFor !== "") { searchedFor += ", "; } 1225 searchedFor += "@Translate("HarnessHorse", "Harness horse")"; 1226 } 1227 } 1228 if ($("#DatabaseSearchForm_DatabaseForm_BreedingDirection_@Kwpn.Models.Enumerations.BreedingDirection.Rijpaard").is(':checked')) { 1229 breedingDirection.push("@Kwpn.Models.Enumerations.EquisBreedingDirection.FOKR_000005.ToString("G")"); 1230 if (noKeyword) { 1231 // no search term, show searched breeding direction as 'searched for' 1232 if (searchedFor !== "") { 1233 searchedFor += ", "; 1234 } 1235 searchedFor += "@Translate("RidingHorse", "Riding horse")"; 1236 } 1237 } 1238 if (breedingDirection.length <= 0) { 1239 breedingDirection.push("Dummy"); //prevent empty string 1240 } 1241 1242 var year = parseInt($("#DatabaseSearchForm_DatabaseForm_YearOfBirth").val()); 1243 1244 // set 'searched for' value 1245 $("#searched-for").html(searchedFor); 1246 1247 // set search api url 1248 searchApi = "/kwpnwebapi/horses/searchtext/@GetGlobalValue("Global:Area.LongLang")/true/" + key + "/" + breedingDirection + "/" + year + "/" + $("#DatabaseSearchForm_DatabaseForm_ShowDeceasedHorses").is(':checked') + "/false"; 1249 1250 // search 1251 SearchHorses(); 1252 $("#yearOfApproval").show(); 1253 $("#approvedStud").show(); 1254 $("#gender-filter").hide(); 1255 $("#startingletter-filter").show(); 1256 1257 //seo 1258 SEO.trackPageView("@string.Format("{0}/{1}/{2}/", 1259 seoPage, 1260 Translate("SEO_TrackPageviewPage_Database_Horse_Search", "horse-search").UrlEncode().ToLower(), 1261 Translate("DatabaseSearchForm_Database", "Stud database").Replace(" ", "-").UrlEncode().ToLower())" + key.toLowerCase() + "/" + breedingDirection + "/" + year.toString().toLowerCase() + "/" + $("#DatabaseSearchForm_DatabaseForm_ShowDeceasedHorses").is(':checked')); 1262 1263 return false; 1264 } 1265 }); 1266 1267 $("#btn-all-studs").click(function () { 1268 1269 // show loading icon in buttom 1270 var allStudsSubmitButtonText = $("#btn-all-studs").html(); 1271 $("#btn-all-studs").html(allStudsSubmitButtonText + " <i class='fa fa-spinner fa-spin'></i>"); 1272 clickedButtonId = "btn-all-studs"; 1273 clickedButtonResetValue = allStudsSubmitButtonText; 1274 1275 // set 'searched for' value 1276 $("#searched-for").html('@Translate("AllApprovedStuds", "All approved studs")'); 1277 1278 // set search api url 1279 searchApi = "/kwpnwebapi/horses/searchtext/@GetGlobalValue("Global:Area.LongLang")/true/Dummy/Dummy/0/" + $("#DatabaseSearchForm_DatabaseForm_ShowDeceasedHorses").is(':checked') + "/true"; 1280 1281 // search 1282 SearchHorses(); 1283 $("#yearOfApproval").show(); 1284 $("#approvedStud").show(); 1285 $("#gender-filter").hide(); 1286 $("#startingletter-filter").show(); 1287 1288 //seo 1289 SEO.trackPageView("@string.Format("{0}/{1}/{2}/{3}", 1290 seoPage, 1291 Translate("SEO_TrackPageviewPage_Database_Horse_Search", "horse-search").UrlEncode().ToLower(), 1292 Translate("DatabaseSearchForm_Database", "Stud database").Replace(" ", "-").UrlEncode().ToLower(), 1293 Translate("AllApprovedStuds", "All approved studs").Replace(" ", "-").UrlEncode().ToLower())"); 1294 1295 1296 return false; 1297 }); 1298 1299 $("#DatabaseSearchForm_BreedingValues_Submit").click(function () { 1300 $("#DatabaseSearchForm_BreedingValues .hide-hints").removeClass("hide-hints"); 1301 if ($("#DatabaseSearchForm_BreedingValuesForm")[0].checkValidity()) { 1302 1303 // show loading icon in buttom 1304 var breedingValuesSubmitButtonText = $("#DatabaseSearchForm_BreedingValues_Submit").html(); 1305 $("#DatabaseSearchForm_BreedingValues_Submit").html(breedingValuesSubmitButtonText + " <i class='fa fa-spinner fa-spin'></i>"); 1306 clickedButtonId = "DatabaseSearchForm_BreedingValues_Submit"; 1307 clickedButtonResetValue = breedingValuesSubmitButtonText; 1308 1309 // disable button 1310 $("#DatabaseSearchForm_BreedingValues_Submit").prop('disabled', true); 1311 1312 var selectedBreedingDirection = $("#DatabaseSearchForm_BreedingValues_BreedingDirection").val(); 1313 1314 //set 'searched for' value 1315 $("#searched-for").html('@Translate("DatabaseSearchForm_BreedingValues", "Breeding values")'); 1316 1317 // fill json object to store in local storage for re-search functionality 1318 var myBreedingValuesSearchObject = new Object(); 1319 myBreedingValuesSearchObject.breedingDirection = selectedBreedingDirection; 1320 myBreedingValuesSearchObject.breedingValues = []; 1321 1322 // put user values into semi-colon seperated string 1323 var stringPramaterArray = []; 1324 $(".form-inline", "#list-breeding-values").each(function () { 1325 var inputField = $(this).find("input[type=number]"); 1326 var code = inputField.attr("id"); 1327 var value = inputField.val(); 1328 var predicate = $(this).find("select").val(); 1329 stringPramaterArray = AddToStringPramater(stringPramaterArray, code, value, predicate); 1330 1331 // fill json object to store in local storage for re-search functionality 1332 if (!isNaN(parseInt(value))) { myBreedingValuesSearchObject.breedingValues.push(code + "," + predicate + "," + value); } 1333 }); 1334 1335 if (stringPramaterArray.length > 0) { 1336 1337 var stringParameter = stringPramaterArray.join(","); 1338 1339 //kwpnwebapi/horses/searchbreedingvalues/{culture}/{breedingDirection}/{params} 1340 searchApi = "/kwpnwebapi/horses/searchbreedingvalues/@GetGlobalValue("Global:Area.LongLang")/" + selectedBreedingDirection + "/" + stringParameter; 1341 1342 // fill local storage for refilling values on re-search 1343 var localStorageId = "lastSubmittedBreedingValues"; 1344 localStorage.removeItem(localStorageId); // remove previous search 1345 localStorage.setItem(localStorageId, JSON.stringify(myBreedingValuesSearchObject)); // add current search 1346 1347 // search 1348 SearchHorses(); 1349 } 1350 1351 // no filter 1352 $("#result-filter-reset").hide(); 1353 $("#yearOfApproval").show(); 1354 $("#approvedStud").show(); 1355 $("#gender-filter").hide(); 1356 $("#startingletter-filter").show(); 1357 1358 //seo 1359 SEO.trackPageView("@string.Format("{0}/{1}/{2}/", 1360 seoPage, 1361 Translate("SEO_TrackPageviewPage_Database_Horse_Search", "horse-search").UrlEncode().ToLower(), 1362 Translate("DatabaseSearchForm_BreedingValues", "Breeding values").Replace(" ", "-").UrlEncode().ToLower())" + selectedBreedingDirection + "/" + stringParameter.toLowerCase()); 1363 1364 return false; 1365 } 1366 }); 1367 1368 function AddToStringPramater(currentArray, code, value, predicate) { 1369 var result = currentArray; 1370 var val = parseInt(value); 1371 1372 if (!isNaN(val)) { 1373 var stringParameter = code; 1374 switch (predicate) { 1375 case "gt": stringParameter += "&gt;"; break; 1376 case "lt": stringParameter += "&lt;"; break; 1377 case "et": stringParameter += "="; break; 1378 } 1379 stringParameter += val; 1380 result.push(stringParameter); 1381 } 1382 1383 return result; 1384 } 1385 1386 1387 function SearchHorses() { 1388 1389 // horse action passed through 1390 var action = "@action"; 1391 if (action === "") { 1392 action = "none"; 1393 } 1394 1395 var apiUrl = searchApi + "/" + filterYear + "/" + filterAcknowledgedStud + "/" + filterColor + "/" + filterGender + "/" + filterStartingLetter + "/" + sortOn + "/" + sortBy + "/" + action + "/" + $("#horsesFilter").val(); 1396 1397 $.getJSON(apiUrl).done(function (result, status, metaData) { 1398 HandleSearchResult(result); 1399 }).fail(function (jqxhr, textStatus, error) { 1400 var err = textStatus + ", " + error; 1401 1402 console.error("Request SearchHorses Failed: " + err); 1403 }).always(function () { 1404 if (clickedButtonId != "") { 1405 $("#" + clickedButtonId).html(clickedButtonResetValue); // remove loading icon from button 1406 $("#" + clickedButtonId).prop('disabled', false); // enable button 1407 } 1408 $("#horse-search-search").addClass("hidden"); // hide form 1409 $("#horse-search-results").removeClass("hidden"); // show results 1410 }); 1411 } 1412 1413 function HandleSearchResult(result) { 1414 if (result.Count != 0 && result.Count != -1) { 1415 var resultCount = result.Count; 1416 if (resultCount < 0) { 1417 resultCount = -resultCount; // too many results, count is made negative, make positive for display 1418 $("#refine").removeClass("hidden"); // show refine your search text 1419 } 1420 else { 1421 $("#refine").addClass("hidden"); // hide refine your search text 1422 } 1423 var counterText = $("#search-result-count").attr("data-default").replace('0', resultCount); 1424 $("#noResults").addClass("hidden"); // hide no results text 1425 $("#search-result-count").html(counterText); // SET result count value 1426 if (result.Count > 100) { 1427 $("#tooManyResults").removeClass("hidden"); // SHOW too many results text 1428 $("#horseListCounter2").html(result.Count); // SET too many results text number values 1429 } else { 1430 $("#tooManyResults").addClass("hidden"); // hide too many results text 1431 } 1432 FillTable(result.Top100); // Fill horse output 1433 ShowFilter(result.Colors, result.Genders); // SHOW filter options 1434 ShowApprovedCheckBoxInFilter(result.Top100); // show/ hide approved filter option 1435 1436 $("#horsesTable").removeClass("hidden"); // SHOW horse output 1437 } else if (result.Count < 0) { // more than max returns a -1 value 1438 ShowRefineSearch(); 1439 } else { 1440 $("#search-result-count").html($("#search-result-count").attr("data-default")); 1441 ShowNoData(); 1442 } 1443 } 1444 1445 function ShowApprovedCheckBoxInFilter(values) { 1446 //var approvedStudFound = false; 1447 //for (i = 0; i < values.length; i++) { 1448 // if (values[i].IsApprovedStud === true) { 1449 // approvedStudFound = true; 1450 // } 1451 //} 1452 //if (approvedStudFound === false) { 1453 // $('#approvedStud').css('display', 'none'); 1454 //} 1455 } 1456 1457 function ShowFilter(colorList, genderList) { 1458 1459 // add color filter 1460 var colorFilter = $("#color-filter"); 1461 colorFilter.addClass("hidden"); 1462 var colorFilterItems = $("#color-filter-items", colorFilter); 1463 colorFilterItems.empty(); // clear existing color filter values 1464 if (colorList.length > 0) { 1465 for (i = 0; i < colorList.length; i++) { 1466 if (colorList.length > 0 && i == 5) { 1467 // add collapse container for more than 5 color items 1468 var collapseContainer = "<a href=\"javascript:void(0);\" id=\"color-filter-items-more-link\">@Translate("More", "more")</a><div id=\"color-filter-items-more\" class=\"hidden\"></div>"; 1469 colorFilterItems.append(collapseContainer); 1470 colorFilterItems = $("#color-filter-items-more", colorFilter); 1471 } 1472 var colorValue = colorList[i].Name; 1473 var colorId = colorValue.replace(/ /g, "-"); 1474 var colorSelected = ""; 1475 if (colorList[i].Selected) colorSelected = "checked"; 1476 var colorSelector = "<input type=\"checkbox\" name=\"horseFilterByColor\" id=\"horseFilterByColor_" + colorId + "\" value=\"" + colorValue + "\" " + colorSelected + " /> <label for=\"horseFilterByColor_" + colorId + "\" class=\"normal capitalize\">" + colorValue.toUpperCase() + "</label><br/>"; 1477 colorFilterItems.append(colorSelector); 1478 } 1479 colorFilter.removeClass("hidden"); 1480 } 1481 $("#color-filter-items-more-link").click(function () { 1482 $("#color-filter-items-more").removeClass("hidden"); 1483 $(this).remove(); 1484 }); 1485 1486 // add gender filter 1487 var genderFilter = $("#gender-filter"); 1488 genderFilter.addClass("hidden"); 1489 var genderFilterItems = $("#gender-filter-items", genderFilter); 1490 genderFilterItems.empty(); 1491 if (genderList.length > 0) { 1492 for (i = 0; i < genderList.length; i++) { 1493 var genderValue = genderList[i].Name; 1494 var genderId = genderValue.replace(/ /g, "-"); 1495 var genderSelected = ""; 1496 if (genderList[i].Selected) genderSelected = "checked"; 1497 1498 var genderLabel = genderValue; 1499 switch (genderLabel) { 1500 case "HENGST": genderLabel = '@Translate("HENGST").ToUpper()'; 1501 break; 1502 case "RUIN": genderLabel = '@Translate("RUIN").ToUpper()'; 1503 break; 1504 case "MERRIE": genderLabel = '@Translate("MERRIE").ToUpper()'; 1505 break; 1506 default: 1507 break; 1508 } 1509 1510 var genderSelector = "<input type=\"checkbox\" name=\"genderFilterByGender\" id=\"genderFilterByGender_" + genderId + "\" value=\"" + genderValue + "\" " + genderSelected + " /> <label for=\"genderFilterByGender_" + genderId + "\" class=\"normal capitalize\">" + genderLabel + "</label><br/>"; 1511 genderFilterItems.append(genderSelector); 1512 } 1513 genderFilter.removeClass("hidden"); 1514 } 1515 1516 $("input[name=horseFilterByColor]").change(function () { 1517 var selectedColors = ""; 1518 $.each($("input[name=horseFilterByColor]:checked"), function () { 1519 if (selectedColors !== "") selectedColors += ","; 1520 selectedColors += $(this).val(); 1521 }); 1522 if (selectedColors === "") selectedColors = "none"; 1523 filterColor = selectedColors; 1524 SearchHorses(); 1525 }); 1526 1527 1528 $("input[name=genderFilterByGender]").change(function () { 1529 var selectedGenders = ""; 1530 $.each($("input[name=genderFilterByGender]:checked"), function () { 1531 if (selectedGenders !== "") selectedGenders += ","; 1532 selectedGenders += $(this).val(); 1533 }); 1534 if (selectedGenders === "") selectedGenders = "none"; 1535 filterGender = selectedGenders; 1536 SearchHorses(); 1537 }); 1538 1539 $("#result-filter").removeClass("hidden"); // SHOW filter options 1540 1541 // filter reset 1542 $("#result-filter-reset").show(); 1543 } 1544 1545 function ShowNoData() { 1546 $("#tooManyResults").addClass("hidden"); // hide too many results text 1547 $("#result-filter").addClass("hidden"); // hide filter options 1548 $("#refine").addClass("hidden"); // hide refine your search text 1549 $("#horsesTable").addClass("hidden"); // hide horse output 1550 $("#noResults").removeClass("hidden"); // SHOW no results text 1551 $("#search-result-count").html($("#search-result-count").html()); // SET result count value 1552 $('#horsesTable tr:gt(0)').remove(); 1553 $("input[name='SearchTypeSelector']").prop('checked', false); // reset search type radio 1554 $("#horseSearchResults").removeClass("hidden"); 1555 } 1556 1557 function ShowRefineSearch() { 1558 $("#noResults").addClass("hidden"); // hide no results text 1559 $("#tooManyResults").addClass("hidden"); // hide too many results text 1560 $("#result-filter").addClass("hidden"); // hide filter options 1561 $("#horsesTable").addClass("hidden"); // hide horse output 1562 $("#refine").removeClass("hidden"); // SHOW refine your search text 1563 $("#search-result-count").html("---"); // SET result count value 1564 $("input[name='SearchTypeSelector']").prop('checked', false); // reset search type radio 1565 $("#horseSearchResults").removeClass("hidden"); 1566 } 1567 1568 function FillTable(data) { 1569 $('#horsesTable th.sorted').removeClass("sorted").find('i').removeClass("fa-chevron-circle-down fa-chevron-circle-up"); 1570 var directionClass = "fa-chevron-circle-down"; 1571 if (sortBy === "Desc") { 1572 directionClass = "fa-chevron-circle-up"; 1573 } 1574 $('#horsesTable th[data-sortOn="' + sortOn + '"]').addClass("sorted").find('i').addClass(directionClass); 1575 $('#horsesTable tr:gt(0)').remove(); 1576 @if (searchMyHorsesOnly) 1577 { 1578 <text> 1579 $("#listSelectHorseTemplate").tmpl(data).appendTo("#horsesTable"); 1580 1581 // add row click event 1582 $(".horseRow.clickable").click(function () { 1583 var horseCode = $(this).attr("data-horseCode"); 1584 @if (isResearchAdd) 1585 { 1586 // add to list, then go to page 1587 <text> 1588 var addHorseUrl = "/kwpnwebapi/forms/research/upserthorse/" + horseCode; 1589 $.getJSON(addHorseUrl).fail(function (jqxhr, textStatus, error) { 1590 var err = textStatus + ", " + error; 1591 console.error("Request AddHorse Failed: " + err); 1592 }).always(function () { 1593 document.location.href = '@horsePageUrl' + horseCode; 1594 }); 1595 </text> 1596 } 1597 else 1598 { 1599 // go to page 1600 <text>document.location.href = '@horsePageUrl' + horseCode;</text> 1601 } 1602 }); 1603 1604 </text> 1605 } 1606 else 1607 { 1608 <text> 1609 $("#listHorseTemplate").tmpl(data).appendTo("#horsesTable"); 1610 </text> 1611 } 1612 $(".horse-search-form").addClass("hidden"); 1613 $("#horseSearchResults").removeClass("hidden"); 1614 $("input[name='SearchTypeSelector']").prop('checked', false); 1615 1616 // tooltip initializer 1617 $("[data-toggle='tooltip']").tooltip(); 1618 1619 } 1620 1621 function ResetFilters() { 1622 sortOn = "Weight"; 1623 sortBy = "Asc"; 1624 filterYear = 0; 1625 filterAcknowledgedStud = false; 1626 filterColor = "none"; 1627 filterGender = "none"; 1628 filterStartingLetter = "none"; 1629 $("#horseFilterByYearOfApproval").val(""); 1630 $("#horseFilterByAcknowledged").prop('checked', false); 1631 $("#horsesFilter").val(""); 1632 $("#horseFilterByStartingLetter").val("none"); 1633 1634 @if (action != null && action.Equals(Translate("ActionLink_Get_StallionAdvice", "StallionAdvice"), StringComparison.InvariantCultureIgnoreCase)) { 1635 <text> 1636 filterGender = "@Kwpn.Models.Enumerations.Gender.MERRIE.ToString("g")"; 1637 </text> 1638 } 1639 1640 $('fieldset[data-checkbox-list]').trigger("reset"); 1641 } 1642 1643 // show form for seleted search type and hide others 1644 function ShowHideForm() { 1645 1646 $("#horseSearchResults").addClass("hidden"); 1647 1648 // hide 'fokwaarden' additional text; https://innovadis.atlassian.net/browse/KWPN-1824 1649 $("#breedingValuesAdditionalText").addClass("hidden"); 1650 1651 //hide forms and show selected 1652 var selectedSearchType = $("input[name=SearchTypeSelector]:checked").val(); 1653 $(".horse-search-form").each(function () { 1654 $(this).addClass("hidden"); 1655 }); 1656 1657 $("#DatabaseSearchForm_" + selectedSearchType).removeClass("hidden"); 1658 1659 // get breeding values 1660 ClearSearchBreedingValues(); 1661 1662 $("#DatabaseSearchForm_BreedingValues_Submit").prop('disabled', true); // gets enabled afted breeding direction selection and loading of values 1663 if (selectedSearchType == "BreedingValues") { 1664 1665 // add 'fokwaarden' additional text; https://innovadis.atlassian.net/browse/KWPN-1824 1666 $("#breedingValuesAdditionalText").removeClass("hidden"); 1667 1668 // add functionality to breeding direction selection 1669 $("#DatabaseSearchForm_BreedingValues_BreedingDirection").change(function () { 1670 $("#DatabaseSearchForm_BreedingValuesForm_ReSearch").addClass("hidden"); 1671 GetSearchBreedingValues(false); 1672 }); 1673 1674 // check if a previous breeding value search has been done to offer a change in those settings 1675 var localStorageId = "lastSubmittedBreedingValues"; 1676 var lastSubmittedBreedingValues = localStorage.getItem(localStorageId); 1677 if (lastSubmittedBreedingValues != null) { 1678 $("#DatabaseSearchForm_BreedingValuesForm_ReSearch").removeClass("hidden"); 1679 } 1680 } 1681 1682 //place asterisks after required labels 1683 $('input,textarea,select') 1684 .filter('[required]:visible') 1685 .closest(".form-inline") 1686 .children("label") 1687 .children("i:not(.fixed)") 1688 .remove() 1689 .end(); 1690 1691 $('#DatabaseSearchForm_' + selectedSearchType + ' input, #DatabaseSearchForm_' + selectedSearchType + ' textarea, #DatabaseSearchForm_' + selectedSearchType + ' select') 1692 .filter('[required]:visible') 1693 .closest(".form-inline") 1694 .children("label") 1695 .append("<i class=\"fa fa-asterisk\" aria-hidden=\"true\"></i>"); 1696 1697 1698 } 1699 1700 1701 1702 $("#horsesFilter").change(function () { 1703 SearchHorses(); 1704 }); 1705 1706 $("#horsesFilter").keypress(function (e) { 1707 var code = e.keyCode || e.which; 1708 if (code === 13) { 1709 // 13 = enter 1710 SearchHorses(); 1711 e.preventDefault(); 1712 return false; 1713 } 1714 return true; 1715 }); 1716 1717 $("#horseFilterByYearOfApproval") 1718 .change(function () { 1719 filterYear = parseInt($("#horseFilterByYearOfApproval").val()); 1720 if (filterYear === NaN) filterYear = 0; 1721 SearchHorses(); 1722 }); 1723 1724 $("#horseFilterByStartingLetter") 1725 .change(function () { 1726 filterStartingLetter = $("#horseFilterByStartingLetter").val(); 1727 SearchHorses(); 1728 }); 1729 1730 $("#horseFilterByAcknowledged") 1731 .change(function () { 1732 filterAcknowledgedStud = $("#horseFilterByAcknowledged").is(":checked"); 1733 SearchHorses(); 1734 }); 1735 1736 $("#horsesTable th").click(function () { 1737 if (sortOn === $(this).data("sorton")) { 1738 //reverse direction when same sortOn click again 1739 if ($(this).data("sortby") === "Asc") { 1740 $(this).data("sortby", "Desc") 1741 } else { 1742 $(this).data("sortby", "Asc") 1743 } 1744 } 1745 sortOn = $(this).data("sorton"); 1746 sortBy = $(this).data("sortby"); 1747 SearchHorses(); 1748 }); 1749 1750 1751 1752 @if (searchMyHorsesOnly) 1753 { 1754 bool showDeadHorses = false; 1755 if (isResearchAdd) 1756 { 1757 showDeadHorses = true; 1758 } 1759 1760 var genderFilter = action.Equals(Translate("ActionLink_Get_StallionAdvice", "StallionAdvice"), StringComparison.InvariantCultureIgnoreCase) ? Kwpn.Models.Enumerations.Gender.MERRIE.ToString("g") : "none"; 1761 1762 <text> 1763 filterGender = "@genderFilter"; 1764 searchApi = "/kwpnwebapi/horses/getmyhorses/@GetGlobalValue("Global:Area.LongLang")/@showDeadHorses.ToString()"; 1765 SearchHorses(); 1766 </text> 1767 } 1768 1769 1770 function ResetSearchFields() { 1771 ResetLifeNumberSearchFields(); 1772 ResetPedigreeSearchFields(); 1773 ResetFreeSearchSearchFields(); 1774 ResetDatabaseSearchFields(); 1775 ResetBreedingValueseSearchFields(); 1776 } 1777 1778 function ResetLifeNumberSearchFields() { 1779 $("#DatabaseSearchForm_LifeNumber_LifeNumber").val(""); 1780 } 1781 1782 function ResetPedigreeSearchFields() { 1783 $("#DatabaseSearchForm_PedigreeForm_Father").val(""); 1784 $("#DatabaseSearchForm_PedigreeForm_MothersFather").val(""); 1785 $("#DatabaseSearchForm_PedigreeForm_YearOfBirth").val(""); 1786 $("#DatabaseSearchForm_PedigreeForm_ShowDeceasedHorses").prop('checked', false); 1787 } 1788 function ResetFreeSearchSearchFields() { 1789 $("#DatabaseSearchForm_FreeSearchForm_Key").val(""); 1790 $("input[name=DatabaseSearchForm_FreeSearchForm_BreedingDirection]").prop("checked", false); 1791 $("#DatabaseSearchForm_FreeSearchForm_ShowDeceasedHorses").prop("checked", false); 1792 $("#DatabaseSearchForm_FreeSearchForm_YearOfBirth").val(""); 1793 } 1794 1795 function ResetDatabaseSearchFields() { 1796 $("#DatabaseSearchForm_DatabaseForm_Key").val(""); 1797 $("input[name=DatabaseSearchForm_DatabaseForm_BreedingDirection]").prop("checked", false); 1798 $("#DatabaseSearchForm_DatabaseForm_YearOfBirth").val(""); 1799 $("#DatabaseSearchForm_DatabaseForm_ShowDeceasedHorses").prop("checked", false); 1800 } 1801 1802 function ResetBreedingValueseSearchFields() { 1803 $("#DatabaseSearchForm_BreedingValues_BreedingDirection").val(""); 1804 $("#list-breeding-values").html(""); 1805 } 1806 1807 function ClearSearchBreedingValues() { 1808 var valuesContainer = $("#list-breeding-values")[0]; 1809 if (valuesContainer) { 1810 $("#list-breeding-values").html(""); 1811 } 1812 $("#DatabaseSearchForm_BreedingValuesForm_ReSearch").addClass("hidden"); 1813 } 1814 1815 function GetSearchBreedingValues(refillPreviousValues) { 1816 1817 var valuesContainer = $("#list-breeding-values"); 1818 var selectedBreedingDirectionCode = $("#DatabaseSearchForm_BreedingValues_BreedingDirection").val(); 1819 1820 if (selectedBreedingDirectionCode == "") { 1821 valuesContainer.html(""); 1822 $("#DatabaseSearchForm_BreedingValues_Submit").prop("disabled", true); 1823 } else { 1824 valuesContainer.html("<i class=\"fa fa-spinner fa-spin\"></i>"); 1825 1826 var valuesAPiUrl = "/kwpnwebapi/horses/searchvaluesfordirection/@culture/" + selectedBreedingDirectionCode; 1827 1828 $.getJSON(valuesAPiUrl).done(function (data) { 1829 if (data != null && data.length > 0) { 1830 valuesContainer.html(""); // remove spinner 1831 $("#valuesTemplate").tmpl(data).appendTo("#list-breeding-values"); 1832 $("input", "#list-breeding-values").numeric(); // only number input 1833 $("#DatabaseSearchForm_BreedingValues_Submit").prop('disabled', false); // enable submit button 1834 1835 if (refillPreviousValues) { 1836 1837 var localStorageId = "lastSubmittedBreedingValues"; 1838 var lastSubmittedBreedingValues = localStorage.getItem(localStorageId); 1839 if (lastSubmittedBreedingValues != null) { 1840 1841 //parse to json 1842 lastSubmitted = JSON.parse(lastSubmittedBreedingValues); 1843 1844 var breedingValues = lastSubmitted.breedingValues; 1845 1846 if (breedingValues != null && breedingValues.length > 0) { 1847 $.each(breedingValues, function (i, item) { 1848 1849 var itemValues = item.split(","); 1850 if (itemValues.length == 3) { 1851 1852 var breedingValueCode = itemValues[0]; 1853 var predicate = itemValues[1]; 1854 var value = itemValues[2]; 1855 1856 // set predicate field 1857 $("select[data-predicate='" + breedingValueCode + "']", "#list-breeding-values").val(predicate); 1858 1859 // set values field 1860 $("#" + breedingValueCode, "#list-breeding-values").val(value); 1861 } 1862 }); 1863 } 1864 } 1865 } 1866 1867 // toggler initializer 1868 $(".toggler", "#list-breeding-values").click(function () { 1869 var contentId = $(this).attr("data-identifyer"); 1870 var typeClass = $(this).attr("data-typeclass"); 1871 $("." + typeClass).not("#" + contentId).hide(); 1872 $("." + typeClass).not("#" + contentId).prev().find("span.toggler i").removeClass("fa-minus").addClass("fa-plus"); 1873 $("#" + contentId).toggle(); 1874 var currentToggler = $("#" + contentId).prev().find("span.toggler i"); 1875 if (currentToggler.hasClass("fa-minus")) { 1876 currentToggler.removeClass("fa-minus").addClass("fa-plus"); 1877 } else { 1878 currentToggler.removeClass("fa-plus").addClass("fa-minus"); 1879 } 1880 }); 1881 1882 //default hide all toggler areas (except first) 1883 $(".breeding-values-content:not(:first)", "#list-breeding-values").hide(); 1884 $(".toggler:first i.fa", "#list-breeding-values").removeClass("fa-plus").addClass("fa-minus"); 1885 1886 } else { 1887 valuesContainer.html("Nothing found"); 1888 } 1889 }).fail(function (jqxhr, textStatus, error) { 1890 var err = textStatus + ", " + error; 1891 1892 console.error("Request GetSearchBreedingValues Failed: " + err); 1893 valuesContainer.html("An error occurred"); 1894 }).always(function () { 1895 //todo 1896 }); 1897 } 1898 } 1899 1900 $("#DatabaseSearchForm_BreedingValuesForm_ReSearch").click(function () { 1901 var localStorageId = "lastSubmittedBreedingValues"; 1902 var lastSubmittedBreedingValues = localStorage.getItem(localStorageId); 1903 if (lastSubmittedBreedingValues != null) { 1904 1905 //parse to json 1906 lastSubmitted = JSON.parse(lastSubmittedBreedingValues); 1907 1908 var breedingDirection = lastSubmitted.breedingDirection; 1909 1910 // set breeding direction 1911 $("#DatabaseSearchForm_BreedingValues_BreedingDirection").val(breedingDirection); 1912 1913 GetSearchBreedingValues(true); 1914 } 1915 return false; 1916 }); 1917 1918 function RestoreSearch() { 1919 var apiUrl = "/kwpnwebapi/horses/restoresearch/@action"; 1920 1921 $.getJSON(apiUrl).done(function (result, status, metaData) { 1922 if (result.LastSearchType >= 1 && result.LastSearchType <= 3) { 1923 $("#searched-for").html(result.SearchedFor.replace('Dummy', '')); 1924 searchApi = result.SearchApiUrl; 1925 if (result.LastSearchType === 1) { //chip or lifenumber 1926 $("#result-filter-reset").hide(); 1927 $("#yearOfApproval").hide(); 1928 $("#approvedStud").hide(); 1929 $("#gender-filter").show(); 1930 $("#startingletter-filter").hide(); 1931 } 1932 if (result.LastSearchType === 2) { //pedigree 1933 $("#yearOfApproval").hide(); 1934 $("#approvedStud").hide(); 1935 $("#gender-filter").show(); 1936 $("#startingletter-filter").hide(); 1937 } 1938 if (result.LastSearchType === 3) { //searchterm 1939 if (result.PreviousSearch.OnlyApprovedStallion) { 1940 $("#yearOfApproval").show(); 1941 $("#approvedStud").show(); 1942 $("#gender-filter").hide(); 1943 $("#startingletter-filter").show(); 1944 } 1945 else { 1946 $("#yearOfApproval").hide(); 1947 $("#approvedStud").hide(); 1948 $("#gender-filter").show(); 1949 $("#startingletter-filter").hide(); 1950 } 1951 1952 } 1953 if (result.PreviousSearch.FilterOn) $("#horsesFilter").val(result.PreviousSearch.FilterOn); 1954 HandleSearchResult(result.SearchResult); 1955 $("#horse-search-search").addClass("hidden"); // hide form 1956 $("#horse-search-results").removeClass("hidden"); // show results 1957 } 1958 }).fail(function (jqxhr, textStatus, error) { 1959 var err = textStatus + ", " + error; 1960 console.error("Request RestoreSearch Failed: " + err); 1961 }) 1962 }; 1963 1964 RestoreSearch(); 1965 }); 1966 1967 </script> 1968 1969 @SnippetEnd("JavascriptsBottom") 1970 } 1971 else 1972 { 1973 if (System.Web.HttpContext.Current.Request.QueryString.AllKeys.Contains("reset")) 1974 { //check if reset param = true and password param correct, if so reset cache for given horse 1975 Kwpn.Repository.Repositories.Horses.ResetHorseCache(animalCode); 1976 } 1977 var horse = HorseHelper.GetDatabasePageHorse(culture, animalCode, true); 1978 if (horse == null && !noHorseNeeded) 1979 { 1980 <div class="break-grid content-container"> 1981 <div class="break-grid-background"> 1982 <div class="in-grid"> 1983 <div class="row"> 1984 <div class="col-xs-12 col-md-7"> 1985 @Translate("HorseNotFound", "Horse not found") 1986 </div> 1987 </div> 1988 </div> 1989 </div> 1990 </div> 1991 1992 // seo 1993 seoPage = string.Format("{0}/{1}/{2}", seoPage, animalCode.UrlEncode(), Translate("SEO_TrackPageviewPage_Database_Horse_Not_Found", "horse-not-found").UrlEncode()).ToLower(); 1994 <Text> 1995 <script> 1996 SEO.trackPageView("@seoPage"); 1997 </script> 1998 </Text> 1999 } 2000 else if (horse == null && noHorseNeeded) 2001 { 2002 <div class="break-grid content-container page-content-aside horse-database"> 2003 <div class="break-grid-background"> 2004 <div class="in-grid"> 2005 2006 <div class="row"> 2007 <div class="col-xs-12"> 2008 <h1 class="pageTitle">&nbsp;</h1> 2009 </div> 2010 </div> 2011 2012 <div class="row"> 2013 <div class="col-xs-12"> 2014 <div class="notification"></div> 2015 </div> 2016 </div> 2017 2018 <div class="row"> 2019 <div class="col-xs-12 col-md-2 col-md-push-10 aside-page"> 2020 <div class="bg_aside closed"> 2021 <div class="aside_pullLabel">Menu<i class="fa fa-bars" aria-hidden="true"></i></div> 2022 <aside> 2023 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2024 @*note: variables like "action/isAlive/isMyHorse/horse/culture/animalCode/isApprovedStud" are set in the parent: Paragraph/HorseDatabase.cshtml*@ 2025 @*DEFAULT ASIDE*@ 2026 @if (string.IsNullOrWhiteSpace(action)) 2027 { 2028 #region TabLinks 2029 <h2 id="listheader-tabs" data-childId="view-list-tabs" class="notactive"><span>@Translate("Menu", "Menu")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 2030 <div class="list-tabs"> 2031 <ul> 2032 <li data-tab="tab_general" data-vp="@Translate("SEO_TrackPageviewPage_Database_tab_general", "general-info").UrlEncode()" class="active"><a href="javascript:void(0);">@Translate("General", "General")</a></li> 2033 <li data-tab="tab_achievements" data-vp="@Translate("SEO_TrackPageviewPage_Database_tab_achievements", "achievements").UrlEncode()"><a href="javascript:void(0);">@Translate("Achievements", "Achievements")</a></li> 2034 <li data-tab="tab_achievements_motherline" data-vp="@Translate("SEO_TrackPageviewPage_Database_tab_achievements_motherline", "achievements-motherline").UrlEncode()"><a href="javascript:void(0);">@Translate("AchievementsMotherLine", "Achievements mother line")</a></li> 2035 @if (showGeneticProfileBasedOnRegister) 2036 { 2037 <li data-tab="tab_genetic_profile" data-vp="@Translate("SEO_TrackPageviewPage_Database_tab_genetic_profile", "genetic-profile").UrlEncode()"><a href="javascript:void(0);">@Translate("GeneticProfile", "Genetic profile")</a></li> 2038 } 2039 @if (isMare || isMyHorse) 2040 { 2041 <li data-tab="tab_offspring" data-vp="@Translate("SEO_TrackPageviewPage_Database_tab_offspring", "offspring").UrlEncode()"><a href="javascript:void(0);">@Translate("Offspring", "Offspring")</a></li> 2042 } 2043 @if (isApprovedStud) 2044 { 2045 <li data-tab="tab_breeding_registration" data-vp="@Translate("SEO_TrackPageviewPage_Database_tab_breeding_registration", "breeding-registration").UrlEncode()"><a href="javascript:void(0);">@Translate("BreedingRegistration", "Breeding registration")</a></li> 2046 <li data-tab="tab_approved_offspring" data-vp="@Translate("SEO_TrackPageviewPage_Database_tab_approved_offspring", "approved-offspring").UrlEncode()"><a href="javascript:void(0);">@Translate("ApprovedOffspring", "Approved offspring")</a></li> 2047 <li data-tab="tab_performance_report" data-vp="@Translate("SEO_TrackPageviewPage_Database_tab_performance_report", "performance-report").UrlEncode()"><a href="javascript:void(0);">@Translate("PerformanceReport", "Performance report")</a></li> 2048 <li data-tab="tab_performance_figures" data-vp="@Translate("SEO_TrackPageviewPage_Database_tab_performance_figures", "performance-figures").UrlEncode()"><a href="javascript:void(0);">@Translate("PerformanceFigures", "Performance figures")</a></li> 2049 <li data-tab="tab_availability" data-vp="@Translate("SEO_TrackPageviewPage_Database_tab_availability", "availability").UrlEncode()"><a href="javascript:void(0);">@Translate("Availability", "Availability")</a></li> 2050 <li data-tab="tab_descendant_report" data-vp="@Translate("SEO_TrackPageviewPage_Database_tab_descendant_report", "descendant-report").UrlEncode()"><a href="javascript:void(0);">@Translate("DescendantsReport", "Descendants report")</a></li> 2051 } 2052 @{ 2053 var asideBreeders = breeders?.Where(b => b.AllowedOwnerBreeder && Kwpn.Repository.Helpers.UserHelper.CheckIfIsMember(b.PersonCode)); 2054 if (asideBreeders != null && asideBreeders.Any()) 2055 { 2056 <li data-tab="tab_breeders_info"> 2057 <span class="list-item"> 2058 @(asideBreeders.Count() > 1 ? Translate("Breeders", "Breeders") : Translate("Breeder", "Breeder")):<br /> 2059 @foreach (var breeder in asideBreeders) 2060 { 2061 <span class="breeder-link" data-personcode="@breeder.PersonCode">@breeder.PersonName</span> 2062 } 2063 </span> 2064 </li> 2065 } 2066 } 2067 </ul> 2068 </div> 2069 2070 @SnippetStart("JavascriptsBottom") 2071 <script id="videoTemplate" type="text/html"> 2072 {{if EmbedURL}} 2073 <div class="row"> 2074 <div class="col-xs-12 col-md-7"> 2075 {{if Title}} 2076 <h3>${Title}</h3> 2077 {{/if}} 2078 <div class="embed-responsive embed-responsive-16by9"> 2079 <iframe data-src="${EmbedURL}" class="embed-responsive-item" allowfullscreen></iframe> 2080 <div onclick="(function (elem) {const iframe = $(elem).prev('iframe');iframe.attr('src', iframe.attr('data-src'));$(elem).remove();})(this);"> 2081 <img src="${Thumb}" class="embed-responsive-item" /> 2082 <i class="play-button"></i> 2083 </div> 2084 </div> 2085 <div class="videoProperties"> 2086 <small> 2087 {{if Description && Description.length > 10}} 2088 <i>${Description}</i><br /> 2089 {{/if}} 2090 {{if Author}} 2091 @Translate("Author"): ${Author}<br /> 2092 {{/if}} 2093 {{if Views.All >= 0}} 2094 @Translate("Views"): ${Views.All}x <br /> 2095 {{/if}} 2096 </small> 2097 </div> 2098 <br /> 2099 </div> 2100 </div> 2101 {{/if}} 2102 </script> 2103 <script> 2104 $(document).ready(function () { 2105 // check for videos 2106 var getVideoCountUrl = "/kwpnwebapi/videos/getvideosbyhorsecount/@culture/@horse.AnimalCode"; 2107 $.getJSON(getVideoCountUrl).done(function (resultcount) { 2108 if (resultcount > 0) { 2109 $(".list-tabs ul").append("<li data-tab=\"tab_videos\"><a href=\"javascript:void(0);\">@Translate("Videos", "Videos")</a></li>"); 2110 2111 $(".list-tabs li[data-tab=tab_videos] a").click(function () { 2112 var listItem = $(this).parent(); 2113 var tab = listItem.attr("data-tab"); 2114 2115 // remove existing active from tab list 2116 $(".list-tabs li").removeClass("active"); 2117 2118 // add active 2119 listItem.addClass("active"); 2120 2121 // hide all content items 2122 $(".horse-detail-item").addClass("hidden"); 2123 2124 LoadVideos(); 2125 2126 // show items corresponding to current active tab 2127 $(".horse-detail-item[data-content=" + tab + "]").removeClass("hidden"); 2128 }); 2129 2130 } 2131 }).fail(function (jqxhr, textStatus, error) { 2132 var err = textStatus + ", " + error; 2133 console.error("Request AddHorse Failed: " + err); 2134 }); 2135 2136 function LoadVideos() { 2137 2138 var videoContent = $("#video-container", "#horse-detail-item-videos"); 2139 if (videoContent.html() === "") { // if not empty, the video's have already been loaded 2140 // add spinner 2141 videoContent.html("<i class=\"fa fa-spinner fa-spin\"></a>"); 2142 2143 // load videos 2144 var getVideoUrl = "/kwpnwebapi/videos/getvideosbyhorse/@culture/@horse.AnimalCode"; 2145 $.getJSON(getVideoUrl).done(function (videos) { 2146 videoContent.html(""); // remove spinner 2147 if (videos != null && videos.MediaList != null && videos.MediaList.Results.length > 0) { 2148 $.each(videos.MediaList.Results, function (i, video) { 2149 $("#videoTemplate").tmpl(video).appendTo("#video-container", "#horse-detail-item-videos"); 2150 }); 2151 } 2152 else { 2153 videoContent.html("<p>@Translate("VideoNotFound", "Videos not found")</p>"); 2154 } 2155 }).fail(function (jqxhr, textStatus, error) { 2156 var err = textStatus + ", " + error; 2157 console.error("Request AddHorse Failed: " + err); 2158 videoContent.html("<p>@Translate("AnErrorOccurred", "An error occurred")</p>"); 2159 }); 2160 } 2161 } 2162 2163 function ClearVideos() { 2164 var videoContent = $("#video-container", "#horse-detail-item-videos"); 2165 videoContent.html(""); 2166 } 2167 2168 $(".list-tabs a").click(function () { 2169 2170 var listItem = $(this).parent(); 2171 var tab = listItem.attr("data-tab"); 2172 var vp = listItem.attr("data-vp").toLowerCase(); 2173 2174 // remove existing active from tab list 2175 $(".list-tabs li").removeClass("active"); 2176 2177 // add active 2178 listItem.addClass("active"); 2179 2180 // hide all content items 2181 $(".horse-detail-item").addClass("hidden"); 2182 2183 // SEO VIRTUAL PAGE VIEW LOGGING 2184 SEO.trackPageView("@seoPage.ToLower()/" + vp); 2185 2186 // if item is "video", load videos 2187 if (tab == "tab_videos") { 2188 LoadVideos(); 2189 } 2190 else { 2191 ClearVideos(); 2192 } 2193 2194 // show items corresponding to current active tab 2195 $(".horse-detail-item[data-content=" + tab + "]").removeClass("hidden"); 2196 2197 }); 2198 }); 2199 </script> 2200 @SnippetEnd("JavascriptsBottom") 2201 #endregion 2202 } 2203 2204 @if (string.IsNullOrWhiteSpace(action) && actionShow) 2205 { 2206 #region ActionLinks 2207 <h2 id="listheader-actions" data-childId="list-actions" class="notactive"> 2208 <span>@Translate("Actions", "Actions")</span><i class="fa fa-chevron-down" aria-hidden="true"></i> 2209 </h2> 2210 <div class="list-actions"> 2211 <ul> 2212 @if (actionRegisterHorseToName) 2213 { 2214 <li><a href="@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.AnimalCode, Translate("ActionLink_Register_HorseToName", "RegisterHorse"))">@Translate("Action_Register_HorseToName", "Register horse")</a></li> 2215 } 2216 @if (actionSignUpInspectionEvent) 2217 { 2218 <li><a href="@Kwpn.Repository.Helpers.HorseHelper.GetHorseEventsPageUrl(culture, horse.AnimalCode)">@Translate("Action_SignUp_InspectionEvent", "Sign up for inspection / event")</a></li> 2219 } 2220 @if (actionRequestBreedingAdvice) 2221 { 2222 <li><a href="@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.AnimalCode, Translate("ActionLink_Request_BreedingAdvice", "BreedingAdvice"))">@Translate("Action_Request_BreedingAdvice", "Request a breeding advice")</a></li> 2223 } 2224 @*@if (actionGetStallionAdvice) 2225 { 2226 <li><a href="@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.AnimalCode, Translate("ActionLink_Get_StallionAdvice", "StallionAdvice"))">@Translate("Action_Request_StallionAdvice", "Stallion advice")</a></li> 2227 }*@ 2228 @if (actionRequestGenomicBreedingValueTest) 2229 { 2230 <li><a href="javascript:void(0);" onclick="javascript:AddHorseToGenomeBreedingValueTest();return false;">@Translate("Action_Request_GenomeBreedingValueTest", "Request DNA/OC research")</a></li> 2231 } 2232 @if (actionSellViaMarketplace) 2233 { 2234 <li><a href="@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.AnimalCode, Translate("ActionLink_SellViaMarketplace", "sell"))">@Translate("Action_SellViaMarketplace", "Sell via KWPN Marketplace")</a></li> 2235 } 2236 @if (actionReportHorseSold) 2237 { 2238 <li><a href="javascript:void(0);" class="horse-sold-button">@Translate("Action_Report_HorseSold", "Report horse as sold")</a></li> 2239 } 2240 @if (actionReportDeceasedHorse) 2241 { 2242 <li><a href="@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.AnimalCode, Translate("ActionLink_Report_HorseDied", "HorseDied"))">@Translate("Action_Report_HorseDied", "Report horse died")</a></li> 2243 } 2244 @if (actionInbreedingCalculation) 2245 { 2246 <li><a href="@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.AnimalCode, Translate("ActionLink_InbreedingCalculation", "InbreedingCalculation"))">@Translate("Action_InbreedingCalculation", "Inbreeding calculation")</a></li> 2247 } 2248 @if (actionRequestDuplicate) 2249 { 2250 <li><a href="@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.AnimalCode, Translate("ActionLink_Request_Duplicate", "Duplicate"))">@Translate("Action_Request_Duplicate", "Request duplicate")</a></li> 2251 } 2252 @if (actionRequestContinuedPassport) 2253 { 2254 <li><a href="@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.AnimalCode, Translate("ActionLink_Request_ContinuedPassport", "PassportRenewal"))">@Translate("Action_Request_ContinuedPassport", "Requests for passport renewal")</a></li> 2255 } 2256 @if (actionRequestPredicates) 2257 { 2258 <li><a href="@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.AnimalCode, Translate("ActionLink_Request_Predicates", "RequestPredicates"))">@Translate("Action_Request_Predicates", "Request predicate(s)")</a></li> 2259 } 2260 @if (actionVeterinarianRequestResearch) 2261 { 2262 if (horse.HorseAtLeast2YearsOldOnAprilFirst()) 2263 { 2264 <li><a href="/aanmelden-onderzoek?@Translate("Horse", "Horse")=@horse.AnimalCode&amp;type=PROK">@Translate("Action_Request_PROK_Exam", "Request PROK examination")</a></li> 2265 <li><a href="/aanmelden-onderzoek?@Translate("Horse", "Horse")=@horse.AnimalCode&amp;type=SPST">@Translate("Action_Request_SPST_Exam", "Request SPST examination")</a></li> 2266 } 2267 <li><a href="/aanmelden-onderzoek?@Translate("Horse", "Horse")=@horse.AnimalCode&amp;type=OC">@Translate("Action_Request_OC_Exam", "Request OC examination")</a></li> 2268 } 2269 @if (isMyHorse) 2270 { 2271 <li class="refresh"><a href="#" id="refresh-link"><abbr title="@Translate("Action_RefreshHorseDataAbbr", "When refreshing the horse data we fetch the information from our back-end system. This may take a while.")">@Translate("Action_RefreshHorseData", "Refresh horse data")</abbr></a></li> 2272 } 2273 </ul> 2274 </div> 2275 @SnippetStart("JavascriptsBottom") 2276 <script> 2277 2278 @if (actionRequestGenomicBreedingValueTest) 2279 { 2280 <text> 2281 function AddHorseToGenomeBreedingValueTest() { 2282 var redirectUrl = '@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.AnimalCode, Translate("ActionLink_Request_GenomeBreedingValueTest", "GenomeBreedingValue"))'; 2283 // add horse to KwpnUser.GenomeBreedingValueItems 2284 var addHorseUrl = "/kwpnwebapi/forms/research/upserthorse/@horse.AnimalCode"; 2285 $.getJSON(addHorseUrl).done(function () { 2286 window.location.href = redirectUrl; 2287 }).fail(function (jqxhr, textStatus, error) { 2288 var err = textStatus + ", " + error; 2289 console.error("Request AddHorse Failed: " + err); 2290 }); 2291 } 2292 </text> 2293 } 2294 2295 $(document).ready(function () { 2296 2297 @if (isMyHorse) 2298 { 2299 <text> 2300 $("#refresh-link").off("click").on("click", function (e) { 2301 e.preventDefault(); 2302 $(".horse-database").addClass("hidden"); 2303 $("#refreshcontainer").removeClass("hidden"); 2304 var refreshHorse = "/kwpnwebapi/horses/refreshmyhorse/@culture/@horse.AnimalCode/@true"; 2305 $.ajax(refreshHorse).always(function () { 2306 window.location.href = "@System.Web.HttpContext.Current.Request.RawUrl"; 2307 }); 2308 return false; 2309 }); 2310 </text> 2311 } 2312 2313 // check if document download links should be added to the action list and if so, do 2314 @if (Kwpn.Repository.Helpers.LoginHelper.HasAccessToExtendedHorseData()) 2315 { 2316 <text> 2317 // download documents 2318 $(".downloaddocument").remove(); 2319 var downloadsApiUrl = "/kwpnwebapi/horses/getdownloaddocuments/@culture/@animalCode"; 2320 $.getJSON(downloadsApiUrl).done(function (result) { 2321 if (result != null && result.length > 0) { 2322 $.each(result, function (i, downloadDocument) { 2323 var downloadDocumentUrl = downloadDocument.URL; 2324 if (downloadDocumentUrl != null) { 2325 downloadDocumentUrl = downloadDocumentUrl.replace(/\\/g, "/"); // fix slashes 2326 var downloadDocumentLabel = "@Translate("DownloadDocument", "Download document"): " + downloadDocument.TypeDocument; 2327 var downloadDocumentListItem = "<li class=\"downloaddocument\"><a href=\"" + downloadDocumentUrl + "\" download target=\"_blank\">" + downloadDocumentLabel + "</a></li>"; 2328 $("aside .list-actions ul").find(' > li:nth-last-child(1)').before(downloadDocumentListItem); // place at the end, but before the last, which is the refresh button 2329 } 2330 }); 2331 } 2332 }).fail(function (jqxhr, textStatus, error) { 2333 var err = textStatus + ", " + error; 2334 console.error("Request Getdownloaddocuments Failed: " + err); 2335 }); 2336 </text> 2337 } 2338 }); 2339 </script> 2340 @SnippetEnd("JavascriptsBottom") 2341 #endregion 2342 } 2343 2344 @*ACTION ASIDES*@ 2345 @if (!string.IsNullOrWhiteSpace(action)) 2346 { 2347 var productService = new Dynamicweb.Ecommerce.Products.ProductService(); 2348 var ecomLanguageId = Dynamicweb.Frontend.PageView.Current().Area.EcomLanguageId; 2349 2350 // EVENT SIGN UP 2351 if (action.Equals(Translate("ActionLink_SignUp_InspectionEvent", "EventSignUp"), StringComparison.InvariantCultureIgnoreCase) && 2352 actionSignUpInspectionEvent) 2353 { 2354 var eventSignUpProduct = productService.GetProductByNumber(Kwpn.Models.Constants.StringConstants.ProductNumbers.EventSignUp, ecomLanguageId); 2355 if (eventSignUpProduct != null) 2356 { 2357 <h2 id="event-signup-aside-info-header" data-childId="event-signup-aside-info" class="notactive"><span>@Translate("Information", "Information")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 2358 <div class="list-actions"> 2359 <table id="event-signup-aside-aside-info" class="aside-content aside-content-info notactive"> 2360 <colgroup> 2361 <col width="30" /> 2362 <col /> 2363 </colgroup> 2364 <tr class="head"> 2365 <th><i class="fa fa-info"></i></th> 2366 <th>@Translate("Product", "Product")</th> 2367 </tr> 2368 <tr> 2369 <td>&nbsp;</td> 2370 <td>@eventSignUpProduct.Name <span class="inspection-price"></span></td> 2371 </tr> 2372 <tr class="required-services hidden" data-subtotal=""> 2373 <td>&nbsp;</td> 2374 <td class="required-service"></td> 2375 </tr> 2376 <tr class="head"> 2377 <th><i class="fa fa-eur"></i></th> 2378 <th>@Translate("Price", "Price")</th> 2379 </tr> 2380 <tr> 2381 <td>&nbsp;</td> 2382 <td>&euro; <span id="eventSignUpPriceAside">@Translate("NotYetKnown", "n.y.k.")</span> (@Translate("VatIncluded", "VAT included"))</td> 2383 </tr> 2384 </table> 2385 </div> 2386 } 2387 } 2388 2389 2390 // CUP EVENT SIGN UP 2391 if (actionSignUpCupEvent) 2392 { 2393 var eventSignUpProduct = productService.GetProductByNumber(Kwpn.Models.Constants.StringConstants.ProductNumbers.EventSignUp, ecomLanguageId); 2394 if (eventSignUpProduct != null) 2395 { 2396 <h2 id="event-signup-aside-info-header" data-childId="event-signup-aside-info" class="notactive"><span>@Translate("Information", "Information")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 2397 <div class="list-actions"> 2398 <table id="event-signup-aside-aside-info" class="aside-content aside-content-info notactive"> 2399 <colgroup> 2400 <col width="30" /> 2401 <col /> 2402 </colgroup> 2403 <tr class="head"> 2404 <th><i class="fa fa-info"></i></th> 2405 <th>@Translate("Product", "Product")</th> 2406 </tr> 2407 <tr> 2408 <td>&nbsp;</td> 2409 <td>@eventSignUpProduct.Name <span class="inspection-price"></span></td> 2410 </tr> 2411 <tr class="required-services hidden" data-subtotal=""> 2412 <td>&nbsp;</td> 2413 <td class="required-service"></td> 2414 </tr> 2415 <tr class="head"> 2416 <th><i class="fa fa-eur"></i></th> 2417 <th>@Translate("Price", "Price")</th> 2418 </tr> 2419 <tr> 2420 <td>&nbsp;</td> 2421 <td><span id="eventCupSignUpPriceAside">@Translate("NotYetKnown", "n.y.k.")</span> (@Translate("VatIncluded", "VAT included"))</td> 2422 </tr> 2423 </table> 2424 </div> 2425 } 2426 } 2427 2428 // BREEDING ADVICE 2429 else if (action.Equals(Translate("ActionLink_Request_BreedingAdvice", "BreedingAdvice"), StringComparison.InvariantCultureIgnoreCase) && 2430 actionRequestBreedingAdvice) 2431 { 2432 var breedingAdviceproduct = (Kwpn.Repository.Helpers.LoginHelper.CurrentUserIsLoggedIn() && Kwpn.Repository.Repositories.KwpnUsers.CurrentUser().IsMember) ? productService.GetProductByNumber( 2433 Kwpn.Models.Constants.StringConstants.ProductNumbers.BreedingAdviceForMembers, ecomLanguageId) : productService.GetProductByNumber( 2434 Kwpn.Models.Constants.StringConstants.ProductNumbers.BreedingAdviceForNonMembers, ecomLanguageId); 2435 2436 if (breedingAdviceproduct != null) 2437 { 2438 <h2 id="breeding-advice-aside-info-header" data-childId="breeding-advice-aside-info" class="notactive"><span>@Translate("Information", "Information")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 2439 <div class="list-actions"> 2440 <table id="breeding-advice-aside-info" class="aside-content aside-content-info notactive"> 2441 <colgroup> 2442 <col width="30" /> 2443 <col /> 2444 </colgroup> 2445 <tr class="head"> 2446 <th><i class="fa fa-info"></i></th> 2447 <th>@Translate("Product", "Product")</th> 2448 </tr> 2449 <tr> 2450 <td>&nbsp;</td> 2451 <td>@breedingAdviceproduct.Name</td> 2452 </tr> 2453 <tr class="head"> 2454 <th><i class="fa fa-eur"></i></th> 2455 <th>@Translate("Price", "Price")</th> 2456 </tr> 2457 <tr> 2458 <td>&nbsp;</td> 2459 <td>@Kwpn.Repository.Helpers.ProductHelper.FormatPrice(Kwpn.Repository.Helpers.ProductHelper.GetProductPrice(breedingAdviceproduct)) (@Translate("VatIncluded", "VAT included"))</td> 2460 </tr> 2461 </table> 2462 </div> 2463 } 2464 } 2465 2466 // STALLION ADVICE 2467 else if (action.Equals(Translate("ActionLink_Get_StallionAdvice", "StallionAdvice"), StringComparison.InvariantCultureIgnoreCase) && 2468 actionGetStallionAdvice) 2469 { 2470 <h2 id="stallion-advice-aside-info-header" data-childId="stallion-advice-aside-info" class="notactive"><span>@Translate("Information", "Information")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 2471 <div class="list-actions"> 2472 <table id="stallion-advice-aside-info" class="aside-content aside-content-info notactive"> 2473 <colgroup> 2474 <col width="30" /> 2475 <col /> 2476 </colgroup> 2477 <tr class="head"> 2478 <th><i class="fa fa-info"></i></th> 2479 <th>Hengsten advies</th> 2480 </tr> 2481 <tr> 2482 <td>&nbsp;</td> 2483 <td>@horseName<br /><span id="stallion-advice-aside-breedingdirection-mare">@horse.BreedingDirection</span></td> 2484 </tr> 2485 </table> 2486 <ul class="aside-content notactive" id="stallion-advice-aside-links"> 2487 <li class="step-0 hidden"><a href='#' onclick="StallionAdvice.ShowStep(0); return false;">@Translate("StallionAdvice_BackToStep0_LinkText", "Explanation")</a></li> 2488 <li class="step-1 hidden"><a href='#' onclick="StallionAdvice.ShowStep(1); return false;">@Translate("StallionAdvice_BackToStep1_LinkText", "Step 1")</a></li> 2489 <li class="step-2 hidden"><a href='#' onclick="StallionAdvice.ShowStep(2); return false;">@Translate("StallionAdvice_BackToStep2_LinkText", "Step 2")</a></li> 2490 </ul> 2491 </div> 2492 } 2493 2494 // CONTINUED PASSPORT 2495 else if (action.Equals(Translate("ActionLink_Request_ContinuedPassport", "PassportRenewal"), StringComparison.InvariantCultureIgnoreCase) && 2496 actionRequestContinuedPassport) 2497 { 2498 var passportRenewalProduct = productService.GetProductByNumber(Kwpn.Models.Constants.StringConstants.ProductNumbers.PassportRenewal, ecomLanguageId); 2499 if (passportRenewalProduct != null) 2500 { 2501 <h2 id="passport-renewal-aside-info-header" data-childId="passport-renewal-aside-info" class="notactive"><span>@Translate("Information", "Information")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 2502 <div class="list-actions"> 2503 <table id="passport-renewal-aside-info" class="aside-content aside-content-info notactive"> 2504 <colgroup> 2505 <col width="30" /> 2506 <col /> 2507 </colgroup> 2508 <tr class="head"> 2509 <th><i class="fa fa-info"></i></th> 2510 <th>@Translate("Product", "Product")</th> 2511 </tr> 2512 <tr> 2513 <td>&nbsp;</td> 2514 <td>@passportRenewalProduct.Name</td> 2515 </tr> 2516 <tr class="head"> 2517 <th><i class="fa fa-eur"></i></th> 2518 <th>@Translate("Price", "Price")</th> 2519 </tr> 2520 <tr> 2521 <td>&nbsp;</td> 2522 <td>@Kwpn.Repository.Helpers.ProductHelper.FormatPrice(Kwpn.Repository.Helpers.ProductHelper.GetProductPrice(passportRenewalProduct)) (@Translate("VatIncluded", "VAT included"))</td> 2523 </tr> 2524 </table> 2525 </div> 2526 } 2527 } 2528 2529 // PASSPORT DUPLICATE 2530 else if (action.Equals(Translate("ActionLink_Request_Duplicate", "Duplicate"), StringComparison.InvariantCultureIgnoreCase) && 2531 actionRequestDuplicate) 2532 { 2533 <h2 id="passport-duplicate-aside-info-header" data-childId="passport-duplicate-aside-info" class="notactive"><span>@Translate("Information", "Information")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 2534 <div class="list-actions"> 2535 <table id="passport-duplicate-info" class="aside-content aside-content-info notactive"> 2536 <colgroup> 2537 <col width="30" /> 2538 <col /> 2539 </colgroup> 2540 <tr class="head"> 2541 <th><i class="fa fa-info"></i></th> 2542 <th>@Translate("Product", "Product")</th> 2543 </tr> 2544 <tr> 2545 <td>&nbsp;</td> 2546 <td id="passport-duplicate-product-name"><!--value is set by javascript based on form selection--></td> 2547 </tr> 2548 <tr class="head"> 2549 <th><i class="fa fa-eur"></i></th> 2550 <th>@Translate("Price", "Price")</th> 2551 </tr> 2552 <tr> 2553 <td>&nbsp;</td> 2554 <td> 2555 <span id="passport-duplicate-product-price"><!--value is set by javascript based on form selection--></span> (@Translate("VatIncluded", "VAT included")) 2556 </td> 2557 </tr> 2558 </table> 2559 </div> 2560 } 2561 2562 // REGISTER HORSE TO NAME 2563 else if (action.Equals(Translate("ActionLink_Register_HorseToName", "RegisterHorse"), StringComparison.InvariantCultureIgnoreCase) && 2564 actionRegisterHorseToName) 2565 { 2566 var registerHorseProduct = productService.GetProductByNumber(Kwpn.Models.Constants.StringConstants.ProductNumbers.RegisterHorse, ecomLanguageId); 2567 if (registerHorseProduct != null) 2568 { 2569 <h2 id="register-horse-aside-info-header" data-childId="register-horse-aside-info" class="notactive"><span>@Translate("Information", "Information")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 2570 <div class="list-actions"> 2571 <table id="register-horse-aside-info" class="aside-content aside-content-info notactive"> 2572 <colgroup> 2573 <col width="30" /> 2574 <col /> 2575 </colgroup> 2576 <tr class="head"> 2577 <th><i class="fa fa-info"></i></th> 2578 <th>@Translate("Product", "Product")</th> 2579 </tr> 2580 <tr> 2581 <td>&nbsp;</td> 2582 <td>@registerHorseProduct.Name</td> 2583 </tr> 2584 <tr class="head"> 2585 <th><i class="fa fa-eur"></i></th> 2586 <th>@Translate("Price", "Price")</th> 2587 </tr> 2588 <tr> 2589 <td>&nbsp;</td> 2590 <td>@Kwpn.Repository.Helpers.ProductHelper.FormatPrice(Kwpn.Repository.Helpers.ProductHelper.GetProductPrice(registerHorseProduct)) (@Translate("VatIncluded", "VAT included"))</td> 2591 </tr> 2592 </table> 2593 </div> 2594 } 2595 } 2596 2597 // REGISTER EMBRYO 2598 else if (action.Equals(Translate("ActionLink_Register_Embryo", "RegisterEmbryo"), StringComparison.InvariantCultureIgnoreCase) && 2599 actionRegisterEmbryo) 2600 { 2601 <h2 id="register-embryo-aside-info-header" data-childId="register-embryo-aside-info" class="notactive"><span>@Translate("Information", "Information")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 2602 <div class="list-actions"> 2603 <table id="register-embryo-aside-info" class="aside-content aside-content-info notactive"> 2604 <colgroup> 2605 <col width="30" /> 2606 <col /> 2607 </colgroup> 2608 <tr class="head"> 2609 <th><i class="fa fa-info"></i></th> 2610 <th>@Translate("Product", "Product")</th> 2611 </tr> 2612 <tr> 2613 <td>&nbsp;</td> 2614 <td id="register-embryo-product-name"><!--value is set by javascript based on form selection--></td> 2615 </tr> 2616 <tr class="head"> 2617 <th><i class="fa fa-eur"></i></th> 2618 <th>@Translate("Price", "Price")</th> 2619 </tr> 2620 <tr> 2621 <td>&nbsp;</td> 2622 <td> 2623 <span id="register-embryo-product-price"><!--value is set by javascript based on form selection--></span> 2624 </td> 2625 </tr> 2626 </table> 2627 </div> 2628 } 2629 2630 // REGISTER FOAL 2631 else if (action.Equals(Translate("ActionLink_Register_Foal", "RegisterFoal"), StringComparison.InvariantCultureIgnoreCase) && 2632 actionRegisterFoal) 2633 { 2634 <h2 id="register-foal-aside-info-header" data-childId="register-foal-aside-info" class="notactive"><span>@Translate("Information", "Information")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 2635 <div class="list-actions"> 2636 <table id="register-foal-aside-info" class="aside-content aside-content-info notactive"> 2637 <colgroup> 2638 <col width="30" /> 2639 <col /> 2640 </colgroup> 2641 <tr class="head"> 2642 <th><i class="fa fa-info"></i></th> 2643 <th>@Translate("Product", "Product")</th> 2644 </tr> 2645 <tr> 2646 <td>&nbsp;</td> 2647 <td id="register-foal-product-name"><!--value is set by javascript based on form selection--></td> 2648 </tr> 2649 <tr class="head"> 2650 <th><i class="fa fa-eur"></i></th> 2651 <th>@Translate("Price", "Price")</th> 2652 </tr> 2653 <tr> 2654 <td>&nbsp;</td> 2655 <td> 2656 <span id="register-foal-product-price"><!--value is set by javascript based on form selection--></span> (@Translate("VatIncluded", "VAT included")) 2657 </td> 2658 </tr> 2659 </table> 2660 </div> 2661 } 2662 2663 // REQUEST WFFS / GENOME BREEDING VALUE TEST 2664 else if (action.Equals(Translate("ActionLink_Request_GenomeBreedingValueTest", "GenomeBreedingValue"), StringComparison.InvariantCultureIgnoreCase) && 2665 actionRequestGenomicBreedingValueTest) 2666 { 2667 <h2 id="genome-breeding-aside-info-header" data-childId="genome-breeding-aside-info" class="notactive"><span>@Translate("Information", "Information")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 2668 <div class="list-actions"> 2669 <table id="genome-breeding-aside-info" class="aside-content aside-content-info notactive"> 2670 <colgroup> 2671 <col width="30" /> 2672 <col /> 2673 </colgroup> 2674 <tr class="head"> 2675 <th><i class="fa fa-info"></i></th> 2676 <th>@Translate("Product", "Product")</th> 2677 </tr> 2678 <tr> 2679 <td>&nbsp;</td> 2680 <td id="genome-breeding-product-name"><!--value is set by javascript based on form selection--></td> 2681 </tr> 2682 <tr class="head"> 2683 <th><i class="fa fa-eur"></i></th> 2684 <th>@Translate("Price", "Price")</th> 2685 </tr> 2686 <tr> 2687 <td>&nbsp;</td> 2688 <td> 2689 <span id="genome-breeding-product-price"><!--value is set by javascript based on form selection--></span> (@Translate("VatIncluded", "VAT included")) 2690 </td> 2691 </tr> 2692 </table> 2693 </div> 2694 } 2695 2696 // SELL HORSE VIA MARKETPLACE 2697 else if (action.Equals(Translate("ActionLink_SellViaMarketplace", "sell"), StringComparison.InvariantCultureIgnoreCase) && 2698 actionSellViaMarketplace) 2699 { 2700 <h2 id="marketplace-aside-info-header" data-childId="marketplace-aside-info" class="notactive"><span>@Translate("Information", "Information")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 2701 <div class="list-actions"> 2702 <table id="marketplace-aside-info" class="aside-content aside-content-info notactive"> 2703 <colgroup> 2704 <col width="30" /> 2705 <col /> 2706 </colgroup> 2707 <tr class="head"> 2708 <th><i class="fa fa-info"></i></th> 2709 <th>@Translate("Product", "Product")</th> 2710 </tr> 2711 <tr> 2712 <td>&nbsp;</td> 2713 <td class="product-name"><!--value is set by javascript based on form selection--></td> 2714 </tr> 2715 <tr class="head paymentInfo hidden"> 2716 <th><i class="fa fa-cc"></i></th> 2717 <th>@Translate("PaymentMethod", "Payment method")</th> 2718 </tr> 2719 <tr class="paymentInfo hidden"> 2720 <td>&nbsp;</td> 2721 <td>@Translate("PaymentMethod_Text_Online", "Pay directly online")</td> 2722 </tr> 2723 <tr class="head"> 2724 <th><i class="fa fa-eur"></i></th> 2725 <th>@Translate("Price", "Price")</th> 2726 </tr> 2727 <tr> 2728 <td>&nbsp;</td> 2729 <td> 2730 <span class="product-price"><!--value is set by javascript based on form selection--></span> (@Translate("VatIncluded", "VAT included")) 2731 </td> 2732 </tr> 2733 </table> 2734 </div> 2735 } 2736 2737 // REQUEST PREDICATES 2738 else if (action.Equals(Translate("ActionLink_Request_Predicates", "RequestPredicates"), StringComparison.InvariantCultureIgnoreCase) && 2739 actionRequestPredicates) 2740 { 2741 <h2 id="request-predicates-aside-info-header" data-childId="request-predicates-aside-info" class="notactive"><span>@Translate("Information", "Information")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 2742 <div class="list-actions"> 2743 <table id="request-predicates-aside-info" class="aside-content aside-content-info notactive"> 2744 <colgroup> 2745 <col width="30" /> 2746 <col /> 2747 </colgroup> 2748 <tr class="head"> 2749 <th><i class="fa fa-info"></i></th> 2750 <th>@Translate("Product", "Product")</th> 2751 </tr> 2752 <tr> 2753 <td>&nbsp;</td> 2754 <td class="product-name"><!--value is set by javascript based on form selection--></td> 2755 </tr> 2756 <tr class="head"> 2757 <th><i class="fa fa-eur"></i></th> 2758 <th>@Translate("Price", "Price")</th> 2759 </tr> 2760 <tr> 2761 <td>&nbsp;</td> 2762 <td> 2763 <span class="product-price"><!--value is set by javascript based on form selection--></span> (@Translate("VatIncluded", "VAT included")) 2764 </td> 2765 </tr> 2766 </table> 2767 </div> 2768 } 2769 } 2770 2771 @*BACK TO DETAILS*@ 2772 @if (!string.IsNullOrWhiteSpace(action)) 2773 { 2774 <h2 id="back-to-info-header" data-childId="back-to-info-list" class="notactive"><span>@Translate("HorseInfo", "Horse info")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 2775 <div class="list-actions"> 2776 <ul id="back-to-info-list" class="aside-content notactive"> 2777 <li><a href='@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, animalCode)'>@Translate("ShowHorseDetails", "Show horse details")</a></li> 2778 </ul> 2779 </div> 2780 } 2781 2782 @*MEMBERSHIP CALL TO ACTION*@ 2783 @*@if (!string.IsNullOrWhiteSpace(action) && (!Kwpn.Repository.Helpers.LoginHelper.HasAccessToExtendedHorseData())) 2784 { 2785 var becomeMemberPageId = Kwpn.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Kwpn.Models.Constants.StringConstants.PageIdSystemNames.BecomeMemberPageId); 2786 if (!string.IsNullOrWhiteSpace(becomeMemberPageId)) 2787 { 2788 var becomeMemberPageUrl = string.Format("/Default.aspx?ID={0}", becomeMemberPageId); 2789 <h2 id="become-member-list-header" data-childId="become-member-list" class="notactive"><span>@Translate("NoAccount?", "No KWPN Account?")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 2790 <div class="list-actions"> 2791 <ul id="become-member-list" class="aside-content notactive"> 2792 <li><a href='@becomeMemberPageUrl'>@Translate("BecomeMemberNow", "Become a member now")</a></li> 2793 </ul> 2794 </div> 2795 } 2796 }*@ 2797 2798 </aside> 2799 </div> 2800 </div> 2801 <article class="col-xs-12 col-md-10 page-content"> 2802 <div>@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2803 @*note: variables like "action/isAlive/isMyHorse/horse/culture/animalCode/showGeneral" are set in the parent: Paragraph/HorseDatabase.cshtml*@ 2804 @if (!string.IsNullOrWhiteSpace(action)) 2805 { 2806 2807 // BREEDING ADVICE 2808 if (action.Equals(Translate("ActionLink_Request_BreedingAdvice", "BreedingAdvice"), StringComparison.InvariantCultureIgnoreCase) && 2809 actionRequestBreedingAdvice) 2810 { 2811 var pageIdFormBreedingAdvice = Kwpn.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Kwpn.Models.Constants.StringConstants.FormPageIdSystemNames.BreedingAdvice); 2812 if (!string.IsNullOrWhiteSpace(pageIdFormBreedingAdvice)) 2813 { 2814 showGeneral = false; 2815 2816 // SEO VIRTUAL PAGE VIEW LOGGING 2817 <Text> 2818 <script> 2819 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_action_breeding_advice", "breeding-advice").UrlEncode()).ToLower()"); 2820 </script> 2821 </Text> 2822 2823 @RenderPageContent(Convert.ToInt32(pageIdFormBreedingAdvice)) 2824 } 2825 } 2826 2827 // STALLION ADVICE 2828 @*if (action.Equals(Translate("ActionLink_Get_StallionAdvice", "StallionAdvice"), StringComparison.InvariantCultureIgnoreCase) && 2829 actionGetStallionAdvice) 2830 { 2831 var pageIdGetStallionAdvice = pageService.GetPageByNavigationTag(Dynamicweb.Frontend.PageView.Current().AreaID, Kwpn.Models.Constants.StringConstants.FormPageIdSystemNames.StallionAdvice)?.ID ?? 0; 2832 if (pageIdGetStallionAdvice > 0) 2833 { 2834 showGeneral = false; 2835 2836 // SEO VIRTUAL PAGE VIEW LOGGING 2837 <Text> 2838 <script> 2839 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_action_stalliob_advice", "stallion-advice").UrlEncode()).ToLower()"); 2840 </script> 2841 </Text> 2842 2843 @RenderPageContent(pageIdGetStallionAdvice) 2844 } 2845 }*@ 2846 2847 // EVENT SIGN UP 2848 if (action.Equals(Translate("ActionLink_SignUp_InspectionEvent", "EventSignUp"), StringComparison.InvariantCultureIgnoreCase) && 2849 actionSignUpInspectionEvent) 2850 { 2851 var pageIdFormEventSignUp = Kwpn.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Kwpn.Models.Constants.StringConstants.FormPageIdSystemNames.EventSignUp); 2852 if (!string.IsNullOrWhiteSpace(pageIdFormEventSignUp) && !string.IsNullOrWhiteSpace(actionId)) 2853 { 2854 showGeneral = false; 2855 2856 // SEO VIRTUAL PAGE VIEW LOGGING 2857 <Text> 2858 <script> 2859 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_action_event_signup", "event-signup").UrlEncode()).ToLower()"); 2860 </script> 2861 </Text> 2862 2863 @RenderPageContent(Convert.ToInt32(pageIdFormEventSignUp)) 2864 } 2865 } 2866 2867 // CUP EVENT SIGN UP 2868 if (actionSignUpCupEvent) 2869 { 2870 var pageIdFormCupEventSignUp = Kwpn.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Kwpn.Models.Constants.StringConstants.FormPageIdSystemNames.CupEventSignUp); 2871 if (!string.IsNullOrWhiteSpace(pageIdFormCupEventSignUp)) 2872 { 2873 showGeneral = false; 2874 2875 // SEO VIRTUAL PAGE VIEW LOGGING 2876 <Text> 2877 <script> 2878 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_action_event_signup", "event-signup").UrlEncode()).ToLower()"); 2879 </script> 2880 </Text> 2881 2882 @RenderPageContent(Convert.ToInt32(pageIdFormCupEventSignUp)) 2883 } 2884 } 2885 2886 // REPORT DECEASED HORSE 2887 if (action.Equals(Translate("ActionLink_Report_HorseDied", "HorseDied"), StringComparison.InvariantCultureIgnoreCase) && 2888 actionReportDeceasedHorse) 2889 { 2890 var pageIdReportDeceased = Kwpn.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Kwpn.Models.Constants.StringConstants.FormPageIdSystemNames.ReportDeceased); 2891 if (!string.IsNullOrWhiteSpace(pageIdReportDeceased)) 2892 { 2893 showGeneral = false; 2894 2895 // SEO VIRTUAL PAGE VIEW LOGGING 2896 <Text> 2897 <script> 2898 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_action_report_deceased_horse", "report-deceased-horse").UrlEncode()).ToLower()"); 2899 </script> 2900 </Text> 2901 2902 @RenderPageContent(Convert.ToInt32(pageIdReportDeceased)) 2903 } 2904 } 2905 2906 // CONINUED PASSPORT 2907 if (action.Equals(Translate("ActionLink_Request_ContinuedPassport", "PassportRenewal"), StringComparison.InvariantCultureIgnoreCase) && 2908 actionRequestContinuedPassport) 2909 { 2910 var pageIdPassportRenewal = Kwpn.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Kwpn.Models.Constants.StringConstants.FormPageIdSystemNames.PassportRenewal); 2911 if (!string.IsNullOrWhiteSpace(pageIdPassportRenewal)) 2912 { 2913 showGeneral = false; 2914 2915 // SEO VIRTUAL PAGE VIEW LOGGING 2916 <Text> 2917 <script> 2918 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_action_continued_passport", "continued-passport").UrlEncode()).ToLower()"); 2919 </script> 2920 </Text> 2921 2922 @RenderPageContent(Convert.ToInt32(pageIdPassportRenewal)) 2923 } 2924 } 2925 2926 // REQUEST DUPLICATE 2927 if (action.Equals(Translate("ActionLink_Request_Duplicate", "Duplicate"), StringComparison.InvariantCultureIgnoreCase) && 2928 actionRequestDuplicate) 2929 { 2930 var pageIdPassportDuplicate = Kwpn.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Kwpn.Models.Constants.StringConstants.FormPageIdSystemNames.PassportDuplicate); 2931 if (!string.IsNullOrWhiteSpace(pageIdPassportDuplicate)) 2932 { 2933 showGeneral = false; 2934 2935 // SEO VIRTUAL PAGE VIEW LOGGING 2936 <Text> 2937 <script> 2938 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_action_request_duplicate", "request-duplicate").UrlEncode()).ToLower()"); 2939 </script> 2940 </Text> 2941 2942 @RenderPageContent(Convert.ToInt32(pageIdPassportDuplicate)) 2943 } 2944 } 2945 2946 // REGISTER HORSE TO NAME 2947 if (action.Equals(Translate("ActionLink_Register_HorseToName", "RegisterHorse"), StringComparison.InvariantCultureIgnoreCase) && 2948 actionRegisterHorseToName) 2949 { 2950 var pageIdFormRegisterHorse = Kwpn.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Kwpn.Models.Constants.StringConstants.FormPageIdSystemNames.RegisterHorse); 2951 if (!string.IsNullOrWhiteSpace(pageIdFormRegisterHorse)) 2952 { 2953 showGeneral = false; 2954 2955 // SEO VIRTUAL PAGE VIEW LOGGING 2956 <Text> 2957 <script> 2958 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_action_register_horse", "register-horse").UrlEncode()).ToLower()"); 2959 </script> 2960 </Text> 2961 2962 @RenderPageContent(Convert.ToInt32(pageIdFormRegisterHorse)) 2963 } 2964 } 2965 2966 // REGISTER EMBRYO 2967 if (action.Equals(Translate("ActionLink_Register_Embryo", "RegisterEmbryo"), StringComparison.InvariantCultureIgnoreCase) && 2968 actionRegisterEmbryo) 2969 { 2970 2971 var pageRegisterEmbryo = pageService.GetPageByNavigationTag(Dynamicweb.Frontend.PageView.Current().AreaID, Kwpn.Models.Constants.StringConstants.FormPageIdSystemNames.RegisterEmbryo); 2972 var pageIdRegisterEmbryo = pageRegisterEmbryo?.ID ?? 0; 2973 if (pageIdRegisterEmbryo > 0) 2974 { 2975 showGeneral = false; 2976 2977 // SEO VIRTUAL PAGE VIEW LOGGING 2978 <Text> 2979 <script> 2980 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_action_register_embryo", "register-embryo").UrlEncode()).ToLower()"); 2981 </script> 2982 </Text> 2983 2984 @RenderPageContent(pageIdRegisterEmbryo) 2985 } 2986 } 2987 2988 // REGISTER FOAL 2989 if (action.Equals(Translate("ActionLink_Register_Foal", "RegisterFoal"), StringComparison.InvariantCultureIgnoreCase) && 2990 actionRegisterFoal) 2991 { 2992 var pageIdRegisterFoal = Kwpn.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Kwpn.Models.Constants.StringConstants.FormPageIdSystemNames.RegisterFoal); 2993 if (!string.IsNullOrWhiteSpace(pageIdRegisterFoal)) 2994 { 2995 showGeneral = false; 2996 2997 // SEO VIRTUAL PAGE VIEW LOGGING 2998 <Text> 2999 <script> 3000 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_action_register_foal", "register-foal").UrlEncode()).ToLower()"); 3001 </script> 3002 </Text> 3003 3004 @RenderPageContent(Convert.ToInt32(pageIdRegisterFoal)) 3005 } 3006 } 3007 3008 // REQUEST GENOME BREEDING VALUE OC (DNA-TEST) 3009 if (action.Equals(Translate("ActionLink_Request_GenomeBreedingValueTest", "GenomeBreedingValue"), StringComparison.InvariantCultureIgnoreCase) && 3010 actionRequestGenomicBreedingValueTest) 3011 { 3012 var pageIdGenomicBreedingValueTest = Kwpn.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Kwpn.Models.Constants.StringConstants.FormPageIdSystemNames.RequestGenomeBreedingValueTest); 3013 if (!string.IsNullOrWhiteSpace(pageIdGenomicBreedingValueTest)) 3014 { 3015 showGeneral = false; 3016 3017 // SEO VIRTUAL PAGE VIEW LOGGING 3018 <Text> 3019 <script> 3020 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_action_request_dna_test", "request-dna-test").UrlEncode()).ToLower()"); 3021 </script> 3022 </Text> 3023 3024 @RenderPageContent(Convert.ToInt32(pageIdGenomicBreedingValueTest)) 3025 } 3026 } 3027 3028 // SELL HORSE VIA MARKETPLACE 3029 if (action.Equals(Translate("ActionLink_SellViaMarketplace", "sell"), StringComparison.InvariantCultureIgnoreCase) && actionSellViaMarketplace) 3030 { 3031 var pageIdSellHorse = Kwpn.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Kwpn.Models.Constants.StringConstants.FormPageIdSystemNames.SellHorse); 3032 if (!string.IsNullOrWhiteSpace(pageIdSellHorse)) 3033 { 3034 showGeneral = false; 3035 3036 // SEO VIRTUAL PAGE VIEW LOGGING 3037 <Text> 3038 <script> 3039 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_action_sell_horse", "sell-horse").UrlEncode()).ToLower()"); 3040 </script> 3041 </Text> 3042 3043 @RenderPageContent(Convert.ToInt32(pageIdSellHorse)) 3044 } 3045 } 3046 3047 // INBREED CALCULATION 3048 if (action.Equals(Translate("ActionLink_InbreedingCalculation", "InbreedingCalculation"), StringComparison.InvariantCultureIgnoreCase) && actionInbreedingCalculation) 3049 { 3050 var pageIdInbreedCalculation = Kwpn.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Kwpn.Models.Constants.StringConstants.PageIdSystemNames.InbreedCalculationPageId); 3051 if (!string.IsNullOrWhiteSpace(pageIdInbreedCalculation)) 3052 { 3053 showGeneral = false; 3054 3055 // SEO VIRTUAL PAGE VIEW LOGGING 3056 <Text> 3057 <script> 3058 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_action_inbreed_calculation", "inbreed-calculation").UrlEncode()).ToLower()"); 3059 </script> 3060 </Text> 3061 3062 @RenderPageContent(Convert.ToInt32(pageIdInbreedCalculation)) 3063 } 3064 } 3065 3066 // REQUEST PREDICATES 3067 if (action.Equals(Translate("ActionLink_Request_Predicates", "RequestPredicates"), StringComparison.InvariantCultureIgnoreCase) && actionRequestPredicates) 3068 { 3069 var pageIdRequestPredicates = Kwpn.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Kwpn.Models.Constants.StringConstants.PageIdSystemNames.PredicatesRequestPageId); 3070 if (!string.IsNullOrWhiteSpace(pageIdRequestPredicates)) 3071 { 3072 showGeneral = false; 3073 3074 // SEO VIRTUAL PAGE VIEW LOGGING 3075 <Text> 3076 <script> 3077 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_action_request_predicates", "request-predicates").UrlEncode()).ToLower()"); 3078 </script> 3079 </Text> 3080 3081 @RenderPageContent(Convert.ToInt32(pageIdRequestPredicates)) 3082 } 3083 } 3084 } 3085 <script> 3086 var pageTitle = $('.paragraphTitel h1, .paragraphText h1').text(); 3087 $('.paragraphTitel h1, .paragraphText h1').remove(); 3088 $('.pageTitle').text(pageTitle); 3089 </script></div> 3090 </article> 3091 </div> 3092 <div class="row"> 3093 <div class="col-xs-12 col-md-10 page-content print-disclaimer"> 3094 @Translate("Print-Disclaimer", "<strong>KWPN Database - &copy; 2017 - Content: KWPN</strong><br /><p>Niets uit de KWPN Database mag zonder uitdrukkelijke toestemming van het KWPN worden overgenomen, vermenigvuldigd en/of openbaar gemaakt, of gebruikt voor herberekening of onderzoek op welke wijze dan ook, met uitzondering van hetgeen in de Auteurswet bepaald is met betrekking tot het reprorecht.</p><p>Het KWPN aanvaardt geen aansprakelijkheid voor schade van welke aard dan ook, die het gevolg is van handelingen en/of beslissingen gebaseerd op informatie van deze site. De door het KWPN verstrekte informatie en berekende fokwaarden op deze website zijn eigendom van het KWPN. De informatie en de fokwaarden zijn bedoeld als voorlichtingsmateriaal en geadviseerd wordt om deze te gebruiken als één van de hulpmiddelen voor selectiedoeleinden. De onderliggende gegevens zijn verzameld in en/of ten behoeve van de KWPN-populatie en de fokwaarden die hieruit zijn voortgekomen zijn van toepassing op de KWPN-populatie. Het KWPN heeft uiterste zorgvuldigheid betracht bij de totstandkoming van de gepresenteerde informatie. De berekeningen hebben plaatsgevonden op basis van de beschikbare kennis van de populatiegenetica en de regels van uitvoering zijn vastgelegd in de reglementen en/of besluiten van bevoegde organen van het KWPN.</p>") 3095 </div> 3096 </div> 3097 </div> 3098 </div> 3099 </div> 3100 } 3101 else 3102 { 3103 isMyHorse = HorseHelper.CheckIfMyHorse(animalCode) && !Kwpn.Repository.Helpers.LoginHelper.IsBlocked(); 3104 isMyHorseAndConfirmed = HorseHelper.CheckIfMyHorseAndConfirmed(animalCode) && !Kwpn.Repository.Helpers.LoginHelper.IsBlocked(); //voorkom dat mensen gelijk na op naam zetten paard kunnen verkopen 3105 isMare = false; 3106 isAlive = !horse.DateOfDeath.HasValue; 3107 isApprovedStud = horse.ApprovedStallion; 3108 isBredByMe = HorseHelper.CheckifBredByMe(horse.Breeders) && !Kwpn.Repository.Helpers.LoginHelper.IsBlocked(); 3109 isAvailableForResearch = HorseHelper.horseIsAvailableForResearch(animalCode); 3110 3111 // HEADER DATA 3112 var genderClass = "fa-question"; 3113 var genderAbbr = ""; 3114 var gender = Kwpn.Models.Enumerations.Gender.UNKNOWN; 3115 Enum.TryParse(horse.Gender.ToUpper(), out gender); 3116 switch (gender) 3117 { 3118 case Kwpn.Models.Enumerations.Gender.HENGST: 3119 genderClass = "fa-mars"; 3120 genderAbbr = Translate("Stallion", "Stallion"); 3121 break; 3122 case Kwpn.Models.Enumerations.Gender.MERRIE: 3123 genderClass = "fa-venus"; 3124 genderAbbr = Translate("Mare", "Mare"); 3125 isMare = true; 3126 break; 3127 case Kwpn.Models.Enumerations.Gender.RUIN: 3128 genderClass = "fa-mars"; //fa-mars-stroke-h 3129 genderAbbr = Translate("Gelding", "Gelding"); 3130 break; 3131 } 3132 horseName = HorseHelper.GetHorseName(horse.SportsName, horse.AnimalName, horse.DateOfBirth.Value); 3133 var fatherName = ""; 3134 var father = horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.Father); 3135 if (father != null) { fatherName = father.AnimalName; } else { fatherName = Translate("Unknown", "Unknown"); } 3136 var fatherNameAbbr = Translate("FathersName", "Fathers name").JsEncode(); 3137 var mothersFatherName = ""; 3138 var mothersFather = horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersFather); 3139 if (mothersFather != null) { mothersFatherName = mothersFather.AnimalName; } else { mothersFatherName = Translate("Unknown", "Unknown"); } 3140 var mothersFatherNameAbbr = Translate("MothersFathersName", "Mothers fathers name").JsEncode(); 3141 3142 // HORSE INFO TABLE DATA 3143 var placeOfBirth = horse.PlaceOfBirth; 3144 var chipNumber = horse.ChipNumber; 3145 var register = horse.Register; 3146 var breedingDirection = horse.BreedingDirection; 3147 var lifeNumber = horse.Lifenumber; 3148 if (!string.IsNullOrWhiteSpace(horse.LifenumberComplete)) { lifeNumber = horse.LifenumberComplete; } 3149 var dateOfBirth = ""; 3150 if (horse.DateOfBirth.HasValue && !dateOfBirth.Equals(DateTime.MinValue)) { dateOfBirth = horse.DateOfBirth.Value.ToShortDateString(); } 3151 var color = ""; 3152 var colorInfo = horse.GetMarkingByType(StringConstants.MarkingTypes.Color); 3153 if (colorInfo != null) { color = colorInfo.Description; } 3154 var wffs = horse.WFFSResearchInformation; 3155 var withers = ""; 3156 var heightInfo = horse.GetMarkingByType(StringConstants.MarkingTypes.Height); 3157 if (heightInfo != null) { withers = heightInfo.Description; } 3158 if (!string.IsNullOrWhiteSpace(withers)) { withers = HorseHelper.ConvertWithers(withers); } 3159 breeders = horse.Breeders; 3160 hasBreeders = breeders != null && breeders.Any(); 3161 3162 // descendent- and performance report 3163 var reports = horse.AnimalReports; 3164 3165 int currentAge = FormatHelpers.CalculateAgeAsInt(horse.DateOfBirth.Value); 3166 3167 showGeneticProfileBasedOnRegister = HorseHelper.IsAllowedRegister(horse.Register) || string.Equals(horse.Register, "ZE", StringComparison.OrdinalIgnoreCase); 3168 showGeneticProfileBasedOnOwnerSettings = !HorseHelper.GeneticProfileIsHidden(animalCode, currentAge); 3169 3170 // validate actions 3171 actionRequestBreedingAdvice = isAlive && isMare; 3172 actionSignUpInspectionEvent = isAlive && isMyHorse; 3173 actionReportDeceasedHorse = isAlive && isMyHorse; 3174 actionRequestContinuedPassport = (!isApprovedStud || isMyHorse) && isAlive; 3175 actionRequestDuplicate = (!isApprovedStud || isMyHorse) && isAlive; 3176 actionRequestPredicates = (!isApprovedStud || isMyHorse); 3177 actionRegisterHorseToName = LoginHelper.IsFullMember() && !isApprovedStud && isAlive && !isMyHorse && !Kwpn.Repository.Helpers.LoginHelper.IsBlocked(); 3178 actionRegisterFoal = isMyHorse && isAlive && isMare; 3179 actionRegisterEmbryo = isMyHorse && isAlive && isMare; 3180 actionReportHorseSold = isAlive && isMyHorse; 3181 actionVeterinarianRequestResearch = UserHelper.CheckIfVeterinarian(); 3182 actionRequestGenomicBreedingValueTest = isMyHorseAndConfirmed && isAvailableForResearch; 3183 actionSellViaMarketplace = isAlive && (UserHelper.CheckIfMarketplaceManager() || (isMyHorseAndConfirmed && HorseHelper.IsAllowedRegister(horse.Register))) && !MarketplaceHelper.AnimalHasActiveMarketplaceAdvert(horse.AnimalCode); 3184 actionInbreedingCalculation = !string.IsNullOrWhiteSpace(horse.BreedingDirection) && 3185 isMyHorse && 3186 isMare && 3187 isAlive && 3188 currentAge > 2 && 3189 currentAge < 26 && 3190 ( 3191 horse.BreedingDirection.Equals(Translate("EquisBreedingDirection_GelderHorse", "Gelder Horse")) || 3192 horse.BreedingDirection.Equals(Translate("EquisBreedingDirection_HarnessHorse", "Harness Horse")) || 3193 horse.BreedingDirection.Equals(Translate("EquisBreedingDirection_RidingHorse", "Riding Horse")) || 3194 horse.BreedingDirection.Equals(Translate("EquisBreedingDirection_DressageHorse", "Dressage Horse")) || 3195 horse.BreedingDirection.Equals(Translate("EquisBreedingDirection_JumperHorse", "Jumper Horse")) 3196 ); 3197 actionGetStallionAdvice = isAlive && isMyHorse && isMare && currentAge > 2 && currentAge < 26; 3198 3199 actionShow = ( 3200 actionRequestBreedingAdvice || 3201 actionSignUpInspectionEvent || 3202 actionReportDeceasedHorse || 3203 actionRequestContinuedPassport || 3204 actionRequestDuplicate || 3205 actionRegisterHorseToName || 3206 actionRegisterEmbryo || 3207 actionRegisterFoal || 3208 actionReportHorseSold || 3209 actionVeterinarianRequestResearch || 3210 actionRequestGenomicBreedingValueTest || 3211 actionSellViaMarketplace || 3212 actionInbreedingCalculation || 3213 actionRequestPredicates || 3214 actionGetStallionAdvice); 3215 3216 // add horse info to seo page 3217 seoPage = string.Format("{0}/{1}/{2}", seoPage, animalCode.UrlEncode(), HorseHelper.GetHorseName(horse.SportsName, horse.AnimalName, null).Replace(" ", "-").UrlEncode()); 3218 3219 if (actionReportHorseSold) 3220 { 3221 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 3222 <div class="modal fade" id="confirm-sold" tabindex="-1" role="dialog" aria-labelledby="horse-sold-modal" aria-hidden="true"> 3223 <div class="modal-dialog"> 3224 <div class="modal-content"> 3225 <div class="modal-header">@Translate("HorseSoldModalHeader", "Report horse as sold")</div> 3226 <div class="modal-body" data-default="@Translate("HorseSoldModalText", "Are you sure you would like to report your horse <span class='horseInfo'>{horse}</span> as sold?")"></div> 3227 <div class="modal-footer"> 3228 <a class="orange_arrow_link" data-dismiss="modal" href="javascript:void(0);">@Translate("Cancel", "Cancel")</a> 3229 <a class="orange_balloon_link modal-ok" href="javascript:void(0);">@Translate("ReportAsSold", "Report as sold")</a> 3230 </div> 3231 </div> 3232 </div> 3233 </div> 3234 @SnippetStart("JavascriptsBottom") 3235 <script> 3236 $(document).ready(function () { 3237 3238 $(".horse-sold-button").click(function (e) { 3239 3240 // set modal text 3241 var horseInfo = "@horseName (@lifeNumber)"; 3242 var modalBody = $("#confirm-sold .modal-body").attr("data-default"); 3243 var newModalBody = modalBody.replace("{horse}", horseInfo); 3244 $("#confirm-sold .modal-body").html(newModalBody); 3245 3246 // seo tracking 3247 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_action_horse_sold", "horse-sold").UrlEncode()).ToLower()"); 3248 3249 // set modal ok button value 3250 var horseCode = "@animalCode"; 3251 var horseSoldApi = "/kwpnwebapi/horses/reportsold/@culture/" + horseCode; 3252 var okButton = $("#confirm-sold .modal-footer .modal-ok"); 3253 okButton.unbind("click"); 3254 okButton.click(function () { 3255 $.getJSON(horseSoldApi).done(function (result, status, metaData) { 3256 if (result) { 3257 location.reload(); // reload page to change isMyhorse options 3258 } 3259 if (!result) { 3260 alert("@Translate("SomethingWentWrong", "Something went wrong")"); 3261 } 3262 }).fail(function (jqxhr, textStatus, error) { 3263 var err = textStatus + ", " + error; 3264 console.error("Request Reportsold Failed: " + err); 3265 }); 3266 $("#confirm-sold").modal("hide"); 3267 }); 3268 3269 // show modal 3270 $("#confirm-sold").modal("show"); 3271 3272 }); 3273 }); 3274 </script> 3275 @SnippetEnd("JavascriptsBottom") 3276 } 3277 <div class="break-grid content-container page-content-aside horse-database"> 3278 <div class="break-grid-background"> 3279 <div class="in-grid"> 3280 3281 <div class="row"> 3282 <div class="col-xs-12"> 3283 <h1 class="pageTitle">&nbsp;</h1> 3284 </div> 3285 </div> 3286 3287 <div class="row"> 3288 <div class="col-xs-12"> 3289 <div class="notification"></div> 3290 </div> 3291 </div> 3292 3293 @if (string.IsNullOrWhiteSpace(action)) 3294 { 3295 var horseNameTitle = horseName; 3296 if (isApprovedStud) 3297 { 3298 horseNameTitle = string.Format("{0} <img class='icon-weapon' src='/Files/Templates/Designs/Kwpn/Images/wapen.svg' /> ", horseNameTitle); 3299 } 3300 <div class="row"> 3301 <div class="col-xs-12 col-md-7"> 3302 <a class="go-back orange_arrow_link arrowleft pull-right hidden-md hidden-lg" href="#">@Translate("Back", "Back")</a> 3303 <h1>@horseNameTitle</h1> 3304 </div> 3305 <div class="hidden-xs hidden-sm col-md-4 col-lg-3"> 3306 <a class="go-back orange_arrow_link arrowleft pull-right" href="#">@Translate("Back", "Back")</a> 3307 </div> 3308 </div> 3309 <div class="row"> 3310 <div class="col-xs-12 col-md-2"> 3311 <span class="gender"><i class="fa @genderClass" title='@genderAbbr.JsEncode()'></i> @genderAbbr.ToUpper()</span>@if (!isAlive) 3312 {<span class="deceased" data-toggle="tooltip" title="@Translate("Deceased", "Deceased").JsEncode().ToUpper()"><img src="/Files/Templates/Designs/Kwpn/Images/deceased-icon.png" /></span>} 3313 </div> 3314 <div class="col-xs-12 col-md-10"> 3315 <span class="pedigree"><i class="fa fa-tag"></i> <abbr title='@fatherNameAbbr'>@fatherName</abbr> x <abbr title='@mothersFatherNameAbbr'>@mothersFatherName</abbr></span> 3316 </div> 3317 </div> 3318 } 3319 3320 <div class="row"> 3321 <div class="col-xs-12 col-md-2 col-md-push-10 aside-page"> 3322 <div class="bg_aside closed"> 3323 <div class="aside_pullLabel">Menu<i class="fa fa-bars" aria-hidden="true"></i></div> 3324 <aside> 3325 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 3326 @*note: variables like "action/isAlive/isMyHorse/horse/culture/animalCode/isApprovedStud" are set in the parent: Paragraph/HorseDatabase.cshtml*@ 3327 @*DEFAULT ASIDE*@ 3328 @if (string.IsNullOrWhiteSpace(action)) 3329 { 3330 #region TabLinks 3331 <h2 id="listheader-tabs" data-childId="view-list-tabs" class="notactive"><span>@Translate("Menu", "Menu")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 3332 <div class="list-tabs"> 3333 <ul> 3334 <li data-tab="tab_general" data-vp="@Translate("SEO_TrackPageviewPage_Database_tab_general", "general-info").UrlEncode()" class="active"><a href="javascript:void(0);">@Translate("General", "General")</a></li> 3335 <li data-tab="tab_achievements" data-vp="@Translate("SEO_TrackPageviewPage_Database_tab_achievements", "achievements").UrlEncode()"><a href="javascript:void(0);">@Translate("Achievements", "Achievements")</a></li> 3336 <li data-tab="tab_achievements_motherline" data-vp="@Translate("SEO_TrackPageviewPage_Database_tab_achievements_motherline", "achievements-motherline").UrlEncode()"><a href="javascript:void(0);">@Translate("AchievementsMotherLine", "Achievements mother line")</a></li> 3337 @if (showGeneticProfileBasedOnRegister) 3338 { 3339 <li data-tab="tab_genetic_profile" data-vp="@Translate("SEO_TrackPageviewPage_Database_tab_genetic_profile", "genetic-profile").UrlEncode()"><a href="javascript:void(0);">@Translate("GeneticProfile", "Genetic profile")</a></li> 3340 } 3341 @if (isMare || isMyHorse) 3342 { 3343 <li data-tab="tab_offspring" data-vp="@Translate("SEO_TrackPageviewPage_Database_tab_offspring", "offspring").UrlEncode()"><a href="javascript:void(0);">@Translate("Offspring", "Offspring")</a></li> 3344 } 3345 @if (isApprovedStud) 3346 { 3347 <li data-tab="tab_breeding_registration" data-vp="@Translate("SEO_TrackPageviewPage_Database_tab_breeding_registration", "breeding-registration").UrlEncode()"><a href="javascript:void(0);">@Translate("BreedingRegistration", "Breeding registration")</a></li> 3348 <li data-tab="tab_approved_offspring" data-vp="@Translate("SEO_TrackPageviewPage_Database_tab_approved_offspring", "approved-offspring").UrlEncode()"><a href="javascript:void(0);">@Translate("ApprovedOffspring", "Approved offspring")</a></li> 3349 <li data-tab="tab_performance_report" data-vp="@Translate("SEO_TrackPageviewPage_Database_tab_performance_report", "performance-report").UrlEncode()"><a href="javascript:void(0);">@Translate("PerformanceReport", "Performance report")</a></li> 3350 <li data-tab="tab_performance_figures" data-vp="@Translate("SEO_TrackPageviewPage_Database_tab_performance_figures", "performance-figures").UrlEncode()"><a href="javascript:void(0);">@Translate("PerformanceFigures", "Performance figures")</a></li> 3351 <li data-tab="tab_availability" data-vp="@Translate("SEO_TrackPageviewPage_Database_tab_availability", "availability").UrlEncode()"><a href="javascript:void(0);">@Translate("Availability", "Availability")</a></li> 3352 <li data-tab="tab_descendant_report" data-vp="@Translate("SEO_TrackPageviewPage_Database_tab_descendant_report", "descendant-report").UrlEncode()"><a href="javascript:void(0);">@Translate("DescendantsReport", "Descendants report")</a></li> 3353 } 3354 @{ 3355 var asideBreeders = breeders?.Where(b => b.AllowedOwnerBreeder && Kwpn.Repository.Helpers.UserHelper.CheckIfIsMember(b.PersonCode)); 3356 if (asideBreeders != null && asideBreeders.Any()) 3357 { 3358 <li data-tab="tab_breeders_info"> 3359 <span class="list-item"> 3360 @(asideBreeders.Count() > 1 ? Translate("Breeders", "Breeders") : Translate("Breeder", "Breeder")):<br /> 3361 @foreach (var breeder in asideBreeders) 3362 { 3363 <span class="breeder-link" data-personcode="@breeder.PersonCode">@breeder.PersonName</span> 3364 } 3365 </span> 3366 </li> 3367 } 3368 } 3369 </ul> 3370 </div> 3371 3372 @SnippetStart("JavascriptsBottom") 3373 <script id="videoTemplate" type="text/html"> 3374 {{if EmbedURL}} 3375 <div class="row"> 3376 <div class="col-xs-12 col-md-7"> 3377 {{if Title}} 3378 <h3>${Title}</h3> 3379 {{/if}} 3380 <div class="embed-responsive embed-responsive-16by9"> 3381 <iframe data-src="${EmbedURL}" class="embed-responsive-item" allowfullscreen></iframe> 3382 <div onclick="(function (elem) {const iframe = $(elem).prev('iframe');iframe.attr('src', iframe.attr('data-src'));$(elem).remove();})(this);"> 3383 <img src="${Thumb}" class="embed-responsive-item" /> 3384 <i class="play-button"></i> 3385 </div> 3386 </div> 3387 <div class="videoProperties"> 3388 <small> 3389 {{if Description && Description.length > 10}} 3390 <i>${Description}</i><br /> 3391 {{/if}} 3392 {{if Author}} 3393 @Translate("Author"): ${Author}<br /> 3394 {{/if}} 3395 {{if Views.All >= 0}} 3396 @Translate("Views"): ${Views.All}x <br /> 3397 {{/if}} 3398 </small> 3399 </div> 3400 <br /> 3401 </div> 3402 </div> 3403 {{/if}} 3404 </script> 3405 <script> 3406 $(document).ready(function () { 3407 // check for videos 3408 var getVideoCountUrl = "/kwpnwebapi/videos/getvideosbyhorsecount/@culture/@horse.AnimalCode"; 3409 $.getJSON(getVideoCountUrl).done(function (resultcount) { 3410 if (resultcount > 0) { 3411 $(".list-tabs ul").append("<li data-tab=\"tab_videos\"><a href=\"javascript:void(0);\">@Translate("Videos", "Videos")</a></li>"); 3412 3413 $(".list-tabs li[data-tab=tab_videos] a").click(function () { 3414 var listItem = $(this).parent(); 3415 var tab = listItem.attr("data-tab"); 3416 3417 // remove existing active from tab list 3418 $(".list-tabs li").removeClass("active"); 3419 3420 // add active 3421 listItem.addClass("active"); 3422 3423 // hide all content items 3424 $(".horse-detail-item").addClass("hidden"); 3425 3426 LoadVideos(); 3427 3428 // show items corresponding to current active tab 3429 $(".horse-detail-item[data-content=" + tab + "]").removeClass("hidden"); 3430 }); 3431 3432 } 3433 }).fail(function (jqxhr, textStatus, error) { 3434 var err = textStatus + ", " + error; 3435 console.error("Request AddHorse Failed: " + err); 3436 }); 3437 3438 function LoadVideos() { 3439 3440 var videoContent = $("#video-container", "#horse-detail-item-videos"); 3441 if (videoContent.html() === "") { // if not empty, the video's have already been loaded 3442 // add spinner 3443 videoContent.html("<i class=\"fa fa-spinner fa-spin\"></a>"); 3444 3445 // load videos 3446 var getVideoUrl = "/kwpnwebapi/videos/getvideosbyhorse/@culture/@horse.AnimalCode"; 3447 $.getJSON(getVideoUrl).done(function (videos) { 3448 videoContent.html(""); // remove spinner 3449 if (videos != null && videos.MediaList != null && videos.MediaList.Results.length > 0) { 3450 $.each(videos.MediaList.Results, function (i, video) { 3451 $("#videoTemplate").tmpl(video).appendTo("#video-container", "#horse-detail-item-videos"); 3452 }); 3453 } 3454 else { 3455 videoContent.html("<p>@Translate("VideoNotFound", "Videos not found")</p>"); 3456 } 3457 }).fail(function (jqxhr, textStatus, error) { 3458 var err = textStatus + ", " + error; 3459 console.error("Request AddHorse Failed: " + err); 3460 videoContent.html("<p>@Translate("AnErrorOccurred", "An error occurred")</p>"); 3461 }); 3462 } 3463 } 3464 3465 function ClearVideos() { 3466 var videoContent = $("#video-container", "#horse-detail-item-videos"); 3467 videoContent.html(""); 3468 } 3469 3470 $(".list-tabs a").click(function () { 3471 3472 var listItem = $(this).parent(); 3473 var tab = listItem.attr("data-tab"); 3474 var vp = listItem.attr("data-vp").toLowerCase(); 3475 3476 // remove existing active from tab list 3477 $(".list-tabs li").removeClass("active"); 3478 3479 // add active 3480 listItem.addClass("active"); 3481 3482 // hide all content items 3483 $(".horse-detail-item").addClass("hidden"); 3484 3485 // SEO VIRTUAL PAGE VIEW LOGGING 3486 SEO.trackPageView("@seoPage.ToLower()/" + vp); 3487 3488 // if item is "video", load videos 3489 if (tab == "tab_videos") { 3490 LoadVideos(); 3491 } 3492 else { 3493 ClearVideos(); 3494 } 3495 3496 // show items corresponding to current active tab 3497 $(".horse-detail-item[data-content=" + tab + "]").removeClass("hidden"); 3498 3499 }); 3500 }); 3501 </script> 3502 @SnippetEnd("JavascriptsBottom") 3503 #endregion 3504 } 3505 3506 @if (string.IsNullOrWhiteSpace(action) && actionShow) 3507 { 3508 #region ActionLinks 3509 <h2 id="listheader-actions" data-childId="list-actions" class="notactive"> 3510 <span>@Translate("Actions", "Actions")</span><i class="fa fa-chevron-down" aria-hidden="true"></i> 3511 </h2> 3512 <div class="list-actions"> 3513 <ul> 3514 @if (actionRegisterHorseToName) 3515 { 3516 <li><a href="@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.AnimalCode, Translate("ActionLink_Register_HorseToName", "RegisterHorse"))">@Translate("Action_Register_HorseToName", "Register horse")</a></li> 3517 } 3518 @if (actionSignUpInspectionEvent) 3519 { 3520 <li><a href="@Kwpn.Repository.Helpers.HorseHelper.GetHorseEventsPageUrl(culture, horse.AnimalCode)">@Translate("Action_SignUp_InspectionEvent", "Sign up for inspection / event")</a></li> 3521 } 3522 @if (actionRequestBreedingAdvice) 3523 { 3524 <li><a href="@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.AnimalCode, Translate("ActionLink_Request_BreedingAdvice", "BreedingAdvice"))">@Translate("Action_Request_BreedingAdvice", "Request a breeding advice")</a></li> 3525 } 3526 @*@if (actionGetStallionAdvice) 3527 { 3528 <li><a href="@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.AnimalCode, Translate("ActionLink_Get_StallionAdvice", "StallionAdvice"))">@Translate("Action_Request_StallionAdvice", "Stallion advice")</a></li> 3529 }*@ 3530 @if (actionRequestGenomicBreedingValueTest) 3531 { 3532 <li><a href="javascript:void(0);" onclick="javascript:AddHorseToGenomeBreedingValueTest();return false;">@Translate("Action_Request_GenomeBreedingValueTest", "Request DNA/OC research")</a></li> 3533 } 3534 @if (actionSellViaMarketplace) 3535 { 3536 <li><a href="@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.AnimalCode, Translate("ActionLink_SellViaMarketplace", "sell"))">@Translate("Action_SellViaMarketplace", "Sell via KWPN Marketplace")</a></li> 3537 } 3538 @if (actionReportHorseSold) 3539 { 3540 <li><a href="javascript:void(0);" class="horse-sold-button">@Translate("Action_Report_HorseSold", "Report horse as sold")</a></li> 3541 } 3542 @if (actionReportDeceasedHorse) 3543 { 3544 <li><a href="@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.AnimalCode, Translate("ActionLink_Report_HorseDied", "HorseDied"))">@Translate("Action_Report_HorseDied", "Report horse died")</a></li> 3545 } 3546 @if (actionInbreedingCalculation) 3547 { 3548 <li><a href="@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.AnimalCode, Translate("ActionLink_InbreedingCalculation", "InbreedingCalculation"))">@Translate("Action_InbreedingCalculation", "Inbreeding calculation")</a></li> 3549 } 3550 @if (actionRequestDuplicate) 3551 { 3552 <li><a href="@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.AnimalCode, Translate("ActionLink_Request_Duplicate", "Duplicate"))">@Translate("Action_Request_Duplicate", "Request duplicate")</a></li> 3553 } 3554 @if (actionRequestContinuedPassport) 3555 { 3556 <li><a href="@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.AnimalCode, Translate("ActionLink_Request_ContinuedPassport", "PassportRenewal"))">@Translate("Action_Request_ContinuedPassport", "Requests for passport renewal")</a></li> 3557 } 3558 @if (actionRequestPredicates) 3559 { 3560 <li><a href="@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.AnimalCode, Translate("ActionLink_Request_Predicates", "RequestPredicates"))">@Translate("Action_Request_Predicates", "Request predicate(s)")</a></li> 3561 } 3562 @if (actionVeterinarianRequestResearch) 3563 { 3564 if (horse.HorseAtLeast2YearsOldOnAprilFirst()) 3565 { 3566 <li><a href="/aanmelden-onderzoek?@Translate("Horse", "Horse")=@horse.AnimalCode&amp;type=PROK">@Translate("Action_Request_PROK_Exam", "Request PROK examination")</a></li> 3567 <li><a href="/aanmelden-onderzoek?@Translate("Horse", "Horse")=@horse.AnimalCode&amp;type=SPST">@Translate("Action_Request_SPST_Exam", "Request SPST examination")</a></li> 3568 } 3569 <li><a href="/aanmelden-onderzoek?@Translate("Horse", "Horse")=@horse.AnimalCode&amp;type=OC">@Translate("Action_Request_OC_Exam", "Request OC examination")</a></li> 3570 } 3571 @if (isMyHorse) 3572 { 3573 <li class="refresh"><a href="#" id="refresh-link"><abbr title="@Translate("Action_RefreshHorseDataAbbr", "When refreshing the horse data we fetch the information from our back-end system. This may take a while.")">@Translate("Action_RefreshHorseData", "Refresh horse data")</abbr></a></li> 3574 } 3575 </ul> 3576 </div> 3577 @SnippetStart("JavascriptsBottom") 3578 <script> 3579 3580 @if (actionRequestGenomicBreedingValueTest) 3581 { 3582 <text> 3583 function AddHorseToGenomeBreedingValueTest() { 3584 var redirectUrl = '@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.AnimalCode, Translate("ActionLink_Request_GenomeBreedingValueTest", "GenomeBreedingValue"))'; 3585 // add horse to KwpnUser.GenomeBreedingValueItems 3586 var addHorseUrl = "/kwpnwebapi/forms/research/upserthorse/@horse.AnimalCode"; 3587 $.getJSON(addHorseUrl).done(function () { 3588 window.location.href = redirectUrl; 3589 }).fail(function (jqxhr, textStatus, error) { 3590 var err = textStatus + ", " + error; 3591 console.error("Request AddHorse Failed: " + err); 3592 }); 3593 } 3594 </text> 3595 } 3596 3597 $(document).ready(function () { 3598 3599 @if (isMyHorse) 3600 { 3601 <text> 3602 $("#refresh-link").off("click").on("click", function (e) { 3603 e.preventDefault(); 3604 $(".horse-database").addClass("hidden"); 3605 $("#refreshcontainer").removeClass("hidden"); 3606 var refreshHorse = "/kwpnwebapi/horses/refreshmyhorse/@culture/@horse.AnimalCode/@true"; 3607 $.ajax(refreshHorse).always(function () { 3608 window.location.href = "@System.Web.HttpContext.Current.Request.RawUrl"; 3609 }); 3610 return false; 3611 }); 3612 </text> 3613 } 3614 3615 // check if document download links should be added to the action list and if so, do 3616 @if (Kwpn.Repository.Helpers.LoginHelper.HasAccessToExtendedHorseData()) 3617 { 3618 <text> 3619 // download documents 3620 $(".downloaddocument").remove(); 3621 var downloadsApiUrl = "/kwpnwebapi/horses/getdownloaddocuments/@culture/@animalCode"; 3622 $.getJSON(downloadsApiUrl).done(function (result) { 3623 if (result != null && result.length > 0) { 3624 $.each(result, function (i, downloadDocument) { 3625 var downloadDocumentUrl = downloadDocument.URL; 3626 if (downloadDocumentUrl != null) { 3627 downloadDocumentUrl = downloadDocumentUrl.replace(/\\/g, "/"); // fix slashes 3628 var downloadDocumentLabel = "@Translate("DownloadDocument", "Download document"): " + downloadDocument.TypeDocument; 3629 var downloadDocumentListItem = "<li class=\"downloaddocument\"><a href=\"" + downloadDocumentUrl + "\" download target=\"_blank\">" + downloadDocumentLabel + "</a></li>"; 3630 $("aside .list-actions ul").find(' > li:nth-last-child(1)').before(downloadDocumentListItem); // place at the end, but before the last, which is the refresh button 3631 } 3632 }); 3633 } 3634 }).fail(function (jqxhr, textStatus, error) { 3635 var err = textStatus + ", " + error; 3636 console.error("Request Getdownloaddocuments Failed: " + err); 3637 }); 3638 </text> 3639 } 3640 }); 3641 </script> 3642 @SnippetEnd("JavascriptsBottom") 3643 #endregion 3644 } 3645 3646 @*ACTION ASIDES*@ 3647 @if (!string.IsNullOrWhiteSpace(action)) 3648 { 3649 var productService = new Dynamicweb.Ecommerce.Products.ProductService(); 3650 var ecomLanguageId = Dynamicweb.Frontend.PageView.Current().Area.EcomLanguageId; 3651 3652 // EVENT SIGN UP 3653 if (action.Equals(Translate("ActionLink_SignUp_InspectionEvent", "EventSignUp"), StringComparison.InvariantCultureIgnoreCase) && 3654 actionSignUpInspectionEvent) 3655 { 3656 var eventSignUpProduct = productService.GetProductByNumber(Kwpn.Models.Constants.StringConstants.ProductNumbers.EventSignUp, ecomLanguageId); 3657 if (eventSignUpProduct != null) 3658 { 3659 <h2 id="event-signup-aside-info-header" data-childId="event-signup-aside-info" class="notactive"><span>@Translate("Information", "Information")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 3660 <div class="list-actions"> 3661 <table id="event-signup-aside-aside-info" class="aside-content aside-content-info notactive"> 3662 <colgroup> 3663 <col width="30" /> 3664 <col /> 3665 </colgroup> 3666 <tr class="head"> 3667 <th><i class="fa fa-info"></i></th> 3668 <th>@Translate("Product", "Product")</th> 3669 </tr> 3670 <tr> 3671 <td>&nbsp;</td> 3672 <td>@eventSignUpProduct.Name <span class="inspection-price"></span></td> 3673 </tr> 3674 <tr class="required-services hidden" data-subtotal=""> 3675 <td>&nbsp;</td> 3676 <td class="required-service"></td> 3677 </tr> 3678 <tr class="head"> 3679 <th><i class="fa fa-eur"></i></th> 3680 <th>@Translate("Price", "Price")</th> 3681 </tr> 3682 <tr> 3683 <td>&nbsp;</td> 3684 <td>&euro; <span id="eventSignUpPriceAside">@Translate("NotYetKnown", "n.y.k.")</span> (@Translate("VatIncluded", "VAT included"))</td> 3685 </tr> 3686 </table> 3687 </div> 3688 } 3689 } 3690 3691 3692 // CUP EVENT SIGN UP 3693 if (actionSignUpCupEvent) 3694 { 3695 var eventSignUpProduct = productService.GetProductByNumber(Kwpn.Models.Constants.StringConstants.ProductNumbers.EventSignUp, ecomLanguageId); 3696 if (eventSignUpProduct != null) 3697 { 3698 <h2 id="event-signup-aside-info-header" data-childId="event-signup-aside-info" class="notactive"><span>@Translate("Information", "Information")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 3699 <div class="list-actions"> 3700 <table id="event-signup-aside-aside-info" class="aside-content aside-content-info notactive"> 3701 <colgroup> 3702 <col width="30" /> 3703 <col /> 3704 </colgroup> 3705 <tr class="head"> 3706 <th><i class="fa fa-info"></i></th> 3707 <th>@Translate("Product", "Product")</th> 3708 </tr> 3709 <tr> 3710 <td>&nbsp;</td> 3711 <td>@eventSignUpProduct.Name <span class="inspection-price"></span></td> 3712 </tr> 3713 <tr class="required-services hidden" data-subtotal=""> 3714 <td>&nbsp;</td> 3715 <td class="required-service"></td> 3716 </tr> 3717 <tr class="head"> 3718 <th><i class="fa fa-eur"></i></th> 3719 <th>@Translate("Price", "Price")</th> 3720 </tr> 3721 <tr> 3722 <td>&nbsp;</td> 3723 <td><span id="eventCupSignUpPriceAside">@Translate("NotYetKnown", "n.y.k.")</span> (@Translate("VatIncluded", "VAT included"))</td> 3724 </tr> 3725 </table> 3726 </div> 3727 } 3728 } 3729 3730 // BREEDING ADVICE 3731 else if (action.Equals(Translate("ActionLink_Request_BreedingAdvice", "BreedingAdvice"), StringComparison.InvariantCultureIgnoreCase) && 3732 actionRequestBreedingAdvice) 3733 { 3734 var breedingAdviceproduct = (Kwpn.Repository.Helpers.LoginHelper.CurrentUserIsLoggedIn() && Kwpn.Repository.Repositories.KwpnUsers.CurrentUser().IsMember) ? productService.GetProductByNumber( 3735 Kwpn.Models.Constants.StringConstants.ProductNumbers.BreedingAdviceForMembers, ecomLanguageId) : productService.GetProductByNumber( 3736 Kwpn.Models.Constants.StringConstants.ProductNumbers.BreedingAdviceForNonMembers, ecomLanguageId); 3737 3738 if (breedingAdviceproduct != null) 3739 { 3740 <h2 id="breeding-advice-aside-info-header" data-childId="breeding-advice-aside-info" class="notactive"><span>@Translate("Information", "Information")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 3741 <div class="list-actions"> 3742 <table id="breeding-advice-aside-info" class="aside-content aside-content-info notactive"> 3743 <colgroup> 3744 <col width="30" /> 3745 <col /> 3746 </colgroup> 3747 <tr class="head"> 3748 <th><i class="fa fa-info"></i></th> 3749 <th>@Translate("Product", "Product")</th> 3750 </tr> 3751 <tr> 3752 <td>&nbsp;</td> 3753 <td>@breedingAdviceproduct.Name</td> 3754 </tr> 3755 <tr class="head"> 3756 <th><i class="fa fa-eur"></i></th> 3757 <th>@Translate("Price", "Price")</th> 3758 </tr> 3759 <tr> 3760 <td>&nbsp;</td> 3761 <td>@Kwpn.Repository.Helpers.ProductHelper.FormatPrice(Kwpn.Repository.Helpers.ProductHelper.GetProductPrice(breedingAdviceproduct)) (@Translate("VatIncluded", "VAT included"))</td> 3762 </tr> 3763 </table> 3764 </div> 3765 } 3766 } 3767 3768 // STALLION ADVICE 3769 else if (action.Equals(Translate("ActionLink_Get_StallionAdvice", "StallionAdvice"), StringComparison.InvariantCultureIgnoreCase) && 3770 actionGetStallionAdvice) 3771 { 3772 <h2 id="stallion-advice-aside-info-header" data-childId="stallion-advice-aside-info" class="notactive"><span>@Translate("Information", "Information")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 3773 <div class="list-actions"> 3774 <table id="stallion-advice-aside-info" class="aside-content aside-content-info notactive"> 3775 <colgroup> 3776 <col width="30" /> 3777 <col /> 3778 </colgroup> 3779 <tr class="head"> 3780 <th><i class="fa fa-info"></i></th> 3781 <th>Hengsten advies</th> 3782 </tr> 3783 <tr> 3784 <td>&nbsp;</td> 3785 <td>@horseName<br /><span id="stallion-advice-aside-breedingdirection-mare">@horse.BreedingDirection</span></td> 3786 </tr> 3787 </table> 3788 <ul class="aside-content notactive" id="stallion-advice-aside-links"> 3789 <li class="step-0 hidden"><a href='#' onclick="StallionAdvice.ShowStep(0); return false;">@Translate("StallionAdvice_BackToStep0_LinkText", "Explanation")</a></li> 3790 <li class="step-1 hidden"><a href='#' onclick="StallionAdvice.ShowStep(1); return false;">@Translate("StallionAdvice_BackToStep1_LinkText", "Step 1")</a></li> 3791 <li class="step-2 hidden"><a href='#' onclick="StallionAdvice.ShowStep(2); return false;">@Translate("StallionAdvice_BackToStep2_LinkText", "Step 2")</a></li> 3792 </ul> 3793 </div> 3794 } 3795 3796 // CONTINUED PASSPORT 3797 else if (action.Equals(Translate("ActionLink_Request_ContinuedPassport", "PassportRenewal"), StringComparison.InvariantCultureIgnoreCase) && 3798 actionRequestContinuedPassport) 3799 { 3800 var passportRenewalProduct = productService.GetProductByNumber(Kwpn.Models.Constants.StringConstants.ProductNumbers.PassportRenewal, ecomLanguageId); 3801 if (passportRenewalProduct != null) 3802 { 3803 <h2 id="passport-renewal-aside-info-header" data-childId="passport-renewal-aside-info" class="notactive"><span>@Translate("Information", "Information")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 3804 <div class="list-actions"> 3805 <table id="passport-renewal-aside-info" class="aside-content aside-content-info notactive"> 3806 <colgroup> 3807 <col width="30" /> 3808 <col /> 3809 </colgroup> 3810 <tr class="head"> 3811 <th><i class="fa fa-info"></i></th> 3812 <th>@Translate("Product", "Product")</th> 3813 </tr> 3814 <tr> 3815 <td>&nbsp;</td> 3816 <td>@passportRenewalProduct.Name</td> 3817 </tr> 3818 <tr class="head"> 3819 <th><i class="fa fa-eur"></i></th> 3820 <th>@Translate("Price", "Price")</th> 3821 </tr> 3822 <tr> 3823 <td>&nbsp;</td> 3824 <td>@Kwpn.Repository.Helpers.ProductHelper.FormatPrice(Kwpn.Repository.Helpers.ProductHelper.GetProductPrice(passportRenewalProduct)) (@Translate("VatIncluded", "VAT included"))</td> 3825 </tr> 3826 </table> 3827 </div> 3828 } 3829 } 3830 3831 // PASSPORT DUPLICATE 3832 else if (action.Equals(Translate("ActionLink_Request_Duplicate", "Duplicate"), StringComparison.InvariantCultureIgnoreCase) && 3833 actionRequestDuplicate) 3834 { 3835 <h2 id="passport-duplicate-aside-info-header" data-childId="passport-duplicate-aside-info" class="notactive"><span>@Translate("Information", "Information")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 3836 <div class="list-actions"> 3837 <table id="passport-duplicate-info" class="aside-content aside-content-info notactive"> 3838 <colgroup> 3839 <col width="30" /> 3840 <col /> 3841 </colgroup> 3842 <tr class="head"> 3843 <th><i class="fa fa-info"></i></th> 3844 <th>@Translate("Product", "Product")</th> 3845 </tr> 3846 <tr> 3847 <td>&nbsp;</td> 3848 <td id="passport-duplicate-product-name"><!--value is set by javascript based on form selection--></td> 3849 </tr> 3850 <tr class="head"> 3851 <th><i class="fa fa-eur"></i></th> 3852 <th>@Translate("Price", "Price")</th> 3853 </tr> 3854 <tr> 3855 <td>&nbsp;</td> 3856 <td> 3857 <span id="passport-duplicate-product-price"><!--value is set by javascript based on form selection--></span> (@Translate("VatIncluded", "VAT included")) 3858 </td> 3859 </tr> 3860 </table> 3861 </div> 3862 } 3863 3864 // REGISTER HORSE TO NAME 3865 else if (action.Equals(Translate("ActionLink_Register_HorseToName", "RegisterHorse"), StringComparison.InvariantCultureIgnoreCase) && 3866 actionRegisterHorseToName) 3867 { 3868 var registerHorseProduct = productService.GetProductByNumber(Kwpn.Models.Constants.StringConstants.ProductNumbers.RegisterHorse, ecomLanguageId); 3869 if (registerHorseProduct != null) 3870 { 3871 <h2 id="register-horse-aside-info-header" data-childId="register-horse-aside-info" class="notactive"><span>@Translate("Information", "Information")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 3872 <div class="list-actions"> 3873 <table id="register-horse-aside-info" class="aside-content aside-content-info notactive"> 3874 <colgroup> 3875 <col width="30" /> 3876 <col /> 3877 </colgroup> 3878 <tr class="head"> 3879 <th><i class="fa fa-info"></i></th> 3880 <th>@Translate("Product", "Product")</th> 3881 </tr> 3882 <tr> 3883 <td>&nbsp;</td> 3884 <td>@registerHorseProduct.Name</td> 3885 </tr> 3886 <tr class="head"> 3887 <th><i class="fa fa-eur"></i></th> 3888 <th>@Translate("Price", "Price")</th> 3889 </tr> 3890 <tr> 3891 <td>&nbsp;</td> 3892 <td>@Kwpn.Repository.Helpers.ProductHelper.FormatPrice(Kwpn.Repository.Helpers.ProductHelper.GetProductPrice(registerHorseProduct)) (@Translate("VatIncluded", "VAT included"))</td> 3893 </tr> 3894 </table> 3895 </div> 3896 } 3897 } 3898 3899 // REGISTER EMBRYO 3900 else if (action.Equals(Translate("ActionLink_Register_Embryo", "RegisterEmbryo"), StringComparison.InvariantCultureIgnoreCase) && 3901 actionRegisterEmbryo) 3902 { 3903 <h2 id="register-embryo-aside-info-header" data-childId="register-embryo-aside-info" class="notactive"><span>@Translate("Information", "Information")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 3904 <div class="list-actions"> 3905 <table id="register-embryo-aside-info" class="aside-content aside-content-info notactive"> 3906 <colgroup> 3907 <col width="30" /> 3908 <col /> 3909 </colgroup> 3910 <tr class="head"> 3911 <th><i class="fa fa-info"></i></th> 3912 <th>@Translate("Product", "Product")</th> 3913 </tr> 3914 <tr> 3915 <td>&nbsp;</td> 3916 <td id="register-embryo-product-name"><!--value is set by javascript based on form selection--></td> 3917 </tr> 3918 <tr class="head"> 3919 <th><i class="fa fa-eur"></i></th> 3920 <th>@Translate("Price", "Price")</th> 3921 </tr> 3922 <tr> 3923 <td>&nbsp;</td> 3924 <td> 3925 <span id="register-embryo-product-price"><!--value is set by javascript based on form selection--></span> 3926 </td> 3927 </tr> 3928 </table> 3929 </div> 3930 } 3931 3932 // REGISTER FOAL 3933 else if (action.Equals(Translate("ActionLink_Register_Foal", "RegisterFoal"), StringComparison.InvariantCultureIgnoreCase) && 3934 actionRegisterFoal) 3935 { 3936 <h2 id="register-foal-aside-info-header" data-childId="register-foal-aside-info" class="notactive"><span>@Translate("Information", "Information")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 3937 <div class="list-actions"> 3938 <table id="register-foal-aside-info" class="aside-content aside-content-info notactive"> 3939 <colgroup> 3940 <col width="30" /> 3941 <col /> 3942 </colgroup> 3943 <tr class="head"> 3944 <th><i class="fa fa-info"></i></th> 3945 <th>@Translate("Product", "Product")</th> 3946 </tr> 3947 <tr> 3948 <td>&nbsp;</td> 3949 <td id="register-foal-product-name"><!--value is set by javascript based on form selection--></td> 3950 </tr> 3951 <tr class="head"> 3952 <th><i class="fa fa-eur"></i></th> 3953 <th>@Translate("Price", "Price")</th> 3954 </tr> 3955 <tr> 3956 <td>&nbsp;</td> 3957 <td> 3958 <span id="register-foal-product-price"><!--value is set by javascript based on form selection--></span> (@Translate("VatIncluded", "VAT included")) 3959 </td> 3960 </tr> 3961 </table> 3962 </div> 3963 } 3964 3965 // REQUEST WFFS / GENOME BREEDING VALUE TEST 3966 else if (action.Equals(Translate("ActionLink_Request_GenomeBreedingValueTest", "GenomeBreedingValue"), StringComparison.InvariantCultureIgnoreCase) && 3967 actionRequestGenomicBreedingValueTest) 3968 { 3969 <h2 id="genome-breeding-aside-info-header" data-childId="genome-breeding-aside-info" class="notactive"><span>@Translate("Information", "Information")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 3970 <div class="list-actions"> 3971 <table id="genome-breeding-aside-info" class="aside-content aside-content-info notactive"> 3972 <colgroup> 3973 <col width="30" /> 3974 <col /> 3975 </colgroup> 3976 <tr class="head"> 3977 <th><i class="fa fa-info"></i></th> 3978 <th>@Translate("Product", "Product")</th> 3979 </tr> 3980 <tr> 3981 <td>&nbsp;</td> 3982 <td id="genome-breeding-product-name"><!--value is set by javascript based on form selection--></td> 3983 </tr> 3984 <tr class="head"> 3985 <th><i class="fa fa-eur"></i></th> 3986 <th>@Translate("Price", "Price")</th> 3987 </tr> 3988 <tr> 3989 <td>&nbsp;</td> 3990 <td> 3991 <span id="genome-breeding-product-price"><!--value is set by javascript based on form selection--></span> (@Translate("VatIncluded", "VAT included")) 3992 </td> 3993 </tr> 3994 </table> 3995 </div> 3996 } 3997 3998 // SELL HORSE VIA MARKETPLACE 3999 else if (action.Equals(Translate("ActionLink_SellViaMarketplace", "sell"), StringComparison.InvariantCultureIgnoreCase) && 4000 actionSellViaMarketplace) 4001 { 4002 <h2 id="marketplace-aside-info-header" data-childId="marketplace-aside-info" class="notactive"><span>@Translate("Information", "Information")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 4003 <div class="list-actions"> 4004 <table id="marketplace-aside-info" class="aside-content aside-content-info notactive"> 4005 <colgroup> 4006 <col width="30" /> 4007 <col /> 4008 </colgroup> 4009 <tr class="head"> 4010 <th><i class="fa fa-info"></i></th> 4011 <th>@Translate("Product", "Product")</th> 4012 </tr> 4013 <tr> 4014 <td>&nbsp;</td> 4015 <td class="product-name"><!--value is set by javascript based on form selection--></td> 4016 </tr> 4017 <tr class="head paymentInfo hidden"> 4018 <th><i class="fa fa-cc"></i></th> 4019 <th>@Translate("PaymentMethod", "Payment method")</th> 4020 </tr> 4021 <tr class="paymentInfo hidden"> 4022 <td>&nbsp;</td> 4023 <td>@Translate("PaymentMethod_Text_Online", "Pay directly online")</td> 4024 </tr> 4025 <tr class="head"> 4026 <th><i class="fa fa-eur"></i></th> 4027 <th>@Translate("Price", "Price")</th> 4028 </tr> 4029 <tr> 4030 <td>&nbsp;</td> 4031 <td> 4032 <span class="product-price"><!--value is set by javascript based on form selection--></span> (@Translate("VatIncluded", "VAT included")) 4033 </td> 4034 </tr> 4035 </table> 4036 </div> 4037 } 4038 4039 // REQUEST PREDICATES 4040 else if (action.Equals(Translate("ActionLink_Request_Predicates", "RequestPredicates"), StringComparison.InvariantCultureIgnoreCase) && 4041 actionRequestPredicates) 4042 { 4043 <h2 id="request-predicates-aside-info-header" data-childId="request-predicates-aside-info" class="notactive"><span>@Translate("Information", "Information")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 4044 <div class="list-actions"> 4045 <table id="request-predicates-aside-info" class="aside-content aside-content-info notactive"> 4046 <colgroup> 4047 <col width="30" /> 4048 <col /> 4049 </colgroup> 4050 <tr class="head"> 4051 <th><i class="fa fa-info"></i></th> 4052 <th>@Translate("Product", "Product")</th> 4053 </tr> 4054 <tr> 4055 <td>&nbsp;</td> 4056 <td class="product-name"><!--value is set by javascript based on form selection--></td> 4057 </tr> 4058 <tr class="head"> 4059 <th><i class="fa fa-eur"></i></th> 4060 <th>@Translate("Price", "Price")</th> 4061 </tr> 4062 <tr> 4063 <td>&nbsp;</td> 4064 <td> 4065 <span class="product-price"><!--value is set by javascript based on form selection--></span> (@Translate("VatIncluded", "VAT included")) 4066 </td> 4067 </tr> 4068 </table> 4069 </div> 4070 } 4071 } 4072 4073 @*BACK TO DETAILS*@ 4074 @if (!string.IsNullOrWhiteSpace(action)) 4075 { 4076 <h2 id="back-to-info-header" data-childId="back-to-info-list" class="notactive"><span>@Translate("HorseInfo", "Horse info")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 4077 <div class="list-actions"> 4078 <ul id="back-to-info-list" class="aside-content notactive"> 4079 <li><a href='@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, animalCode)'>@Translate("ShowHorseDetails", "Show horse details")</a></li> 4080 </ul> 4081 </div> 4082 } 4083 4084 @*MEMBERSHIP CALL TO ACTION*@ 4085 @*@if (!string.IsNullOrWhiteSpace(action) && (!Kwpn.Repository.Helpers.LoginHelper.HasAccessToExtendedHorseData())) 4086 { 4087 var becomeMemberPageId = Kwpn.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Kwpn.Models.Constants.StringConstants.PageIdSystemNames.BecomeMemberPageId); 4088 if (!string.IsNullOrWhiteSpace(becomeMemberPageId)) 4089 { 4090 var becomeMemberPageUrl = string.Format("/Default.aspx?ID={0}", becomeMemberPageId); 4091 <h2 id="become-member-list-header" data-childId="become-member-list" class="notactive"><span>@Translate("NoAccount?", "No KWPN Account?")</span><i class="fa fa-chevron-down" aria-hidden="true"></i></h2> 4092 <div class="list-actions"> 4093 <ul id="become-member-list" class="aside-content notactive"> 4094 <li><a href='@becomeMemberPageUrl'>@Translate("BecomeMemberNow", "Become a member now")</a></li> 4095 </ul> 4096 </div> 4097 } 4098 }*@ 4099 4100 @if (action == null) 4101 { 4102 <!-- /204473129/DatabaseDetail/Banner1 --> 4103 <div id='div-gpt-ad-banner1-1' class="google-container google-container--size--b google-container--databasedetail"> 4104 <script> 4105 googletag.cmd.push(function () { googletag.display('div-gpt-ad-banner1-1'); }); 4106 </script> 4107 </div> 4108 } 4109 </aside> 4110 </div> 4111 </div> 4112 <article class="col-xs-12 col-md-10 page-content"> 4113 @if ( 4114 !isApprovedStud || 4115 isMyHorse || 4116 (action != null && action.Equals(Translate("ActionLink_SellViaMarketplace", "sell"), StringComparison.InvariantCultureIgnoreCase) && actionSellViaMarketplace)) 4117 { 4118 <div>@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 4119 @*note: variables like "action/isAlive/isMyHorse/horse/culture/animalCode/showGeneral" are set in the parent: Paragraph/HorseDatabase.cshtml*@ 4120 @if (!string.IsNullOrWhiteSpace(action)) 4121 { 4122 4123 // BREEDING ADVICE 4124 if (action.Equals(Translate("ActionLink_Request_BreedingAdvice", "BreedingAdvice"), StringComparison.InvariantCultureIgnoreCase) && 4125 actionRequestBreedingAdvice) 4126 { 4127 var pageIdFormBreedingAdvice = Kwpn.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Kwpn.Models.Constants.StringConstants.FormPageIdSystemNames.BreedingAdvice); 4128 if (!string.IsNullOrWhiteSpace(pageIdFormBreedingAdvice)) 4129 { 4130 showGeneral = false; 4131 4132 // SEO VIRTUAL PAGE VIEW LOGGING 4133 <Text> 4134 <script> 4135 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_action_breeding_advice", "breeding-advice").UrlEncode()).ToLower()"); 4136 </script> 4137 </Text> 4138 4139 @RenderPageContent(Convert.ToInt32(pageIdFormBreedingAdvice)) 4140 } 4141 } 4142 4143 // STALLION ADVICE 4144 @*if (action.Equals(Translate("ActionLink_Get_StallionAdvice", "StallionAdvice"), StringComparison.InvariantCultureIgnoreCase) && 4145 actionGetStallionAdvice) 4146 { 4147 var pageIdGetStallionAdvice = pageService.GetPageByNavigationTag(Dynamicweb.Frontend.PageView.Current().AreaID, Kwpn.Models.Constants.StringConstants.FormPageIdSystemNames.StallionAdvice)?.ID ?? 0; 4148 if (pageIdGetStallionAdvice > 0) 4149 { 4150 showGeneral = false; 4151 4152 // SEO VIRTUAL PAGE VIEW LOGGING 4153 <Text> 4154 <script> 4155 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_action_stalliob_advice", "stallion-advice").UrlEncode()).ToLower()"); 4156 </script> 4157 </Text> 4158 4159 @RenderPageContent(pageIdGetStallionAdvice) 4160 } 4161 }*@ 4162 4163 // EVENT SIGN UP 4164 if (action.Equals(Translate("ActionLink_SignUp_InspectionEvent", "EventSignUp"), StringComparison.InvariantCultureIgnoreCase) && 4165 actionSignUpInspectionEvent) 4166 { 4167 var pageIdFormEventSignUp = Kwpn.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Kwpn.Models.Constants.StringConstants.FormPageIdSystemNames.EventSignUp); 4168 if (!string.IsNullOrWhiteSpace(pageIdFormEventSignUp) && !string.IsNullOrWhiteSpace(actionId)) 4169 { 4170 showGeneral = false; 4171 4172 // SEO VIRTUAL PAGE VIEW LOGGING 4173 <Text> 4174 <script> 4175 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_action_event_signup", "event-signup").UrlEncode()).ToLower()"); 4176 </script> 4177 </Text> 4178 4179 @RenderPageContent(Convert.ToInt32(pageIdFormEventSignUp)) 4180 } 4181 } 4182 4183 // CUP EVENT SIGN UP 4184 if (actionSignUpCupEvent) 4185 { 4186 var pageIdFormCupEventSignUp = Kwpn.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Kwpn.Models.Constants.StringConstants.FormPageIdSystemNames.CupEventSignUp); 4187 if (!string.IsNullOrWhiteSpace(pageIdFormCupEventSignUp)) 4188 { 4189 showGeneral = false; 4190 4191 // SEO VIRTUAL PAGE VIEW LOGGING 4192 <Text> 4193 <script> 4194 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_action_event_signup", "event-signup").UrlEncode()).ToLower()"); 4195 </script> 4196 </Text> 4197 4198 @RenderPageContent(Convert.ToInt32(pageIdFormCupEventSignUp)) 4199 } 4200 } 4201 4202 // REPORT DECEASED HORSE 4203 if (action.Equals(Translate("ActionLink_Report_HorseDied", "HorseDied"), StringComparison.InvariantCultureIgnoreCase) && 4204 actionReportDeceasedHorse) 4205 { 4206 var pageIdReportDeceased = Kwpn.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Kwpn.Models.Constants.StringConstants.FormPageIdSystemNames.ReportDeceased); 4207 if (!string.IsNullOrWhiteSpace(pageIdReportDeceased)) 4208 { 4209 showGeneral = false; 4210 4211 // SEO VIRTUAL PAGE VIEW LOGGING 4212 <Text> 4213 <script> 4214 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_action_report_deceased_horse", "report-deceased-horse").UrlEncode()).ToLower()"); 4215 </script> 4216 </Text> 4217 4218 @RenderPageContent(Convert.ToInt32(pageIdReportDeceased)) 4219 } 4220 } 4221 4222 // CONINUED PASSPORT 4223 if (action.Equals(Translate("ActionLink_Request_ContinuedPassport", "PassportRenewal"), StringComparison.InvariantCultureIgnoreCase) && 4224 actionRequestContinuedPassport) 4225 { 4226 var pageIdPassportRenewal = Kwpn.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Kwpn.Models.Constants.StringConstants.FormPageIdSystemNames.PassportRenewal); 4227 if (!string.IsNullOrWhiteSpace(pageIdPassportRenewal)) 4228 { 4229 showGeneral = false; 4230 4231 // SEO VIRTUAL PAGE VIEW LOGGING 4232 <Text> 4233 <script> 4234 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_action_continued_passport", "continued-passport").UrlEncode()).ToLower()"); 4235 </script> 4236 </Text> 4237 4238 @RenderPageContent(Convert.ToInt32(pageIdPassportRenewal)) 4239 } 4240 } 4241 4242 // REQUEST DUPLICATE 4243 if (action.Equals(Translate("ActionLink_Request_Duplicate", "Duplicate"), StringComparison.InvariantCultureIgnoreCase) && 4244 actionRequestDuplicate) 4245 { 4246 var pageIdPassportDuplicate = Kwpn.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Kwpn.Models.Constants.StringConstants.FormPageIdSystemNames.PassportDuplicate); 4247 if (!string.IsNullOrWhiteSpace(pageIdPassportDuplicate)) 4248 { 4249 showGeneral = false; 4250 4251 // SEO VIRTUAL PAGE VIEW LOGGING 4252 <Text> 4253 <script> 4254 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_action_request_duplicate", "request-duplicate").UrlEncode()).ToLower()"); 4255 </script> 4256 </Text> 4257 4258 @RenderPageContent(Convert.ToInt32(pageIdPassportDuplicate)) 4259 } 4260 } 4261 4262 // REGISTER HORSE TO NAME 4263 if (action.Equals(Translate("ActionLink_Register_HorseToName", "RegisterHorse"), StringComparison.InvariantCultureIgnoreCase) && 4264 actionRegisterHorseToName) 4265 { 4266 var pageIdFormRegisterHorse = Kwpn.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Kwpn.Models.Constants.StringConstants.FormPageIdSystemNames.RegisterHorse); 4267 if (!string.IsNullOrWhiteSpace(pageIdFormRegisterHorse)) 4268 { 4269 showGeneral = false; 4270 4271 // SEO VIRTUAL PAGE VIEW LOGGING 4272 <Text> 4273 <script> 4274 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_action_register_horse", "register-horse").UrlEncode()).ToLower()"); 4275 </script> 4276 </Text> 4277 4278 @RenderPageContent(Convert.ToInt32(pageIdFormRegisterHorse)) 4279 } 4280 } 4281 4282 // REGISTER EMBRYO 4283 if (action.Equals(Translate("ActionLink_Register_Embryo", "RegisterEmbryo"), StringComparison.InvariantCultureIgnoreCase) && 4284 actionRegisterEmbryo) 4285 { 4286 4287 var pageRegisterEmbryo = pageService.GetPageByNavigationTag(Dynamicweb.Frontend.PageView.Current().AreaID, Kwpn.Models.Constants.StringConstants.FormPageIdSystemNames.RegisterEmbryo); 4288 var pageIdRegisterEmbryo = pageRegisterEmbryo?.ID ?? 0; 4289 if (pageIdRegisterEmbryo > 0) 4290 { 4291 showGeneral = false; 4292 4293 // SEO VIRTUAL PAGE VIEW LOGGING 4294 <Text> 4295 <script> 4296 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_action_register_embryo", "register-embryo").UrlEncode()).ToLower()"); 4297 </script> 4298 </Text> 4299 4300 @RenderPageContent(pageIdRegisterEmbryo) 4301 } 4302 } 4303 4304 // REGISTER FOAL 4305 if (action.Equals(Translate("ActionLink_Register_Foal", "RegisterFoal"), StringComparison.InvariantCultureIgnoreCase) && 4306 actionRegisterFoal) 4307 { 4308 var pageIdRegisterFoal = Kwpn.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Kwpn.Models.Constants.StringConstants.FormPageIdSystemNames.RegisterFoal); 4309 if (!string.IsNullOrWhiteSpace(pageIdRegisterFoal)) 4310 { 4311 showGeneral = false; 4312 4313 // SEO VIRTUAL PAGE VIEW LOGGING 4314 <Text> 4315 <script> 4316 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_action_register_foal", "register-foal").UrlEncode()).ToLower()"); 4317 </script> 4318 </Text> 4319 4320 @RenderPageContent(Convert.ToInt32(pageIdRegisterFoal)) 4321 } 4322 } 4323 4324 // REQUEST GENOME BREEDING VALUE OC (DNA-TEST) 4325 if (action.Equals(Translate("ActionLink_Request_GenomeBreedingValueTest", "GenomeBreedingValue"), StringComparison.InvariantCultureIgnoreCase) && 4326 actionRequestGenomicBreedingValueTest) 4327 { 4328 var pageIdGenomicBreedingValueTest = Kwpn.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Kwpn.Models.Constants.StringConstants.FormPageIdSystemNames.RequestGenomeBreedingValueTest); 4329 if (!string.IsNullOrWhiteSpace(pageIdGenomicBreedingValueTest)) 4330 { 4331 showGeneral = false; 4332 4333 // SEO VIRTUAL PAGE VIEW LOGGING 4334 <Text> 4335 <script> 4336 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_action_request_dna_test", "request-dna-test").UrlEncode()).ToLower()"); 4337 </script> 4338 </Text> 4339 4340 @RenderPageContent(Convert.ToInt32(pageIdGenomicBreedingValueTest)) 4341 } 4342 } 4343 4344 // SELL HORSE VIA MARKETPLACE 4345 if (action.Equals(Translate("ActionLink_SellViaMarketplace", "sell"), StringComparison.InvariantCultureIgnoreCase) && actionSellViaMarketplace) 4346 { 4347 var pageIdSellHorse = Kwpn.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Kwpn.Models.Constants.StringConstants.FormPageIdSystemNames.SellHorse); 4348 if (!string.IsNullOrWhiteSpace(pageIdSellHorse)) 4349 { 4350 showGeneral = false; 4351 4352 // SEO VIRTUAL PAGE VIEW LOGGING 4353 <Text> 4354 <script> 4355 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_action_sell_horse", "sell-horse").UrlEncode()).ToLower()"); 4356 </script> 4357 </Text> 4358 4359 @RenderPageContent(Convert.ToInt32(pageIdSellHorse)) 4360 } 4361 } 4362 4363 // INBREED CALCULATION 4364 if (action.Equals(Translate("ActionLink_InbreedingCalculation", "InbreedingCalculation"), StringComparison.InvariantCultureIgnoreCase) && actionInbreedingCalculation) 4365 { 4366 var pageIdInbreedCalculation = Kwpn.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Kwpn.Models.Constants.StringConstants.PageIdSystemNames.InbreedCalculationPageId); 4367 if (!string.IsNullOrWhiteSpace(pageIdInbreedCalculation)) 4368 { 4369 showGeneral = false; 4370 4371 // SEO VIRTUAL PAGE VIEW LOGGING 4372 <Text> 4373 <script> 4374 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_action_inbreed_calculation", "inbreed-calculation").UrlEncode()).ToLower()"); 4375 </script> 4376 </Text> 4377 4378 @RenderPageContent(Convert.ToInt32(pageIdInbreedCalculation)) 4379 } 4380 } 4381 4382 // REQUEST PREDICATES 4383 if (action.Equals(Translate("ActionLink_Request_Predicates", "RequestPredicates"), StringComparison.InvariantCultureIgnoreCase) && actionRequestPredicates) 4384 { 4385 var pageIdRequestPredicates = Kwpn.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Kwpn.Models.Constants.StringConstants.PageIdSystemNames.PredicatesRequestPageId); 4386 if (!string.IsNullOrWhiteSpace(pageIdRequestPredicates)) 4387 { 4388 showGeneral = false; 4389 4390 // SEO VIRTUAL PAGE VIEW LOGGING 4391 <Text> 4392 <script> 4393 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_action_request_predicates", "request-predicates").UrlEncode()).ToLower()"); 4394 </script> 4395 </Text> 4396 4397 @RenderPageContent(Convert.ToInt32(pageIdRequestPredicates)) 4398 } 4399 } 4400 } 4401 <script> 4402 var pageTitle = $('.paragraphTitel h1, .paragraphText h1').text(); 4403 $('.paragraphTitel h1, .paragraphText h1').remove(); 4404 $('.pageTitle').text(pageTitle); 4405 </script></div> 4406 } 4407 @if (showGeneral) 4408 { 4409 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 4410 <div class="horse-detail-item" id="horse-detail-item-stud-photo" data-content="tab_general"> 4411 @if (horse.HasImage) 4412 { 4413 var studPhoto = string.Format("images/horseimage.ashx?pc={0}", horse.AnimalCode); 4414 <div class="row"> 4415 <div class="col-xs-12"> 4416 <img src="@studPhoto" alt="@horseName" /> 4417 </div> 4418 </div> 4419 } 4420 </div> 4421 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 4422 <div class="horse-detail-item" id="horse-detail-item-general-info" data-content="tab_general"> 4423 @{ 4424 var publicSportsLevels = Kwpn.Repository.Helpers.FormatHelpers.CreateSportniveauList(horse.SportResults); 4425 var kinship = Kwpn.Repository.Helpers.HorseHelper.GetKinshipPercentage(horse, Dynamicweb.Frontend.PageView.Current().Area.Culture); 4426 } 4427 @CreateHorseInfoTableRow(Translate("LifeNumber", "Life number"), lifeNumber) 4428 @CreateHorseInfoTableRow(Translate("DateOfBirth", "Date of birth"), dateOfBirth) 4429 @CreateHorseInfoTableRow(Translate("BreedingDirection", "Breeding direction"), breedingDirection) 4430 @CreateHorseInfoTableRow(Translate("Register", "Register"), register) 4431 @if (!string.IsNullOrEmpty(kinship)) 4432 { 4433 var kinshipLabel = Translate("Kinship", "Kinship"); 4434 var kinshipValue = kinship; 4435 if (kinship.Contains(":")) { 4436 kinshipLabel = kinship.Split(':')[0].Trim(); 4437 kinshipValue = kinship.Split(':')[1].Trim(); 4438 } 4439 @CreateHorseInfoTableRow(kinshipLabel, kinshipValue) 4440 } 4441 @if (!string.IsNullOrWhiteSpace(publicSportsLevels)) 4442 { 4443 @CreateHorseInfoTableRow(Translate("SportStandings", "Sport standings"), publicSportsLevels) 4444 } 4445 @CreateHorseInfoTableRow(Translate("Withers", "Withers"), withers) 4446 @CreateHorseInfoTableRow(Translate("Color", "Color"), color) 4447 @if (!string.IsNullOrWhiteSpace(wffs)) 4448 { 4449 @CreateHorseInfoTableRow(Translate("WFFS", "WFFS"), wffs.ToLower()) 4450 } 4451 @if (isMyHorse || isBredByMe) 4452 { 4453 @CreateHorseInfoTableRow(Translate("ChipNumber", "Chip number"), chipNumber) 4454 } 4455 </div> 4456 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 4457 <div class="horse-detail-item" id="horse-detail-item-breeders" data-content="tab_general"> 4458 <div class="breedersinfo infotable"> 4459 4460 @if (hasBreeders) 4461 { 4462 var showBreederLinks = breeders.Any(breeder => breeder.AllowedOwnerBreeder && Kwpn.Repository.Helpers.UserHelper.CheckIfIsMember(breeder.PersonCode)); 4463 4464 <h2>@(breeders.Count() > 1 ? Translate("Breeders", "Breeders") : Translate("Breeder", "Breeder"))</h2> 4465 4466 if (showBreederLinks) 4467 { 4468 <p>@Translate("Breeders_ClickOnNameText", "Click the breeder name to get more info about this breeder.")</p> 4469 } 4470 4471 var breederCounter = 0; 4472 @CreateInfoTableRow(breederCounter, Translate("Name", "Name"), "", true) 4473 foreach (var breeder in breeders) 4474 { 4475 if (breeder.AllowedOwnerBreeder) 4476 { 4477 var linkData = Kwpn.Repository.Helpers.UserHelper.CheckIfIsMember(breeder.PersonCode) ? $" class=\"breeder-link\" data-personcode=\"{breeder.PersonCode}\"" : ""; // only link to breeders which are member 4478 @CreateInfoTableRow(breederCounter, $"<span{linkData}>{breeder.PersonName}</span>", "", false, false, false, false, true) 4479 } 4480 else 4481 { 4482 @CreateInfoTableRow(breederCounter, Translate("Breeders_Anonymous", "Anonymous"), "", false, false, false, false, true) 4483 } 4484 breederCounter++; 4485 } 4486 } 4487 4488 4489 @{ 4490 // if horse is approved stud or horse is mine or minimal 1 owner has given approval to be shown, then show owners 4491 List<Kwpn.Models.ApiModels.PersonModel> owners = horse.Owners; 4492 var hasOwners = owners != null && owners.Any(); 4493 4494 if (hasOwners) 4495 { 4496 var showOwnerLinks = owners.Any(owner => owner.AllowedOwnerBreeder && Kwpn.Repository.Helpers.UserHelper.CheckIfIsMember(owner.PersonCode)); 4497 4498 <h2>@(owners.Count > 1 ? Translate("Registered2", "Registered") : Translate("Registered", "Registered"))</h2> 4499 4500 if (showOwnerLinks) 4501 { 4502 <p>@Translate("Registered_ClickOnNameText", "Click the name to get more info about this registered owner.")</p> 4503 } 4504 4505 var registeredCounter = 0; 4506 @CreateInfoTableRow(registeredCounter, Translate("Name", "Name"), "", true) 4507 foreach (var owner in owners) 4508 { 4509 if (owner.AllowedOwnerBreeder && Kwpn.Repository.Helpers.UserHelper.CheckIfIsMember(owner.PersonCode)) 4510 { 4511 var linkData = Kwpn.Repository.Helpers.UserHelper.CheckIfIsMember(owner.PersonCode) ? $" class=\"registered-link\" data-personcode=\"{owner.PersonCode}\"" : ""; // only link to owners which are member 4512 @CreateInfoTableRow(registeredCounter, $"<span{linkData}>{owner.PersonName}</span>", "", false, false, false, false, true) 4513 } 4514 else 4515 { 4516 @CreateInfoTableRow(registeredCounter, Translate("Owner_Anonymous", "Anonymous"), "", false, false, false, false, true) 4517 } 4518 registeredCounter++; 4519 } 4520 } 4521 } 4522 </div> 4523 </div> 4524 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 4525 @*note: variables like "horse/culture" are set in the parent: Paragraph/HorseDatabase.cshtml*@ 4526 <div class="horse-detail-item" id="horse-detail-item-pedigree" data-content="tab_general"> 4527 @{ 4528 var pedigree_Me = Kwpn.Repository.Helpers.HorseHelper.GetHorseName(horse.SportsName, horse.AnimalName, DateTime.MinValue); 4529 var pedigree_Father = horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.Father); 4530 var pedigree_Mother = horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.Mother); 4531 } 4532 @if (pedigree_Father != null && pedigree_Mother != null) 4533 { 4534 <script type="text/javascript"> 4535 4536 $(document).ready(function () { 4537 4538 var jsGender = ''; 4539 if ('@genderClass' == 'fa-mars') { 4540 jsGender = 'male' 4541 } else { 4542 jsGender = 'female' 4543 } 4544 4545 var datasource = { 4546 'name': '@horse.Lifenumber.JsEncode()', 4547 'title': '@horse.AnimalName.JsEncode()', 4548 @if (Kwpn.Repository.Helpers.HorseHelper.IsAllowedRegister(horse.Register)) 4549 { 4550 <text>'subtext': '@horse.Register.JsEncode()',</text> 4551 <text>'link': '@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.AnimalCode)',</text> 4552 } 4553 else 4554 { 4555 <text>'subtext': '-',</text> 4556 <text>'link': '',</text> 4557 } 4558 'sex': jsGender, 4559 'children': [ 4560 { 4561 'name': '@pedigree_Father.Lifenumber.JsEncode()', 4562 'title': '@pedigree_Father.AnimalName.JsEncode()', 4563 @if (Kwpn.Repository.Helpers.HorseHelper.IsAllowedRegister(pedigree_Father.Register)) 4564 { 4565 <text>'subtext': '@pedigree_Father.Register.JsEncode()',</text> 4566 <text>'link': '@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, pedigree_Father.AnimalCode)',</text> 4567 } 4568 else 4569 { 4570 <text>'subtext': '-',</text> 4571 <text>'link': '',</text> 4572 } 4573 'sex': 'male', 4574 'children': [ 4575 { 4576 'name': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersFather).Lifenumber.JsEncode()', 4577 'title': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersFather).AnimalName.JsEncode()', 4578 @if (Kwpn.Repository.Helpers.HorseHelper.IsAllowedRegister(horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersFather).Register)) 4579 { 4580 <text>'subtext': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersFather).Register.JsEncode()',</text> 4581 <text>'link': '@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersFather).AnimalCode)',</text> 4582 } 4583 else 4584 { 4585 <text>'subtext': '-',</text> 4586 <text>'link': '',</text> 4587 } 4588 'sex': 'male', 4589 'children': [ 4590 { 4591 'name': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersFathersFather).Lifenumber.JsEncode()', 4592 'title': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersFathersFather).AnimalName.JsEncode()', 4593 @if (Kwpn.Repository.Helpers.HorseHelper.IsAllowedRegister(horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersFathersFather).Register)) 4594 { 4595 <text>'subtext': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersFathersFather).Register.JsEncode()',</text> 4596 <text>'link': '@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersFathersFather).AnimalCode)',</text> 4597 } 4598 else 4599 { 4600 <text>'subtext': '-',</text> 4601 <text>'link': '',</text> 4602 } 4603 'sex': 'male' 4604 }, { 4605 'name': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersFathersMother).Lifenumber.JsEncode()', 4606 'title': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersFathersMother).AnimalName.JsEncode()', 4607 @if (Kwpn.Repository.Helpers.HorseHelper.IsAllowedRegister(horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersFathersMother).Register)) 4608 { 4609 <text>'subtext': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersFathersMother).Register.JsEncode()',</text> 4610 <text>'link': '@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersFathersMother).AnimalCode)',</text> 4611 } 4612 else 4613 { 4614 <text>'subtext': '-',</text> 4615 <text>'link': '',</text> 4616 } 4617 'sex': 'female' 4618 } 4619 ] 4620 }, { 4621 'name': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersMother).Lifenumber.JsEncode()', 4622 'title': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersMother).AnimalName.JsEncode()', 4623 @if (Kwpn.Repository.Helpers.HorseHelper.IsAllowedRegister(horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersMother).Register)) 4624 { 4625 <text>'subtext': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersMother).Register.JsEncode()',</text> 4626 <text>'link': '@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersMother).AnimalCode)',</text> 4627 } 4628 else 4629 { 4630 <text>'subtext': '-',</text> 4631 <text>'link': '',</text> 4632 } 4633 'sex': 'female', 4634 'children': [ 4635 { 4636 'name': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersMothersFather).Lifenumber.JsEncode()', 4637 'title': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersMothersFather).AnimalName.JsEncode()', 4638 @if (Kwpn.Repository.Helpers.HorseHelper.IsAllowedRegister(horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersMothersFather).Register)) 4639 { 4640 <text>'subtext': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersMothersFather).Register.JsEncode()',</text> 4641 <text>'link': '@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersMothersFather).AnimalCode)',</text> 4642 } 4643 else 4644 { 4645 <text>'subtext': '-',</text> 4646 <text>'link': '',</text> 4647 } 4648 'sex': 'male' 4649 }, { 4650 'name': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersMothersMother).Lifenumber.JsEncode()', 4651 'title': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersMothersMother).AnimalName.JsEncode()', 4652 @if (Kwpn.Repository.Helpers.HorseHelper.IsAllowedRegister(horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersMothersMother).Register)) 4653 { 4654 <text>'subtext': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersMothersMother).Register.JsEncode()',</text> 4655 <text>'link': '@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.FathersMothersMother).AnimalCode)',</text> 4656 } 4657 else 4658 { 4659 <text>'subtext': '-',</text> 4660 <text>'link': '',</text> 4661 } 4662 'sex': 'female' 4663 }] 4664 }] 4665 }, 4666 { 4667 'name': '@pedigree_Mother.Lifenumber.JsEncode()', 4668 'title': '@pedigree_Mother.AnimalName.JsEncode()', 4669 @if (Kwpn.Repository.Helpers.HorseHelper.IsAllowedRegister(pedigree_Mother.Register)) 4670 { 4671 <text>'subtext': '@pedigree_Mother.Register.JsEncode()',</text> 4672 <text>'link': '@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, pedigree_Mother.AnimalCode)',</text> 4673 } 4674 else 4675 { 4676 <text>'subtext': '-',</text> 4677 <text>'link': '',</text> 4678 } 4679 'sex': 'female', 4680 'children': [ 4681 { 4682 'name': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersFather).Lifenumber.JsEncode()', 4683 'title': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersFather).AnimalName.JsEncode()', 4684 @if (Kwpn.Repository.Helpers.HorseHelper.IsAllowedRegister(horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersFather).Register)) 4685 { 4686 <text>'subtext': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersFather).Register.JsEncode()',</text> 4687 <text>'link': '@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersFather).AnimalCode)',</text> 4688 } 4689 else 4690 { 4691 <text>'subtext': '-',</text> 4692 <text>'link': '',</text> 4693 } 4694 'sex': 'male', 4695 'children': [ 4696 { 4697 'name': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersFathersFather).Lifenumber.JsEncode().JsEncode()', 4698 'title': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersFathersFather).AnimalName.JsEncode().JsEncode()', 4699 @if (Kwpn.Repository.Helpers.HorseHelper.IsAllowedRegister(horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersFathersFather).Register)) 4700 { 4701 <text>'subtext': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersFathersFather).Register.JsEncode().JsEncode()',</text> 4702 <text>'link': '@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersFathersFather).AnimalCode)',</text> 4703 } 4704 else 4705 { 4706 <text>'subtext': '-',</text> 4707 <text>'link': '',</text> 4708 } 4709 'sex': 'male' 4710 }, { 4711 'name': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersFathersMother).Lifenumber.JsEncode()', 4712 'title': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersFathersMother).AnimalName.JsEncode()', 4713 @if (Kwpn.Repository.Helpers.HorseHelper.IsAllowedRegister(horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersFathersMother).Register)) 4714 { 4715 <text>'subtext': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersFathersMother).Register.JsEncode()',</text> 4716 <text>'link': '@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersFathersMother).AnimalCode)',</text> 4717 } 4718 else 4719 { 4720 <text>'subtext': '-',</text> 4721 <text>'link': '',</text> 4722 } 4723 'sex': 'female' 4724 } 4725 ] 4726 }, { 4727 'name': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersMother).Lifenumber.JsEncode()', 4728 'title': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersMother).AnimalName.JsEncode()', 4729 @if (Kwpn.Repository.Helpers.HorseHelper.IsAllowedRegister(horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersMother).Register)) 4730 { 4731 <text>'subtext': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersMother).Register.JsEncode()',</text> 4732 <text>'link': '@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersMother).AnimalCode)',</text> 4733 } 4734 else 4735 { 4736 <text>'subtext': '-',</text> 4737 <text>'link': '',</text> 4738 } 4739 'sex': 'female', 4740 'children': [ 4741 { 4742 'name': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersMothersFather).Lifenumber.JsEncode()', 4743 'title': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersMothersFather).AnimalName.JsEncode()', 4744 @if (Kwpn.Repository.Helpers.HorseHelper.IsAllowedRegister(horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersMothersFather).Register)) 4745 { 4746 <text>'subtext': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersMothersFather).Register.JsEncode()',</text> 4747 <text>'link': '@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersMothersFather).AnimalCode)',</text> 4748 } 4749 else 4750 { 4751 <text>'subtext': '-',</text> 4752 <text>'link': '',</text> 4753 } 4754 'sex': 'male' 4755 }, { 4756 'name': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersMothersMother).Lifenumber.JsEncode()', 4757 'title': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersMothersMother).AnimalName.JsEncode()', 4758 @if (Kwpn.Repository.Helpers.HorseHelper.IsAllowedRegister(horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersMothersMother).Register)) 4759 { 4760 <text>'subtext': '@horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersMothersMother).Register.JsEncode()',</text> 4761 <text>'link': '@Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, horse.GetPredigreeByPrefix(Kwpn.Models.Constants.StringConstants.PedigreePrefixes.MothersMothersMother).AnimalCode)',</text> 4762 } 4763 else 4764 { 4765 <text>'subtext': '-',</text> 4766 <text>'link': '',</text> 4767 } 4768 'sex': 'female' 4769 } 4770 ] 4771 } 4772 ] 4773 }] 4774 }; 4775 4776 4777 $('#chart-container').orgchart({ 4778 data: datasource, 4779 direction: 'l2r', 4780 nodeContent: 'title', 4781 parentNodeSymbol: '', 4782 createNode: function ($node, data) { 4783 var icon = '<div class="imagecontainer"><i class="fa fa-' + (data.sex === 'male' ? 'mars' : 'venus') + '"></i></div>'; 4784 var subtext = '<div class="subtext">' + data.subtext + '</div></div>'; 4785 $node.find('i[class^="edge"], i[class^="fa"]').remove(); 4786 $node.prepend(icon); 4787 $node.append(subtext); 4788 $node.find('.imagecontainer').nextAll().wrapAll('<div class="contextcontainer"/>'); 4789 4790 if (data.link.length > 0) { 4791 $node.css('cursor', 'pointer'); 4792 $node.on('click', function (event) { 4793 location.href = data.link; 4794 }); 4795 } 4796 4797 $node.on('mouseenter', function () { 4798 $('#custom_tooltip').css('display', 'block'); 4799 $('#custom_tooltip').find('.title').text(data.title); 4800 $('#custom_tooltip').find('.subtext').text(data.subtext); 4801 }); 4802 4803 $node.on('mouseleave', function () { 4804 $('#custom_tooltip').css('display', 'none'); 4805 }); 4806 } 4807 }); 4808 4809 $('.tooltip').on('shown.bs.tooltip', function () { 4810 console.log('tooltip show'); 4811 }); 4812 4813 4814 }); 4815 4816 $(window).on('mousemove', function (e) { 4817 var mouseX = e.clientX + 10; 4818 var mouseY = e.clientY + 20; 4819 $('#custom_tooltip').css('left', mouseX); 4820 $('#custom_tooltip').css('top', mouseY); 4821 }); 4822 </script> 4823 <div class="pedigreetree"> 4824 <div id="custom_tooltip"> 4825 <div class="title"></div> 4826 <div class="subtext"></div> 4827 </div> 4828 <h2>@Translate("Pedigree", "Pedigree")</h2> 4829 <div id="chart-container"></div> 4830 </div> 4831 } 4832 </div> 4833 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 4834 <div class="horse-detail-item" id="horse-detail-item-markings" data-content="tab_general"> 4835 @if (isMyHorse || isBredByMe) 4836 { 4837 // MARKINGS DATA 4838 var showMarkings = false; 4839 var head = ""; 4840 var headInfo = horse.GetMarkingByBodyPart(StringConstants.MarkingTypes.Head); 4841 if (headInfo != null) 4842 { 4843 head = headInfo.Description; 4844 showMarkings = true; 4845 } 4846 var frontLeft = ""; 4847 var frontLeftInfo = horse.GetMarkingByBodyPart(StringConstants.MarkingTypes.FrontLeft); 4848 if (frontLeftInfo != null) 4849 { 4850 frontLeft = frontLeftInfo.Description; 4851 showMarkings = true; 4852 } 4853 var frontRight = ""; 4854 var frontRightInfo = horse.GetMarkingByBodyPart(StringConstants.MarkingTypes.FrontRight); 4855 if (frontRightInfo != null) 4856 { 4857 frontRight = frontRightInfo.Description; 4858 showMarkings = true; 4859 } 4860 var rearLeft = ""; 4861 var rearLeftInfo = horse.GetMarkingByBodyPart(StringConstants.MarkingTypes.RearLeft); 4862 if (rearLeftInfo != null) 4863 { 4864 rearLeft = rearLeftInfo.Description; 4865 showMarkings = true; 4866 } 4867 var rearRight = ""; 4868 var rearRightInfo = horse.GetMarkingByBodyPart(StringConstants.MarkingTypes.RearRight); 4869 if (rearRightInfo != null) 4870 { 4871 rearRight = rearRightInfo.Description; 4872 showMarkings = true; 4873 } 4874 var misc = ""; 4875 var miscInfo = horse.GetMarkingByBodyPart(StringConstants.MarkingTypes.Misc); 4876 if (miscInfo != null) 4877 { 4878 misc = miscInfo.Description; 4879 showMarkings = true; 4880 } 4881 4882 if (showMarkings) 4883 { 4884 var markingsCounter = 0; 4885 <div class="breedersinfo infotable"> 4886 <h2>@Translate("Markings", "Markings")</h2> 4887 @CreateInfoTableRow(markingsCounter, Translate("MarkingLocation", "Location"), Translate("MarkingDescription", "Description"), true) 4888 @if (!string.IsNullOrWhiteSpace(head)) 4889 { 4890 @CreateInfoTableRow(markingsCounter, Translate("MarkingHead", "Head"), head, false, false, false) 4891 markingsCounter++; 4892 } 4893 @if (!string.IsNullOrWhiteSpace(frontLeft)) 4894 { 4895 @CreateInfoTableRow(markingsCounter, Translate("MarkingFrontLeft", "Front left"), frontLeft, false, false, false) 4896 markingsCounter++; 4897 } 4898 @if (!string.IsNullOrWhiteSpace(frontRight)) 4899 { 4900 @CreateInfoTableRow(markingsCounter, Translate("MarkingFrontRight", "Front right"), frontRight, false, false, false) 4901 markingsCounter++; 4902 } 4903 @if (!string.IsNullOrWhiteSpace(rearLeft)) 4904 { 4905 @CreateInfoTableRow(markingsCounter, Translate("MarkingRearLeft", "Rear left"), rearLeft, false, false, false) 4906 markingsCounter++; 4907 } 4908 @if (!string.IsNullOrWhiteSpace(rearRight)) 4909 { 4910 @CreateInfoTableRow(markingsCounter, Translate("MarkingRearRight", "Rear right"), rearRight, false, false, false) 4911 markingsCounter++; 4912 } 4913 @if (!string.IsNullOrWhiteSpace(misc)) 4914 { 4915 @CreateInfoTableRow(markingsCounter, Translate("MarkingMiscellaneous", "Miscellaneous"), misc, false, false, false) 4916 markingsCounter++; 4917 } 4918 </div> 4919 } 4920 } 4921 </div> 4922 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 4923 <div class="horse-detail-item" id="horse-detail-item-register" data-content="tab_general"> 4924 @if (isMyHorse || isBredByMe) 4925 { 4926 var predicates = horse.Predicates; 4927 if (predicates != null && predicates.Any()) 4928 { 4929 predicates = predicates.OrderByDescending(p => p.Date).ToList(); 4930 4931 var predicateCounter = 0; 4932 <div class="breedersinfo infotable"> 4933 <h2>@Translate("RegisterHistory", "Register history")</h2> 4934 @CreateInfoTableRow(predicateCounter, Translate("Register", "Register"), Translate("FromDate", "From date"), true) 4935 @foreach (var predicate in predicates) 4936 { 4937 var date = ""; 4938 if (predicate.Date != null && !predicate.Date.Equals(DateTime.MinValue)) 4939 { 4940 date = predicate.Date.ToShortDateString(); 4941 } 4942 4943 @CreateInfoTableRow(predicateCounter, predicate.PredicateName, date, false, false, false) 4944 predicateCounter++; 4945 } 4946 </div> 4947 } 4948 } 4949 </div> 4950 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 4951 <div class="horse-detail-item" id="horse-detail-item-breeding-direction" data-content="tab_general"> 4952 @*NIET BESCHIKBAAR*@ 4953 </div> 4954 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 4955 <div class="horse-detail-item hidden" id="horse-detail-item-achievements" data-content="tab_achievements"> 4956 @{ 4957 var getInspectionLineairScores = false; 4958 var myPerformanceInfo = horse.SportPerformanceMotherline; 4959 var mySportsLevels = Kwpn.Repository.Helpers.FormatHelpers.CreateSportniveauList(horse.SportResults); 4960 List<Kwpn.Models.ApiModels.InspectionInformationModel> inspections = horse.Inspections; 4961 List<Kwpn.Models.ApiModels.InspectionInformationModel> abilityTests = horse.AbilityTests; 4962 } 4963 <h2>@Translate("Achievements", "Achievements")</h2> 4964 4965 @*SportsInfo*@ 4966 <div class="achievements infotable"> 4967 @CreateInfoTableRow(0, Translate("SportsName", "Sportsname"), horse.SportsName, false, false, false, false) 4968 @CreateInfoTableRow(1, Translate("SportsLevel", "Sports level"), mySportsLevels, false, false, false, false) 4969 </div> 4970 4971 @*Inspections*@ 4972 @if (!isApprovedStud && inspections != null && inspections.Any()) 4973 { 4974 getInspectionLineairScores = true; 4975 var inspectionCounter = 0; 4976 <h2>@Translate("Inspections", "Inspections")</h2> 4977 <div class="table-responsive"> 4978 <table id="inspectionstable"> 4979 <tr class="tableheader"> 4980 <th>@Translate("DateAndInspectionType", "Date and inspection type")</th> 4981 <th>@Translate("Location", "Location")</th> 4982 <th>@Translate("Scores", "Scores")</th> 4983 <th>@Translate("Result", "Result")</th> 4984 <td>&nbsp;</td> 4985 </tr> 4986 @foreach (Kwpn.Models.ApiModels.InspectionInformationModel inspection in inspections.OrderByDescending(i => i.DateFrom)) 4987 { 4988 var inspectionDateLocation = ""; 4989 if (inspection.DateFrom != null) 4990 { 4991 inspectionDateLocation = inspection.DateFrom.ToShortDateString(); 4992 } 4993 if (!string.IsNullOrWhiteSpace(inspection.InspectionDescription)) 4994 { 4995 if (!string.IsNullOrWhiteSpace(inspectionDateLocation)) 4996 { 4997 inspectionDateLocation = string.Format("{0},<br />", inspectionDateLocation); 4998 } 4999 inspectionDateLocation = string.Format("{0}{1}", inspectionDateLocation, inspection.InspectionDescription); 5000 } 5001 string premiumPlacing = ""; 5002 if (inspection.Participations != null && inspection.Participations.Count > 0) 5003 { 5004 premiumPlacing = string.Format("{0} {1}", inspection.Participations[0].Premium, inspection.Participations[0].Placing).Trim(); 5005 } 5006 5007 // modulo for row color display 5008 var mod = "0"; 5009 if (inspectionCounter % 2 == 0) 5010 { 5011 mod = "1"; 5012 } 5013 <tr class="mod-@mod"> 5014 <td>@inspectionDateLocation</td> 5015 <td>@inspection.Place</td> 5016 <td class="scores" data-inspectioncode="@inspection.InspectionCode"></td> 5017 <td>@premiumPlacing</td> 5018 <td class="center"> 5019 @if (inspection.Participations != null && inspection.Participations.Count > 0 && 5020 inspection.Participations[0].ResultAppreciatives != null && inspection.Participations[0].ResultAppreciatives.Count > 0) 5021 { 5022 <span class="toggler" data-identifyer='insp-@inspection.InspectionCode-@inspectionCounter' data-typeclass="inspection-details"><i class="fa fa-plus"></i></span> 5023 } 5024 </td> 5025 </tr> 5026 <tr id="insp-@inspection.InspectionCode-@inspectionCounter" class="inspection-details mod-@mod"> 5027 <td>&nbsp;</td> 5028 <td>&nbsp;</td> 5029 <td colspan="3"> 5030 @if (inspection.Rubrics != null && inspection.Rubrics.Count > 0) 5031 { 5032 @*<b>@inspection.Rubrics[0].Description</b><br />*@ 5033 } 5034 @if (inspection.Participations != null && inspection.Participations.Count > 0) 5035 { 5036 var participation = inspection.Participations[0]; 5037 if (participation.ResultAppreciatives != null && participation.ResultAppreciatives.Count > 0) 5038 { 5039 <div class="inspection-summary"> 5040 <table> 5041 <thead> 5042 <tr> 5043 <th>@Translate("Description", "Description")</th> 5044 <th>@Translate("Value", "Value")</th> 5045 </tr> 5046 </thead> 5047 <tbody> 5048 @foreach (var ResultAppreciative in participation.ResultAppreciatives) 5049 { 5050 <tr> 5051 <td>@ResultAppreciative.Description</td> 5052 <td>@ResultAppreciative.Value</td> 5053 </tr> 5054 } 5055 </tbody> 5056 </table> 5057 </div> 5058 } 5059 } 5060 </td> 5061 </tr> 5062 inspectionCounter++; 5063 } 5064 </table> 5065 </div> 5066 } 5067 5068 @*SportResults*@ 5069 @if (abilityTests != null && abilityTests.Count > 0) 5070 { 5071 var abilityCounter = 0; 5072 <h2>@Translate("AbilityTests", "Ability tests")</h2> 5073 <div class="table-responsive"> 5074 <table id="abilitytesttable"> 5075 <tr class="tableheader"> 5076 <th>@Translate("DateAndInspectionType", "Date and inspection type")</th> 5077 <th>@Translate("Location", "Location")</th> 5078 <th>&nbsp;</th> 5079 <td>&nbsp;</td> 5080 </tr> 5081 @foreach (Kwpn.Models.ApiModels.InspectionInformationModel inspection in abilityTests.OrderByDescending(i => i.DateFrom)) 5082 { 5083 var inspectionDateLocation = ""; 5084 if (inspection.DateFrom != null) 5085 { 5086 inspectionDateLocation = inspection.DateFrom.ToShortDateString(); 5087 } 5088 if (!string.IsNullOrWhiteSpace(inspection.InspectionDescription)) 5089 { 5090 if (!string.IsNullOrWhiteSpace(inspectionDateLocation)) 5091 { 5092 inspectionDateLocation = string.Format("{0},<br />", inspectionDateLocation); 5093 } 5094 inspectionDateLocation = string.Format("{0}{1}", inspectionDateLocation, inspection.InspectionDescription); 5095 } 5096 5097 // modulo for row color display 5098 var mod = "0"; 5099 if (abilityCounter % 2 == 0) 5100 { 5101 mod = "1"; 5102 } 5103 <tr class="mod-@mod"> 5104 <td>@inspectionDateLocation</td> 5105 <td>@inspection.Place</td> 5106 <td>&nbsp;</td> 5107 <td class="center"> 5108 @if (inspection.Participations != null && inspection.Participations.Count > 0 && 5109 inspection.Participations[0].ResultAppreciatives != null && inspection.Participations[0].ResultAppreciatives.Count > 0) 5110 { 5111 <span class="toggler" data-identifyer='at-@inspection.InspectionCode-@abilityCounter' data-typeclass="ability-details"><i class="fa fa-plus"></i></span> 5112 } 5113 </td> 5114 </tr> 5115 <tr id="at-@inspection.InspectionCode-@abilityCounter" class="ability-details mod-@mod"> 5116 <td>&nbsp;</td> 5117 <td colspan="3"> 5118 @if (inspection.Rubrics != null && inspection.Rubrics.Count > 0) 5119 { 5120 @*<b>@inspection.Rubrics[0].Description</b><br />*@ 5121 } 5122 @if (inspection.Participations != null && inspection.Participations.Count > 0) 5123 { 5124 var participation = inspection.Participations[0]; 5125 if (participation.ResultAppreciatives != null && participation.ResultAppreciatives.Count > 0) 5126 { 5127 <div class="ability-summary"> 5128 <table> 5129 <thead> 5130 <tr> 5131 <th>@Translate("Description", "Description")</th> 5132 <th>@Translate("Value", "Value")</th> 5133 </tr> 5134 </thead> 5135 <tbody> 5136 @foreach (var ResultAppreciative in participation.ResultAppreciatives) 5137 { 5138 <tr> 5139 <td>@ResultAppreciative.Description</td> 5140 <td>@ResultAppreciative.Value</td> 5141 </tr> 5142 } 5143 </tbody> 5144 </table> 5145 </div> 5146 } 5147 } 5148 </td> 5149 </tr> 5150 abilityCounter++; 5151 } 5152 </table> 5153 </div> 5154 } 5155 </div> 5156 @SnippetStart("JavascriptsBottom") 5157 5158 <script type="text/javascript"> 5159 $(document).ready(function () { 5160 5161 // toggler initializer 5162 $(".toggler", "#horse-detail-item-achievements").click(function () { 5163 var contentId = $(this).attr("data-identifyer"); 5164 var typeClass = $(this).attr("data-typeclass"); 5165 $("." + typeClass).not("#" + contentId).hide(); 5166 $("." + typeClass).not("#" + contentId).prev().find("span.toggler i").removeClass("fa-minus").addClass("fa-plus"); 5167 var currentToggler = $("#" + contentId).prev().find("span.toggler i"); 5168 if (currentToggler.hasClass("fa-minus")) { 5169 currentToggler.removeClass("fa-minus").addClass("fa-plus"); 5170 } else { 5171 currentToggler.removeClass("fa-plus").addClass("fa-minus"); 5172 } 5173 }); 5174 5175 // Get inspection lineair score documents and attach to inspection 5176 @if (getInspectionLineairScores) 5177 { 5178 <text> 5179 $(".inspectionlineairscore").remove(); 5180 var inspectionlineairscoreApiUrl = "/kwpnwebapi/horses/getinspectionlineairscore/@culture/@animalCode"; 5181 $.getJSON(inspectionlineairscoreApiUrl).done(function (result) { 5182 if (result != null && result.length > 0) { 5183 $.each(result, function (i, inspectionLineairScore) { 5184 var inspectionCode = inspectionLineairScore.Reference; 5185 var inspectionLineairScoreUrl = inspectionLineairScore.URL; 5186 if (inspectionCode != null && inspectionLineairScoreUrl != null) { 5187 var $achievement = $("td.scores[data-inspectioncode=" + inspectionCode + "]", "#inspectionstable"); 5188 if ($achievement.length) { 5189 inspectionLineairScoreUrl = inspectionLineairScoreUrl.replace(/\\/g, "/"); // fix slashes 5190 var inspectionLineairScoreListItem = "<a href=\"" + inspectionLineairScoreUrl + "\" download target=\"_blank\">@Translate("ScoreForm", "Score form")</a><br/>"; 5191 $achievement.append(inspectionLineairScoreListItem); 5192 } 5193 } 5194 }); 5195 } 5196 }).fail(function (jqxhr, textStatus, error) { 5197 var err = textStatus + ", " + error; 5198 console.error("Request GetInspectionLineairScore Failed: " + err); 5199 }); 5200 </text> 5201 } 5202 5203 }); 5204 </script> 5205 @SnippetEnd("JavascriptsBottom") 5206 5207 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 5208 <div class="horse-detail-item hidden" id="horse-detail-item-achievements-motherline" data-content="tab_achievements_motherline"> 5209 @{ 5210 var performanceInfo = horse.SportPerformanceMotherline; 5211 var performanceItems = performanceInfo.lstItems; 5212 var achievements = Kwpn.Repository.Helpers.FormatHelpers.CreateAchievementsList(performanceItems, culture); 5213 5214 var motherName = performanceInfo.MAnimalname; 5215 var motherItems = performanceInfo.lstItemsM; 5216 var motherAchievements = Kwpn.Repository.Helpers.FormatHelpers.CreateAchievementsList(motherItems, culture); 5217 5218 var grandMotherName = performanceInfo.MMAnimalname; 5219 var grandMotherItems = performanceInfo.lstItemsMM; 5220 var grandMotherAchievements = Kwpn.Repository.Helpers.FormatHelpers.CreateAchievementsList(grandMotherItems, culture); 5221 5222 var greatGrandMotherName = performanceInfo.MMMAnimalname; 5223 var greatGrandMotherItems = performanceInfo.lstItemsMMM; 5224 var greatGrandMotherAchievements = Kwpn.Repository.Helpers.FormatHelpers.CreateAchievementsList(greatGrandMotherItems, culture); 5225 } 5226 5227 <h2>@Translate("AchievementsMotherLine", "Achievements mother line")</h2> 5228 5229 @if (performanceItems != null && performanceItems.Any()) 5230 { 5231 var name = Kwpn.Repository.Helpers.HorseHelper.GetHorseName(horse.SportsName, horse.AnimalName, null); 5232 5233 <div class="motherline infotable"> 5234 @CreateInfoTableRow(0, Translate("HorseName", "Horse name"), name, false, false, false) 5235 @CreateInfoTableRow(1, Translate("Achievements", "Achievements"), achievements, false, false, false) 5236 </div> 5237 } 5238 <br /> 5239 <div class="motherline-mother infotable"> 5240 <h3>@Translate("Mother", "Mother")</h3> 5241 @CreateInfoTableRow(0, Translate("HorseName", "Horse name"), motherName, false, false, false) 5242 @CreateInfoTableRow(1, Translate("Achievements", "Achievements"), motherAchievements, false, false, false) 5243 </div> 5244 <br /> 5245 <div class="motherline-mother infotable"> 5246 <h3>@Translate("MothersMother", "Mothers mother")</h3> 5247 @CreateInfoTableRow(0, Translate("HorseName", "Horse name"), grandMotherName, false, false, false) 5248 @CreateInfoTableRow(1, Translate("Achievements", "Achievements"), grandMotherAchievements, false, false, false) 5249 </div> 5250 <br /> 5251 <div class="motherline-mother infotable"> 5252 <h3>@Translate("MothersMothersMother", "Mothers mothers mother")</h3> 5253 @CreateInfoTableRow(0, Translate("HorseName", "Horse name"), greatGrandMotherName, false, false, false) 5254 @CreateInfoTableRow(1, Translate("Achievements", "Achievements"), greatGrandMotherAchievements, false, false, false) 5255 </div> 5256 </div> 5257 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 5258 <div class="horse-detail-item hidden" id="horse-detail-item-genetic-profile" data-content="tab_genetic_profile"> 5259 @if (Kwpn.Repository.Helpers.HorseHelper.CheckIfMyHorse(animalCode) && FormatHelpers.CalculateAgeAsInt(horse.DateOfBirth.Value) < 3) 5260 { 5261 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 5262 <div class="modal fade" id="extra-settings" tabindex="-1" role="dialog" aria-labelledby="extra-settings-modal" aria-hidden="true"> 5263 <div class="modal-dialog"> 5264 <div class="modal-content"> 5265 <div class="modal-header">@Translate("ExtraSettingsModalHeader", "Extra settings")</div> 5266 <div class="modal-body"> 5267 <div> 5268 <h2 class="name"></h2> 5269 </div> 5270 <div id="modal-genetic-profile-loading"> 5271 <i class='fa fa-spinner fa-spin'></i> 5272 </div> 5273 <div id="modal-genetic-profile" class="hidden"> 5274 @Translate("ExtraSettingsModal_GeneticProfileText", "") 5275 <input type="checkbox" name="genetic-profile-hidden" id="genetic-profile-hidden" /> 5276 <label for="genetic-profile-hidden">@Translate("ExtraSettingsModal_GeneticProfileLabel", "The genetic profile is hidden")</label> 5277 <br /> 5278 <div id="genetic-profile-moderator" class="hidden small">@Translate("ExtraSettingsModal_GeneticProfileLastEditedBy", "Last change by ")<span class="small"></span></div> 5279 </div> 5280 </div> 5281 <div class="modal-footer"> 5282 <a class="orange_arrow_link" data-dismiss="modal" href="javascript:void(0);">@Translate("Close", "Close")</a> 5283 </div> 5284 </div> 5285 </div> 5286 </div> 5287 <p> 5288 <button type="button" 5289 class="btn btn-settings-gp" 5290 data-horsecode="@animalCode" 5291 data-horseinfo="@horseName (@lifeNumber)" 5292 data-toggle="tooltip" 5293 data-genetic-profile="true" 5294 title="@Translate("HorseSettings", "Extra settings").JsEncode().ToUpper()"> 5295 <i class="fa fa-gear"></i> 5296 </button> 5297 </p> 5298 @SnippetStart("JavascriptsBottom") 5299 <script> 5300 5301 var geneticProfileSettingChanged = false; 5302 5303 function MailGeneticProfileSetting(animalcode, value) { 5304 var geneticProfileSettingsApi = "/kwpnwebapi/horses/mailgeneticprofilesetting/@Dynamicweb.Frontend.PageView.Current().AreaID/" + animalcode + "/" + value; 5305 $.getJSON(geneticProfileSettingsApi).done(function (result, status, metaData) { 5306 if (!result) { 5307 alert("@Translate("SomethingWentWrongSendingEmail", "Something went wrong while sending email")"); 5308 } 5309 }).fail(function (jqxhr, textStatus, error) { 5310 var err = textStatus + ", " + error; 5311 console.error("MailGeneticProfileSetting Failed: " + err); 5312 }); 5313 } 5314 5315 function SetGeneticProfileSetting(animalcode, value) { 5316 5317 var geneticProfileSettingsApi = "/kwpnwebapi/horses/setgeneticprofilesetting/" + animalcode + "/" + value; 5318 $.getJSON(geneticProfileSettingsApi).done(function (result, status, metaData) { 5319 if (result != null) { 5320 $("#genetic-profile-moderator span").text(result.HideGeneticProfileLastChangedBy); 5321 $("#genetic-profile-moderator").removeClass("hidden"); 5322 geneticProfileSettingChanged = true; 5323 MailGeneticProfileSetting(animalcode, value); 5324 } else { 5325 alert("@Translate("SomethingWentWrong", "Something went wrong")"); 5326 } 5327 }).fail(function (jqxhr, textStatus, error) { 5328 var err = textStatus + ", " + error; 5329 console.error("SetGeneticProfileSetting Failed: " + err); 5330 }); 5331 } 5332 5333 function ActivateExtraSettingsButtons() { 5334 5335 $(".btn-settings-gp").click(function (e) { 5336 5337 // defaults 5338 $("#modal-genetic-profile-loading").removeClass("hidden"); 5339 $("#genetic-profile-hidden").prop("checked", false); 5340 $("#modal-genetic-profile").addClass("hidden"); 5341 $("#genetic-profile-moderator").addClass("hidden"); 5342 $("#genetic-profile-moderator span").empty(); 5343 5344 // set modal text 5345 var horseInfo = $(this).attr("data-horseinfo"); 5346 $("#extra-settings h2").text(horseInfo); 5347 5348 var showGeneticProfile = $(this).attr("data-genetic-profile"); 5349 if (showGeneticProfile === "true") { 5350 5351 // get current value 5352 var horseCode = $(this).attr("data-horsecode"); 5353 var geneticProfileSettingsApi = "/kwpnwebapi/horses/getgeneticprofilesetting/" + horseCode; 5354 $.getJSON(geneticProfileSettingsApi).done(function (result, status, metaData) { 5355 if (result) { 5356 5357 if (result.HideGeneticProfile) { 5358 $("#genetic-profile-hidden").prop("checked", true); 5359 } 5360 5361 if (result.HideGeneticProfileLastChangedBy.length > 0) { 5362 $("#genetic-profile-moderator span").text(result.HideGeneticProfileLastChangedBy); 5363 $("#genetic-profile-moderator").removeClass("hidden") 5364 } 5365 5366 $("#genetic-profile-hidden").off("click").on("click", function () { 5367 SetGeneticProfileSetting(horseCode, $('#genetic-profile-hidden').is(':checked')); 5368 }); 5369 5370 $("#modal-genetic-profile").removeClass("hidden"); 5371 } else { 5372 alert("@Translate("SomethingWentWrong", "Something went wrong")"); 5373 } 5374 5375 $("#modal-genetic-profile-loading").addClass("hidden"); 5376 }).fail(function (jqxhr, textStatus, error) { 5377 var err = textStatus + ", " + error; 5378 console.error("GetGeneticProfileSettings Failed: " + err); 5379 }); 5380 } 5381 5382 // show modal 5383 $("#extra-settings").modal("show"); 5384 5385 // prevent row click 5386 e.stopPropagation(); 5387 5388 }); 5389 5390 $(document).on('hide.bs.modal', '#extra-settings', function () { 5391 if (geneticProfileSettingChanged) { 5392 if (!alert("@Translate("ReloadForChanges", "The page must be refreshed for the change to take effect.")")) location.reload(); 5393 } 5394 5395 }); 5396 } 5397 5398 $(document).ready(function () { 5399 ActivateExtraSettingsButtons(); 5400 }); 5401 5402 </script> 5403 @SnippetEnd("JavascriptsBottom") 5404 } 5405 @if (showGeneticProfileBasedOnRegister) 5406 { 5407 List<BreedingValuesModel> geneticProfile = horse.BreedingValues; 5408 if (geneticProfile != null && geneticProfile.Any()) 5409 { 5410 var geneticProfileIntro = Translate("GeneticProfileIntro", ""); 5411 var geneticProfileRowCounter = 0; 5412 5413 var legend = Kwpn.Repository.Helpers.HorseHelper.GetGeneticProfileLegend(culture); 5414 5415 <h2>@Translate("GeneticProfile", "Genetic profile")</h2> 5416 5417 if (horse.PublicationTypes != null && horse.PublicationTypes.Any()) 5418 { 5419 foreach (var publicationTypes in horse.PublicationTypes) 5420 { 5421 @Translate($"GeneticProfile_Intro_{publicationTypes}", "") 5422 } 5423 } 5424 5425 if (!string.IsNullOrWhiteSpace(geneticProfileIntro) && !geneticProfileIntro.Equals("GeneticProfileIntro")) 5426 { 5427 if (!geneticProfileIntro.StartsWith("<p>", StringComparison.InvariantCultureIgnoreCase)) 5428 { 5429 geneticProfileIntro = string.Format("<p>{0}</p>", geneticProfileIntro); 5430 } 5431 if (!string.IsNullOrWhiteSpace(geneticProfileIntro) && geneticProfileIntro.Contains("{legend}") && !string.IsNullOrEmpty(legend)) 5432 { 5433 geneticProfileIntro = geneticProfileIntro.Replace("{legend}", $"<a href='javascript:void(0);' class='legend-opener'>{Translate("GeneticProfileIntro_LegendLinkText", "legend")}</a>"); 5434 } 5435 @geneticProfileIntro 5436 } 5437 5438 <div class="table-responsive"> 5439 <table width="600" class="genetic-profile-table"> 5440 <colgroup> 5441 <col class="description" /> 5442 <col class="percentage" /> 5443 <col class="minimum" /> 5444 <col class="value" /> 5445 <col class="value" /> 5446 <col class="value" /> 5447 <col class="value" /> 5448 <col class="value" /> 5449 <col class="value" /> 5450 <col class="value" /> 5451 <col class="value" /> 5452 <col class="value" /> 5453 <col class="value" /> 5454 <col class="maximum" /> 5455 </colgroup> 5456 <tr class="index"> 5457 <td>&nbsp;</td> 5458 <th>@Translate("Btbh.", "Btbh.")</th> 5459 <td>&nbsp;</td> 5460 <th class="value stars">***</th> 5461 <th class="value stars">**</th> 5462 <th class="value stars">*</th> 5463 <th colspan="4" class="average">@Translate("Avarage", "Avarage")</th> 5464 <th class="value stars">*</th> 5465 <th class="value stars">**</th> 5466 <th class="value stars">***</th> 5467 <td>&nbsp;</td> 5468 </tr> 5469 <tr class="spacer"> 5470 <td>&nbsp;</td> 5471 <td>&nbsp;</td> 5472 <td>&nbsp;</td> 5473 <td>&nbsp;</td> 5474 <td>&nbsp;</td> 5475 <td>&nbsp;</td> 5476 <td>&nbsp;</td> 5477 <td>&nbsp;</td> 5478 <td>&nbsp;</td> 5479 <td>&nbsp;</td> 5480 <td>&nbsp;</td> 5481 <td>&nbsp;</td> 5482 <td>&nbsp;</td> 5483 <td>&nbsp;</td> 5484 </tr> 5485 @foreach (var breedingValuesTable in geneticProfile) 5486 { 5487 if (breedingValuesTable.BreedingValues != null && breedingValuesTable.BreedingValues.Count > 0) 5488 { 5489 geneticProfileRowCounter = 0; 5490 <tr class="table-caption"> 5491 <th colspan="14"> 5492 @breedingValuesTable.Type 5493 @if (breedingValuesTable != geneticProfile.First()) 5494 { 5495 var relia = breedingValuesTable.BreedingValues.FirstOrDefault(); 5496 if (relia != null) 5497 { 5498 @relia.Reliability 5499 } 5500 } 5501 </th> 5502 </tr> 5503 } 5504 foreach (BreedingValueModel breedingValue in breedingValuesTable.BreedingValues) 5505 { 5506 // modulo for row color display 5507 var mod = "0"; 5508 if (geneticProfileRowCounter % 2 == 0) { mod = "1"; } 5509 5510 var breedingValueValue = 0; 5511 Int32.TryParse(breedingValue.Value, out breedingValueValue); 5512 5513 var description = breedingValue.Description; 5514 if (!string.IsNullOrWhiteSpace(breedingValue.TypeCalculation)) 5515 { 5516 description = $"{description} ({breedingValue.TypeCalculation})"; 5517 } 5518 5519 <tr class="table-row mod-@mod"> 5520 <td class="description nowrap">@description</td> 5521 <td class="percentage"> 5522 @if (breedingValuesTable == geneticProfile.First()) 5523 { 5524 @breedingValue.Reliability 5525 } 5526 </td> 5527 <td class="minimum">@breedingValue.Minimum</td> 5528 @HorseHelper.GetGeneticProfileValues(breedingValueValue, breedingValue.Differentiation, showGeneticProfileBasedOnOwnerSettings) 5529 <td class="maximum">@breedingValue.Maximum</td> 5530 </tr> 5531 5532 geneticProfileRowCounter++; 5533 } 5534 <tr class="spacer"> 5535 <td>&nbsp;</td> 5536 <td>&nbsp;</td> 5537 <td>&nbsp;</td> 5538 <td>&nbsp;</td> 5539 <td>&nbsp;</td> 5540 <td>&nbsp;</td> 5541 <td>&nbsp;</td> 5542 <td>&nbsp;</td> 5543 <td>&nbsp;</td> 5544 <td>&nbsp;</td> 5545 <td>&nbsp;</td> 5546 <td>&nbsp;</td> 5547 <td>&nbsp;</td> 5548 <td>&nbsp;</td> 5549 </tr> 5550 } 5551 </table> 5552 </div> 5553 5554 if (!string.IsNullOrWhiteSpace(legend)) 5555 { 5556 <div class="modal fade" id="legend" tabindex="-1" role="dialog" aria-labelledby="legend-modal" aria-hidden="true"> 5557 <div class="modal-dialog"> 5558 <div class="modal-content"> 5559 <div class="modal-header"> 5560 @Translate("GeneticProfileIntro_LegendHeader", "Legend") 5561 <a class="orange_arrow_link close-model" data-dismiss="modal" href="javascript:void(0);">@Translate("GeneticProfileIntro_LegendClose", "Close")</a> 5562 </div> 5563 <div class="modal-body legend-body"> 5564 @legend 5565 </div> 5566 <div class="modal-footer"> 5567 <a class="orange_arrow_link" data-dismiss="modal" href="javascript:void(0);">@Translate("GeneticProfileIntro_LegendClose", "Close")</a> 5568 </div> 5569 </div> 5570 </div> 5571 </div> 5572 @SnippetStart("JavascriptsBottom") 5573 <script> 5574 $(document).ready(function () { 5575 // legend modal opener 5576 $(".legend-opener").off("click").on("click", function () { 5577 $("#legend").modal("show"); 5578 }); 5579 }); 5580 </script> 5581 @SnippetEnd("JavascriptsBottom") 5582 } 5583 } 5584 } 5585 </div> 5586 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 5587 @* 5588 Note: 5589 5590 Variables like "action/isAlive/isMyHorse/isMare/horse/culture/animalCode/showMemberContent/etc..." are set in the parent: Paragraph/HorseDatabase.cshtml 5591 5592 This content is ALWAYS available for mares. 5593 This content is available if the horse is mine 5594 5595 Always show: 5596 - gender 5597 - horse name 5598 - date of birth 5599 - register 5600 - sports level <-- NOT AVAILABLE IN SearchAnimalResultItemModel 5601 When the parent is a mare then show: 5602 - father name 5603 When the parent is NOT a mare then show: 5604 - mother name <-- NOT AVAILABLE IN SearchAnimalResultItemModel 5605 - mothers father name 5606 *@ 5607 <div class="horse-detail-item hidden" id="horse-detail-item-offspring" data-content="tab_offspring"> 5608 @if (isMare || isMyHorse) 5609 { 5610 var offspring = horse.Offspring; 5611 <h2>@Translate("Offspring", "Offspring")</h2> 5612 <div class="table-responsive"> 5613 @if (offspring != null && offspring.Any()) 5614 { 5615 <table id="offspringTable" class="horsesTable"> 5616 <thead> 5617 <tr> 5618 <th data-sortOn="Gender" data-sortBy="Asc"></th> 5619 <th data-sortOn="Name" data-sortBy="Asc">@Translate("Name", "Name")<i class="fa"></i></th> 5620 @if (isMare) 5621 { 5622 <th data-sortOn="Father" data-sortBy="Asc">@Translate("Father", "Father")<i class="fa"></i></th> 5623 } 5624 else 5625 { 5626 @*<th data-sortOn="Mother" data-sortBy="Asc">@Translate("Mother", "Mother")<i class="fa"></i></th>*@ 5627 <th data-sortOn="MothersFather" data-sortBy="Asc">@Translate("MothersFather", "Mothers father")<i class="fa"></i></th> 5628 } 5629 <th data-sortOn="DateOfBirth" data-sortBy="Asc">@Translate("YearOfBirth", "Year of birth")<i class="fa"></i></th> 5630 <th data-sortOn="Register" data-sortBy="Asc">@Translate("Register", "Register")<i class="fa"></i></th> 5631 <th data-sortOn="SportsLevel" data-sortBy="Asc">@Translate("SportsLevel", "Sports level")<i class="fa"></i></th> 5632 5633 </tr> 5634 </thead> 5635 5636 @foreach (var child in offspring.OrderByDescending(c => c.DateOfBirth)) 5637 { 5638 var childGenderClass = "fa-question"; 5639 var childGenderImage = ""; 5640 var childGenderAbbr = ""; 5641 var childGender = Kwpn.Models.Enumerations.Gender.UNKNOWN; 5642 var childIsAlive = child.DateOfDeath == null; 5643 Enum.TryParse(child.Gender.ToUpper(), out childGender); 5644 switch (childGender) 5645 { 5646 case Kwpn.Models.Enumerations.Gender.HENGST: 5647 childGenderClass = "fa-mars"; 5648 childGenderAbbr = Translate("Stallion", "Stallion"); 5649 break; 5650 case Kwpn.Models.Enumerations.Gender.MERRIE: 5651 childGenderClass = "fa-venus"; 5652 childGenderAbbr = Translate("Mare", "Mare"); 5653 break; 5654 case Kwpn.Models.Enumerations.Gender.RUIN: 5655 childGenderClass = "fa-mars"; 5656 childGenderAbbr = Translate("Gelding", "Gelding"); 5657 break; 5658 case Kwpn.Models.Enumerations.Gender.EMBRYO: 5659 childGenderClass = ""; 5660 childGenderAbbr = Translate("Embryo", "Embryo"); 5661 childGenderImage = "<img src=\"/Files/Templates/Designs/Kwpn/Images/StyleElements/Icon_Embryo_20x20.png\" />"; 5662 break; 5663 } 5664 5665 var childIsApprovedStud = child.ApprovedStallion; 5666 5667 var childName = child.AnimalName; 5668 //if (!string.IsNullOrWhiteSpace(child.SportsName)) 5669 //{ 5670 // childName = child.SportsName; 5671 //} 5672 5673 var childDoBirth = ""; 5674 var childYoBirth = ""; 5675 if (child.DateOfBirth.HasValue && !child.DateOfBirth.Value.Equals(DateTime.MinValue)) 5676 { 5677 childDoBirth = child.DateOfBirth.Value.ToShortDateString(); 5678 childYoBirth = child.DateOfBirth.Value.Year.ToString(); 5679 } 5680 5681 var childsFather = child.Father; 5682 var childsMothersFather = child.MothersFather; 5683 var childSportsLevel = child.SportResult; 5684 5685 <tr @(!childGender.Equals(Kwpn.Models.Enumerations.Gender.EMBRYO) ? $" class=\"clickable\" onclick=\"document.location.href='{Kwpn.Repository.Helpers.HorseHelper.GetHorseInfoPageUrl(culture, child.AnimalCode)}';\"" : "") data-horsecode="@child.AnimalCode"> 5686 <td class="nowrap"> 5687 <i class="fa @childGenderClass">@childGenderImage</i> 5688 @if (!childIsAlive) 5689 { 5690 <div class="fa-death" data-toggle="tooltip" title="@Translate("Deceased", "Deceased").JsEncode().ToUpper()"></div> 5691 } 5692 @if (childIsApprovedStud) 5693 { 5694 <div class="fa-approved-stud" data-toggle="tooltip" title="@Translate("IsApprovedStud", "Is an approved stud").JsEncode().ToUpper()"></div> 5695 } 5696 </td> 5697 <td class="nowrap">@childName</td> 5698 @if (isMare) 5699 { 5700 <td>@childsFather</td> 5701 } 5702 else 5703 { 5704 @*<td>-</td> mother*@ 5705 <td>@childsMothersFather</td> 5706 } 5707 <td><div data-toggle="tooltip" @(!childGender.Equals(Kwpn.Models.Enumerations.Gender.EMBRYO) ? $" title='{childDoBirth}'" : "")>@childYoBirth</div></td> 5708 <td style="width:150px" class="ellipsis"><div data-toggle="tooltip" title="@child.Register.JsEncode()">@child.Register</div></td> 5709 <td>@childSportsLevel</td> 5710 5711 </tr> 5712 } 5713 </table> 5714 } 5715 else 5716 { 5717 <p>@Translate("NoRegisteredOffspring", "No registered offspring")</p> 5718 } 5719 </div> 5720 } 5721 </div> 5722 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 5723 @*note: variables like "showMemberContent/reports/language" are set in the parent: Paragraph/HorseDatabase.cshtml*@ 5724 <div class="horse-detail-item hidden" id="horse-detail-item-approved-offspring" data-content="tab_approved_offspring"> 5725 @if (isApprovedStud) 5726 { 5727 var approvedOffspring = horse.ApprovedOffspring; 5728 var approvedOffspring2ndGen = horse.ApprovedOffspringGrandchild; 5729 5730 if ((approvedOffspring != null && approvedOffspring.Any()) || (approvedOffspring2ndGen != null && approvedOffspring2ndGen.Any())) 5731 { 5732 if (approvedOffspring != null && approvedOffspring.Any()) 5733 { 5734 <h2>@Translate("ApprovedOffspring1stGen", "Approved offspring 1st generation")</h2> 5735 <div class="table-responsive"> 5736 <table id="offspring1GenTable" class="horsesTable"> 5737 <thead> 5738 <tr> 5739 <th data-sortOn="Gender" data-sortBy="Asc"></th> 5740 <th data-sortOn="Name" data-sortBy="Asc">@Translate("Name", "Name")<i class="fa"></i></th> 5741 <th data-sortOn="DateOfBirth" data-sortBy="Asc">@Translate("YearOfBirth", "Year of birth")<i class="fa"></i></th> 5742 <th data-sortOn="Color" data-sortBy="Asc">@Translate("Color", "Color")<i class="fa"></i></th> 5743 <th data-sortOn="Father" data-sortBy="Asc">@Translate("FathersName", "Father") x @Translate("MothersFathersName", "Mothers father")<i class="fa"></i></th> 5744 @*<th data-sortOn="Mother" data-sortBy="Asc">@Translate("MothersMotherFatherName", "Mothers mothers father")<i class="fa"></i></th>*@ 5745 </tr> 5746 </thead> 5747 @foreach (var offspring1Gen in approvedOffspring) 5748 { 5749 // SearchAnimalResultModel 5750 5751 var offspring1GenGenderClass = "fa-question"; 5752 var offspring1GenGenderAbbr = ""; 5753 var offspring1GenGender = Kwpn.Models.Enumerations.Gender.UNKNOWN; 5754 var offspring1GenIsAlive = offspring1Gen.DateOfDeath == null; 5755 Enum.TryParse(offspring1Gen.Gender.ToUpper(), out offspring1GenGender); 5756 switch (offspring1GenGender) 5757 { 5758 case Kwpn.Models.Enumerations.Gender.HENGST: 5759 offspring1GenGenderClass = "fa-mars"; 5760 offspring1GenGenderAbbr = Translate("Stallion", "Stallion"); 5761 break; 5762 case Kwpn.Models.Enumerations.Gender.MERRIE: 5763 offspring1GenGenderClass = "fa-venus"; 5764 offspring1GenGenderAbbr = Translate("Mare", "Mare"); 5765 break; 5766 case Kwpn.Models.Enumerations.Gender.RUIN: 5767 offspring1GenGenderClass = "fa-mars"; //fa-mars-stroke-h 5768 offspring1GenGenderAbbr = Translate("Gelding", "Gelding"); 5769 break; 5770 } 5771 5772 var offspring1GenName = offspring1Gen.AnimalName; 5773 if (!string.IsNullOrWhiteSpace(offspring1Gen.SportsName)) 5774 { 5775 offspring1GenName = offspring1Gen.SportsName; 5776 } 5777 5778 var offspring1GenDoBirth = ""; 5779 var offspring1GenYoBirth = ""; 5780 if (offspring1Gen.DateOfBirth.HasValue && !offspring1Gen.DateOfBirth.Value.Equals(DateTime.MinValue)) 5781 { 5782 offspring1GenDoBirth = offspring1Gen.DateOfBirth.Value.ToShortDateString(); 5783 offspring1GenYoBirth = offspring1Gen.DateOfBirth.Value.Year.ToString(); 5784 } 5785 5786 var offspring1GenFather = offspring1Gen.Father; 5787 var offspring1GenMothersFather = offspring1Gen.MothersFather; 5788 var offspring1GenIsApprovedStud = offspring1Gen.ApprovedStallion; 5789 5790 <tr class="clickable" onclick="document.location.href='@HorseHelper.GetHorseInfoPageUrl(culture, offspring1Gen.AnimalCode)';" data-horsecode="@offspring1Gen.AnimalCode"> 5791 <td class="nowrap"> 5792 <i class="fa @offspring1GenGenderClass"></i> 5793 @if (!offspring1GenIsAlive) 5794 { 5795 <div class="fa-death" data-toggle="tooltip" title="@Translate("Deceased", "Deceased").JsEncode().ToUpper()"></div> 5796 } 5797 @if (offspring1GenIsApprovedStud) 5798 { 5799 <div class="fa-approved-stud" data-toggle="tooltip" title="@Translate("IsApprovedStud", "Is an approved stud").JsEncode().ToUpper()"></div> 5800 } 5801 </td> 5802 <td>@offspring1GenName</td> 5803 <td><div data-toggle="tooltip" title="@offspring1GenDoBirth">@offspring1GenYoBirth</div></td> 5804 <td>@offspring1Gen.Color</td> 5805 <td><span class="nowrap">@offspring1GenFather</span> x <span class="nowrap">@offspring1GenMothersFather</span></td> 5806 </tr> 5807 } 5808 </table> 5809 </div> 5810 } 5811 5812 if (approvedOffspring2ndGen != null && approvedOffspring2ndGen.Any()) 5813 { 5814 <h2>@Translate("ApprovedOffspring2ndGen", "Approved offspring 2nd generation")</h2> 5815 <div class="table-responsive"> 5816 <table id="offspring2GenTable" class="horsesTable"> 5817 <thead> 5818 <tr> 5819 <th data-sortOn="Gender" data-sortBy="Asc"></th> 5820 <th data-sortOn="Name" data-sortBy="Asc">@Translate("Name", "Name")<i class="fa"></i></th> 5821 <th data-sortOn="DateOfBirth" data-sortBy="Asc">@Translate("YearOfBirth", "Year of birth")<i class="fa"></i></th> 5822 <th data-sortOn="Color" data-sortBy="Asc">@Translate("Color", "Color")<i class="fa"></i></th> 5823 <th data-sortOn="Father" data-sortBy="Asc">@Translate("FathersName", "Father") x @Translate("MothersFathersName", "Mothers father")<i class="fa"></i></th> 5824 </tr> 5825 </thead> 5826 @foreach (var offspring2Gen in approvedOffspring2ndGen) 5827 { 5828 // SearchAnimalResultModel 5829 var offspring2GenGenderClass = "fa-question"; 5830 var offspring2GenGenderAbbr = ""; 5831 var offspring2GenGender = Kwpn.Models.Enumerations.Gender.UNKNOWN; 5832 var offspring2GenIsAlive = offspring2Gen.DateOfDeath == null; 5833 Enum.TryParse(offspring2Gen.Gender.ToUpper(), out offspring2GenGender); 5834 switch (offspring2GenGender) 5835 { 5836 case Kwpn.Models.Enumerations.Gender.HENGST: 5837 offspring2GenGenderClass = "fa-mars"; 5838 offspring2GenGenderAbbr = Translate("Stallion", "Stallion"); 5839 break; 5840 case Kwpn.Models.Enumerations.Gender.MERRIE: 5841 offspring2GenGenderClass = "fa-venus"; 5842 offspring2GenGenderAbbr = Translate("Mare", "Mare"); 5843 break; 5844 case Kwpn.Models.Enumerations.Gender.RUIN: 5845 offspring2GenGenderClass = "fa-mars"; 5846 offspring2GenGenderAbbr = Translate("Gelding", "Gelding"); 5847 break; 5848 } 5849 5850 var offspring2GenName = offspring2Gen.AnimalName; 5851 if (!string.IsNullOrWhiteSpace(offspring2Gen.SportsName)) 5852 { 5853 offspring2GenName = offspring2Gen.SportsName; 5854 } 5855 5856 var offspring2GenDoBirth = ""; 5857 var offspring2GenYoBirth = ""; 5858 if (offspring2Gen.DateOfBirth.HasValue && !offspring2Gen.DateOfBirth.Value.Equals(DateTime.MinValue)) 5859 { 5860 offspring2GenDoBirth = offspring2Gen.DateOfBirth.Value.ToShortDateString(); 5861 offspring2GenYoBirth = offspring2Gen.DateOfBirth.Value.Year.ToString(); 5862 } 5863 5864 var offspring2GenFather = offspring2Gen.Father; 5865 var offspring2GenMothersFather = offspring2Gen.MothersFather; 5866 var offspring2GenIsApprovedStud = offspring2Gen.ApprovedStallion; 5867 5868 <tr class="clickable" onclick="document.location.href='@HorseHelper.GetHorseInfoPageUrl(culture, offspring2Gen.AnimalCode)';" data-horsecode="@offspring2Gen.AnimalCode"> 5869 <td class="nowrap"> 5870 <i class="fa @offspring2GenGenderClass"></i> 5871 @if (!offspring2GenIsAlive) 5872 { 5873 <div class="fa-death" data-toggle="tooltip" title="@Translate("Deceased", "Deceased").JsEncode().ToUpper()"></div> 5874 } 5875 @if (offspring2GenIsApprovedStud) 5876 { 5877 <div class="fa-approved-stud" data-toggle="tooltip" title="@Translate("IsApprovedStud", "Is an approved stud").JsEncode().ToUpper()"></div> 5878 } 5879 </td> 5880 <td class="nowrap">@offspring2GenName</td> 5881 <td><div data-toggle="tooltip" title="@offspring2GenDoBirth">@offspring2GenYoBirth</div></td> 5882 <td>@offspring2Gen.Color</td> 5883 <td><span class="nowrap">@offspring2GenFather</span> x <span class="nowrap">@offspring2GenMothersFather</span></td> 5884 </tr> 5885 } 5886 </table> 5887 </div> 5888 } 5889 } 5890 else 5891 { 5892 <h2>@Translate("ApprovedOffspring", "Approved offspring")</h2> 5893 <p>@Translate("NoApprovedOffspring", "No approved offspring")</p> 5894 } 5895 } 5896 </div> 5897 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 5898 @*note: variables like "showMemberContent/horseHasMemberContentOverride/reports/language" are set in the parent: Paragraph/HorseDatabase.cshtml*@ 5899 <div class="horse-detail-item hidden" id="horse-detail-item-performance-report" data-content="tab_performance_report"> 5900 @if (isApprovedStud) 5901 { 5902 <h2>@Translate("PerformanceReport", "Performance report")</h2> 5903 var performanceReportText = ""; 5904 if (reports != null) 5905 { 5906 var performanceReport = reports.Where( 5907 r => r.Language.Equals(language, StringComparison.OrdinalIgnoreCase) && 5908 r.Type.Equals(Kwpn.Models.Enumerations.ReportType.Verrichtingsverslag.ToString(), StringComparison.OrdinalIgnoreCase) 5909 ).FirstOrDefault(); 5910 5911 if (performanceReport != null) 5912 { 5913 performanceReportText = Kwpn.Repository.Helpers.FormatHelpers.CleanEquisText(performanceReport.Report); 5914 } 5915 } 5916 if (!string.IsNullOrWhiteSpace(performanceReportText)) 5917 { 5918 @performanceReportText 5919 } 5920 else 5921 { 5922 <p>@Translate("NoPerformanceReport", "No registered performance report")</p> 5923 } 5924 } 5925 </div> 5926 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 5927 @*note: variables like "showMemberContent/isApprovedStud" are set in the parent: Paragraph/HorseDatabase.cshtml*@ 5928 <div class="horse-detail-item hidden" id="horse-detail-item-performance-figures" data-content="tab_performance_figures"> 5929 @if (isApprovedStud) 5930 { 5931 var performanceFigures = horse.PerformancetestScores; 5932 if (performanceFigures != null && performanceFigures.Any()) 5933 { 5934 var performanceFigureCounter = 0; 5935 <h2>@Translate("PerformanceFigures", "Performance test scores")</h2> 5936 <div class="performance-figures infotable"> 5937 @CreateInfoTableRow(performanceFigureCounter, Translate("Description", "Description"), Translate("Value", "Value"), true) 5938 @foreach (var figure in performanceFigures) 5939 { 5940 //PerformancetestScoreModel 5941 @CreateInfoTableRow(performanceFigureCounter, figure.Description, figure.Value, false, false, false) 5942 performanceFigureCounter++; 5943 } 5944 </div> 5945 } 5946 else 5947 { 5948 <p>@Translate("NoPerformanceFigures", "No registered test scores")</p> 5949 } 5950 } 5951 </div> 5952 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 5953 <div class="horse-detail-item hidden" id="horse-detail-item-breeding-registration" data-content="tab_breeding_registration"> 5954 @if (isApprovedStud) 5955 { 5956 var breedingRegistrations = horse.BreedingRegistrations; 5957 if (breedingRegistrations != null && breedingRegistrations.Any()) 5958 { 5959 var breedingRegistrationCounter = 0; 5960 <div class="breedingRegistrations infotable"> 5961 <h2>@Translate("BreedingRegistration", "Breeding registration")</h2> 5962 @foreach (var breedingRegistration in breedingRegistrations) 5963 { 5964 @CreateInfoTableRow(breedingRegistrationCounter, breedingRegistration.Description, breedingRegistration.Value, false, false, false) 5965 breedingRegistrationCounter++; 5966 } 5967 </div> 5968 } 5969 } 5970 </div> 5971 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 5972 @*note: variables like "showMemberContent/reports/language" are set in the parent: Paragraph/HorseDatabase.cshtml*@ 5973 <div class="horse-detail-item hidden" id="horse-detail-item-descendant-report" data-content="tab_descendant_report"> 5974 @if (isApprovedStud) 5975 { 5976 <h2>@Translate("DescendantsReport", "Descendants report")</h2> 5977 var descendantsReportText = ""; 5978 if (reports != null) 5979 { 5980 var descendantsReport = reports.Where( 5981 r => r.Language.Equals(language, StringComparison.OrdinalIgnoreCase) && 5982 r.Type.Equals(Kwpn.Models.Enumerations.ReportType.Afstammelingenrapport.ToString(), StringComparison.OrdinalIgnoreCase) 5983 ).FirstOrDefault(); 5984 5985 if (descendantsReport != null) 5986 { 5987 descendantsReportText = Kwpn.Repository.Helpers.FormatHelpers.CleanEquisText(descendantsReport.Report); 5988 } 5989 } 5990 5991 if (!string.IsNullOrWhiteSpace(descendantsReportText)) 5992 { 5993 @descendantsReportText 5994 } 5995 else 5996 { 5997 <p>@Translate("NoDescendantsReport", "No registered descendants report")</p> 5998 } 5999 } 6000 </div> 6001 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 6002 @*note: variables like "showMemberContent/reports/language" are set in the parent: Paragraph/HorseDatabase.cshtml*@ 6003 <div class="horse-detail-item hidden" id="horse-detail-item-availability" data-content="tab_availability"> 6004 @if (isApprovedStud) 6005 { 6006 <h2>@Translate("Availability", "Availability")</h2> 6007 var spermAvailables = horse.SpermAvailables; 6008 if (spermAvailables != null && spermAvailables.Any()) 6009 { 6010 <div class="table-responsive"> 6011 <table id="availability-sperm"> 6012 <thead> 6013 <tr> 6014 <th>@Translate("Type", "Type")</th> 6015 <th>@Translate("StudStation", "Stud station")</th> 6016 <th>@Translate("TelephoneNumber", "Telephone number")</th> 6017 <th>@Translate("Website", "Website")</th> 6018 </tr> 6019 </thead> 6020 6021 @foreach (var spermAvailability in spermAvailables) 6022 { 6023 //SpermAvailableModel 6024 var telephone = spermAvailability.Telephone; 6025 if (!string.IsNullOrWhiteSpace(spermAvailability.Mobile)) 6026 { 6027 if (!string.IsNullOrWhiteSpace(telephone) && !telephone.Equals(spermAvailability.Mobile)) 6028 { 6029 telephone = string.Format("{0}, ", telephone); 6030 telephone = string.Format("{0}{1}", telephone, spermAvailability.Mobile); 6031 } 6032 else 6033 { 6034 telephone = spermAvailability.Mobile; 6035 } 6036 } 6037 if (string.IsNullOrWhiteSpace(telephone)) 6038 { 6039 telephone = "-"; 6040 } 6041 6042 var website = spermAvailability.Website; 6043 if (!string.IsNullOrWhiteSpace(website)) 6044 { 6045 var websiteText = ""; 6046 var websiteUrl = ""; 6047 website = website.ToLower(); 6048 if (website.Contains("://")) 6049 { 6050 websiteText = new Uri(website).PathAndQuery; 6051 websiteUrl = website; 6052 } 6053 else 6054 { 6055 websiteText = website; 6056 websiteUrl = string.Format("http://{0}", website); 6057 } 6058 website = string.Format("<a href=\"{0}\" target=\"blank\" title=\"{2}: {1}\">{2}</a>", websiteUrl, websiteText, Translate("GoToWebsite", "Go to website").JsEncode()); 6059 } 6060 else 6061 { 6062 website = "-"; 6063 } 6064 <tr> 6065 <td>@spermAvailability.Type</td> 6066 <td>@spermAvailability.StallionOwner</td> 6067 <td>@telephone</td> 6068 <td>@website</td> 6069 </tr> 6070 } 6071 </table> 6072 </div> 6073 } 6074 else 6075 { 6076 <p>@Translate("AvailabilityUnknown", "Availability unknown")</p> 6077 } 6078 } 6079 </div> 6080 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 6081 <div class="horse-detail-item hidden" id="horse-detail-item-breederinfo" data-content="tab_breeders_info" data-culture="@Dynamicweb.Frontend.PageView.Current().Area.Culture"> 6082 <div class="breederinfo-panel hidden" id="breeder-data"> 6083 <div class="row"> 6084 <div class="col-xs-12"> 6085 <h2>@Translate("BreederInfo_Title", "About") <span class="breeder-name"></span></h2> 6086 <table> 6087 <tr id="breeder-website-row" class="hidden"> 6088 <td>@Translate("BreederInfo_Website", "Website"):</td> 6089 <td class="js-content" id="breeder-website"></td> 6090 </tr> 6091 </table> 6092 </div> 6093 </div> 6094 <div class="row"> 6095 @{ 6096 var currentUrl = System.Web.HttpContext.Current.Request.Url.PathAndQuery; 6097 } 6098 <div class="col-xs-12" id="quick-links"> 6099 <i class="fa fa-spinner fa-spin" id="quick-links-loader"></i> 6100 <a class="hidden" href="#breeder-products">@Translate("BreederInfo_QuickLink_BreedingProducts", "Breeding products")</a> 6101 <a class="hidden" href="#breeder-horses">@Translate("BreederInfo_QuickLink_Horses", "Owned horses")</a> 6102 <a class="hidden" href="#breeder-horsesforsale">@Translate("BreederInfo_QuickLink_HorsesForSale", "Horses for sale")</a> 6103 <a class="hidden" href="#breeder-horsenews">@Translate("BreederInfo_QuickLink_HorsesNews", "Horses to name and breeding products in the news")</a> 6104 <a class="hidden" href="#breeder-performance">@Translate("BreederInfo_QuickLink_Performance", "")</a> 6105 <a class="hidden" href="#breeder-contact">@Translate("BreederInfo_QuickLink_Contact", "Contact this breeder")</a> 6106 </div> 6107 </div> 6108 </div> 6109 <div class="breederinfo-panel hidden" id="breeder-products" data-culture="@Dynamicweb.Frontend.PageView.Current().Area.Culture"> 6110 <div class="background"> 6111 <div class="row"> 6112 <div class="col-xs-12"> 6113 <h2> 6114 <a href="javascript:void(0);" class="breeder-products-toggler"> 6115 @Translate("BreederInfo_BreedingProducts", "Breeding products") <span id="breeder-products-counter" class="js-content"></span> 6116 <i class="fa fa-chevron-down rotated"></i> 6117 </a> 6118 </h2> 6119 </div> 6120 </div> 6121 @{ 6122 var productsIntro = Translate("BreederInfo_BreedingProductsIntro", ""); 6123 if (!string.IsNullOrWhiteSpace(productsIntro)) 6124 { 6125 <div class="row breeder-products-data"> 6126 <div class="col-xs-12"> 6127 @productsIntro 6128 </div> 6129 </div> 6130 } 6131 } 6132 <div class="row filter-row breeder-products-data"> 6133 <div id="breeder-products-too-many-results" class="col-xs-12 hidden"> 6134 <p>@Translate("BreederInfo_Products_TooManySearchResults", "Your search gave <span id='breeder-products-too-many-results2'></span> results, of which we show the first 100. Please use filtering and sorting to find what you are looking for.")</p> 6135 </div> 6136 <div class="col-xs-12 col-md-4"> 6137 <div class="input-group"> 6138 <input type="text" class="form-control" id="breeder-products-filter" placeholder='@Translate("FilterByAttributes", "Filter by attributes")' /> 6139 <span class="input-group-addon" id="btn-breeder-products-filter"><i class="fa fa-search"></i></span> 6140 </div> 6141 </div> 6142 <div class="col-xs-12 col-md-4"> 6143 <div class="input-group"> 6144 <input type="checkbox" class="form-control" id="breeder-products-showdeadhorses" /> 6145 <label for="breeder-products-showdeadhorses">@Translate("ShowDeadHorses", "Show dead horses")</label> 6146 </div> 6147 </div> 6148 </div> 6149 <div class="row breeder-products-data"> 6150 <div class="col-xs-12"> 6151 <div class="table-responsive" style="zoom: 0.9;"> 6152 <table id="breeder-products-table"> 6153 <thead> 6154 <tr> 6155 <th data-sortOn="Gender" data-sortBy="Asc"><span class="hidden-xs hidden-sm">@Translate("Gender", "Gender")<i class="fa"></i></span></th> 6156 <th data-sortOn="Name" data-sortBy="Asc">@Translate("Name", "Name")<i class="fa"></i></th> 6157 <th data-sortOn="Lifenumber" data-sortBy="Asc">@Translate("LifeNumber_Short", "Life nr")<i class="fa"></i></th> 6158 <th data-sortOn="Register" data-sortBy="Asc">@Translate("Register", "Register")<i class="fa"></i></th> 6159 <th data-sortOn="Color" data-sortBy="Asc">@Translate("Color", "Color")<i class="fa"></i></th> 6160 <th data-sortOn="Father" data-sortBy="Asc">@Translate("FathersName", "Father") x @Translate("MothersFathersName", "Mothers father")<i class="fa"></i></th> 6161 </tr> 6162 </thead> 6163 <tbody class="js-content"></tbody> 6164 </table> 6165 </div> 6166 </div> 6167 </div> 6168 </div> 6169 </div> 6170 <div class="breederinfo-panel hidden" id="breeder-horses" data-culture="@Dynamicweb.Frontend.PageView.Current().Area.Culture"> 6171 <div class="background"> 6172 <div class="row"> 6173 <div class="col-xs-12"> 6174 <h2> 6175 <a href="javascript:void(0);" class="breeder-horses-toggler"> 6176 @Translate("BreederInfo_Horses", "Owned horses") <span id="breeder-horses-counter" class="js-content"></span> 6177 <i class="fa fa-chevron-down rotated"></i> 6178 </a> 6179 </h2> 6180 </div> 6181 </div> 6182 @{ 6183 var horsesIntro = Translate("BreederInfo_HorsesIntro", ""); 6184 if (!string.IsNullOrWhiteSpace(horsesIntro)) 6185 { 6186 <div class="row breeder-horses-data"> 6187 <div class="col-xs-12"> 6188 @horsesIntro 6189 </div> 6190 </div> 6191 } 6192 } 6193 <div class="row filter-row breeder-horses-data"> 6194 <div id="breeder-horses-too-many-results" class="col-xs-12 hidden"> 6195 <p>@Translate("BreederInfo_Horses_TooManySearchResults", "Your search gave <span id='breeder-horses-too-many-results2'></span> results, of which we show the first 100. Please use filtering and sorting to find what you are looking for.")</p> 6196 </div> 6197 <div class="col-xs-12 col-md-4"> 6198 <div class="input-group"> 6199 <input type="text" class="form-control" id="breeder-horses-filter" placeholder='@Translate("FilterByAttributes", "Filter by attributes")' /> 6200 <span class="input-group-addon" id="btn-breeder-horses-filter"><i class="fa fa-search"></i></span> 6201 </div> 6202 </div> 6203 <div class="col-xs-12 col-md-4"> 6204 <div class="input-group"> 6205 <input type="checkbox" class="form-control" id="breeder-horses-showdeadhorses" /> 6206 <label for="breeder-horses-showdeadhorses">@Translate("ShowDeadHorses", "Show dead horses")</label> 6207 </div> 6208 </div> 6209 </div> 6210 <div class="row breeder-horses-data"> 6211 <div class="col-xs-12"> 6212 <div class="table-responsive" style="zoom: 0.9;"> 6213 <table id="breeder-horses-table"> 6214 <thead> 6215 <tr> 6216 <th data-sortOn="Gender" data-sortBy="Asc"><span class="hidden-xs hidden-sm">@Translate("Gender", "Gender")<i class="fa"></i></span></th> 6217 <th data-sortOn="Name" data-sortBy="Asc">@Translate("Name", "Name")<i class="fa"></i></th> 6218 <th data-sortOn="Lifenumber" data-sortBy="Asc">@Translate("LifeNumber_Short", "Life nr")<i class="fa"></i></th> 6219 <th data-sortOn="Register" data-sortBy="Asc">@Translate("Register", "Register")<i class="fa"></i></th> 6220 <th data-sortOn="Color" data-sortBy="Asc">@Translate("Color", "Color")<i class="fa"></i></th> 6221 <th data-sortOn="Father" data-sortBy="Asc">@Translate("FathersName", "Father") x @Translate("MothersFathersName", "Mothers father")<i class="fa"></i></th> 6222 </tr> 6223 </thead> 6224 <tbody class="js-content"></tbody> 6225 </table> 6226 </div> 6227 </div> 6228 </div> 6229 </div> 6230 </div> 6231 <div class="breederinfo-panel marketplace-topx hidden" id="breeder-horsesforsale"> 6232 <div class="row"> 6233 <div class="col-xs-12"> 6234 <h2> 6235 <a href="javascript:void(0);" class="breeder-horsesforsale-toggler"> 6236 @Translate("BreederInfo_HorsesForSale", "Horses for sale") <span id="breeder-horsesforsale-counter" class="js-content"></span> 6237 <i class="fa fa-chevron-down rotated"></i> 6238 </a> 6239 </h2> 6240 </div> 6241 </div> 6242 @{ 6243 var forSaleIntro = Translate("BreederInfo_HorsesForSaleIntro", ""); 6244 if (!string.IsNullOrWhiteSpace(forSaleIntro)) 6245 { 6246 <div class="row breeder-horsesforsale-data"> 6247 <div class="col-xs-12"> 6248 @forSaleIntro 6249 </div> 6250 </div> 6251 } 6252 } 6253 <div class="row breeder-horsesforsale-data"> 6254 <div class="col-xs-12 result-container js-content" id="breeder-horsesforsale-adverts"> 6255 </div> 6256 </div> 6257 </div> 6258 <div class="breederinfo-panel hidden" id="breeder-horsenews"> 6259 <div class="row"> 6260 <div class="col-xs-12"> 6261 <h2> 6262 <a href="javascript:void(0);" class="breeder-horsenews-toggler"> 6263 @Translate("BreederInfo_HorsesNews", "Horses to name and breeding products in the news") <span id="breeder-horsenews-counter" class="js-content"></span> 6264 <i class="fa fa-chevron-down rotated"></i> 6265 </a> 6266 </h2> 6267 </div> 6268 </div> 6269 @{ 6270 var newsIntro = Translate("BreederInfo_NewsIntro", ""); 6271 if (!string.IsNullOrWhiteSpace(newsIntro)) 6272 { 6273 <div class="row breeder-horsenews-data"> 6274 <div class="col-xs-12"> 6275 @newsIntro 6276 </div> 6277 </div> 6278 } 6279 } 6280 <div class="row breeder-horsenews-data"> 6281 <div class="col-xs-12 js-content" id="breeder-horsenews-items"> 6282 6283 </div> 6284 </div> 6285 </div> 6286 <div class="breederinfo-panel hidden" id="breeder-performance"> 6287 <div class="row"> 6288 <div class="col-xs-12"> 6289 <h2> 6290 <a href="javascript:void(0);" class="breeder-performance-toggler"> 6291 @Translate("BreederInfo_Performance", "Performance") <i class="fa fa-chevron-down rotated"></i> 6292 </a> 6293 </h2> 6294 </div> 6295 </div> 6296 @{ 6297 var performanceIntro = Translate("BreederInfoPerformanceIntro", ""); 6298 if (!string.IsNullOrWhiteSpace(performanceIntro)) 6299 { 6300 <div class="row breeder-performance-data"> 6301 <div class="col-xs-12"> 6302 @performanceIntro 6303 </div> 6304 </div> 6305 } 6306 } 6307 <div class="row breeder-performance-data"> 6308 <div class="col-xs-12 performance-item hidden" id="breeder-performance-items-@Kwpn.Models.Enumerations.BreederPerformanceType.PerformanceMares.ToString("g").ToLower()"> 6309 <h3>@Translate($"BreederInfo_Performance_{Kwpn.Models.Enumerations.BreederPerformanceType.PerformanceMares.ToString("g")}", Kwpn.Models.Enumerations.BreederPerformanceType.PerformanceMares.ToString("g"))</h3> 6310 <div class="table-responsive" style="zoom: 0.9;"> 6311 <table id="breeder-performance-items-@Kwpn.Models.Enumerations.BreederPerformanceType.PerformanceMares.ToString("g").ToLower()-table"> 6312 <thead> 6313 <tr> 6314 <th data-sortOn="Name" data-sortBy="Asc">@Translate("Name", "Name")<i class="fa"></i></th> 6315 <th data-sortOn="Lifenumber" data-sortBy="Asc">@Translate("LifeNumber_Short", "Life nr")<i class="fa"></i></th> 6316 <th data-sortOn="Register" data-sortBy="Asc">@Translate("Register", "Register")<i class="fa"></i></th> 6317 <th data-sortOn="Color" data-sortBy="Asc">@Translate("Color", "Color")<i class="fa"></i></th> 6318 <th data-sortOn="Father" data-sortBy="Asc">@Translate("FathersName", "Father") x @Translate("MothersFathersName", "Mothers father")<i class="fa"></i></th> 6319 </tr> 6320 </thead> 6321 <tbody class="js-content"></tbody> 6322 </table> 6323 </div> 6324 </div> 6325 <div class="col-xs-12 performance-item hidden" id="breeder-performance-items-@Kwpn.Models.Enumerations.BreederPerformanceType.PreferredMares.ToString("g").ToLower()"> 6326 <h3>@Translate($"BreederInfo_Performance_{Kwpn.Models.Enumerations.BreederPerformanceType.PreferredMares.ToString("g")}", Kwpn.Models.Enumerations.BreederPerformanceType.PreferredMares.ToString("g"))</h3> 6327 <div class="table-responsive" style="zoom: 0.9;"> 6328 <table id="breeder-performance-items-@Kwpn.Models.Enumerations.BreederPerformanceType.PreferredMares.ToString("g").ToLower()-table"> 6329 <thead> 6330 <tr> 6331 <th data-sortOn="Name" data-sortBy="Asc">@Translate("Name", "Name")<i class="fa"></i></th> 6332 <th data-sortOn="Lifenumber" data-sortBy="Asc">@Translate("LifeNumber_Short", "Life nr")<i class="fa"></i></th> 6333 <th data-sortOn="Register" data-sortBy="Asc">@Translate("Register", "Register")<i class="fa"></i></th> 6334 <th data-sortOn="Color" data-sortBy="Asc">@Translate("Color", "Color")<i class="fa"></i></th> 6335 <th data-sortOn="Father" data-sortBy="Asc">@Translate("FathersName", "Father") x @Translate("MothersFathersName", "Mothers father")<i class="fa"></i></th> 6336 </tr> 6337 </thead> 6338 <tbody class="js-content"></tbody> 6339 </table> 6340 </div> 6341 </div> 6342 <div class="col-xs-12 performance-item hidden" id="breeder-performance-items-@Kwpn.Models.Enumerations.BreederPerformanceType.EliteMares.ToString("g").ToLower()"> 6343 <h3>@Translate($"BreederInfo_Performance_{Kwpn.Models.Enumerations.BreederPerformanceType.EliteMares.ToString("g")}", Kwpn.Models.Enumerations.BreederPerformanceType.EliteMares.ToString("g"))</h3> 6344 <div class="table-responsive" style="zoom: 0.9;"> 6345 <table id="breeder-performance-items-@Kwpn.Models.Enumerations.BreederPerformanceType.EliteMares.ToString("g").ToLower()-table"> 6346 <thead> 6347 <tr> 6348 <th data-sortOn="Name" data-sortBy="Asc">@Translate("Name", "Name")<i class="fa"></i></th> 6349 <th data-sortOn="Lifenumber" data-sortBy="Asc">@Translate("LifeNumber_Short", "Life nr")<i class="fa"></i></th> 6350 <th data-sortOn="Register" data-sortBy="Asc">@Translate("Register", "Register")<i class="fa"></i></th> 6351 <th data-sortOn="Color" data-sortBy="Asc">@Translate("Color", "Color")<i class="fa"></i></th> 6352 <th data-sortOn="Father" data-sortBy="Asc">@Translate("FathersName", "Father") x @Translate("MothersFathersName", "Mothers father")<i class="fa"></i></th> 6353 </tr> 6354 </thead> 6355 <tbody class="js-content"></tbody> 6356 </table> 6357 </div> 6358 </div> 6359 <div class="col-xs-12 performance-item hidden" id="breeder-performance-items-@Kwpn.Models.Enumerations.BreederPerformanceType.SportMares.ToString("g").ToLower()"> 6360 <h3>@Translate($"BreederInfo_Performance_{Kwpn.Models.Enumerations.BreederPerformanceType.SportMares.ToString("g")}", Kwpn.Models.Enumerations.BreederPerformanceType.SportMares.ToString("g"))</h3> 6361 <div class="table-responsive" style="zoom: 0.9;"> 6362 <table id="breeder-performance-items-@Kwpn.Models.Enumerations.BreederPerformanceType.SportMares.ToString("g").ToLower()-table"> 6363 <thead> 6364 <tr> 6365 <th data-sortOn="Name" data-sortBy="Asc">@Translate("Name", "Name")<i class="fa"></i></th> 6366 <th data-sortOn="Lifenumber" data-sortBy="Asc">@Translate("LifeNumber_Short", "Life nr")<i class="fa"></i></th> 6367 <th data-sortOn="Register" data-sortBy="Asc">@Translate("Register", "Register")<i class="fa"></i></th> 6368 <th data-sortOn="Color" data-sortBy="Asc">@Translate("Color", "Color")<i class="fa"></i></th> 6369 <th data-sortOn="Father" data-sortBy="Asc">@Translate("FathersName", "Father") x @Translate("MothersFathersName", "Mothers father")<i class="fa"></i></th> 6370 </tr> 6371 </thead> 6372 <tbody class="js-content"></tbody> 6373 </table> 6374 </div> 6375 </div> 6376 <div class="col-xs-12 performance-item hidden" id="breeder-performance-items-@Kwpn.Models.Enumerations.BreederPerformanceType.ApprovedStallions.ToString("g").ToLower()"> 6377 <h3>@Translate($"BreederInfo_Performance_{Kwpn.Models.Enumerations.BreederPerformanceType.ApprovedStallions.ToString("g")}", Kwpn.Models.Enumerations.BreederPerformanceType.ApprovedStallions.ToString("g"))</h3> 6378 <div class="table-responsive" style="zoom: 0.9;"> 6379 <table id="breeder-performance-items-@Kwpn.Models.Enumerations.BreederPerformanceType.ApprovedStallions.ToString("g").ToLower()-table"> 6380 <thead> 6381 <tr> 6382 <td></td> 6383 <th data-sortOn="Name" data-sortBy="Asc">@Translate("Name", "Name")<i class="fa"></i></th> 6384 <th data-sortOn="Lifenumber" data-sortBy="Asc">@Translate("LifeNumber_Short", "Life nr")<i class="fa"></i></th> 6385 <th data-sortOn="Register" data-sortBy="Asc">@Translate("Register", "Register")<i class="fa"></i></th> 6386 <th data-sortOn="Color" data-sortBy="Asc">@Translate("Color", "Color")<i class="fa"></i></th> 6387 <th data-sortOn="Father" data-sortBy="Asc">@Translate("FathersName", "Father") x @Translate("MothersFathersName", "Mothers father")<i class="fa"></i></th> 6388 </tr> 6389 </thead> 6390 <tbody class="js-content"></tbody> 6391 </table> 6392 </div> 6393 </div> 6394 <div class="col-xs-12 performance-item hidden" id="breeder-performance-items-@Kwpn.Models.Enumerations.BreederPerformanceType.GoodPerformanceMares.ToString("g").ToLower()"> 6395 <h3>@Translate($"BreederInfo_Performance_{Kwpn.Models.Enumerations.BreederPerformanceType.GoodPerformanceMares.ToString("g")}", Kwpn.Models.Enumerations.BreederPerformanceType.GoodPerformanceMares.ToString("g"))</h3> 6396 <div class="table-responsive" style="zoom: 0.9;"> 6397 <table id="breeder-performance-items-@Kwpn.Models.Enumerations.BreederPerformanceType.GoodPerformanceMares.ToString("g").ToLower()-table"> 6398 <thead> 6399 <tr> 6400 <th data-sortOn="Name" data-sortBy="Asc">@Translate("Name", "Name")<i class="fa"></i></th> 6401 <th data-sortOn="Lifenumber" data-sortBy="Asc">@Translate("LifeNumber_Short", "Life nr")<i class="fa"></i></th> 6402 <th data-sortOn="Register" data-sortBy="Asc">@Translate("Register", "Register")<i class="fa"></i></th> 6403 <th data-sortOn="Color" data-sortBy="Asc">@Translate("Color", "Color")<i class="fa"></i></th> 6404 <th data-sortOn="Father" data-sortBy="Asc">@Translate("FathersName", "Father") x @Translate("MothersFathersName", "Mothers father")<i class="fa"></i></th> 6405 </tr> 6406 </thead> 6407 <tbody class="js-content"></tbody> 6408 </table> 6409 </div> 6410 </div> 6411 </div> 6412 </div> 6413 <div class="breederinfo-panel hidden" id="breeder-contact"> 6414 <div class="row"> 6415 <div class="col-xs-12"> 6416 <h2> 6417 <a href="javascript:void(0);" class="breeder-contact-toggler"> 6418 @Translate("BreederInfo_Contact", "Contact") <span class="breeder-name"></span> 6419 <i class="fa fa-chevron-down rotated"></i> 6420 </a> 6421 </h2> 6422 </div> 6423 </div> 6424 @{ 6425 var contactIntro = Translate("BreederInfo_ContactIntro", ""); 6426 if (!string.IsNullOrWhiteSpace(contactIntro)) 6427 { 6428 <div class="row breeder-contact-data"> 6429 <div class="col-xs-12"> 6430 @contactIntro 6431 </div> 6432 </div> 6433 } 6434 } 6435 <div class="row breeder-contact-data form-body"> 6436 <div class="col-xs-12"> 6437 <div class="form-group"> 6438 6439 @*NAME*@ 6440 <div class="form-inline"> 6441 <label class="control-label col-sm-3" for="Breeder_Contact_Name">@Translate("BreederInfo_Contact_Name", "Name") *</label> 6442 <input type="text" class="form-control hide-hints" id="Breeder_Contact_Name" name="Breeder_Contact_Name" value="" required /> 6443 </div> 6444 6445 @*EMAIL*@ 6446 <div class="form-inline"> 6447 <label class="control-label col-sm-3" for="Breeder_Contact_EmailAddress">@Translate("BreederInfo_Contact_EmailAddress", "Email address") *</label> 6448 <input type="email" class="form-control hide-hints" id="Breeder_Contact_EmailAddress" name="Breeder_Contact_EmailAddress" value="" required /> 6449 </div> 6450 6451 @*PHONE*@ 6452 <div class="form-inline"> 6453 <label class="control-label col-sm-3" for="Breeder_Contact_Phone">@Translate("BreederInfo_Contact_Phone", "Phone number")</label> 6454 <input type="text" class="form-control hide-hints" id="Breeder_Contact_Phone" name="Breeder_Contact_Phone" value="" /> 6455 </div> 6456 6457 @*City*@ 6458 <div class="form-inline"> 6459 <label class="control-label col-sm-3" for="Breeder_Contact_City">@Translate("City", "City")</label> 6460 <input type="text" class="form-control hide-hints" id="Breeder_Contact_City" name="Breeder_Contact_City" value="" /> 6461 </div> 6462 6463 @*QUESTION*@ 6464 <div class="form-inline"> 6465 <label class="control-label col-sm-3" for="Breeder_Contact_Question">@Translate("BreederInfo_Contact_Question", "Question") *</label> 6466 <textarea class="form-control hide-hints" id="Breeder_Contact_Question" name="Breeder_Contact_Question" placeholder="@Translate("BreederInfo_Contact_Question_Placeholder", "What's on your mind?")" cols="36" rows="5" required></textarea> 6467 </div> 6468 6469 <div class="form-inline"> 6470 <div class="col-sm-offset-3 form-end"> 6471 6472 @{ 6473 var reCaptchaSiteKey = Kwpn.Models.Constants.StringConstants.ApplicationVariables.RecaptchaSiteKey; 6474 var useReCaptcha = !string.IsNullOrEmpty(reCaptchaSiteKey); 6475 6476 if (useReCaptcha) 6477 { 6478 <button class="submitBtn g-recaptcha" 6479 id="Breeder_Contact_Submit" 6480 name="Breeder_Contact_Submit" 6481 data-sitekey="@reCaptchaSiteKey" 6482 data-callback="breederContactCheckReCaptcha" 6483 data-action="submit" 6484 data-badge="inline" 6485 defaultText="@Translate("BreederInfo_Contact_Submit", "Submit").JsEncode()"> 6486 @Translate("BreederInfo_Contact_Submit", "Submit") 6487 </button> 6488 6489 @SnippetStart("JavascriptsBottom") 6490 <script> 6491 function breederContactCheckReCaptcha(token) { 6492 BreederInfoHelper.SubmitContactForm(token); 6493 } 6494 6495 $(document).ready(function () { 6496 6497 // handle recaptcha terms 6498 $("input[type=text], input[type=email]", ".breeder-contact-data").focusin(function () { 6499 $("body > div > .grecaptcha-badge").css("visibility", "visible"); 6500 }); 6501 $("input[type=text], input[type=email]", ".breeder-contact-data").focusout(function () { 6502 $("body > div > .grecaptcha-badge").css("visibility", "hidden"); 6503 }); 6504 }); 6505 </script> 6506 @SnippetEnd("JavascriptsBottom") 6507 } 6508 else 6509 { 6510 <button id="Breeder_Contact_Submit" 6511 class="g-recaptcha submitBtn" 6512 type="button" 6513 defaultText="@Translate("BreederInfo_Contact_Submit", "Submit").JsEncode()" 6514 onclick="BreederInfoHelper.SubmitContactForm();"> 6515 @Translate("BreederInfo_Contact_Submit", "Submit") 6516 </button> 6517 } 6518 6519 6520 } 6521 6522 6523 6524 </div> 6525 </div> 6526 6527 <div class="error"> 6528 <div class="col-sm-offset-3"> 6529 <span class="all-required hidden">@Translate("BreederInfo_Contact_AllFieldsRequired", "All fields are required")</span> 6530 <span class="email-invalid hidden">@Translate("BreederInfo_Contact_EmailInvalid", "The emailaddress is invalid")</span> 6531 <span class="send-error hidden">@Translate("BreederInfo_Contact_SendError", "Something went wrong")</span> 6532 </div> 6533 </div> 6534 </div> 6535 <div class="confirm-text hidden"> 6536 @Translate("BreederInfo_Contact_ConfirmationText", "Thanks. KWPN will send your question to this breeder.") 6537 </div> 6538 </div> 6539 </div> 6540 </div> 6541 <div class="breederinfo-panel hidden static" id="breeder-loadfailed"> 6542 <p>@Translate("BreederInfo_LoadFailed", "Something went wrong while loading the breeder data.")</p> 6543 </div> 6544 @SnippetStart("JavascriptsBottom") 6545 <script id="breeder-horses-item-template" type="text/html"> 6546 <tr class="${ClassName} clickable" onclick="document.location.href = '${DetailLink}';" data-horsecode="${HorseCode}"> 6547 <td class="nowrap"> 6548 <i class="fa ${GenderClass}"></i><span class="hidden-xs hidden-sm"> ${GenderAbbr}</span> 6549 {{if !IsAlive}} 6550 <div class="fa-death" data-toggle="tooltip" title="@Translate("Deceased", "Deceased").JsEncode().ToUpper()"></div> 6551 {{/if}} 6552 {{if IsApprovedStud}} 6553 <div class="fa-approved-stud" data-toggle="tooltip" title="@Translate("IsApprovedStud", "Is an approved stud").JsEncode().ToUpper()"></div> 6554 {{/if}} 6555 </td> 6556 <td>${AnimalName}{{if DateOfBirth != ""}}<br /><span class='small'>${GetDate(DateOfBirth)}</span>{{/if}}</td> 6557 <td>${Lifenumber}{{if LifenumberComplete != Lifenumber}}<br /><span class='small'>${LifenumberComplete}</span>{{/if}}</td> 6558 <td>${Register}</td> 6559 <td>${Color}</td> 6560 <td><span class="nowrap">${Father}</span> x <span class="nowrap">${MothersFather}</span></td> 6561 </tr> 6562 </script> 6563 <script id="breeder-advert-template" type="text/html"> 6564 <div class="col-xs-12 col-sm-6 col-md-3"> 6565 <a href="${advertLink}" data-horsecode="${animalCode}"> 6566 <div class="advert {{if isTopAdvert}} topadvert {{/if}}"> 6567 <div class="photo" style="background-image: url('{{if photo1 > ""}}${photo1}{{else}}/Files/Templates/Designs/Kwpn/Images/Marketplace_NoImg.jpg{{/if}}');"> 6568 {{if isTopAdvert}}<div class="topadd">@Translate("Marketplace_TopAdvertIndicator", "Top add")</div>{{/if}} 6569 <div class="datesince">@Translate("Marketplace_Since", "Since") ${MarketplaceHelper.GetSinceDate(dateFrom, "@Dynamicweb.Frontend.PageView.Current().Area.Culture.ToLower()")} </div> 6570 </div> 6571 <div class="specs"> 6572 <div class="row"> 6573 <div class="col-xs-3 text-center"> 6574 <div class="gender"> 6575 {{if gender == '@Kwpn.Models.Enumerations.Gender.HENGST.ToString()'}} 6576 <i class="fa fa-mars" title="@Translate(Kwpn.Models.Enumerations.Gender.HENGST.ToString())"></i> 6577 {{/if}} 6578 {{if gender == '@Kwpn.Models.Enumerations.Gender.RUIN.ToString()'}} 6579 <i class="fa fa-mars" title="@Translate(Kwpn.Models.Enumerations.Gender.RUIN.ToString())"></i> 6580 {{/if}} 6581 {{if gender == '@Kwpn.Models.Enumerations.Gender.MERRIE.ToString()'}} 6582 <i class="fa fa-venus" title="@Translate(Kwpn.Models.Enumerations.Gender.MERRIE.ToString())"></i> 6583 {{/if}} 6584 </div> 6585 </div> 6586 <div class="col-xs-9 text-left" style="margin-left: -15px;"> 6587 <div class="name"> 6588 ${animalName}{{if age >= 0}}, ${age} @Translate("Marketplace_Years", "Years"){{/if}} 6589 </div> 6590 <div class="pedigree"> 6591 ${fatherName} x ${mothersFatherName} 6592 </div> 6593 <div class="price">${priceLabel}</div> 6594 </div> 6595 </div> 6596 </div> 6597 </div> 6598 </a> 6599 </div> 6600 </script> 6601 <script id="breeder-horsenews-template" type="text/html"> 6602 <div class="col-xs-12"> 6603 <span class="date">${MarketplaceHelper.GetSinceDate(NewsDate, "@Dynamicweb.Frontend.PageView.Current().Area.Culture.ToLower()")}</span> 6604 <span class="horses"> 6605 {{each(key, value) Horses}} 6606 <span class="horse"><a href="${key}">${value}</a></span> 6607 {{/each}} 6608 </span> 6609 <a href="${NewsLink}"> 6610 <span class="title">${NewsTitle}</span> 6611 </a> 6612 </div> 6613 </script> 6614 <script id="breeder-performance-item-template" type="text/html"> 6615 <tr class="${ClassName} clickable" onclick="document.location.href = '${DetailLink}';" data-horsecode="${HorseCode}"> 6616 <td>${AnimalName}{{if DateOfBirth != ""}}<br /><span class='small'>${GetDate(DateOfBirth)}</span>{{/if}}</td> 6617 <td>${Lifenumber}{{if LifenumberComplete != Lifenumber}}<br /><span class='small'>${LifenumberComplete}</span>{{/if}}</td> 6618 <td>${Register}</td> 6619 <td>${Color}</td> 6620 <td><span class="nowrap">${Father}</span> x <span class="nowrap">${MothersFather}</span></td> 6621 </tr> 6622 </script> 6623 <script id="breeder-performance-item-@Kwpn.Models.Enumerations.BreederPerformanceType.ApprovedStallions.ToString("g").ToLower()-template" type="text/html"> 6624 <tr class="${ClassName} clickable" onclick="document.location.href = '${DetailLink}';" data-horsecode="${HorseCode}"> 6625 <td><img src="images/horseimage.ashx?pc=${HorseCode}" alt="${AnimalName}" /></td> 6626 <td>${AnimalName}{{if DateOfBirth != ""}}<br /><span class='small'>${GetDate(DateOfBirth)}</span>{{/if}}</td> 6627 <td>${Lifenumber}{{if LifenumberComplete != Lifenumber}}<br /><span class='small'>${LifenumberComplete}</span>{{/if}}</td> 6628 <td>${Register}</td> 6629 <td>${Color}</td> 6630 <td><span class="nowrap">${Father}</span> x <span class="nowrap">${MothersFather}</span></td> 6631 </tr> 6632 </script> 6633 @SnippetEnd("JavascriptsBottom") 6634 </div> 6635 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 6636 <div class="horse-detail-item hidden" id="horse-detail-item-videos" data-content="tab_videos"> 6637 <div id="video-container"></div> 6638 </div> 6639 6640 // SEO VIRTUAL PAGE VIEW LOGGING: GENERALINFO 6641 <Text> 6642 <script> 6643 SEO.trackPageView("@string.Format("{0}/{1}", seoPage, Translate("SEO_TrackPageviewPage_Database_tab_general", "general-info").UrlEncode()).ToLower()"); 6644 </script> 6645 </Text> 6646 6647 } 6648 </article> 6649 </div> 6650 <div class="row"> 6651 <div class="col-xs-12 col-md-10 page-content print-disclaimer"> 6652 @Translate("Print-Disclaimer", "<strong>KWPN Database - &copy; 2017 - Content: KWPN</strong><br /><p>Niets uit de KWPN Database mag zonder uitdrukkelijke toestemming van het KWPN worden overgenomen, vermenigvuldigd en/of openbaar gemaakt, of gebruikt voor herberekening of onderzoek op welke wijze dan ook, met uitzondering van hetgeen in de Auteurswet bepaald is met betrekking tot het reprorecht.</p><p>Het KWPN aanvaardt geen aansprakelijkheid voor schade van welke aard dan ook, die het gevolg is van handelingen en/of beslissingen gebaseerd op informatie van deze site. De door het KWPN verstrekte informatie en berekende fokwaarden op deze website zijn eigendom van het KWPN. De informatie en de fokwaarden zijn bedoeld als voorlichtingsmateriaal en geadviseerd wordt om deze te gebruiken als één van de hulpmiddelen voor selectiedoeleinden. De onderliggende gegevens zijn verzameld in en/of ten behoeve van de KWPN-populatie en de fokwaarden die hieruit zijn voortgekomen zijn van toepassing op de KWPN-populatie. Het KWPN heeft uiterste zorgvuldigheid betracht bij de totstandkoming van de gepresenteerde informatie. De berekeningen hebben plaatsgevonden op basis van de beschikbare kennis van de populatiegenetica en de regels van uitvoering zijn vastgelegd in de reglementen en/of besluiten van bevoegde organen van het KWPN.</p>") 6653 </div> 6654 </div> 6655 </div> 6656 </div> 6657 </div> 6658 6659 if (isMyHorse) 6660 { 6661 <div class="break-grid content-container hidden" id="refreshcontainer"> 6662 <div class="break-grid-background"> 6663 <div class="in-grid"> 6664 <div class="row"> 6665 <div class="col-xs-12 col-md-7"> 6666 <i class='fa fa-refresh fa-spin fa-3x fa-fw'></i><span class="reloading-text">@Translate("HorseDetailsReloading", "One moment please. We are fetching the horse data from our back-end system.")</span> 6667 </div> 6668 </div> 6669 </div> 6670 </div> 6671 </div> 6672 } 6673 6674 <script> 6675 6676 // We only want the menu interaction on Desktop, so we disable it on mobile screens 6677 // the breakpoint is 991 px. 6678 var pageId = '@Dynamicweb.Frontend.PageView.Current().Page.ID'; 6679 var _mx = 991; 6680 var screenWidth = window.innerWidth; 6681 checkWidth(); 6682 6683 $(window).on('resize', function () { 6684 screenWidth = window.innerWidth 6685 checkWidth(); 6686 openAsideOnFirstPagevisit(); 6687 }); 6688 6689 function enable_menu_slide() { 6690 $(".aside-page").on('click', function () { 6691 $(this).find('.bg_aside').toggleClass("closed") 6692 $(this).find('.bg_aside').toggleClass("open") 6693 }); 6694 } 6695 6696 function checkWidth() { 6697 if (screenWidth > _mx) { 6698 enable_menu_slide(); 6699 } else { 6700 $(".aside-page").unbind(); 6701 } 6702 } 6703 6704 function openAsideOnFirstPagevisit() { 6705 if (sessionStorage.getItem('popState' + pageId) != 'shown' && screenWidth > _mx && screenWidth <= '1346') { 6706 $(".bg_aside").delay(2000).toggleClass("closed open"); 6707 sessionStorage.setItem('popState' + pageId, 'shown'); 6708 } 6709 } 6710 6711 $(document).ready(function () { 6712 6713 // Open aside menu on first page visit 6714 openAsideOnFirstPagevisit(); 6715 6716 // Open and close tabs 6717 $('i.fa-chevron-down').on('click', function () { 6718 $(this).toggleClass('fa-rotate-180'); 6719 $(this).parent().next().toggleClass('open_tab'); 6720 }); 6721 6722 // Handle go back 6723 $(".go-back").click(function (event) { 6724 event.preventDefault(); 6725 history.back(1); 6726 }); 6727 6728 // Handle breeder click 6729 @if (hasBreeders) { 6730 <text> 6731 $(".breeder-link").off("click").on("click", function () { 6732 var breederPersonCode = $(this).data("personcode"); 6733 BreederInfoHelper.InitializeBreeder(breederPersonCode, false); 6734 // SEO VIRTUAL PAGE VIEW LOGGING 6735 SEO.trackPageView("@seoPage.ToLower()/@Translate("SEO_TrackPageviewPage_Database_tab_breeders_info", "breeders-info").UrlEncode()"); 6736 }); 6737 $(".registered-link").off("click").on("click", function () { 6738 var registeredPersonCode = $(this).data("personcode"); 6739 BreederInfoHelper.InitializeBreeder(registeredPersonCode, true); 6740 // SEO VIRTUAL PAGE VIEW LOGGING 6741 SEO.trackPageView("@seoPage.ToLower()/@Translate("SEO_TrackPageviewPage_Database_tab_registered_info", "registered-info").UrlEncode()"); 6742 }); 6743 </text> 6744 } 6745 }); 6746 </script> 6747 } 6748 } 6749 }
€ 124.75 per year

KWPN Membership

  • Subscription to the montlhy digital KWPN Magazine (in Dutch)
  • Free advertising at KWPN Horses for Sale
Become a member now

About the KWPN

The KWPN (Studbook of the Royal Dutch Sport Horse) is a Netherlands-based organization specializing in the breeding of jumpers, dressage horses, harness horses, and Gelder horses.

More info

Official Partners


Cookies on the KWPN website

We request your agreement to the use of cookies on our website. More information is available on our cookie policy page.

Cookie Policy