Rijpaard (springen en dressuur)














Tuigpaard





Gelders paard


Jong KWPN



Toepassen
Error executing template "/Designs/Kwpn/Paragraph/HorseDatabase.cshtml"
System.IO.IOException: The process cannot access the file 'D:\inetpub\wwwroot\www.kwpn.nl\Files\Templates\Designs\Kwpn\Translations.xml' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Dynamicweb.Rendering.Translation.Source.WriteDocument(XmlDocument document)
at Dynamicweb.Rendering.Translation.Source.Save()
at Dynamicweb.Rendering.Translation.Source.UpdateTranslationSource(Source source, IEnumerable`1 newKeys, String designName, IEnumerable`1 cultures)
at Dynamicweb.Rendering.TemplateBase`1.Translate(String text, String defaultValue, String cultureName)
at CompiledRazorTemplates.Dynamic.RazorEngine_ab0e1bee1b4e4102832aac6475c734af.Execute() in D:\inetpub\wwwroot\www.kwpn.nl\Files\Templates\Designs\Kwpn\Paragraph\HorseDatabase.cshtml:line 875
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.b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()

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

Halfjaarslidmaatschap KWPN

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

JongKWPN lidmaatschap

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

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

Word nu lid

Official Partners


Het KWPN maakt gebruik van cookies

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

Cookiebeleid