Rijpaard (springen en dressuur)














Tuigpaard





Gelders paard


Jong KWPN



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

Lidmaatschap KWPN

  • Iedere maand het KWPN Magazine - In de Strengen
  • Onbeperkt toegang tot KWPN.tv
  • Gratis advertenties plaatsen op KWPN Horses for Sale
Word nu lid
€22,- per jaar

JongKWPN lidmaatschap

  • Ben jij tussen de 16 en 30 jaar?
  • Ben jij geïnteresseerd in fokkerij en sport? 

Dan is JongKWPN vast en zeker iets voor jou! JongKWPN biedt een gevarieerd programma. 

Word nu lid

Official Partners


Het KWPN maakt gebruik van cookies

Wij vragen uw akkoord voor het gebruik van cookies op onze website. Meer informatie is beschikbaar in ons cookiebeleid.

Cookiebeleid