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

KWPN Membership

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

About the KWPN

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

More info

Official Partners


Cookies on the KWPN website

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

Cookie Policy