Page source: |
1: <script src="${website.cdn("/info/klass.min.js")}"></script>
2:
3: ## PICK UP OPTIONS
4: $website.include("options")
5: #set ($options = $request.getAttribute("options"))
6: #set ($locale = "en_us")
7: #set ($locale = $options.get("locale"))
8:
9: ## HACK TO GET STATS URL FROM RENDERER... NEEDS SERVER CHANGE
10: #set ($bioObject = $page.getDataAsObject())
11: #set ($statsURL = $bioObject.statsURL)
12: #if ($statsURL.length() > 0)
13: $website.includeAgain("${statsURL}?tmpl=bio-stats-template")
14: ## various settings to get the variables set
15: #set ($events = $request.getAttribute("bio_events"))
16: #set ($seasons = $request.getAttribute("bio_seasons"))
17: #set ($career = $request.getAttribute("bio_career"))
18: #set ($labels = $request.getAttribute("bio_labels"))
19: #set ($briefs = $request.getAttribute("bio_briefs"))
20: #set ($gamelogs = $request.getAttribute("bio_gamelogs"))
21: #set ($splits = $request.getAttribute("bio_splits"))
22: #set ($statPosition = $request.getAttribute("bio_position"))
23: #set ($positions = $request.getAttribute("bio_positions"))
24: #set ($playerId = $request.getAttribute("bio_player_id"))
25: #set ($highlights = $request.getAttribute("bio_highlights"))
26: #set ($formats = $request.getAttribute("bio_formats"))
27: #set ($gamelogsCategoriesLabels = $request.getAttribute("bio_gamelogs_labels"))
28: #set ($briefsCategoriesLabels = $request.getAttribute("bio_briefs_labels"))
29: #set ($gamesResults = $request.getAttribute("bio_games_results"))
30: #set ($monthsPlayed = $request.getAttribute("bio_months_played"))
31: #set ($rosterTransactions = $request.getAttribute("roster_transactions"))
32: #end
33: #set ($pos = "")
34: #set ($pos = $attributes.get("position"))
35: #set ($pos = $statPosition)
36: #set ($posVec = $pos.split("/"))
37: #set ($pos = $posVec[0])
38: #set ($pos = $pos.toLowerCase())
39: #set ($statPos = $positions.get($pos))
40: #set ($paramPos = $request.getParameter("pos"))
41:
42: #set ($playerId = $attributes.get("playerId"))
43: #set ($stats = $splits.overall)
44: #set ($highlights = $highlights.get($statPos))
45:
46: #set ($showHighlights = true)
47: #if ($options.get("bio_show_highlights") && $options.get("bio_show_highlights") == false)
48: #set ($showHighlights = false)
49: #end
50:
51: #set ($enhancedLayout = false)
52: #if (($options.get("bio_enhanced_layout") == "yes") || ($request.getParameter("bio_enhanced_layout") == true))
53: #set ($enhancedLayout = true)
54: #end
55:
56: #set ($showActionShots = true)
57: #if ($options.get("bio_show_action_shots") && $options.get("bio_show_action_shots") == false)
58: #set ($showActionShots = false)
59: #end
60:
61: #set ($actionShotsLimit = 5)
62: #set ($actionShotsLimit = $tool.math.toInteger($options.get("bio_action_shots_limit")))
63:
64: #set ($showCareer = $wiki.valid() && $seasons)
65: #if ("yes" == $options.get("stats_show_career") && $seasons)
66: #set ($showCareer = true)
67: #end
68:
69: #set ($hasEvents = $events.size() > 0)
70: #set ($hasSynopsis = $synopsis.trim().length() > 0)
71: #set ($htmlStatsURL = "${page.url}-stats")
72: #set ($hasHTMLStats = $website.exists($htmlStatsURL))
73: #set ($bioBriefURL = "${page.url}-brief")
74: #set ($hasBioBrief = $website.exists("$bioBriefURL"))
75: #set ($showRoster = ($page.contentType == "loki/bio" && $page.headlinesFeatured.size() > 0) || ($page.contentType == "loki/bio-network" && $page.sectionPage.children.size() > 1))
76: #if ($options.get("bio_hide_roster") == true)
77: #set ($showRoster = false)
78: #end
79:
80: #set ($view = "")
81: #if ($hasSynopsis || $hasBioBrief)
82: #set ($view = "bio")
83: #elseif ($statsURL.length() > 0)
84: #set ($view = "profile")
85: #elseif ($hasHTMLStats)
86: #set ($view = "htmlstats")
87: #elseif ($releases.size() > 0)
88: #set ($view = "news")
89: #elseif ($playerPhotos.size() > 0)
90: #set ($view = "photos")
91: #elseif ($playerVideos.size() > 0)
92: #set ($view = "videos")
93: #end
94:
95: #if ($options.get("bio_default_view").length() > 0)
96: #set ($checkView = $options.get("bio_default_view"))
97: #else
98: ## THIS ESTABLISHES A DEFAULT TAB FOR NEW BOOTSTRAP THEMES
99: #if ($hasSynopsis || $hasBioBrief)
100: #set ($checkView = "bio")
101: #elseif ($statsURL.length() > 0)
102: #set ($checkView = "profile")
103: #elseif ($releases.size() > 0)
104: #set ($checkView = "news")
105: #end
106: #end
107:
108: #if ($request.getParameter("view"))
109: #set ($checkView = $request.getParameter("view"))
110: #end
111:
112: #if ($checkView == "profile" && $statsURL.length() > 0)
113: #set ($view = "profile")
114: #elseif ($checkView == "bio" && ($hasSynopsis || $hasBioBrief))
115: #set ($view = "bio")
116: #elseif ($checkView == "gamelog" && $statsURL.length() > 0)
117: #set ($view = "gamelog")
118: #elseif ($checkView == "career" && $showCareer)
119: #set ($view = "career")
120: #elseif ($checkView == "splits" && $statsURL.length() > 0)
121: #set ($view = "splits")
122: #elseif ($checkView == "htmlstats" && $hasHTMLStats)
123: #set ($view = "htmlstats")
124: #elseif ($checkView == "news" && $releases.size() > 0)
125: #set ($view = "news")
126: #elseif ($checkView == "photos" && $playerPhotos.size() > 0)
127: #set ($view = "photos")
128: #elseif ($checkView == "videos" && $playerVideos.size() > 0)
129: #set ($view = "videos")
130: #end
131:
132: #macro (printResultAriaLabel $event)
133: #set ($ariaLabel = "${event.sport} event: ${formatter.formatDate($event.date, 'MMMM d hh:mm a:')}")
134: #if ($event.neutralSite.length() > 0 || $event.home)
135: #set ($ariaLabel = "${ariaLabel} vs.")
136: #else
137: #set ($ariaLabel = "${ariaLabel} at")
138: #end
139: #set ($ariaLabel = "${ariaLabel} ${event.opponent.name}:")
140: #if ($event.neutralSite.length() > 0)
141: #set ($ariaLabel = "${ariaLabel} @ ${event.neutralSite}:")
142: #end
143: #set ($ariaLabel = "${ariaLabel} Box Score")
144: aria-label="$ariaLabel"
145: #end
146:
147: #macro (printGrid $items $type)
148: <div class="bio-news-mentions">
149: <div class="card-columns">
150: #foreach ($item in $items)
151: #if ($item.title.length() > 0)
152: <div class="card ${type}">
153: <a href="$item.url">
154: #if ($item.thumbnailURL)
155: <img src="${item.thumbnailURL}?max_width=510" alt="$item.thumbnailAlt" class="card-img-top img-fluid" />
156: #elseif ($item.contentType == "loki/youtube")
157: <img src="http://img.youtube.com/vi/${item.dataAsString}/mqdefault.jpg" alt="$item.thumbnailAlt" class="card-img-top img-fluid" />
158: #else
159: #if ($website.exists("/images/setup/default-article-thumbnail.png"))
160: <img src="/images/setup/default-article-thumbnail.png?max_width=510&max_height=287" class="card-img-top img-fluid" alt="$item.thumbnailAlt" />
161: #else
162: <img src="$website.cdn("/info/images/default-article-thumbnail.png?max_width=510&max_height=287")" class="card-img-top img-fluid" alt="$item.thumbnailAlt" />
163: #end
164: #end
165: </a>
166: <div class="card-body">
167: <h5 class="card-title"><a href="$item.url">$item.title</a></h5>
168: #if ($item.leadIn.length() > 0)
169: <p class="card-text">$formatter.limitLen(146, $item.leadIn)</p>
170: #end
171: #if ($item.date)
172: <p class="card-text"><small class="text-muted">$formatter.formatLongDate($item.date)</small></p>
173: #end
174: </div>
175: </div>
176: #end
177: #end ## foreach
178: </div>
179: </div>
180: #end ## ends macro
181:
182: #macro (gamelogData $p)
183:
184: #set ($p = $positions.get($p))
185: #set ($gamelogs = $gamelogs.get($p))
186:
187: #if ($hasEvents)
188: <div class="stats-box full clearfix">
189: <div class="table-responsive">
190: <table class="table table-hover table-sm">
191: <thead class="thead-dark">
192: <tr>
193: <th scope="col">Date</th>
194: <th scope="col" class="pinned-col">Opponent</th>
195: <th scope="col">Score</th>
196: #foreach ($gamelog in $gamelogs)
197: <th scope="col">$gamelog</th>
198: #end
199: </tr>
200: </thead>
201: <tbody>
202: #foreach ($event in $events)
203: <tr>
204: <td scope="row">$formatter.formatDate($event.event.date, "MMM d")</td>
205: <td class="pinned-col">
206: #if ($event.event.neutralSite.length() > 0) vs. #elseif (!$event.event.home) at #end
207: $event.event.opponent.name
208: </td>
209: <td>
210: #if ($event.event.statusCode >= 0)
211: #if ($event.event.eventId.length() > 0 && $event.stats.size() > 0)
212: <a #printResultAriaLabel($event.event) href="../boxscores/${formatter.formatBoxScoreLink($event.event)}">${event.event.APResult}</a>
213: #else
214: ${event.event.APResult}
215: #end
216: #else #end
217: </td>
218: #foreach ($gamelog in $gamelogs.keySet())
219: #set ($value = "-")
220: #set ($value = $formatter.formatNumber($event.stats.get($gamelog), $formats.get($gamelog)))
221: <td>$value</td>
222: #end
223: </tr>
224: #end
225: </tbody>
226: </table>
227: </div> ## table-responsive
228: </div> ## stats-box
229: #end
230:
231: #end ## macro gamelogData
232:
233: #macro (splitWithLabels $statPosBriefs $label $stats $rowSpan $rowSpanLabel)
234: <tr>
235: #if ($tool.math.toInteger($rowSpan) > 0)
236: <th rowspan="$rowSpan" scope="rowgroup">$rowSpanLabel</th>
237: #end
238:
239: <th scope="row" class="pinned-col">${label}</th>
240: #if($rosterTransactions && $v == "career")
241: #set($keys = $stats.names())
242: #set($array = $keys.toString().replace('"','').split(","))
243: #foreach ($brief in $statPosBriefs.keySet())
244: #set ($value = "-")
245: #if($array.contains($brief))
246: #set ($value = $!formatter.formatNumber($tool.math.toDouble($stats.get($brief)), $formats.get($brief)))
247: #end
248: <td>#if ($value.length() > 0) $value #else - #end</td>
249: #end
250: #else
251: #foreach ($brief in $statPosBriefs.keySet())
252: #set ($value = "-")
253: #set ($value = $!formatter.formatNumber($stats.get($brief), $formats.get($brief)))
254: <td>#if ($value.length() > 0) $value #else - #end</td>
255: #end
256: #end
257:
258: </tr>
259: #end
260:
261: #macro (careerData $p)
262: #set ($p = $positions.get($p))
263: #set ($statPosBriefs = $briefs.get($p))
264:
265: <div class="stats-box full clearfix">
266: <div class="table-responsive">
267: <table class="table table-hover table-sm">
268: <thead class="thead-dark">
269: <tr>
270: <th scope="col" class="pinned-col"> </th>
271: #foreach ($brief in $statPosBriefs)
272: <th scope="col">$brief</th>
273: #end
274: </tr>
275: </thead>
276: <tbody>
277: #if($rosterTransactions)
278: #set ($seasonLength = $career.seasons.length())
279: #foreach ($index in [0..$tool.math.sub($seasonLength, 1)])
280: #set($season = $career.seasons[$index])
281: #if($season.seasonStatsURL != "null")
282: #set ($label = "<a href='${season.seasonStatsURL}?view=profile'>$season.seasonName.replaceAll('^[^0-9-]*','') - $season.team.teamName</a>")
283: #else
284: #set ($label = "$season.seasonName.replaceAll('^[^0-9-]*','') - $season.team.teamName ")
285: #end
286: #splitWithLabels($statPosBriefs, $label, $season.player.stats, "", "")
287: #end
288: #splitWithLabels($statPosBriefs, "Total", $career.totals, "", "")
289: #else
290: #set ($careerTotals = $request.getAttribute("careerTotals"))
291: #set ($careerMap = $request.getAttribute("careerMap"))
292: #foreach ($season in $seasons)
293: ## Check if we did not get stats for this season
294: #if ($careerMap.get($season.seasonName))
295: #set ($label = "<a href='${season.path}?view=profile'>$season.seasonName</a>")
296: #splitWithLabels($statPosBriefs, $label, $careerMap[$season.seasonName], "", "")
297: #elseif ($wiki.valid())
298: <tr>
299: <td scope="row" class="text">${season.seasonName}</td>
300: <td colspan="${statPosBriefs.size()}">We could not find the "players" page in the ${season.seasonName} section.</td>
301: </tr>
302: #end
303: #end
304: #splitWithLabels($statPosBriefs, "Total", $request.getAttribute("careerTotals").overall, "", "")
305: #end
306: </tbody>
307: </table>
308: </div> ## table-responsive
309: </div> ## stats-box
310:
311: #end ## macro careerData
312:
313: #macro (splitsData $p)
314:
315: #set ($p = $positions.get($p))
316: #set ($statPosBriefs = $briefs.get($p))
317: #set ($colspan = $tool.math.add($statPosBriefs.size(), 1))
318:
319: #if ($statPosBriefs.size() > 0)
320: <div class="stats-box full clearfix">
321: <div class="table-responsive">
322: <table class="table table-hover table-sm">
323: <thead class="thead-dark">
324: <tr>
325: <th scope="col" class="pinned-col"> </th>
326: <th scope="col" class="pinned-col"> </th>
327: #foreach ($brief in $statPosBriefs)
328: <th scope="col">$brief</th>
329: #end
330: </tr>
331: </thead>
332:
333: <tbody>
334: #splitWithLabels($statPosBriefs, "Total", $splits.overall, "3", "Event")
335: #splitWithLabels($statPosBriefs, "Conference", $splits.conference, "", "")
336: #splitWithLabels($statPosBriefs, "Exhibition", $splits.exhibition, "", "")
337: </tbody>
338:
339: <tbody>
340: #splitWithLabels($statPosBriefs, "Home", $splits.home, "3", "Location")
341: #splitWithLabels($statPosBriefs, "Away", $splits.away, "", "")
342: #splitWithLabels($statPosBriefs, "Neutral", $splits.neutral, "", "")
343: </tbody>
344:
345: <tbody>
346: #set ($rowSpan = $gamesResults.entrySet().size())
347: #set ($rowSpanLabel = "Result")
348:
349: #foreach($gameResult in $gamesResults.entrySet())
350: #if ($gameResult.key == "wins")
351: #set ($splitGameResult = $splits.inWins)
352: #elseif ($gameResult.key == "losses")
353: #set ($splitGameResult = $splits.inLosses)
354: #elseif ($gameResult.key == "ties")
355: #set ($splitGameResult = $splits.inTies)
356: #end
357:
358: #splitWithLabels($statPosBriefs, $gameResult.value, $splitGameResult, $rowSpan, $rowSpanLabel)
359:
360: #set ($rowSpan = "")
361: #end
362: </tbody>
363:
364: #if ($monthsPlayed and $monthsPlayed.size() > 0)
365: <tbody>
366: #set ($rowSpan = $monthsPlayed.size())
367: #set ($rowSpanLabel = "Month")
368:
369: #foreach($month in $monthsPlayed)
370: #if ($month == 'January')
371: #set ($splitMonth = $splits.january)
372: #elseif ($month == 'February')
373: #set ($splitMonth = $splits.february)
374: #elseif ($month == 'March')
375: #set($splitMonth = $splits.march)
376: #elseif ($month == 'April')
377: #set($splitMonth = $splits.april)
378: #elseif ($month == 'May')
379: #set ($splitMonth = $splits.may)
380: #elseif ($month == 'June')
381: #set ($splitMonth = $splits.june)
382: #elseif ($month == 'July')
383: #set($splitMonth = $splits.july)
384: #elseif ($month == 'August')
385: #set ($splitMonth = $splits.august)
386: #elseif ($month == 'September')
387: #set($splitMonth = $splits.september)
388: #elseif ($month == 'October')
389: #set($splitMonth = $splits.october)
390: #elseif ($month == 'November')
391: #set ($splitMonth = $splits.november)
392: #elseif ($month == 'December')
393: #set($splitMonth = $splits.december)
394: #end
395:
396: #splitWithLabels($statPosBriefs, $month, $splitMonth, $rowSpan, $rowSpanLabel)
397:
398: #set ($rowSpan = "")
399:
400: #end ## foreach
401: </tbody>
402: #end
403: </table>
404: </div> ## table-responsive
405: </div> ## stats-box
406: #end
407:
408: #end ## macro splitsData
409:
410: #macro (printRecentGames)
411: #if ($hasEvents)
412: <div class="table-responsive">
413: <table class="table table-hover table-sm">
414: <thead class="thead-dark">
415: <tr><th colspan="3" scope="col">Recent Games</th></tr>
416: </thead>
417: <tbody>
418: #set ($eventEnd = -1)
419: #foreach ($event in $events)
420: #if ($event.event.result.resolved)
421: #set ($eventEnd = $velocityCount)
422: #end
423: #end
424:
425: #set ($eventStart = $eventEnd - 5)
426: #if ($eventStart < 0) #set ($eventStart = 0) #end
427:
428: #foreach ($event in $events)
429: #if ($velocityCount >= $eventStart and $velocityCount <= $eventEnd)
430: <tr>
431: <td scope="row">$formatter.formatDate($event.event.date, "MMM d")</td>
432: <td>
433: #if ($event.event.neutralSite.length() > 0) vs.
434: #elseif (!$event.event.home) at
435: #else ## nothing for a home game
436: #end
437: $event.event.opponent.name
438: </td>
439: <td>
440: #if ($event.event.statusCode >= 0)
441: #if ($event.event.eventId.length() > 0 && $event.stats.size() > 0)
442: <a #printResultAriaLabel($event.event) href="../boxscores/${formatter.formatBoxScoreLink($event.event)}">${event.event.APResult}</a>
443: #else
444: ${event.event.APResult}
445: #end
446: #end
447: </td>
448: </tr>
449: #end ## if
450: #end
451: </tbody>
452: </table>
453: </div>
454: #end
455: #end ## macro printRecentGames
456:
457: #macro (printCategories $briefCategoryLabels $v $ariaLabel)
458: <div class="$classTabPaneContent has-child-tabs">
459: <div class="$classBioTabChildrenWrapper" data-momentum="false">
460: <div class="jscroll-inner">
461: <ul class="$classBioTabChildren" id="bio-tabs-$v" role="tablist">
462: #foreach($briefCat in $briefCategoryLabels.entrySet())
463: #set ($briefCatLabel = $briefCat.value)
464: #set ($briefCatKey = $briefCat.key)
465: #if ($locale == "en_gb" && $briefCatLabel == "Defense")
466: #set ($briefCatLabel = "Defence")
467: #end
468: <li class="nav-item">
469: <a data-toggle="tab" id="${v}-tab-pos-${briefCatKey}" class="nav-link#if ($activePos == $briefCatKey) active#end" data-target="#${v}-tab-pos-${briefCatKey}-content" href="${page.url}?view=${v}&pos=${briefCatKey}" aria-label="${ariaLabel}: ${briefCatLabel}">${briefCatLabel}</a>
470: </li>
471: #end
472: </ul>
473: </div>
474: </div>
475: <div class="tab-content" id="${v}-tab-content">
476: #foreach ($briefCat in $briefCategoryLabels.entrySet())
477: #set ($briefCatLabel = $briefCat.value)
478: #set ($briefCatKey = $briefCat.key)
479: #set ($class = "tab-panel")
480: #if ($briefCat.key == $activePos)
481: #set ($class = "tab-panel active show")
482: #end
483: <div class="tab-pane fade ${class}" id="${v}-tab-pos-${briefCatKey}-content" role="tabpanel" aria-labelledby="${v}-tab-pos-${briefCatKey}">
484: <div class="stats-wrap $classTabPaneContent">
485: ## $page.url.contains("records/") <h4 class="bio-tabbed-content-heading">$ariaLabel - <small class="text-muted"> $briefCatLabel</small></h4>
486: <h4 class="bio-tabbed-content-heading">$ariaLabel - <small class="text-muted"> $briefCatLabel</small></h4>
487: #if ($v == "splits")
488: #splitsData($briefCat.key)
489: #elseif ($v == "career")
490: #careerData($briefCat.key)
491: #end
492: </div>
493: </div>
494: #end
495: </div>
496: </div>
497: #end ## macro printCategories
498:
499: #macro (printHeadshot)
500: #if ($enhancedLayout)
501: #set ($classPlayerPhoto = "img-fluid img-thumbnail")
502: #else
503: #set ($classPlayerPhoto = "img-fluid")
504: #end
505:
506: #if ($headshot.url)
507: #set ($src = $headshot.url)
508: #elseif ($website.exists("/images/setup/default-headshot.png"))
509: #set ($src = "/images/setup/default-headshot.png")
510: #elseif ($website.exists("/images/setup/headshot_default.jpg"))
511: #set ($src = "/images/setup/headshot_default.jpg")
512: #else
513: #set ($src = "/info/images/default-headshot.png")
514: #end
515:
516: #if ($src.trim().length() > 0)
517: <img src="$src?max_width=510&max_height=600" class="$classPlayerPhoto" alt="$fullName" />
518: #end
519: #end ## macro printHeadshot
520:
521: #macro (printBioInfo)
522: #if ($enhancedLayout)
523: #set ($classListItems = "col-md-6 px-2")
524: #set ($definitionListItems = "d-flex border-bottom m-0 p-2")
525: #else
526: #set ($classListItems = "col-md-12 px-2")
527: #set ($definitionListItems = "d-flex flex-column border-bottom m-0 p-2")
528: #end
529:
530: #if ($enhancedLayout)
531: <div class="player-heading h3 bg-primary d-flex align-content-stretch text-white position-relative z-index-1">
532: #if ($!attributes.get("number").length() > 0)<span class="number bg-secondary inline-block text-white p-3">$!attributes.get("number")</span>#end
533: <span class="name inline-block p-3">$fullName</span>
534: </div>
535: #end
536:
537: <div class="roster-player-fields">
538: <ul class="d-flex flex-row flex-wrap justify-content-between list-unstyled">
539: #foreach ($i in [1..10])
540: #set ($stickyKey = "bio_custom${i}_sticky")
541: #if ($options.get($stickyKey).length() > 0 && $attributes.get("custom${i}").length() > 0)
542: <li class="$classListItems bio-field-custom-sticky">
543: <dl class="${definitionListItems}">
544: <dt class="label p-0 mr-2">$options.get($stickyKey): </dt>
545: <dd class="value p-0 m-0">$!attributes.get("custom${i}")</dd>
546: </dl>
547: </li>
548: #end
549: #end
550:
551: #foreach ($field in $fields)
552: #if (!$field.key.startsWith("custom"))
553: #if ($attributes.get($field.key).length() > 0 && ($field.key != "first_name" && $field.key != "last_name" && $field.key != "number" && $field.key != "full_name"))
554: #if ($field.key == "phone1" || $field.key == "phone2")
555: <li class="$classListItems bio-field-standard">
556: <dl class="${definitionListItems}">
557: <dt class="label p-0 mr-2">Phone: </dt>
558: <dd class="value p-0 m-0">$!attributes.get($field.key)</dd>
559: </dl>
560: </li>
561: #elseif ($field.key == "email_address")
562: <li class="$classListItems bio-field-standard">
563: <dl class="${definitionListItems}">
564: #set ($emailAdd = $attributes.get($field.key))
565: <dt class="label p-0 mr-2">Email: </dt>
566: <dd class="value p-0 m-0 text-truncate"><a href="mailto:${emailAdd}">$emailAdd</a></dd>
567: </dl>
568: </li>
569: #elseif ($field.key == "weight_class")
570: <li class="$classListItems bio-field-standard">
571: <dl class="${definitionListItems}">
572: <dt class="label p-0 mr-2">Class: </dt>
573: <dd class="value p-0 m-0">$!attributes.get($field.key)</dd>
574: </dl>
575: </li>
576: #elseif ($field.key != "position_abbr")
577: <li class="$classListItems bio-field-standard">
578: <dl class="${definitionListItems}">
579: <dt class="label p-0 mr-2">$field.value: </dt>
580: <dd class="value p-0 m-0">$!attributes.get($field.key)</dd>
581: </dl>
582: </li>
583: #end
584: #end
585: #end
586: #end
587:
588: #foreach ($i in [1..10])
589: #set ($customKey = "bio_custom${i}")
590: #if ($options.get($customKey).length() > 0 && $attributes.get("custom${i}"))
591: <li class="$classListItems bio-field-custom">
592: <dl class="${definitionListItems}">
593: <dt class="label p-0 mr-2">$options.get($customKey): </dt>
594: <dd class="value p-0 m-0">$!attributes.get("custom${i}")</dd>
595: </dl>
596: </li>
597: #end
598: #end
599: </ul>
600: </div>
601: #end ## macro printBioInfo
602:
603: #macro (printActionShots)
604: #if ($showActionShots)
605: ## FILTERS OUT THE NUMBER OF ACTION PHOTOS
606: #set ($totalPhotoAvaiable = $playerPhotos.size())
607: #set ($playerPhotosFiltered = $playerPhotos)
608: #if ($actionShotsLimit < $totalPhotoAvaiable)
609: #set ($playerPhotosFiltered = $playerPhotos.subList(0, $actionShotsLimit))
610: #end
611: #set ($playerPhotosFiltered = $tool.sorter.sort($playerPhotosFiltered, "lastUpdated:desc"))
612: <div class="action-shots clearfix mb-md-n5 d-none d-sm-none d-md-block">
613: <div id="action-shots-carousel" class="carousel slide carousel-fade" data-interval="12000" data-ride="carousel">
614: <ol class="carousel-indicators pb-sm-3 mb-sm-5">
615: #foreach($photo in $playerPhotosFiltered)
616: <li data-target="#action-shots-carousel" data-slide-to="$foreach.index" class="#if ($foreach.index == 0)active#end"></li>
617: #end
618: </ol>
619: <div class="carousel-inner">
620: #foreach($photo in $playerPhotosFiltered)
621: #set ($imgAlt = "Large featured action photo of $fullName - Image $foreach.count")
622: #if ($photo.altText.length() > 0)
623: #set ($imgAlt = $photo.altText)
624: #elseif( $photo.title.length() > 0 )
625: #set ($imgAlt = $photo.title)
626: #end
627: <div class="carousel-item#if ($foreach.index == 0) active#end">
628: <img src="${photo.url}?max_width=1200" alt="$imgAlt" class="d-block w-100" data-lastupdated="$photo.lastUpdated" />
629: </div>
630: #end
631: </div>
632: </div>
633: </div>
634: #end
635: #end ## macro printActionShots
636:
637: #macro (printHighlights)
638: #if ($highlights && $showHighlights)
639: <div class="roster-bio-highlights mt-3 bg-white text-dark">
640: <ul class="d-flex flex-row flex-wrap justify-content-between list-unstyled m-0">
641: #foreach ($highlight in $highlights.keySet())
642: #set ($value = "-")
643: #set ($value = $formatter.formatNumber($stats.get($highlight), $formats.get($highlight)))
644: <li class="flex-fill px-2 text-center border border-white bg-primary text-white">
645: <dl class="stat d-block m-0 p-2">
646: <dt class="d-block label p-0 m-0 text-uppercase">$!highlights.get($highlight)</dt>
647: <dd class="d-block value p-0 m-0">$value</dd>
648: </dl>
649: </li>
650: #end
651: </ul>
652: </div>
653: #end
654: #end ## macro printHighlights
655:
656: #macro (printRoster)
657: #if ($enhancedLayout)
658: $website.includeAgain("${page.url}?tmpl=roster-switcher-template&id=roster-list")
659: #else
660: #set ($id = "roster-switcher")
661: #if ($request.getParameter("id").length() > 0)
662: #set ($id = $request.getParameter("id"))
663: #end
664:
665: #if ($page.contentType == "loki/bio")
666: #set ($headlinesFeaturedSize = 0)
667: #foreach ($featuredPage in $page.headlinesFeatured)
668: #if ($featuredPage.contentType == "loki/headlines")
669: #set ($headlinesFeaturedSize = $headlinesFeaturedSize + 1)
670: #end
671: #end
672: #if ($headlinesFeaturedSize > 0)
673: <div id="$id" class="float-sm-right roster-switcher-template">
674: <div class="input-group mb-3">
675: <div class="input-group-prepend">
676: <label class="input-group-text" for="$id-options">Related Bios</label>
677: </div>
678: <select class="custom-select" id="$id-options" onchange="location=this.value;">
679: #foreach ($featuredPage in $page.headlinesFeatured)
680: #if ($featuredPage.contentType == "loki/headlines")
681: $website.includeAgain("${featuredPage.url}?tmpl=roster-list-template¤t_url=${page.url}")
682: #end
683: #end
684: </select>
685: </div>
686: </div>
687: #end
688: #elseif ($page.contentType == "loki/bio-network")
689: #set ($relatedPlayers = $page.sectionPage.children)
690: #set ($teamNames = {})
691: #foreach ($relatedPlayer in $relatedPlayers)
692: #if ($relatedPlayer.contentType == "loki/bio-network")
693: #set ($relatedPlayerObj = $relatedPlayer.getDataAsObject().getAttributes())
694: #set ($teamName = $relatedPlayerObj.get("team"))
695: #if ($teamName.length() > 0)
696: #if (!$teamNames.containsValue($teamName))
697: $!teamNames.put($tool.math.add($teamNames.size(), 1), $teamName)
698: #end
699: #end
700: #end
701: #end
702: <div id="$id" class="float-sm-right roster-switcher-template">
703: <div class="input-group mb-3">
704: <div class="input-group-prepend">
705: <label class="input-group-text" for="$id-options">Related Bios</label>
706: </div>
707: <select class="custom-select" id="$id-options" onchange="location=this.value;">
708: #foreach ($i in [1..$teamNames.size()])
709: #if ($teamNames.size() > 1)
710: <optgroup label="$teamNames.get($i)">
711: #end
712:
713: #foreach ($relatedPlayer in $relatedPlayers)
714: #if ($relatedPlayer.contentType == "loki/bio-network")
715: #set ($relatedPlayerObj = $relatedPlayer.getDataAsObject().getAttributes())
716: #set ($teamName = $relatedPlayerObj.get("team"))
717: #if ($teamName.length() > 0 && $teamName == $teamNames.get($i))
718: #set ($playerFirstName = $relatedPlayerObj.get("first_name"))
719: #set ($playerLastName = $relatedPlayerObj.get("last_name"))
720: <option value="$relatedPlayer.url" #if ($page.url == $relatedPlayer.url)selected#end>${playerFirstName} ${playerLastName}</option>
721: #end
722: #end
723: #end
724:
725: #if ($teamNames.size() > 1)
726: </optgroup>
727: #end
728: #end
729: </select>
730: </div>
731: </div>
732: #end
733: #end ## enhancedLayout check
734: #end ## macro printRoster
735:
736: ################################################## END MACROS #############################################################
737:
738: #if ($attributes.get("full_name").length() > 0)
739: #set ($fullName = $attributes.get("full_name"))
740: #else
741: #set ($firstName = $!attributes.get("first_name"))
742: #set ($lastName = $!attributes.get("last_name"))
743: #set ($fullName = "${firstName} ${lastName}")
744: #end
745:
746: #set ($pageTitle = "")
747: #if($request.getAttribute("pageTitle").length() > 0)
748: #set ($pageTitle = $request.getAttribute("pageTitle"))
749: #end
750: #if ($page.title.length() > 0)
751: #set ($pageTitle = $!page.title)
752: #end
753: $!request.setAttribute("pageTitle", "${pageTitle}")
754:
755: #set ($actionShots = false)
756: #if ($enhancedLayout && $playerPhotos.size() > 0)
757: #set ($actionShots = true)
758: #end
759:
760: #if ($enhancedLayout)
761: #set ($classRoot = "bio-enhanced")
762: #if ($actionShots && $showActionShots)
763: #set ($classRoot = "${classRoot} action")
764: #else
765: #set ($classRoot = "${classRoot} plain")
766: #end
767: #set ($classCard = "mb-5 bg-light p-3 col-sm-12 pt-md-0")
768: #set ($classBody = "col-sm-12")
769: #set ($classBioTabParentsWrapper = "nav-tabs-wrapper position-relative py-3 border-top border-bottom")
770: #set ($classBioTabParents = "nav nav-pills nav-tabs-responsive d-flex flex-row text-nowrap justify-content-center")
771: #set ($classBioTabChildrenWrapper = "nav-tabs-wrapper position-relative py-3 border-bottom")
772: #set ($classBioTabChildren = "nav nav-pills nav-tabs-responsive d-flex flex-row text-nowrap justify-content-center")
773: #set ($classTabPaneContent = "tab-pane-contents py-3")
774: #else
775: #set ($classRoot = "bio-wrap")
776: #set ($classCard = "mb-5 p-3 col-lg-4 col-xl-3 bg-light")
777: #set ($classBody = "col-lg-8 col-xl-9")
778: #set ($classBioTabParentsWrapper = "nav-tabs-wrapper position-relative")
779: #set ($classBioTabParents = "nav nav-tabs nav-tabs-responsive d-flex flex-row text-center justify-content-start")
780: #set ($classBioTabChildrenWrapper = "nav-tabs-wrapper position-relative")
781: #set ($classBioTabChildren = "nav nav-tabs nav-tabs-responsive d-flex flex-row text-center justify-content-start")
782: #set ($classTabPaneContent = "tab-pane-contents p-3")
783:
784: #end
785:
786: ## FULL ROSTER
787: <div class="${classRoot} #if ($highlights) bio-wrap-has-highlights #end clearfix">
788:
789: ## RELATED BIOS
790: #if ($showRoster)
791: <div class="related-bios clearfix">#printRoster</div>
792: #end
793:
794: #if ($actionShots)
795: #printActionShots
796: #end
797: #if ($enhancedLayout)
798: #else
799: <div class="player-heading h3 d-flex align-content-stretch position-relative z-index-1 mb-3 bg-primary text-white border">
800: #if ($!attributes.get("number").length() > 0)<span class="number bg-secondary inline-block text-white p-3">$!attributes.get("number")</span>#end
801: <span class="name inline-block p-3">$fullName</span>
802: </div>
803: #end
804:
805: <div class="container">
806: <div class="row">
807: <div class="bio-card ${classCard}">
808: <div class="player-about clearfix">
809: #if ($enhancedLayout)
810: <div class="row no-gutters">
811: <div class="col-md-4 col-lg-3">
812: <div class="player-headshot text-center position-relative z-index-1 mt-md-n5">#printHeadshot</div>
813: </div>
814: <div class="col-md-8 col-lg-9">
815: <div class="player-info">#printBioInfo</div>
816: </div>
817: </div>
818: #else
819: <div class="row">
820: <div class="col-md-4 col-lg-12">
821: <div class="player-headshot text-center position-relative z-index-1 mb-3">#printHeadshot</div>
822: </div>
823: <div class="col-md-8 col-lg-12">
824: <div class="player-info mb-3">#printBioInfo</div>
825: </div>
826: </div>
827: #end
828: </div>
829: #printHighlights
830: </div> ## bio-card
831:
832: #if ($view.length() > 0)
833: $request.setAttribute("icl-responsive-tabs-script", true)
834:
835: <div class="bio-body ${classBody}">
836: <div class="tab-container">
837: #if ($statsURL.length() > 0 || $hasHTMLStats || $releases.size() > 0|| $playerPhotos.size() > 0 || $playerVideos.size() > 0)
838: <div class="$classBioTabParentsWrapper" data-momentum="false">
839: <div class="jscroll-inner">
840: <ul class="$classBioTabParents" id="bio-tabs-parents" role="tablist">
841: #if ($hasSynopsis || $hasBioBrief)
842: <li class="nav-item">
843: <a data-toggle="tab" id="bio-tab" class="nav-link #if ($view == "bio") active#end" data-target="#bio" href="${page.url}?view=bio">Bio</a>
844: </li>
845: #end
846:
847: #if ($statsURL.length() > 0)
848: <li class="nav-item">
849: <a data-toggle="tab" id="profile-tab" class="nav-link#if ($view == "profile") active#end" data-target="#profile" href="${page.url}?view=profile">Player Profile</a>
850: </li>
851: <li class="nav-item">
852: <a data-toggle="tab" id="gamelog-tab" class="nav-link#if ($view == "gamelog") active#end" data-target="#gamelog" href="${page.url}?view=gamelog">Game Log</a>
853: </li>
854: #if ($showCareer)
855: <li class="nav-item">
856: <a data-toggle="tab" id="career-tab" class="nav-link#if ($view == "career") active#end" data-target="#career" href="${page.url}?view=career">Career Stats</a>
857: </li>
858: #end
859: <li class="nav-item">
860: <a data-toggle="tab" id="splits-tab" class="nav-link#if ($view == "splits") active#end" data-target="#splits" href="${page.url}?view=splits">Split Stats</a>
861: </li>
862: #end
863:
864: #if ($hasHTMLStats)
865: <li class="nav-item">
866: <a data-toggle="tab" id="htmlstats-tab" class="nav-link#if ($view == "htmlstats") active#end" data-target="#htmlstats" href="${page.url}?view=htmlstats">HTML Stats</a>
867: </li>
868: #end
869:
870: #if ($releases.size() > 0)
871: <li class="nav-item">
872: <a data-toggle="tab" id="news-tab" class="nav-link#if ($view == "news") active#end" data-target="#news" href="${page.url}?view=news">News</a>
873: </li>
874: #end
875:
876: #if ($playerPhotos.size() > 0)
877: <li class="nav-item">
878: <a data-toggle="tab" id="photos-tab" class="nav-link#if ($view == "photos") active#end" data-target="#photos" href="${page.url}?view=photos">Photos</a>
879: </li>
880: #end
881:
882: #if ($playerVideos.size() > 0)
883: <li class="nav-item">
884: <a data-toggle="tab" id="videos-tab" class="nav-link#if ($view == "videos") active#end" data-target="#videos" href="${page.url}?view=videos">Videos</a>
885: </li>
886: #end
887: </ul>
888: </div>
889: </div>
890: #end
891: <div class="tab-content" id="roster-tab-content">
892: ## BIO
893: #if ($hasSynopsis || $hasBioBrief)
894: #set ($class = "tab-panel")
895: #if ($view == "bio")
896: #set ($class = "tab-panel active show")
897: #end
898:
899: <div class="tab-pane fade ${class}" id="bio" role="tabpanel" aria-labelledby="bio-tab">
900: <div class="$classTabPaneContent synopsis">
901: #if (!$page.url.contains("records/"))
902: ## CLIENT REQUEST TO DISABLE THIS HEADING ON RECORD PAGES - https://prestosports.jira.com/browse/FED-15527
903: <h4 class="bio-tabbed-content-heading">Bio</h4>
904: #end
905: #if ($hasSynopsis)
906: $synopsis
907: #elseif ($hasBioBrief)
908: $website.include("$bioBriefURL")
909: #end
910: </div>
911: </div> ## tab-panel
912: #end
913:
914: ## STATS
915: #if ($statsURL.length() > 0)
916:
917: ## PROFILE
918: #set ($class = "tab-panel")
919: #if ($view == "profile")
920: #set ($class = "tab-panel active show")
921: #end
922:
923: <div class="tab-pane fade ${class}" id="profile" role="tabpanel" aria-labelledby="profile-tab">
924: <div class="$classTabPaneContent stats-wrap">
925: <h4 class="bio-tabbed-content-heading">Player Profile</h4>
926: ## LAST SIX GAMES
927: <div class="row">
928: <div class="stats-box col-12">
929: #printRecentGames()
930: </div>
931:
932: ## RANKING
933: <div class="stats-box col-12">
934: #if ($statPos.length() > 0)
935: $website.include("players?tmpl=stats-bios-rank-template&rank=${playerId}&pos=${statPos}")
936: #end
937: </div>
938: </div>
939: </div> ## stats-wrap
940: </div> ## tab-content
941:
942: ## GAMELOG
943: #set ($class = "tab-panel")
944: #if ($view == "gamelog")
945: #set ($class = "tab-panel active show")
946: #end
947:
948: #set ($activePos = $statPos)
949: #if ($view == "gamelog" && $paramPos.length() > 0)
950: #if ($positions.get($paramPos).length() > 0)
951: #set ($activePos = $positions.get($paramPos))
952: #end
953: #end
954:
955: <div class="tab-pane fade ${class}" id="gamelog" role="tabpanel" aria-labelledby="gamelog-tab">
956: #if ($gamelogsCategoriesLabels)
957: <div class="$classTabPaneContent has-child-tabs">
958: <div class="$classBioTabChildrenWrapper" data-momentum="false">
959: <div class="jscroll-inner">
960: <ul class="$classBioTabChildren" id="bio-tabs-gamelog" role="tablist">
961: #foreach($gamelogsCatLabel in $gamelogsCategoriesLabels.entrySet())
962: #set($gamelogsCatLabelVal = $gamelogsCatLabel.value)
963: #if ($locale == "en_gb" && $gamelogsCatLabelVal == "Defense")
964: #set($gamelogsCatLabelVal = "Defence")
965: #end
966: <li class="nav-item">
967: <a data-toggle="tab" id="gamelog-tab-pos-${gamelogsCatLabel.key}" class="nav-link#if ($activePos == $gamelogsCatLabel.key) active#end" data-target="#gamelog-tab-pos-${gamelogsCatLabel.key}-content" href="${page.url}?view=gamelog&pos=${gamelogsCatLabel.key}" aria-label="Game Log: ${gamelogsCatLabelVal}">$gamelogsCatLabelVal</a>
968: </li>
969: #end
970: </ul>
971: </div>
972: </div>
973: <div class="tab-content" id="gamelog-tab-content">
974: #foreach($gamelogsCatLabel in $gamelogsCategoriesLabels.entrySet())
975: #set ($class = "tab-panel")
976: #if ($gamelogsCatLabel.key == $activePos)
977: #set ($class = "tab-panel active show")
978: #end
979: <div class="tab-pane fade ${class}" id="gamelog-tab-pos-${gamelogsCatLabel.key}-content" role="tabpanel" aria-labelledby="gamelog-tab-pos-${gamelogsCatLabel.key}">
980: <div class="stats-wrap $classTabPaneContent">
981: <h4 class="bio-tabbed-content-heading">Game Log - <small class="text-muted"> $gamelogsCatLabel.value</small></h4></h4>
982: #gamelogData($gamelogsCatLabel.key)
983: </div>
984: </div>
985: #end
986: </div>
987: </div>
988: #else
989: <div class="stats-wrap $classTabPaneContent">#gamelogData($pos)</div>
990: #end
991:
992: </div> ## tab-panel
993:
994: ## CAREER
995: #if ($showCareer)
996:
997: #set ($activePos = $statPos)
998: #if ($view == "career" && $paramPos.length() > 0)
999: #if ($positions.get($paramPos).length() > 0)
1000: #set ($activePos = $positions.get($paramPos))
1001: #end
1002: #end
1003:
1004: #set ($class = "tab-panel")
1005: #if ($view == "career")
1006: #set ($class = "tab-panel active show")
1007: #end
1008:
1009: <div class="tab-pane fade ${class}" id="career" role="tabpanel" aria-labelledby="career-tab">
1010: #if ($briefsCategoriesLabels)
1011: #printCategories($briefsCategoriesLabels "career" "Career Stats")
1012: #else
1013: <div class="stats-wrap $classTabPaneContent">#careerData($activePos)</div>
1014: #end
1015: </div>
1016: #end
1017:
1018: ## SPLITS
1019: #set ($class = "tab-panel clearfix")
1020: #if ($view == "splits")
1021: #set ($class = "tab-panel active show")
1022: #end
1023:
1024: #set ($activePos = $statPos)
1025: #if ($view == "splits" && $paramPos.length() > 0)
1026: #if ($positions.get($paramPos).length() > 0)
1027: #set ($activePos = $positions.get($paramPos))
1028: #end
1029: #end
1030:
1031: <div class="tab-pane fade ${class}" id="splits" role="tabpanel" aria-labelledby="splits-tab">
1032: #if ($briefsCategoriesLabels)
1033: #printCategories($briefsCategoriesLabels "splits" "Splits Stats")
1034: #else
1035: <div class="stats-wrap $classTabPaneContent">#splitsData($pos)</div>
1036: #end
1037: </div>
1038: #end
1039:
1040: ## HTML STATS
1041: #if ($hasHTMLStats)
1042: #set ($class = "tab-panel clearfix")
1043: #if ($view == "htmlstats")
1044: #set ($class = "tab-panel active show")
1045: #end
1046: <div class="tab-pane fade ${class}" id="htmlstats" role="tabpanel" aria-labelledby="htmlstats-tab">
1047: <div class="$classTabPaneContent">
1048: <h4 class="bio-tabbed-content-heading">Other Stats</h4>
1049: <a href="${htmlStatsURL}" class="bio-htmlstats-identifier">Click to view HTML Stats</a>
1050: </div>
1051: </div>
1052: #end
1053:
1054: ## NEWS
1055: #if ($releases.size() > 0)
1056: #set ($class = "tab-panel clearfix")
1057: #if ($view == "news")
1058: #set ($class = "tab-panel active show")
1059: #end
1060: <div class="tab-pane fade ${class}" id="news" role="tabpanel" aria-labelledby="news-tab">
1061: <div class="$classTabPaneContent">
1062: <h4 class="bio-tabbed-content-heading">News Mentions</h4>
1063: #printGrid($releases, "article")
1064: </div>
1065: </div>
1066: #end
1067:
1068: ## PHOTOS
1069: #if ($playerPhotos.size() > 0)
1070: #set ($class = "tab-panel clearfix")
1071: #if ($view == "photos")
1072: #set ($class = "tab-panel active clearfix")
1073: #end
1074: <div class="tab-pane fade ${class}" id="photos" role="tabpanel" aria-labelledby="photos-tab">
1075: <div class="$classTabPaneContent">
1076: <h4 class="bio-tabbed-content-heading">Photos</h4>
1077: $website.includeAgain("${page.url}?tmpl=bio-photos-template")
1078: </div>
1079: </div>
1080: #end
1081:
1082: ## VIDEOS
1083: #if ($playerVideos.size() > 0)
1084: #set ($class = "tab-panel clearfix")
1085: #if ($view == "videos")
1086: #set ($class = "tab-panel active clearfix")
1087: #end
1088: <div class="tab-pane fade ${class}" id="videos" role="tabpanel" aria-labelledby="videos-tab">
1089: <div class="$classTabPaneContent">
1090: <h4 class="bio-tabbed-content-heading">Videos</h4>
1091: #printGrid($playerVideos, "video")
1092: </div>
1093: </div>
1094: #end
1095:
1096: </div> ## tab-panels
1097: </div> ## tab-container
1098: </div> ## body
1099: #end
1100: </div>
1101: </div>
1102:
1103: $wiki
1104: </div> ## ends bio-wrap
1105:
1106: ## GLOBAL ADS SERVER
1107: #if ($website.ads.isAdvertisingEnabled('BIOS'))
1108: $website.includeAgain("global-adserver-slots?adSlot=bios")
1109: #end
|