There was a problem with a Velocity script
Pagestatcrew-soxml-template
ErrorInvocation of method 'calculate' in class com.prestosports.render.stats.PreviewTeamStats threw exception java.lang.NullPointerException at statcrew-soxml-template[line 216, column 112]
Page source:
1: #if ($stats.view == "pt")
2:     $website.include("options")
3: 
4:     ## This is for testability purposes.
5:     #set ($pregame = $stats.pregame)
6:     #set ($startTime = $document.getRootElement().valueOf("network/@startTime"))
7:     #if ($document.getRootElement().valueOf("network/@tba") == 'Y')
8:         #set ($tba = true)
9:     #else
10:         #set ($tba = false)
11:     #end
12:     #set ($location = $document.getRootElement().valueOf("network/@location"))
13:     #set ($localDate = $document.getRootElement().valueOf("network/@localDate"))
14:     #set ($localTime = $document.getRootElement().valueOf("network/@localTime"))
15: 	#set ($hasVideo = false)
16: 	#if ($document.getRootElement().valueOf("primetime/@videoProvider").length() > 0 && $document.getRootElement().valueOf("primetime/@videoProvider") != "none")
17: 		#set ($hasVideo = true)
18: 	#end
19:     #if ($location != '')
20:         #set ($neutral = true)
21:     #else
22:         #set ($neutral = false)
23:     #end
24:     #if ($request.getParameter("paused") == 'y')
25:         #set ($paused = true)
26:     #else
27:         #set ($paused = false)
28:     #end
29: 
30:     #if ($pregame)
31:         #set ($visitorTeamId = $document.getRootElement().valueOf("team[@vh='V']/@teamId"))
32:         #set ($homeTeamId = $document.getRootElement().valueOf("team[@vh='H']/@teamId"))
33: 
34:         #if ($!options.get("primetime_preview_hide").equalsIgnoreCase("hide"))
35:             #set ($shouldStatsShow = false)
36:         #else
37:             #set ($shouldStatsShow = $preview.shouldStatsShow($homeTeamId,$visitorTeamId))
38:         #end
39:     #end
40: 
41:     <head>
42:         <script type="text/javascript" src='$website.cdn("/info/jquery-2.1.1.js")'></script>
43:         <script type="text/javascript" src='$website.cdn("/info/notifications/jquery.noty.packaged.min.js")'></script>
44:         <script type="text/javascript" src='$website.cdn("/info/dataTables/js/jquery.dataTables.js")'></script>
45:         <script type="text/javascript" src='$website.cdn("/info/momentjs/moment.js")'></script>
46:         <script type="text/javascript" src='$website.cdn("/info/primetime3/js/full_screen_api.js")'></script>
47:         <script type="text/javascript" src='$website.cdn("/info/primetime3/js/flipclock.min.js")'></script>
48: 
49:         $website.addCss($website.cdn("/info/dataTables/css/jquery.dataTables.css"))
50:         $website.addCss($website.cdn("/info/primetime3/css/flipclock.css"))
51: 
52:         <script type="text/javascript" src="/info/primetime3/js/pt3-embed.js"></script>
53: 
54:         <script type="text/javascript">var jQuery_2_1 = $.noConflict(true);</script>
55:         <script type="text/javascript" src="/info/primetime3/js/add-ons.js"></script>
56:         <script type="text/javascript" src="/info/primetime3/js/pt3-util.js"></script>
57:         <script type="text/javascript" src="/info/primetime3/js/pt3-soc-template.js"></script>
58: 
59:         <script src="/info/primetime3/js/highcharts.js"></script>
60:         <script src="/info/primetime3/js/highcharts-more.js"></script>
61:         <script src="/info/primetime3/js/solid-gauge.js"></script>
62: 
63:         <script type="text/javascript" src="/info/primetime3/js/pt3-preview-charts.js"></script>
64: 
65:         $website.addCss("/info/primetime3/css/pt3-styles.css")
66:         $website.addCss("/info/primetime3/css/pt3-soccer-icons.css")
67:         $website.addCss("/info/primetime3/css/pt3-field-hockey-icons.css")
68: 
69:         $website.addCss("/info/primetime3/css/pt3-responsive.css")
70: 
71:         <script type="text/javascript" src="/info/primetime3/js/restive.js"></script>
72:         <script type="text/javascript" src="/info/primetime3/js/pt3-restive.js"></script>
73: 
74:         <script type="text/javascript">
75:             var conf = new Object();
76:             conf.locale = '${locale}';
77:             conf.videoProvider = '${videoProvider}';
78:             conf.videoId = '${videoId}';
79:             conf.eventId = '$document.valueOf("sogame/network/@eventId")';
80:             conf.eventIdHashCode = '$eventIdHashCode';
81:             conf.visitorTeamLogo = '$stats.visitorTeamLogo';
82:             conf.homeTeamLogo = '$stats.homeTeamLogo';
83:             conf.visitorTeamColor = '#121212';
84:             conf.homeTeamColor = '#6D6D6D';
85:             conf.startTime = '$startTime';
86:             conf.pregame = $pregame;
87:             conf.tba = $tba;
88:             conf.localDate = '$localDate';
89:             conf.localTime = '$localTime';
90:             conf.visitor = '${tool.esc.javascript($document.getRootElement().valueOf("team[@vh='V']/@name"))}';
91:             conf.home = '${tool.esc.javascript($document.getRootElement().valueOf("team[@vh='H']/@name"))}';
92:             conf.currentDate = new Date();
93:             conf.statusFinal = $stats.final;
94:             conf.neutral = $neutral;
95:             conf.paused = $paused;
96: 
97:             conf.visitorTeamLighterColor = $.fn.increase_brightness(conf.visitorTeamColor, 30);
98:             conf.homeTeamLighterColor = $.fn.increase_brightness(conf.homeTeamColor, 30);
99:         </script>
100:     </head>
101: 
102:     #if ($pregame && !$shouldStatsShow)
103:         <div id="primetime-wrapper" class="primetime-pre-game primetime-soccer primetime-wrapper clearfix">
104:             <div class="primetime-overflow clearfix">
105:                 <div id="primetime-header" class="grid-row">
106:                     <div class="grid-col grid-col-hdr">
107: 
108:                         <div class="pt-header clearfix">
109:                             <div class="pt-team pt-team-away visitor-team-color" style="background: $document.getRootElement().valueOf("team[@vh='V']/@color")">
110:                                 <img src="$stats.visitorTeamLogo" alt="" class="team-logo visitor-team-logo" />
111:                                 <h3 class="team-name visitor-team-name">$document.getRootElement().valueOf("team[@vh='V']/@name")</h3>
112:                             </div>
113: 
114:                             <div class="pt-team pt-team-home home-team-color" style="background: $document.getRootElement().valueOf("team[@vh='H']/@color")">
115:                                 <img src="$stats.homeTeamLogo" alt="" class="team-logo home-team-logo" />
116:                                 <h3 class="team-name home-team-name">$document.getRootElement().valueOf("team[@vh='H']/@name")</h3>
117:                             </div>
118: 
119:                             <div class="pt-match-scoreboard clearfix">
120:                                 <div class="pt-mtach-info pt-pregame">
121:                                     <center>
122:                                         <div>
123:                                             $localDate <br>
124:                                             #if ($tba)
125:                                                 TBA
126:                                             #else
127:                                                 $localTime
128:                                             #end
129:                                         </div>
130:                                     </center>
131:                                 </div>
132:                             </div>
133:                         </div>
134:                     </div>
135:                 </div>
136:                 <div class="grid-row-container clearfix">
137:                     <div class="grid-row">
138:                         <div class="content">
139:                             <div class="pt-last-play clearfix" style="display: none">
140:                                 <span class="pt-label clearfix" style="text-align: center !important; width: 100% ">
141:                                     This event doesn't have a set start time, but PrimeTime will be available once the event begins.
142:                                 </span>
143:                             </div>
144:                             <div class="text">
145:                                 <h3>
146:                                     Live statistics will be available at the start of the event in:
147:                                 </h3>
148:                                 <center>
149:                                     <div class="clock"></div><br/>
150:                                     #if ($tba)
151:                                         Days
152:                                     #end
153:                                 </center>
154:                             </div>
155:                         </div>
156:                     </div>
157:                     <div class="pt-game-info grid-row clearfix">
158:                         <div class="pt-tabs-panes clearfix">
159:                             <div id="stats-tabs" class="pt-tabs-pane clearfix">
160:                                 <div id="divGameInformation" class="grid-row">
161:                                     <div class="grid-col grid-col-gi grid-col1">
162:                                         <h3 class="grid-title">
163:                                             Game Information
164:                                         </h3>
165:                                         <div class="grid-content clearfix">
166:                                             <div class="pt-game-information clearfix">
167:                                                 <div class="pt-row clearfix">
168:                                                     <center>
169:                                                         <div class="game-location pt-col">
170:                                                         <span class="date">
171:                                                             $localDate<br />
172:                                                             #if ($tba)
173:                                                                 TBA
174:                                                             #else
175:                                                                 $localTime
176:                                                             #end
177:                                                         </span>
178:                                                             <h3>Date & Time</h3>
179:                                                         </div>
180:                                                         #if ($location != '')
181:                                                             <div class="game-venue pt-col">
182:                                                         <span class="venue">
183:                                                             $location<br />
184:                                                             (Neutral)
185:                                                         </span>
186:                                                                 <h3>Location</h3>
187:                                                             </div>
188:                                                         #end
189:                                                     </center>
190:                                                 </div>
191:                                             </div>
192:                                         </div>
193:                                     </div>
194:                                 </div>
195:                             </div>
196:                         </div>
197:                     </div>
198:                 </div>
199: 
200:                 <div id="primetime-footer" class="grid-row">
201:                     <div class="grid-col grid-col-ftr">
202:                         <a href="/"></a>
203:                     </div>
204:                 </div>
205:             </div>
206:             ## GENERAL INFORMATION
207:         </div>
208:     #elseif ($pregame && $shouldStatsShow)
209:         #set ($visitorTeamId = $document.getRootElement().valueOf("team[@vh='V']/@teamId"))
210:         #set ($homeTeamId = $document.getRootElement().valueOf("team[@vh='H']/@teamId"))
211: 
212:         #set ($teamStats = ["sha", "sogpt", "svpg", "svpt", "gfa", "gaa"])
213:         #set ($teamStatsLabels = {"sha": "Shots-per Game", "sogpt": "SOG percentage", "svpg": "Saves per game", "svpt": "Save percentage", "gfa":"GPG", "gaa": "GAA"})
214:         #set ($topStats = ["p", "g", "a", "gaa"])
215: 
216:         #set ($visitorStats = $preview.getTeam($visitorTeamId).setTeamStats($teamStats).setTopStats($topStats).calculate())
217:         #set ($homeStats = $preview.getTeam($homeTeamId).setTeamStats($teamStats).setTopStats($topStats).calculate())
218: 
219:         <div id="primetime-wrapper" class="primetime-pre-game primetime-soccer clearfix">
220:             <div class="primetime-overflow clearfix">
221:                 <div id="primetime-header" class="grid-row">
222:                 <div class="grid-col grid-col-hdr">
223:                     <div class="pt-header clearfix">
224:                         <div class="pt-team pt-team-away visitor-team-color" style="background: $document.getRootElement().valueOf("team[@vh='V']/@color")">
225:                             <img src="$stats.visitorTeamLogo" alt="" class="team-logo visitor-team-logo" />
226:                             <h3 class="team-name visitor-team-name">$document.getRootElement().valueOf("team[@vh='V']/@name")</h3>
227:                         </div>
228: 
229:                         <div class="pt-team pt-team-home home-team-color" style="background: $document.getRootElement().valueOf("team[@vh='H']/@color")">
230:                             <img src="$stats.homeTeamLogo" alt="" class="team-logo home-team-logo" />
231:                             <h3 class="team-name home-team-name">$document.getRootElement().valueOf("team[@vh='H']/@name")</h3>
232:                         </div>
233: 
234:                         <div class="pt-match-scoreboard clearfix">
235:                             <div class="pt-mtach-info pt-pregame">
236:                                 <center>
237:                                     <div>
238:                                         $localDate <br>
239:                                         #if ($tba)
240:                                             TBA
241:                                         #else
242:                                             $localTime
243:                                         #end
244:                                     </div>
245:                                 </center>
246:                             </div>
247:                         </div>
248:                     </div>
249:                 </div>
250:             </div>
251:                 <div class="grid-row-container clearfix">
252:                     <div class="grid-row preview">
253:                         <div class="content">
254:                             <div class="pt-last-play clearfix" style="display: none">
255:                                 <span class="pt-label clearfix" style="text-align: center !important; width: 100% ">
256:                                     This event doesn't have a set start time, but PrimeTime will be available once the event begins.
257:                                 </span>
258:                             </div>
259:                             <div class="text">
260:                                 <h3>
261:                                     Live statistics will be available at the start of the event in:
262:                                 </h3>
263:                                 <center>
264:                                     <div class="clock"></div><br/>
265:                                     #if ($tba)
266:                                         Days
267:                                     #end
268:                                 </center>
269:                             </div>
270:                         </div>
271:                     </div>
272: 
273:                     <!-- Team Overview -->
274:                     <div class="grid-row pt-overview">
275:                         <h2>Overview</h2>
276:                         <div class="grid-col grid-col-e grid-col2 background-black">
277:                             <h3>$document.getRootElement().valueOf("team[@vh='V']/@name")</h3>
278:                             <div class="container clearfix pt-live-action">
279:                                 <table>
280:                                     <thead>
281:                                     <tr>
282:                                         <th>Team Record</th>
283:                                         <th>Conf. Record</th>
284:                                         <th>Last Game</th>
285:                                     </tr>
286:                                     </thead>
287:                                     <tbody>
288:                                     <tr>
289:                                         <td>${visitorStats.overallRecord}</td>
290:                                         <td>${visitorStats.conferenceRecord}</td>
291:                                         <td style="text-align: center">
292:                                             ${visitorStats.lastGame.APResult}
293:                                             <span>
294:                                             #if ($visitorStats.lastGame.neutralSite.length() > 0 || $visitorStats.lastGame.home)
295:                                                 vs.
296:                                             #else
297:                                                 at
298:                                             #end
299:                                                 ${visitorStats.lastGame.opponent.name}
300:                                         </span>
301:                                         </td>
302:                                     </tr>
303:                                     </tbody>
304:                                 </table>
305:                             </div>
306:                             <br />
307:                         </div>
308:                         <div class="grid-col grid-col-e grid-col2 background-gray">
309:                             <h3>$document.getRootElement().valueOf("team[@vh='H']/@name")</h3>
310:                             <div class="pt-live-action">
311:                                 <table>
312:                                     <thead>
313:                                     <tr>
314:                                         <th>Team Record</th>
315:                                         <th>Conf. Record</th>
316:                                         <th>Last Game</th>
317:                                     </tr>
318:                                     </thead>
319:                                     <tbody>
320:                                     <tr>
321:                                         <td>${homeStats.overallRecord}</td>
322:                                         <td>${homeStats.conferenceRecord}</td>
323:                                         <td style="text-align: center">
324:                                             ${homeStats.lastGame.APResult}
325:                                             <span>
326:                                             #if ($homeStats.lastGame.neutralSite.length() > 0 || $homeStats.lastGame.home)
327:                                                 vs.
328:                                             #else
329:                                                 at
330:                                             #end
331:                                                 ${homeStats.lastGame.opponent.name}
332:                                         </span>
333:                                         </td>
334:                                     </tr>
335:                                     </tbody>
336:                                 </table>
337:                             </div>
338:                             <br />
339:                         </div>
340:                     </div>
341: 
342:                     <!-- Team Comaprison -->
343:                     <div class="grid-row">
344:                         <div class="grid-col team-compare">
345:                             <h2>Team Comparison</h2>
346: 
347:                             <div class="charts-line">
348:                                 <div class="charts-inner">
349:                                     #foreach ($i in [0..3])
350:                                         #set ($key = $teamStats[$i])
351:                                         <div class="chart-container">
352:                                             <h3>${teamStatsLabels[$key]}</h3>
353:                                             <div class="stats-chart ts-$key"></div>
354:                                             <div class="stats-values">
355:                                                 <div class="stats-value visitor">${formatter.formatNumber($visitorStats.teamStats[$key], $formats.get($key))}</div>
356:                                                 <div class="stats-value home">${formatter.formatNumber($homeStats.teamStats[$key], $formats.get($key))}</div>
357:                                             </div>
358:                                         </div>
359:                                     #end
360:                                 </div>
361:                             </div>
362: 
363:                             <br/>
364: 
365:                             <div class="game-leaders">
366:                                 <div class="top">
367:                                     <div class="charts">
368:                                         #foreach ($i in [4..5])
369:                                             #set ($key = $teamStats[$i])
370:                                                 <div class="chart">
371:                                                     <div class="stats-chart visitor $key"></div>
372:                                                     <div class="label"><span>${formatter.formatNumber($visitorStats.teamStats[$key], $formats.get($key))}</span><span class="title">${teamStatsLabels[$key]}</span><span>${formatter.formatNumber($homeStats.teamStats[$key], $formats.get($key))}</span></div>
373:                                                     <div class="stats-chart home $key"></div>
374:                                                 </div>
375:                                         #end
376:                                     </div>
377:                                 </div>
378:                             </div>
379:                             <div class="legend grid-col clearfix">
380:                                 <div class="stats-value visitor">$document.getRootElement().valueOf("team[@vh='V']/@name") (based on ${visitorStats.gamesPlayed} games)</div>
381:                                 <div class="stats-value home">$document.getRootElement().valueOf("team[@vh='H']/@name") (based on ${homeStats.gamesPlayed} games)</div>
382:                             </div>
383:                         </div>
384:                     </div>
385: 
386:                     <!-- Key Contributors -->
387:                     <div class="grid-row">
388:                         <div class="grid-col grid-col1 game-leaders grid-col">
389:                             <h2>Key Contributors</h2>
390:                             #macro (gameLeaders $category $label $visitorPlayers $homePlayers $quantityPlayers $displayFormat)
391:                                 #set ($quantityPlayers = $quantityPlayers - 1)
392:                                 <div class="game-leaders">
393:                                     <br/>
394:                                     <h3>$label</h3>
395:                                     <div class="grid-col top1">
396:                                         <div class="grid-col charts">
397:                                             #foreach ($i in [0..$quantityPlayers])
398:                                                 #set ($visitorTopPlayer = $visitorPlayers[$i])
399:                                                 #set ($homeTopPlayer = $homePlayers[$i])
400:                                                 <div class="grid-col chart">
401:                                                     <div class="stats-player visitor">
402:                                                         <div class="player-name">${visitorTopPlayer.firstName} ${visitorTopPlayer.lastName}</div>
403:                                                         <div class="stats-chart visitor ${category}-top${i}"></div>
404:                                                     </div>
405:                                                     <!-- Using the format '#' directly since the wyg has set 0.0 as format on the stats metadata object -->
406:                                                     <div class="label"><span>${formatter.formatNumber($visitorTopPlayer.stats[$category], $displayFormat)}</span><span class="title"></span><span>${formatter.formatNumber($homeTopPlayer.stats[$category], $displayFormat)}</span></div>
407:                                                     <div class="stats-player home">
408:                                                         <div class="player-name">${homeTopPlayer.firstName} ${homeTopPlayer.lastName}</div>
409:                                                         <div class="stats-chart home ${category}-top${i}"></div>
410:                                                     </div>
411:                                                 </div>
412:                                             #end
413:                                         </div>
414:                                     </div>
415:                                 </div>
416:                             #end
417: 
418:                             #gameLeaders('p' 'Points' $visitorStats.topStats['p'] $homeStats.topStats['p'] 2 $formats.get('p'))
419:                             #gameLeaders('g' 'Goals' $visitorStats.topStats['g'] $homeStats.topStats['g'] 2 $formats.get('g'))
420:                             #gameLeaders('a' 'Assists' $visitorStats.topStats['a'] $homeStats.topStats['a'] 2 $formats.get('a'))
421:                             #gameLeaders('gaa' 'Goals Against Average' $visitorStats.topStats['gaa'] $homeStats.topStats['gaa'] 1 $formats.get('gaa'))
422: 
423:                             <div class="legend grid-col clearfix">
424:                                 <div class="stats-value visitor">$document.getRootElement().valueOf("team[@vh='V']/@name") (based on ${visitorStats.gamesPlayed} games)</div>
425:                                 <div class="stats-value home">$document.getRootElement().valueOf("team[@vh='H']/@name") (based on ${homeStats.gamesPlayed} games)</div>
426:                             </div>
427:                         </div>
428:                     </div>
429: 
430:                     <!-- Game Information -->
431:                     <div class="pt-game-info grid-row clearfix">
432:                         <div class="pt-tabs-panes clearfix">
433:                             <div id="stats-tabs" class="pt-tabs-pane clearfix">
434:                                 <div id="divGameInformation" class="grid-row">
435:                                     <div class="grid-col grid-col-gi grid-col1">
436:                                         <h2 class="grid-title">
437:                                             Game Information
438:                                         </h2>
439:                                         <div class="grid-content clearfix">
440:                                             <div class="pt-game-information clearfix">
441:                                                 <div class="pt-row clearfix">
442:                                                     <center>
443:                                                         <div class="game-location pt-col">
444:                                                                 <span class="date">
445:                                                                     $localDate<br />
446:                                                                     #if ($tba)
447:                                                                         TBA
448:                                                                     #else
449:                                                                         $localTime
450:                                                                     #end
451:                                                                 </span>
452:                                                             <h3>Date & Time</h3>
453:                                                         </div>
454:                                                         #if ($location != '')
455:                                                             <div class="game-venue pt-col">
456:                                                                 <span class="venue">
457:                                                                     $location<br />
458:                                                                     (Neutral)
459:                                                                 </span>
460:                                                                 <h3>Location</h3>
461:                                                             </div>
462:                                                         #end
463:                                                     </center>
464:                                                 </div>
465:                                             </div>
466:                                         </div>
467:                                     </div>
468:                                 </div>
469:                             </div>
470:                         </div>
471:                     </div>
472:                 </div>
473: 
474:                 <div id="primetime-footer" class="grid-row">
475:                 <div class="grid-col grid-col-ftr">
476:                     <a href="/"></a>
477:                 </div>
478:             </div>
479:             </div>
480:             <script type="text/javascript">
481:             (function($) {
482:                 $(document).ready(function() {
483:                     Highcharts.setOptions({
484:                         colors: [conf.homeTeamColor, conf.visitorTeamColor]
485:                     });
486: 
487:                     #foreach ($i in [0..3])
488:                         #set ($key = $teamStats[$i])
489:                         $.fn.buildDonutChart('.stats-chart.ts-$key', ${visitorStats.teamStats[$key]}, ${homeStats.teamStats[$key]});
490:                     #end
491: 
492:                     #foreach ($i in [4..5])
493:                         #set ($key = $teamStats[$i])
494:                         $.fn.buildVisitorBarChart('.top .visitor.$key', ${visitorStats.teamStats[$key]}, 4.0, conf.visitorTeamLighterColor);
495:                         $.fn.buildHomeBarChart('.top .home.$key', ${homeStats.teamStats[$key]}, 4.0, conf.homeTeamLighterColor);
496:                     #end
497: 
498:                     // Key Contributors
499:                     #macro (playerStatsScript $category $visitorPlayers $homePlayers $visitorLimit $homeLimit $playersLimit)
500:                         #set ($playersLimit = $playersLimit - 1)
501:                         #foreach ($i in [0..$playersLimit])
502:                             #set ($visitorTopPlayer = $visitorPlayers[$i])
503:                             #set ($homeTopPlayer = $homePlayers[$i])
504:                             $.fn.buildVisitorBarChart('.${category}-top${i}.visitor', ${visitorTopPlayer.stats[$category]}, $visitorLimit, conf.visitorTeamLighterColor);
505:                             $.fn.buildHomeBarChart('.${category}-top${i}.home', ${homeTopPlayer.stats[$category]}, $homeLimit, conf.homeTeamLighterColor);
506:                         #end
507:                     #end
508: 
509:                     #playerStatsScript('p' $visitorStats.topStats['p'] $homeStats.topStats['p'] 55 55 2)
510:                     #playerStatsScript('g' $visitorStats.topStats['g'] $homeStats.topStats['g'] 25 25 2)
511:                     #playerStatsScript('a' $visitorStats.topStats['a'] $homeStats.topStats['a'] 25 25 2)
512:                     #playerStatsScript('gaa' $visitorStats.topStats['gaa'] $homeStats.topStats['gaa'] 15 15 1)
513: 
514:                     $('.stats-value.visitor').css("background-color", conf.visitorTeamColor);
515:                     $('.stats-value.visitor.light').css("background-color", conf.visitorTeamLighterColor);
516:                     $('.stats-value.home').css("background-color", conf.homeTeamColor);
517:                     $('.stats-value.home.light').css("background-color", conf.homeTeamLighterColor);
518:                 });
519:             })(jQuery);
520:         </script>
521:         </div>
522:     #else
523:         <div id="primetime-wrapper" class="primetime-soccer primetime-wrapper clearfix">
524: 
525:             <div class="primetime-overflow clearfix">
526:                 ## HEADER
527:                 <div id="primetime-header" class="grid-row">
528:                     <div class="grid-col grid-col-hdr">
529: 
530:                         <div class="primetime-screen-controls clearfix"> 
531:                             <a href="#" class="full-screen-button pt-icon-resize-full"><span class="text">Switch</span></a> 
532:                             <a href="#" class="normal-screen-button pt-icon-resize-small"><span class="text">Switch</span></a> 
533:                             <a href="#" class="expand-button pt-icon-link-ext"><span class="text">Switch</span></a>
534:                         </div>
535: 
536:                         <div class="pt-header clearfix">
537: 
538:                             <div class="pt-team pt-team-away visitor-team-color"><img src="$stats.visitorTeamLogo" alt="" class="team-logo visitor-team-logo" /><span
539:                                     class="team-record visitor-team-record"></span>
540:                                 <h3 class="team-name visitor-team-name"></h3>
541:                             </div>
542: 
543:                             <div class="pt-team pt-team-home home-team-color">
544:                                 <span class="team-record home-team-record"></span>
545:                                 <img src="$stats.homeTeamLogo" alt="" class="team-logo home-team-logo" />
546:                                 <h3 class="team-name home-team-name"></h3>
547:                             </div>
548: 
549:                             <div class="pt-match-scoreboard clearfix">
550:                                 <p class="team-score visitor-team-score"></p>
551:                                 <p class="team-score home-team-score"></p>
552: 
553:                                 <div class="pt-mtach-info">
554:                                     <span class="time scoreboard-time"></span><br />
555:                                     <span class="period scoreboard-period" style="width: 100%"></span>
556:                                 </div>
557: 
558:                             </div>
559: 
560:                             <div id="pt-page-nav" class="pt-page-nav">
561: 								<a href="#" class="pt-menu">Menu</a>
562:                             	<ul class="clearfix">
563:                                     <li><a href="#live-action-title" data-stroke="1" data-id="#live-action-title">Live Action</a></li>
564:                             		<li><a href="#line-score-title" data-stroke="2" data-id="#line-score-title">Line Score</a></li>
565:                             		## <li><a href="#social-sharing-title" data-id="social-sharing-title">Social Sharing</a></li>
566:                             		<li><a href="#scoring-plays-title" data-stroke="3" data-id="#scoring-plays-title" data-tab-id="#stats-tabs">Scoring Plays</a></li>
567:                             		<li><a href="#team-comparison-title" data-stroke="4" data-id="#team-comparison-title" data-tab-id="#stats-tabs">Team Comparison</a></li>
568:                             		<li><a href="#individual-stats-title" data-stroke="5" data-id="#individual-stats-title" data-tab-id="#stats-tabs">Individual Stats</a></li>
569:                             		<li><a href="#game-info-title" data-stroke="6" data-id="#game-info-title" data-tab-id="#stats-tabs">Game Information</a></li>
570:                             		<li><a href="#play-by-play-title" data-stroke="7" data-id="#play-by-play-title" data-tab-id="#pbp-tabs">Play by Play</a></li>
571:                             	</ul>
572:                             </div>
573: 
574:                         </div>
575: 
576:                     </div>
577:                 </div>
578:                 ## PRIMETIME HEADER 
579: 
580: 				## GRID ROW CONTAINER
581:                 <div class="grid-row-container clearfix">
582: 
583:                 ## GRID ROW
584: 				#set ($gridRowClass = "grid-row no-video")
585: 				#if ($hasVideo)
586: 					#set ($gridRowClass = "grid-row")
587: 				#end
588: 				
589:                 <div id="firstPanelRow" class="$gridRowClass">
590: 
591: 				#set ($gridCounter = 0)
592: 				
593: 				#if ($hasVideo)	
594: 					#set ($gridCounter = $gridCounter + 1)
595:                     <div class="grid-col grid-col-v grid-col${gridCounter}">
596:                         <h3 id="video-field-title" class="grid-title">Broadcast<span class="close">x</span></h3>
597:                         <div class="grid-content clearfix">
598:                             <div class='embed-container'>
599: 
600:                             </div>
601:                         </div>
602:                         ## GRID CONTENT
603:                     </div>
604:                     ## VIDEO COL
605: 				#end
606: 
607: 					#set ($gridCounter = $gridCounter + 1)
608:                     <div class="grid-col grid-col-cd grid-col${gridCounter}">
609:                         <h3 id="live-action-title" class="grid-title">
610:                             Live Action<span class="close">x</span>
611:                         </h3>
612:                         <div class="grid-content clearfix">
613:                             <div class="clearfix">
614:                                 <div class="container clearfix pt-live-action">
615:                                     <table>
616:                                         <thead>
617:                                             <tr>
618:                                                 <th>Time</th>
619:                                                 <th>Action</th>
620:                                                 <th>Plays</th>
621:                                             </tr>
622:                                         </thead>
623:                                         <tbody>
624:                                         </tbody>
625:                                     </table>
626:                                 </div>
627:                             </div>
628:                         </div>
629:                     </div>
630:                 </div>
631: 
632: ## COMMENT THE TIMELINE AND TIMEPLAY CODE
633: #*
634:                 <div class="grid-row">
635:                     <div class="grid-col pt-timeline grid-col-tl grid-col3">
636:                         <h3 id="timeline-title" class="grid-title">
637:                             Timeline<span class="close">x</span>
638:                         </h3>
639:                         <div class="grid-content clearfix ">
640:                             <div class="pt-timeline-logos">
641:                                 <img class="team-logo visitor-team-logo" /><br />
642:                                 <img class="team-logo home-team-logo" />
643:                             </div>
644:                             <div class="pt-timeline-times">
645:                             </div>
646:                         </div>
647:                     </div>
648:                 </div>
649: 
650:                 <div class="grid-row">
651:                     <div class="grid-col pt-timeline-plays grid-col-tp grid-col4">
652: 						<h3 id="timeline-plays-title" class="grid-title">
653:                     		Timeline Plays<span class="close">x</span>
654:                     	</h3>
655:                         <div class="grid-content clearfix">
656:                         </div>
657:                     </div>
658:                 </div>
659: *#
660:                 <div class="grid-row">
661: 					#set ($gridCounter = $gridCounter + 1)
662:                     <div class="grid-col grid-col-bs grid-col${gridCounter}">
663:                         <h3 id="line-score-title" class="grid-title">
664:                             Line Score<span class="close">x</span>
665:                         </h3>
666:                         <div class="grid-content clearfix">
667:                             <div class="pt-line-score clearfix">
668:                                 <table id="scoreByPeriod">
669:                                     <thead>
670:                                         <tr>
671:                                             <th></th>
672:                                         </tr>
673:                                     </thead>
674:                                     <tbody>
675:                                         <tr class="visitor">
676:                                             <td><img src="" alt=""
677:                                                 class="team-logo visitor-team-logo" />
678:                                                 <span class="team-name visitor-team-name"></span></td>
679:                                         </tr>
680:                                         <tr class="home">
681:                                             <td><img src="" alt=""
682:                                                 class="team-logo home-team-logo" />
683:                                                 <span class="team-name home-team-name"></span></td>
684:                                         </tr>
685:                                     </tbody>
686:                                 </table>
687: 
688:                             </div>
689:                         </div>
690:                         ## GRID CONTENT
691:                     </div>
692:                     ## LINE SCORE
693: 					
694: 					## SOCIAL
695: 					#*
696: 					#set ($gridCounter = $gridCounter + 1)
697:                     <div class="grid-col grid-col-ls grid-col${gridCounter}">
698:                         <h3 id="social-sharing-title" class="grid-title">
699:                             Social Sharing<span class="close">x</span>
700:                         </h3>
701:                         <div class="grid-content clearfix">
702:                             <div class="pt-last-score clearfix">
703: 
704:                             </div>
705:                         </div>
706:                         ## GRID CONTENT
707:                     </div>
708: 					*#
709:                     ## SOCIAL
710:                 </div>
711:                 ## GRID ROW ## TABS
712:                 <div class="pt-game-info clearfix">
713: 
714:                     <ul class="pt-tabs clearfix">
715:                         <li class="current"><a href="#stats-tabs">Statistics</a></li>
716:                         <li><a href="#pbp-tabs">Play By Play</a></li>
717:                     </ul>
718: 
719:                     <div class="pt-tabs-panes clearfix">
720:                         <div id="stats-tabs" class="pt-tabs-pane clearfix">
721: 
722:                             ## GRID ROW
723:                             <div class="grid-row">
724: 								#set ($gridCounter = $gridCounter + 1)
725:                                 <div class="grid-col grid-col-sp grid-col${gridCounter}">
726:                                     <h3 id="scoring-plays-title" class="grid-title">
727:                                         Scoring Plays<span class="close">x</span>
728:                                     </h3>
729:                                     <div class="grid-content clearfix">
730:                                         <div id="scoringPlayList" class="pt-scoring-plays clearfix">
731:                                         </div>
732:                                     </div>
733:                                     ## GRID CONTENT
734: 
735:                                 </div>
736:                                 ## SCRING PLAY
737:                             </div>
738:                             ## GRID ROW ##GRID ROW
739:                             <div class="grid-row">
740: 								#set ($gridCounter = $gridCounter + 1)
741:                                 <div class="grid-col grid-col-tc grid-col${gridCounter}">
742:                                     <h3 id="team-comparison-title" class="grid-title">
743:                                         Team Comparison<span class="close">x</span>
744:                                     </h3>
745:                                     <div class="grid-content clearfix">
746:                                         <div class="pt-team-compare clearfix">
747:                                             <table id="teamCompare">
748:                                                 <thead>
749:                                                     <tr>
750:                                                         <th><img src="" alt="" class="team-logo visitor-team-logo" /><br />
751:                                                             <span class="team-name visitor-team-name"></span></th>
752:                                                         <th> <span></span></th>
753:                                                         <th><img src="" alt="" class="team-logo home-team-logo" /><br />
754:                                                             <span class="team-name home-team-name"></span></th>
755:                                                     </tr>
756:                                                 </thead>
757: 
758:                                                 <tbody>
759:                                                     <tr class="stats-shots">
760:                                                         <td></td>
761:                                                         <td class="stats-cat">Shots</td>
762:                                                         <td></td>
763:                                                     </tr>
764: 
765:                                                     <tr class="stats-sog">
766:                                                         <td></td>
767:                                                         <td class="stats-cat">SOG</td>
768:                                                         <td></td>
769:                                                     </tr>
770: 
771:                                                     <tr class="stats-saves">
772:                                                         <td></td>
773:                                                         <td class="stats-cat">Saves</td>
774:                                                         <td></td>
775:                                                     </tr>
776: 
777:                                                     <tr class="stats-corners">
778:                                                         <td></td>
779:                                                         <td class="stats-cat">Corners</td>
780:                                                         <td></td>
781:                                                     </tr>
782: 
783:                                                     <tr class="stats-offsides">
784:                                                         <td></td>
785:                                                         <td class="stats-cat">Offsides</td>
786:                                                         <td></td>
787:                                                     </tr>
788: 
789:                                                     <tr class="stats-fouls">
790:                                                         <td></td>
791:                                                         <td class="stats-cat">Fouls</td>
792:                                                         <td></td>
793:                                                     </tr>
794: 
795:                                                     <tr class="stats-yc">
796:                                                         <td></td>
797:                                                         <td class="stats-cat">YC</td>
798:                                                         <td></td>
799:                                                     </tr>
800: 
801:                                                     <tr class="stats-rc">
802:                                                         <td></td>
803:                                                         <td class="stats-cat">RC</td>
804:                                                         <td></td>
805:                                                     </tr>
806:                                                 </tbody>
807: 
808:                                             </table>
809:                                         </div>
810:                                     </div>
811:                                     ## GRID CONTENT
812:                                 </div>
813:                                 ## TEAM COMPARE
814:                             </div>
815:                             ## GRID ROW ## GRID ROW
816:                             <div class="grid-row">
817: 								#set ($gridCounter = $gridCounter + 1)
818:                                 <div class="grid-col grid-col-is grid-col${gridCounter}">
819:                                     <h3 id="individual-stats-title" class="grid-title">
820:                                         Individual Stats<span class="close">x</span>
821:                                     </h3>
822:                                     <div class="grid-content clearfix">
823:                                         <div class="pt-team-stats clearfix">
824: 
825:                                             <div id="visitorTeamIndividualStats"
826:                                                 class="pt-team-col pt-stats-team active clearfix">
827: 
828:                                                 <div class="pt-team clearfix">
829:                                                     <img src="" alt=""
830:                                                         class="team-logo visitor-team-logo active" />
831:                                                     <h3 class="team-name visitor-team-name"></h3>
832:                                                 </div>
833: 
834:                                                 <div class="pt-stats-tabs clearfix">
835:                                                     <div class="pt-panes clearfix">
836:                                                         <div id="vOffenseTab" class="pt-pane pt-pane1 clearfix">
837: 
838:                                                             <div class="pt-row">
839:                                                                 <table class="goalieStats display"> <!-- goalies -->
840:                                                                     <thead>
841:                                                                         <tr>
842:                                                                             <th>#</th>
843:                                                                             <th>Goalkeepers</th>
844:                                                                             <th>SOG</th>
845:                                                                             <th>GA</th>
846:                                                                             <th>SV</th>
847:                                                                             <th>MIN</th>
848:                                                                         </tr>
849:                                                                     </thead>
850:                                                                     <tbody>
851: 
852:                                                                     </tbody>
853:                                                                 </table>
854:                                                             </div>
855: 
856:                                                             <div class="pt-row">
857:                                                                 <table class="startersStats display"> <!-- starters -->
858:                                                                     <thead>
859:                                                                         <tr>
860:                                                                             <th>#</th>
861:                                                                             <th>Starters</th>
862:                                                                             <th>Pos</th>
863:                                                                             <th>Sh</th>
864:                                                                             <th>Sog</th>
865:                                                                             <th>G</th>
866:                                                                             <th>A</th>
867:                                                                             <th class="dsCell">DS</th>
868:                                                                         </tr>
869:                                                                     </thead>
870:                                                                     <tbody>
871: 
872:                                                                     </tbody>
873:                                                                 </table>
874:                                                             </div>
875:                                                             <div class="pt-row">
876:                                                                 <table class="substitutesStats display"> <!-- substitutes -->
877:                                                                     <thead>
878:                                                                         <tr>
879:                                                                             <th>#</th>
880:                                                                             <th>Substitutes</th>
881:                                                                             <th>Pos</th>
882:                                                                             <th>Sh</th>
883:                                                                             <th>Sog</th>
884:                                                                             <th>G</th>
885:                                                                             <th>A</th>
886:                                                                             <th class="dsCell">DS</th>
887:                                                                         </tr>
888:                                                                     </thead>
889:                                                                     <tbody>
890: 
891:                                                                     </tbody>
892:                                                                 </table>
893:                                                             </div>
894:                                                         </div>
895:                                                     </div>
896:                                                 </div>
897:                                             </div>
898: 
899:                                             <div id="homeTeamIndividualStats" class="pt-team-col pt-stats-team clearfix">
900: 
901:                                                 <div class="pt-team clearfix">
902:                                                     <img src="" alt=""
903:                                                         class="team-logo home-team-logo active" />
904:                                                     <h3 class="team-name home-team-name"></h3>
905:                                                 </div>
906: 
907:                                                 <div class="pt-stats-tabs clearfix">
908: 
909:                                                     <div class="pt-panes clearfix">
910:                                                         <div class="pt-pane clearfix">
911: 
912:                                                             <div class="pt-row">
913:                                                                 <table class="goalieStats display"> <!-- goalies -->
914:                                                                     <thead>
915:                                                                         <tr>
916:                                                                             <th>#</th>
917:                                                                             <th>Goalkeepers</th>
918:                                                                             <th>SOG</th>
919:                                                                             <th>GA</th>
920:                                                                             <th>SV</th>
921:                                                                             <th>MIN</th>
922:                                                                         </tr>
923:                                                                     </thead>
924:                                                                     <tbody>
925: 
926:                                                                     </tbody>
927:                                                                 </table>
928:                                                             </div>
929: 
930:                                                             <div class="pt-row">
931:                                                                 <table class="startersStats display"> <!-- starters -->
932:                                                                     <thead>
933:                                                                         <tr>
934:                                                                             <th>#</th>
935:                                                                             <th>Starters</th>
936:                                                                             <th>Pos</th>
937:                                                                             <th>Sh</th>
938:                                                                             <th>Sog</th>
939:                                                                             <th>G</th>
940:                                                                             <th>A</th>
941:                                                                             <th class="dsCell">DS</th>
942:                                                                         </tr>
943:                                                                     </thead>
944:                                                                     <tbody>
945: 
946:                                                                     </tbody>
947:                                                                 </table>
948:                                                             </div>
949:                                                             <div class="pt-row">
950:                                                                 <table class="substitutesStats display"> <!-- substitutes -->
951:                                                                     <thead>
952:                                                                         <tr>
953:                                                                             <th>#</th>
954:                                                                             <th>Substitutes</th>
955:                                                                             <th>Pos</th>
956:                                                                             <th>Sh</th>
957:                                                                             <th>Sog</th>
958:                                                                             <th>G</th>
959:                                                                             <th>A</th>
960:                                                                             <th class="dsCell">DS</th>
961:                                                                         </tr>
962:                                                                     </thead>
963:                                                                     <tbody>
964:                                                                     </tbody>
965:                                                                 </table>
966:                                                             </div>
967: 
968:                                                         </div>
969:                                                     </div>
970:                                                 </div>
971:                                             </div>
972: 
973:                                         </div>
974:                                     </div>
975:                                     ## GRID CONTENT
976:                                 </div>
977:                                 ## INDIVISUAL STATS
978:                             </div>
979:                             ## GRID ROW ## GRID ROW
980:                             <div class="grid-row">
981: 								#set ($gridCounter = $gridCounter + 1)
982:                                 <div class="grid-col grid-col-gi grid-col${gridCounter}">
983:                                     <h3 id="game-info-title" class="grid-title">
984:                                         Game Information<span class="close">x</span>
985:                                     </h3>
986:                                     <div class="grid-content clearfix">
987:                                         <div class="pt-game-information clearfix">
988: 
989:                                             <div class="pt-row clearfix">
990:                                                 <center>
991:                                                 <div class="date-time pt-col">
992:                                                     <span id="gameInformationDate" class="date"></span>
993:                                                     <span id="gameInformationTime" class="time"></span>
994:                                                     <h3>Date & Time</h3>
995:                                                 </div>
996: 
997:                                                 <div class="game-location pt-col">
998:                                                     <span id="gameInformationLocation" class="location"></span>
999:                                                     <h3>Location</h3>
1000:                                                 </div>
1001: 
1002:                                                 <div class="game-venue pt-col">
1003:                                                     <span id="gameInformationVenue" class="venue"></span>
1004:                                                     <h3>Venue</h3>
1005:                                                 </div>
1006: 
1007:                                                 <div class="weather pt-col">
1008: 
1009:                                                     <div class="weather-condition">
1010:                                                         <span id="gameInformationTemperature"
1011:                                                             class="temp"></span>
1012:                                                         <span id="gameInformationCondition" class="condition"></span>
1013:                                                     </div>
1014:                                                     <h3>Weather</h3>
1015:                                                 </div>
1016:                                                 </center>
1017:                                             </div>
1018: 
1019:                                         </div>
1020:                                     </div>
1021:                                     ## GRID CONTENT
1022:                                 </div>
1023:                                 ## GENERAL INFORMATION
1024:                             </div>
1025:                             ## GRID ROW
1026: 
1027:                         </div>
1028: 
1029:                         ## PLAY BY PLAY TABS
1030:                         <div id="pbp-tabs" class="pt-tabs-pane clearfix">
1031: 
1032:                             ## GRID ROW
1033:                             <div class="grid-row">
1034: 								#set ($gridCounter = $gridCounter + 1)
1035:                                 <div class="grid-col grid-col-ds grid-col${gridCounter}">
1036: 								<h3 id="play-by-play-title" class="grid-title">
1037: 									Play by Play<span class="close">x</span>
1038: 								</h3>                                	
1039:                                     <div class="grid-content clearfix">
1040:                                         <div id="playByPlay" class="clearfix">
1041:                                             <select id="filterPeriod" class="dropdownFilter">
1042:                                                 <option value="" selected>ALL PERIODS</option>
1043:                                             </select>
1044:                                             <select id="filterTeam" class="dropdownFilter">
1045:                                                 <option value="" selected>BOTH TEAMS</option>
1046:                                                 <option value="" class="team-name visitor-team-name"></option>
1047:                                                 <option value="" class="team-name home-team-name"></option>
1048:                                             </select>
1049:                                             <select id="filterPlayType" class="dropdownFilter">
1050:                                                 <option value="" selected>ALL PLAYS</option>
1051:                                                 <option value="GOAL">Goal</option>
1052:                                                 <option value="SHOT">Shot</option>
1053:                                                 <option id="headerOption" value="HDR">Header</option>
1054:                                                 <option id="cornerOption" value="CORNER">Corner</option>
1055:                                                 <option value="FOUL">Foul</option>
1056:                                                 <option id="offsideOption" value="OFFSIDE">Offside</option>
1057:                                                 <option value="YC">Yellow Card</option>
1058:                                                 <option value="RC">Red Card</option>
1059:                                                 <option id="greenCardOption" value="GC">Green Card</option>
1060:                                                 <option value="SUB">Substitution</option>
1061:                                             </select>
1062:                                         </div>
1063:                                         <div class="pt-play-by-play clearfix">
1064:                                             <table>
1065:                                                 <thead>
1066:                                                     <tr>
1067:                                                         <th><span class="team-name visitor-team-name"></span><span>&nbsp;PLAYS</span></th>
1068:                                                         <th>TIME</th>
1069:                                                         <th>ACTION</th>
1070:                                                         <th><span class="team-name home-team-name"></span><span>&nbsp;PLAYS</span></th>
1071:                                                     </tr>
1072:                                                 </thead>
1073:                                                 <tbody>
1074:                                                 </tbody>
1075:                                             </table>
1076:                                         </div>
1077:                                     </div>
1078:                                     ## GRID CONTENT
1079:                                 </div>
1080:                                 ## DRIVE SUMMARY
1081:                             </div>
1082:                             ## GRID ROW
1083: 
1084:                         </div>
1085:                         ## PLAY BY PLAY TABS
1086:                     </div>
1087:                     ## PT TABS PANES
1088:                 </div>
1089:                 ## PRIME TIME GAME INFO 
1090: 
1091: 				</div> 
1092: 				## GRID ROW CONTAINER
1093: 
1094:                 ## FOOTER
1095:                 <div id="primetime-footer" class="grid-row">
1096:                     <div class="grid-col grid-col-ftr">
1097:                         <a href="/"></a>
1098:                     </div>
1099:                 </div>
1100: 
1101:             </div>
1102:             ## PRIMTE TIME OVERFLOW
1103:         </div>
1104:         ## PRIME TIME WRAPPER
1105:     #end
1106:     
1107:     #set ($showWiki = true)
1108:     #set ($showWiki = $showWikiVar)
1109:     #if ($showWiki == true)
1110:         $wiki.su 
1111:     #end
1112:     ## END OF PRIMETIME	    
1113: 
1114: #else
1115: ## SOCCER BOX SCORE
1116: 
1117: ## DEFAULT VALUES
1118: #set ($showPlayerMin = false)
1119: 
1120: ## PICK UP OPTIONS
1121: #if ($website && $stats.view != "pdf")
1122:     $website.include("options")
1123: #end
1124: #set ($options = $request.getAttribute("options"))
1125: 
1126: ## SET VARIABLES FROM OPTIONS
1127: #set ($showPlayerMin = $options.get("boxscore_so_player_min"))
1128: #if ($showPlayerMin == "show")
1129: 	#set ($showPlayerMin = true)
1130: #end
1131: 
1132: #set ($hasScoringSummary = false)
1133: #if ($document.selectNodes("sogame/scores/score").size() > 0)
1134: 	#set ($hasScoringSummary = true)
1135: #end
1136: 
1137: #set ($showWiki = true)
1138: #set ($showWiki = $showWikiVar)
1139: 
1140: #if ($showWiki == true)
1141: 	$!wiki.su 
1142: #end
1143: 
1144: #if ($document.valueOf("sogame/@source") == 'DakStats Soccer')
1145: 	#set ($isDakStats = true)
1146: #else
1147: 	#set ($isDakStats = false)
1148: #end
1149: 
1150: #set ($showGoalDesc = $document.valueOf("sogame/venue/show/@goaldesc") == "1")
1151: #set ($showFieldHockey = $document.valueOf("sogame/venue/show/@fhk") == "1")
1152: #set ($shootoutScores = {"V" : 0, "H" : 0})
1153: #set ($shootouts = $document.selectNodes("sogame/shootouts/shootout"))
1154: #set ($penalties = $document.selectNodes("sogame/penalties/pen"))
1155: 
1156: #set ($linkPlayers = $stats.linkPlayers)
1157: #set ($linkPlayersBase = $stats.linkPlayersBase)
1158: #set ($linkTeams = $stats.linkTeams)
1159: #set ($linkTeamsBase = $stats.linkTeamsBase)
1160: 
1161: #set ($home = $document.valueOf("sogame/team[@vh='H']/@name"))
1162: #set ($visitor = $document.valueOf("sogame/team[@vh='V']/@name"))
1163: #set ($homeNode = $document.selectSingleNode("sogame/team[@vh='H']"))
1164: #set ($visitorNode = $document.selectSingleNode("sogame/team[@vh='V']"))
1165: 
1166: ## RULES
1167: #set ($periodRule = $document.valueOf("sogame/venue/rules/@periods"))
1168: #set ($periodLength = $document.valueOf("sogame/venue/rules/@minutes"))
1169: #set ($otPeriodLength = $document.valueOf("sogame/venue/rules/@minutesot"))
1170: 
1171: ## STATUS
1172: #set ($status = $document.valueOf("sogame/status/@period"))
1173: #set ($clock = $document.valueOf("sogame/status/@clock"))
1174: #set ($compClock = $document.valueOf("sogame/status/@complementClock"))
1175: 
1176: ## FOULS
1177: #set ($showFouls = false)
1178: #if($showFieldHockey)
1179: 	#set ($homeFouls =  $tool.math.toInteger($document.valueOf("sogame/team[@vh='H']/totals/penalty/@fouls")))
1180: 	#set ($visitorFouls =  $tool.math.toInteger($document.valueOf("sogame/team[@vh='V']/totals/penalty/@fouls")))
1181: 
1182: 	#if($homeFouls > 0 || $visitorFouls > 0)
1183: 		#set ($showFouls = true)
1184: 	#end
1185: #else 
1186: 	#set ($showFouls = true) ## ALWAYS SHOW FOR SOCCER
1187: #end
1188: 
1189: #if ($clock.length() > 0 && $clock != "90:00")
1190:   #if ($periodRule.length() > 0 && $periodLength.length() > 0 && $otPeriodLength.length() > 0)
1191:     #set ($normalTime = $tool.math.mul($periodRule, $periodLength))
1192: 	#set ($extraTime = $tool.math.mul($otPeriodLength, 2))
1193: 	#set ($totalTime = "$tool.math.mul($normalTime, $extraTime):00")
1194: 	$totalTime
1195:   #end
1196: #end
1197: 
1198: #set ($periodRange = [1..$document.selectNodes("sogame/team[1]/linescore/lineprd").size()])
1199: #set ($isNeutralGame = $documnt.valueOf("sogame/venue/@neutralgame"))
1200: #if ($isNeutralGame.length() > 0 && $isNeutralGame.equals("Y"))
1201:   #set ($isNeutralGame = true)
1202: #else
1203:   #set ($isNeutralGame = false)
1204: #end
1205: 
1206: #set ($hasPeriods = $document.selectNodes("sogame/plays/period").size() > 0)
1207: 
1208: #set ($homeTeam = $homeNode.valueOf("@name"))
1209: #set ($homeScore = $tool.math.toInteger($homeNode.valueOf("linescore/@score")))
1210: #set ($homename = $document.valueOf("sogame/venue/@homename"))
1211: #set ($visitorTeam = $visitorNode.valueOf("@name"))
1212: #set ($visScore = $tool.math.toInteger($visitorNode.valueOf("linescore/@score")))
1213: #set ($visname = $document.valueOf("sogame/venue/@visname"))
1214: #set ($location = $document.valueOf("sogame/venue/@location"))
1215: #set ($stadium = $document.valueOf("sogame/venue/@stadium"))
1216: #set ($dateVal = $document.valueOf("sogame/venue/@date"))
1217: #set ($date = $tool.date.toDate("MM/dd/yyyy", $dateVal))
1218: #set ($time = $document.valueOf("sogame/venue/@time"))
1219: 
1220: #set ($duration = $document.valueOf("sogame/venue/@duration"))
1221: #set ($schedNote = $document.valueOf("sogame/venue/@schednote"))
1222: #set ($attendance = $document.valueOf("sogame/venue/@attend"))
1223: #set ($homeTotals = $homeNode.selectSingleNode("totals"))
1224: #set ($visitorTotals = $visitorNode.selectSingleNode("totals"))
1225: 
1226: #if ($stats.pageUrl.length() > 0 && !$stats.pageUrl.contains("?"))
1227:     #set ($paramSep = "?")
1228: #else
1229:     #set ($paramSep = "&")
1230: #end
1231: 
1232: #set ($showWiki = true)
1233: #set ($showWiki = $showWikiVar)
1234: 
1235: ## MACROS
1236: #macro (printPdfHeader $title)
1237: <div class="stats-fullbox clearfix">
1238:     <table>
1239:         <tr>
1240:             <td class="align-center"><h4>$title</h4></td>
1241:         </tr>
1242:     </table>
1243: </div>
1244: #end
1245: 
1246: #macro (printPeriods $attr)
1247:     #foreach ($prd in $document.selectNodes("sogame/team[1]/linescore/lineprd"))
1248:     <th scope="col" $attr>
1249:         #if ($velocityCount >= 3)
1250:             #if ($velocityCount == 3)
1251:                 OT
1252:             #elseif ($velocityCount == 5)
1253:                 SO
1254:             #else
1255:                 ${tool.math.sub($velocityCount, 2)}OT
1256:             #end
1257:         #else
1258:             $!velocityCount
1259:         #end
1260:     </th>
1261:     #end
1262: #end
1263: 
1264: #macro (shootout $shootouts $t)
1265: 	#set ($printVal = "")
1266: 	#foreach ($shot in $shootouts)
1267: 		#if ($shot.valueOf("@vh") == $t)
1268: 			#set ($player = $shot.valueOf("@name"))
1269: 			#set ($shotResult = ${shot.valueOf("@result")})
1270: 			#set ($singlePrintVal = "$player - $shotResult")
1271: 			#if ($shot.valueOf("@result") == "MADE")
1272: 				#set ($score = $shootoutScores.get($t))
1273: 				#set ($score = $tool.math.add($score, 1))
1274: 				#set ($score = $shootoutScores.put($t, $score))
1275: 			#end ## result
1276: 			#if ($printVal.length() > 0) #set ($printVal = "${printVal}; ") #end
1277: 			#set ($printVal = "${printVal} ${singlePrintVal}")			
1278: 		#end ## if
1279: 	#end ## foreach
1280: 	$printVal
1281: #end
1282: 
1283: #macro (period $p)
1284: 	#if ($p == 1) 1st
1285: 	#elseif ($p == 2) 2nd
1286: 	#elseif ($p == 3) OT
1287: 	#elseif ($p == 4) 2OT
1288: 	#elseif ($p == 5) SO
1289: 	#else $p
1290: 	#end
1291: #end
1292: 
1293: #macro (showTeam $team)
1294:     #if ($team.attributeValue("link").length() > 0 &&  $linkTeams)
1295:         <a href="$!linkTeamsBase?id=${team.attributeValue('teamId')}">$team.attributeValue("name")</a>
1296:     #else
1297:     	$team.attributeValue("name")
1298:     #end
1299: #end
1300: 
1301: ## GOALIE SHOTS
1302: #macro (shots $ga $saves)
1303: 	#if ($saves.length() > 0)
1304:  		$tool.math.add($ga, $saves)
1305: 	#end
1306: #end
1307: 	    
1308: ## PLAY BY PLAY
1309: #macro (printPlayByPlay)
1310: 	<div class="stats-wrap clearfix">	
1311: 	    <div class="stats-box full">
1312: 	    	#if ($stats.view != "pdf")
1313: 	    		<div class="periods-links clearfix">
1314: 	    			<span class="label">Periods:</span>
1315: 	    			<ul>
1316: 	    				#foreach ($p in [1..$document.selectNodes("sogame/plays/period").size()])
1317: 	    					<li><a href="#prd${p}">#period($p)</a></li>
1318: 	    				#end
1319: 	    			</ul>
1320: 	    		</div>
1321: 	    	#end
1322: 	    	#set ($vscore = 0)
1323: 	    	#set ($hscore = 0)
1324: 	    	#foreach ($playPeriod in $document.selectNodes("sogame/plays/period"))
1325: 	    		#set ($prdCount = $playPeriod.valueOf("@number"))
1326: 				<table>
1327: 					<caption class="caption">
1328: 						<h2><span id="prd${prdCount}">#period($prdCount)</span></h2>
1329: 					</caption>
1330: 				    #set ($score = "")
1331: 				    #set ($playNodes = $playPeriod.selectNodes("*"))
1332: 				    #foreach ($play in $playNodes)
1333: 				        #set ($nodeName = $play.getName())
1334: 				        #set ($rowClass = "row")
1335: 				    	#set ($playText = "")
1336: 				    	#set ($isVisitorPlay = $play.valueOf('@vh') == "V")
1337: 				    	#set ($isHomePlay = $play.valueOf('@vh') == "H")
1338: 				    	#set ($playAction = $play.valueOf("@action"))
1339: 				    	#set ($playTime = $play.valueOf("@clock"))
1340: 				            								                
1341: 				        #if ($nodeName == "play" && !$playAction.equalsIgnoreCase("goalmsg"))
1342: 							#if ($playAction.equalsIgnoreCase("foul"))
1343: 								#set ($rowClass = "${rowClass} foul")
1344: 							#end
1345: 				            #if ($playAction.equalsIgnoreCase("goal"))
1346: 				            	#set ($rowClass = "${rowClass} goal accent-bg")
1347: 				                #set ($playText = "<span class='action-title'>Goal!</span>${play.valueOf('@text')}")
1348: 				                #if ($isVisitorPlay)
1349: 		                            #set ($vscore = $play.valueOf("@vscore"))
1350: 		                        #else
1351: 		                            #set ($hscore = $play.valueOf("@hscore"))
1352: 		                        #end
1353: 		                        #set ($score = "<span class='v-score'>${vscore}</span><span class='sep'> - </span><span class='h-score'>${hscore}</span>")
1354: 				                #if ($playNodes.size() > $tool.math.add($velocityCount, 1) && $playNodes.get($tool.math.add($velocityCount, 1)).valueOf("@action").equalsIgnoreCase("goalmsg"))
1355: 				                    #set ($goalMsg = $playNodes.get($tool.math.add($velocityCount, 1)).valueOf("@text"))
1356: 				                    #set ($playText = "${playText} ${goalMsg}")
1357: 				                #end
1358: 								#set ($score = "<span class='v-score'>${vscore}</span><span class='sep'> - </span><span class='h-score'>${hscore}</span>")
1359: 								#set ($playText = "${playText} <br/> <strong>( ${score} )</strong>")	
1360: 				            #elseif ($playAction.equalsIgnoreCase("shootout"))
1361: 				            	#set ($playText = $play.valueOf("@text"))
1362: 				                #if(!$shootoutHeader)
1363: 				                	#set ($playText = "<span class='action-title'>Shootout!</span>${playText}")
1364: 				                	#set($shootoutHeader = "true")
1365: 				                #end
1366: 				            #elseif ($playAction.equalsIgnoreCase("sub"))
1367: 								#set ($rowClass = "${rowClass} substitute")
1368: 								#set ($playText = "<span class='action-title'>Substitution!</span>${play.valueOf('@text')}")
1369: 							#else
1370: 				                #set ($playText = $play.valueOf("@text"))
1371: 				            #end
1372: 				        
1373: 				        	#if($isHomePlay || $isVisitorPlay)
1374: 						        <tr class="$rowClass">
1375: 					                <td class="time">$playTime</td>
1376: 									<td class="play">$playText</td>                   
1377: 					            </tr>
1378: 							#end
1379: 			            #end ## node name check
1380: 				    #end ## play foreach
1381: 				    #if ($stats.view != "pdf")
1382: 				    	<tr class="back-to-top"><td colspan="4"><a href="#pbp">back to top <span class="gicon-up"></span></a></td></tr>
1383: 				    #end
1384: 			    </table>
1385: 	    	#end ## play period foreach
1386: 	    </div>
1387:     </div> ## stats-wrap
1388: #end ## ends printPlayByPlay
1389: 
1390: ## PENALTY STATS
1391: #macro (printPenaltyStats)
1392: 	<table class="striped">
1393: 		<caption class="caption"><h2>Penalty Summary</h2></caption>
1394:     	<thead>
1395: 			<tr>
1396: 				<th class="col-head" scope="col">Period</th>
1397: 				<th class="col-head" scope="col">Time</th>
1398: 				<th class="col-head text" scope="col">Fouls</th>
1399: 			</tr>
1400: 		</thead>
1401: 		<tbody>
1402: 			#foreach ($penalty in $document.selectNodes("sogame/penalties/pen"))
1403: 				<tr>
1404: 					#set ($vh = $penalty.valueOf("@vh"))
1405: 					#set ($prd = $penalty.valueOf("@prd"))
1406: 					<th class="row-head nowrap period" scope="row">
1407: 						#if ($vh == "V" && $stats.view != "pdf")
1408: 							#set ($visitorScore = $tool.math.add($visitorScore, 1))
1409: 							<div class="team-logo" style="background-image:url($stats.visitorTeamLogo)"><span class="offscreen">$teamName</span></div>
1410: 						#elseif ($vh == "H" && $stats.view != "pdf")
1411: 							#set ($homeScore = $tool.math.add($homeScore, 1))
1412: 							<div class="team-logo" style="background-image:url($stats.homeTeamLogo)"><span class="offscreen">$teamName</span></div>
1413: 						#end
1414: 						<span class="period">#period($prd)</span>
1415: 					</th>
1416: 					<td class="time">$penalty.valueOf("@time")</td>
1417: 					<td class="text">
1418: 						#if ($penalty.valueOf("@type").length() > 0)
1419: 							#if ($penalty.valueOf("@type").contains('GREEN'))<span>Green card - </span>#end
1420: 							#if ($penalty.valueOf("@type").contains('YELLOW'))<span>Yellow card - </span>#end
1421: 							#if ($penalty.valueOf("@type").contains('RED'))<span>Red card - </span>#end
1422: 						#end
1423: 						$penalty.valueOf("@name")#if ($!penalty.valueOf("@desc").length() > 0): $!penalty.valueOf("@desc")#end
1424: 					</td>	
1425: 				</tr>				
1426: 			#end
1427: 		</tbody>
1428: 	</table>
1429: #end
1430: 
1431: ## PENALTY SUMMARY
1432: #macro (printPenaltySummary $boxWidth)
1433: 	#if ($penalties.size() > 0)
1434: 		#if ($boxWidth == "full") 
1435: 			<div class="stats-wrap">
1436: 				<div class="stats-box ${boxWidth} penalty-summary clearfix">
1437: 					#printPenaltyStats
1438: 				</div>
1439: 			</div>
1440: 		#else
1441: 			<div class="stats-box ${boxWidth} penalty-summary clearfix">
1442: 				#printPenaltyStats
1443: 			</div>
1444: 		#end
1445: 	#end
1446: #end
1447: 
1448: ## SCORING SUMMARY
1449: #macro (printScoringSummary)
1450:     <div class="stats-wrap clearfix">
1451: 		#if ($hasScoringSummary)
1452:         <div class="stats-box half scoring-summary clearfix">
1453:             #set ($visitorScore = 0)
1454:             #set ($homeScore = 0)
1455:             <table class="striped">
1456:                 <caption class="caption"><h2>Scoring Summary</h2></caption>
1457:                 <thead>
1458:     				<tr>
1459: 						<th class="col-head" scope="col">Period</th>
1460: 						<th class="col-head" scope="col">Time</th>
1461: 						<th class="col-head text" scope="col">Play</th>
1462: 						<th class="col-head" scope="col">V - H</th>
1463: 					</tr>
1464:                 </thead>
1465:                 <tbody>
1466: 	                #foreach ($pd in $periodRange)
1467: 		                #foreach ($score in $document.selectNodes("sogame/scores/score"))
1468: 					        #set ($teamName = "")
1469: 					    	#set ($scoreText = "")
1470: 					    	#set ($scoreDesc = "")
1471: 					    	#set ($scorePlayer = $!score.valueOf("@playerId"))
1472: 					    	#set ($scoreTime = $score.valueOf("@time"))
1473: 					    	#set ($isVisitorScore = $score.valueOf('@vh') == "V")
1474: 					    	#set ($isHomeScore = $score.valueOf('@vh') == "H")
1475: 					            					
1476: 					    	#if($isVisitorScore)
1477: 				                #set ($teamName = $visitorTeam)
1478: 				            #else
1479: 				                #set ($teamName = $homeTeam)                                        
1480: 				            #end
1481: 				            
1482: 		                    #if ($pd == $score.valueOf("@prd"))
1483: 	                            #if ($scorePlayer.length() > 0 and $linkPlayers)
1484: 	                            	#set ($scoreText = "<a href='${!linkPlayersBase}?id=${scorePlayer}'>")
1485: 	                            #end
1486: 	                            #if($score.valueOf("@name").equalsIgnoreCase("team") && $hasPeriods)
1487: 	                                #if($isHomeScore) #set ($scoreText = "${scoreText} ${visitorNode.attributeValue('name')}")#elseif($isVisitorScore) #set ($scoreText = "${scoreText} ${homeNode.attributeValue('name')}")#end
1488: 	                                #set ($scoreText = "${scoreText} Own goal")
1489: 	                            #else
1490: 	                                #set ($scoreText = "${scoreText} ${score.valueOf('@name')}")
1491: 	                            #end
1492: 	                            #if ($scorePlayer.length() > 0 and $linkPlayers)
1493: 	                            	#set ($scoreText = "${scoreText} </a>")
1494: 	                            #end
1495: 	
1496: 	                            #if ($score.valueOf("@seasong").length() > 0) #set ($scoreText = "${scoreText} (${score.valueOf('@seasong')})") #end
1497: 	
1498: 	                            #if($score.valueOf("@assist1").length() > 0)
1499: 	                                #if ($score.valueOf("@assist1Id").length() > 0 and $linkPlayers)#set ($scoreText = "${scoreText} <a href='${!linkPlayersBase}?id=${score.valueOf('@assist1Id')}'>")#end
1500: 	                                #if ($score.valueOf("@assist2").length() > 0)
1501: 	                                    #set ($scoreText = "${scoreText} (${score.valueOf('@assist1')}")
1502: 	                                #else
1503: 	                                    #set ($scoreText = "${scoreText} (${score.valueOf('@assist1')})")
1504: 	                                #end
1505: 	                                #if ($score.valueOf("@assist1Id").length() > 0 and $linkPlayers)#set ($scoreText = "${scoreText}</a>")#end
1506: 	                            #elseif ($score.valueOf("@name") != "Team")
1507: 	                                #set ($scoreText = "${scoreText} (unassisted)")
1508: 	                            #end
1509: 	                            #if($score.valueOf("@assist2").length() > 0)
1510: 	                                #set ($scoreText = "${scoreText} &amp;")
1511: 	                                #if ($score.valueOf("@assist2Id").length() > 0 and $linkPlayers)#set ($scoreText = "${scoreText} <a href='${!linkPlayersBase}?id=${score.valueOf('@assist2Id')}'>")#end
1512: 	                                #set ($scoreText = "${scoreText} ${score.valueOf('@assist2')})")
1513: 	                                #if ($score.valueOf("@assist2Id").length() > 0 and $linkPlayers)#set ($scoreText = "${scoreText}</a>")#end
1514: 	                            #end
1515: 	                            
1516: 	                            #if ($showGoalDesc)
1517: 	                                #if($!score.valueOf("@desc").length() > 0)
1518: 	                                    #set ($scoreText = "${scoreText} - $!{score.valueOf('@desc')}")
1519: 	                                #else
1520: 	                                    #foreach ($play in $document.selectNodes("sogame/plays/period/play"))
1521: 	                                        #if(($play.valueOf("@action") == "PENSHOT") && ($play.valueOf("@clock") == $scoreTime))
1522: 	                                            #if ($showFieldHockey)
1523: 	                                            	#set ($scoreText = "${scoreText} - Penalty Stroke")
1524: 	                                            #else 
1525: 	                                            	#set ($scoreText = "${scoreText} - Penalty Kick") 
1526: 	                                            #end
1527: 	                                        #end
1528: 	                                    #end
1529: 	                                #end
1530: 	                            #end
1531: 	                            
1532: 	                            <tr>
1533: 	                            	<th class="row-head nowrap period" scope="row">
1534: 		                            	#if ($isVisitorScore && $stats.view != "pdf")
1535: 		                            		#set ($visitorScore = $tool.math.add($visitorScore, 1))
1536: 		                            		<div class="team-logo" style="background-image:url($stats.visitorTeamLogo)"><span class="offscreen">$teamName</span></div>
1537: 		                            	#elseif ($isHomeScore && $stats.view != "pdf")
1538: 		                            		#set ($homeScore = $tool.math.add($homeScore, 1))
1539: 		                            		<div class="team-logo" style="background-image:url($stats.homeTeamLogo)"><span class="offscreen">$teamName</span></div>
1540: 		                            	#end
1541: 		                            	<span class="period">#period($pd)</span>
1542: 	                            	</th>
1543: 					                <td class="time">$!scoreTime</td>
1544: 					                <td class="text">$scoreText</td>
1545: 					                <td class="total">$visitorScore - $homeScore</td>
1546: 				            	</tr> ## row
1547: 	                            
1548: 		                    #end ## if
1549: 		                #end ## scoring foreach
1550: 		            #end ## period range
1551:                 </tbody>
1552:             </table>
1553:         </div> ## stats-box
1554:         #end
1555: 
1556: 		## PENALTY / SCORING SUMMARY
1557: 		#if ($shootouts.size() > 0)        
1558: 			#printShootoutSummary
1559: 		#else
1560: 			#printPenaltySummary("half")
1561: 		#end
1562: 
1563: 	</div>
1564: #end ## SCORING SUMMARY MACRO END
1565: 
1566: #macro(printShootoutSummary)
1567: 	#set ($visitorPenaltyMade = $document.selectNodes("sogame/shootouts/shootout[@vh='V'][@result='MADE']"))
1568: 	#set ($homePenaltyMade = $document.selectNodes("sogame/shootouts/shootout[@vh='H'][@result='MADE']"))
1569: 	<div class="stats-box half shootout-summary clearfix">
1570: 		<table>
1571:                	<caption class="caption"><h2>Shootout</h2></caption>
1572: 				<tr>
1573: 					<th scope="col" class="col-head" colspan="2">$visitor</th>
1574: 					<th scope="col" class="col-head" colspan="2">$home</th>
1575:                 </tr>
1576:         		#set ($penaltyCount = 0)
1577:         		#foreach ($shootout in $shootouts)
1578:         			#if ($shootout.valueOf("@vh") == "V")
1579:         				#set ($visPenaltyShooter  = $shootout.valueOf("@name"))
1580:         				#set ($visPenaltyResult = $shootout.valueOf("@result"))
1581:         			#end
1582:         			#if ($shootout.valueOf("@vh") == "H")
1583:         				#set ($homePenaltyShooter = $shootout.valueOf("@name"))
1584:         				#set ($homePenaltyResult = $shootout.valueOf("@result"))
1585:         			#end
1586:         			#if ($velocityCount % 2 == 0 || $velocityCount == $shootouts.size())
1587:         				#set ($penaltyCount = $penaltyCount + 1)
1588:         				<tr>
1589:         					<td #if ($visPenaltyResult == "MISSED") class="visitor shot-missed" #else class="visitor shot-made" #end><span class="icon"></span>$visPenaltyShooter</td>
1590:         					<th class="row-head" colspan="2">Pen$penaltyCount</th>
1591:         					<td #if ($homePenaltyResult == "MISSED") class="home shot-missed" #else class="home shot-made" #end>$homePenaltyShooter<span class="icon"></span></td>
1592:         				</tr>
1593:         			#end
1594:         		#end
1595:         		<tr class="totals">
1596:         			<td colspan="4"><strong>Final:</strong> $visitorPenaltyMade.size() - $homePenaltyMade.size()</td>
1597:         		</tr>
1598: 		</table>	
1599: 	</div>          
1600: #end
1601: 
1602: #macro (printPlayerStats $team)
1603: 
1604: 	<thead>
1605: 	    <tr>
1606: 	        <th scope="col" class="col-head text">PLAYER</th>
1607: 	        <th scope="col" class="col-head">SH</th>
1608: 	        <th scope="col" class="col-head">SOG</th>
1609: 	        <th scope="col" class="col-head">G</th>
1610: 	        <th scope="col" class="col-head">A</th>
1611: 	        #if ($showFieldHockey)<th scope="col" class="col-head">DS</th>#end
1612: 	        #if ($showPlayerMin == true)<th scope="col" class="col-head">MIN</th>#end
1613: 	    </tr>
1614: 	</thead>
1615: 	
1616: 	<tbody>
1617: 	    #foreach ($statNode in $team.selectNodes("player[@gp='1']/shots"))
1618: 	        <tr>
1619: 	        	<th scope="row" class="row-head text">
1620: 	            	<span class="uniform">$!statNode.valueOf("../@uni") - </span>
1621: 	            
1622: 	                #if ($statNode.valueOf("../@playerId").length() > 0 && $linkPlayers && $team.attributeValue("link").length() > 0)
1623: 	                	<a href="$!linkPlayersBase?id=${statNode.valueOf("../@playerId")}" class="player-name">$statNode.valueOf("../@name")</a>
1624: 	                #else
1625: 	                	<span class="player-name">$statNode.valueOf("../@name")</span>
1626: 	                #end
1627: 	                
1628: 	                #if($statNode.valueOf("../@pos").length() > 0)<span class="position" style="text-transform:lowercase"> - $statNode.valueOf("../@pos")</span>#end
1629: 	                
1630: 	                #foreach ($penalty in $document.selectNodes("sogame/penalties/pen"))
1631: 	                	#if ($penalty.valueOf("@name").equals($statNode.valueOf("../@name")))	
1632: 	                        #if ($penalty.valueOf("@type").length() > 0)
1633: 	                            #if ($penalty.valueOf("@type").contains('YELLOW'))<span class="penalty-card yellow">- Yellow card <span class="time">$penalty.valueOf("@time")</span></span>#end
1634: 	                            #if ($penalty.valueOf("@type").contains('RED'))<span class="penalty-card red">- Red card <span class="time">$penalty.valueOf("@time")</span></span>#end
1635: 	                        #end
1636: 	                	#end
1637: 	                #end ## penalty foreach
1638: 	            </th>
1639: 		        <td>$!statNode.valueOf("@sh")</td>
1640: 	            <td>$!statNode.valueOf("@sog")</td>
1641: 	            <td>$!statNode.valueOf("@g")</td>
1642: 	            <td>$!statNode.valueOf("@a")</td>
1643: 	            #if ($showFieldHockey)<td>$!statNode.valueOf("../misc/@dsave")</td>#end
1644: 	            #if ($showPlayerMin == true)<td>$!statNode.valueOf("../misc/@minutes")</td>#end
1645: 	        </tr>
1646: 	    #end
1647: 	</tbody>
1648: 	
1649: 	<tbody>
1650: 	    <tr class="totals">
1651: 	        <th scope="rowgroup" class="row-head text">TOTALS</th>
1652: 	        #set ($statTotals = $team.selectSingleNode("totals/shots"))
1653: 	        <td>$!statTotals.valueOf("@sh")</td>
1654: 	        <td>$!statTotals.valueOf("@sog")</td>
1655: 	        <td>$!statTotals.valueOf("@g")</td>
1656: 	        <td>$!statTotals.valueOf("@a")</td>
1657: 	        #if ($showFieldHockey)<td>$!statTotals.valueOf("../misc/@dsave")</td>#end
1658: 	        #if ($showPlayerMin == true)<td>$!statTotals.valueOf("../misc/@minutes")</td>#end
1659: 	    </tr>
1660:     </tbody> 
1661: #end ## printPlayerStats
1662: 
1663: #macro (printTeamGoalies $team)
1664:     
1665: 	<thead>
1666: 	    <tr>
1667: 	        <th scope="col" class="col-head text">GOALIES</th>
1668: 	        <th scope="col" class="col-head">&#160;</th>
1669: 	        #if ($showPlayerMin == true)<th scope="col" class="col-head">&#160;</th>#end
1670: 	        <th scope="col" class="col-head">SOG</th>
1671: 	        <th scope="col" class="col-head">GA</th>
1672: 	        <th scope="col" class="col-head">SV</th>
1673: 	        #if ($showFieldHockey)<th scope="col" class="col-head">&#160;</th>#end
1674: 	        <th scope="col" class="col-head">Min</th>
1675: 	    </tr>
1676:     </thead>
1677: 
1678: 	<tbody>
1679: 	    #foreach ($stat in $team.selectNodes("player/goalie"))
1680: 	        <tr>
1681: 	            <th scope="row" class="row-head text">
1682: 	            	<span class="uniform">$!stat.valueOf("../@uni") - </span>
1683: 	            	
1684: 	                #if ($stat.valueOf("../@playerId").length() > 0 && $linkPlayers && $team.attributeValue("link").length() > 0)
1685: 	                	<a href="$!linkPlayersBase?id=${stat.valueOf("../@playerId")}" class="player-name">$stat.valueOf("../@name")</a>
1686: 	                #else
1687: 	                	<span class="player-name">$stat.valueOf("../@name")</span>
1688: 	                #end
1689: 	
1690: 					#if ($isDakStats)
1691: 						#if($tool.math.toInteger($stat.valueOf("@win")) > 0)<span>(W, $stat.valueOf("@win"))</span>#end
1692: 						#if($tool.math.toInteger($stat.valueOf("@loss")) > 0)<span>(L, $stat.valueOf("@loss"))</span>#end
1693: 						#if($tool.math.toInteger($stat.valueOf("@tie")) > 0)<span>(T, $stat.valueOf("@tie"))</span>#end
1694: 					#else
1695: 						#if($stat.valueOf("@win").length() > 0)<span>(W, $stat.valueOf("@win"))</span>#end
1696: 						#if($stat.valueOf("@loss").length() > 0)<span>(L, $stat.valueOf("@loss"))</span>#end
1697: 						#if($stat.valueOf("@tie").length() > 0)<span>(T, $stat.valueOf("@tie"))</span>#end
1698: 					#end
1699: 					
1700: 	            </th>
1701: 	            <td>$!formatter.formatNumber($ga, "#")</td>
1702: 	            #if ($showPlayerMin == true)<td>&#160;</td>#end
1703: 	            <td>#shots($stat.valueOf("@ga") $stat.valueOf("@saves"))</td>
1704: 	            <td>$stat.valueOf("@ga")</td>
1705: 	            <td>$!stat.valueOf("@saves")</td>
1706: 	            #if ($showFieldHockey)<td>&#160;</td>#end
1707: 	            <td>$!stat.valueOf("@minutes")</td>
1708: 	        </tr>
1709: 	    #end
1710:     </tbody>
1711: 
1712: 	<tbody>
1713: 	    #if ($team.selectNodes("player/goalie").size() > 1) ## if more than one goalie appeared show totals
1714: 	        <tr class="totals">
1715: 	            <th scope="rowgroup" class="row-head text">TOTALS</th>
1716: 	            #set ($goalieTotals = $team.selectSingleNode("totals/goalie"))
1717: 	            <td>$!formatter.formatNumber($goalieTotals.valueOf("@ga"), "#")</td>
1718: 	            #if ($showPlayerMin == true)<td>&#160;</td>#end
1719: 	            <td>#shots($goalieTotals.valueOf("@ga") $goalieTotals.valueOf("@saves"))</td>
1720: 	            <td>$!goalieTotals.valueOf("@ga")</td>
1721: 	            <td>$!goalieTotals.valueOf("@saves")</td>
1722: 	            #if ($showFieldHockey)<td>&#160;</td>#end
1723: 	            <td>$!goalieTotals.valueOf("@minutes")</td>
1724: 	        </tr>
1725: 	    #end
1726:     </tbody>
1727:     
1728: #end ## print team goalies
1729: 
1730: #macro (printTabControl $teamNode $id)
1731: 	#set ($vh = $teamNode.valueOf("@vh").toLowerCase())
1732: 	#set ($inputClass = "home")
1733: 	#if ($vh == "v")
1734: 		#set ($inputClass = "visitor")
1735:                                         #end
1736: 	#if ($stats.view != "pdf")
1737: 	   	<input class="radio ${inputClass}" type="radio" id="${vh}-${id}" name="team-${id}" #if ($vh == "v")checked="checked"#end>
1738: 	   	<label class="label ${inputClass}" for="${vh}-${id}">$teamNode.valueOf("@name")</label>
1739:     #end
1740: #end
1741: 
1742: ## PRINT BOX SCORE
1743: #macro (printBoxScore)   
1744: 	#printTabControl($visitorNode, "lineup")
1745: 	#printTabControl($homeNode, "lineup")
1746: 	<div class="stats-wrap clearfix">
1747: 	#foreach ($teamNode in $document.selectNodes("sogame/team"))
1748: 		#set ($teamName = $teamNode.valueOf("@name"))
1749:        	#set ($teamId = $teamNode.valueOf("@teamId"))
1750: 		#set ($vh = $teamNode.valueOf("@vh").toLowerCase())
1751: 		<div class="stats-box half lineup ${vh} clearfix">
1752: 			<table class="striped">
1753: 				<caption class="caption">
1754: 					<h2><span class="team-name">$teamName</span></h2>
1755: 				</caption>
1756: 				#printPlayerStats($teamNode)
1757: 			</table>
1758: 		</div>
1759: 	#end
1760: 	</div> ## stats-wrap
1761: #end ## print box score
1762: 
1763: ## PRINT BOX SCORE
1764: #macro (printGoalies)    
1765: 	<div class="stats-wrap clearfix">        
1766: 		#foreach ($teamNode in $document.selectNodes("sogame/team"))
1767: 			#set ($teamName = $teamNode.valueOf("@name"))
1768: 			#set ($teamId = $teamNode.valueOf("@teamId"))
1769: 			#set ($vh = $teamNode.valueOf("@vh").toLowerCase())
1770: 			<div class="stats-box half lineup ${vh} clearfix">
1771: 				<table class="striped">
1772: 					<caption class="caption"><h2>$teamName <span class="offscreen">Goalies</span></h2></caption>
1773: 					#printTeamGoalies($teamNode)
1774: 				</table>
1775: 			</div>
1776: 		#end
1777: 	</div> ## stats-wrap
1778: #end ## print goalies
1779: 
1780: ## TEAM SUMMARY STATISTICS
1781: #macro (printTeamStats)
1782: 
1783: 	<div class="stats-wrap clearfix">
1784: 		<div class="stats-box full team-stats clearfix">
1785: 	        <table  class="striped"><tbody><tr>
1786: 	            <th style="width:33%">#showTeam($visitorNode)</th>
1787: 	            <th style="width:34%">Team Statistics</th>
1788: 	            <th>#showTeam($homeNode)</th>
1789: 	        </tr>
1790: 	        <tr>
1791: 	            <td >$visitorNode.valueOf('totals/shots/@sh')</td>
1792: 	            <td class="totals">SHOTS</td>
1793: 	            <td>$homeNode.valueOf('totals/shots/@sh')</td>
1794: 	        </tr>
1795: 	        <tr>
1796: 	            <td>$visitorNode.valueOf("totals/goalie/@saves")</td>
1797: 	            <td class="totals">SAVES</td>
1798: 	            <td>$homeNode.valueOf("totals/goalie/@saves")</td>
1799: 	        </tr>
1800: 	        <tr>
1801: 	            <td>#totalCorners($visitorNode)</td>
1802: 	            <td class="totals">#if ($showFieldHockey) PENALTY CORNERS #else CORNER KICKS #end</td>
1803: 	            <td>#totalCorners($homeNode)</td>
1804: 	        </tr>
1805: 	            #if ($showFouls)
1806: 	            <tr>
1807: 	                <td>$visitorNode.valueOf("totals/penalty/@fouls")</td>
1808: 	                <td class="totals">FOULS</td>
1809: 	                <td>$homeNode.valueOf("totals/penalty/@fouls")</td>
1810: 	            </tr>
1811: 	            #end
1812: 	        </tbody></table>
1813: 	    </div>
1814:     </div> ## stats-wrap
1815: 
1816: #end ## print team stats
1817: 
1818: ## Game Information
1819: #macro (printGameInfo)
1820:     <div class="stats-wrap clearfix">
1821:         <div class="stats-box game-info">
1822:         	<table class="table-inline">
1823:         		<caption class="caption"><h2>Game Information</h2></caption>
1824:         		#if ($date)<tr><th class="row-head text" scope="row">Date/Time: </th><td class="text">$formatter.formatLongDate($date) #if ($time.length() > 0) - $!time #end</td></tr>#end
1825:         		#if ($location.length() > 0)<tr><th class="row-head text" scope="row">Location: </th><td class="text">$location</td></tr>#end
1826:             	#if ($stadium.length() > 0)<tr><th class="row-head text" scope="row">Stadium: </th><td class="text">$document.valueOf("sogame/venue/@stadium")</td></tr>#end
1827:             	#if ($duration.length() > 0)<tr><th class="row-head text" scope="row">Game Length: </th><td class="text">$document.valueOf("sogame/venue/@duration")</td></tr>#end
1828:             	#if ($attendance.length() > 0)<tr><th class="row-head text" scope="row">Attendance: </th><td class="text">$document.valueOf("sogame/venue/@attend")</td></tr>#end
1829:             	#foreach ($official in $document.selectNodes("sogame/venue/officials/official"))
1830:                 	<tr><th class="row-head text" scope="row">$official.valueOf("@title"): </th><td class="text">$official.valueOf("@name")</td></tr>
1831:             	#end
1832:         	</table>
1833:     	</div> 
1834:     </div>
1835: #end ## print game info
1836: 
1837: #macro (printStatsBox $colTitle $nodeAttr)
1838: 	<table>
1839: 		<tr>
1840: 			<th scope="col" class="col-head text">$colTitle</th>
1841: 			#printPeriods('class="col-head" style="width:40px"')
1842: 			<th scope="col" class="col-head" style="width:50px">TOTAL</th>
1843: 		</tr>
1844: 		
1845: 		#foreach ($team in $document.selectNodes("sogame/team"))
1846: 			#set ($total = 0)
1847: 			<tr>
1848: 				<th scope="row" class="row-head text">$team.valueOf("@name")</th>
1849: 				#foreach ($prd in $team.selectNodes("linescore/lineprd"))
1850: 					<td>$prd.valueOf("${nodeAttr}")</td>
1851: 					#set ($total = $tool.math.add($total, $prd.valueOf("${nodeAttr}")))
1852: 				#end
1853: 				<td>$total</td>
1854: 			</tr>
1855: 		#end
1856: 	</table>
1857: #end ## print stats box
1858: 
1859: #macro (printTabBoxscore)
1860: 
1861: 	<div class=" stats-wrap clearfix">
1862: 	
1863: 		## SHOTS BY PERIOD
1864:         <div class="stats-box half team-stats">
1865: 			#printStatsBox ("SHOTS" "@shots")
1866: 		</div>
1867: 		
1868: 		## SAVES
1869: 		<div class="stats-box half team-stats">
1870: 			#printStatsBox ("SAVES" "@saves")
1871: 		</div>
1872: 		
1873: 	</div> ## stats wrap
1874: 
1875: 	<div class=" stats-wrap clearfix">
1876: 	
1877: 		## PENALTY CORNERS / CORNER KICKS
1878:         <div class="stats-box half team-stats">
1879: 	        #if ($showFieldHockey)
1880: 	        	#printStatsBox ("PENALTY CORNERS" "@corners")
1881: 	        #else
1882: 				#printStatsBox ("CORNER KICKS" "@corners")
1883: 			#end
1884: 		</div>
1885: 
1886: 		## FOULS BY PERIOD
1887: 		#if ($showFouls)
1888: 			<div class="stats-box half team-stats">
1889: 				#printStatsBox ("FOULS" "@fouls")
1890: 			</div>
1891: 		#end
1892: 		
1893: 	</div> ## stats wrap
1894: 
1895: #end ## print tab boxscore
1896: 
1897: <head>
1898:     <title>$visname #if($isNeutralGame)vs.#else at #end $homename | Box Score #if($date.length() > 0)| $date #end</title>
1899:     #if ($stats.inProgress)
1900:         <meta http-equiv="refresh" content="60"/>
1901:     #end
1902:     #if ($stats.view == "pdf")
1903:         #include("statcrew-pdf-css-template")
1904:     #end
1905: </head>
1906: 
1907: #if ($stats.view == "pdf")
1908:     
1909: <div class='footer-left'>$visname vs. $homename</div>
1910: <div class='footer-right'><span id="pagenumber"></span> of <span id="pagecount"></span></div>		    
1911: <div class="stats-wrapper">
1912: 	#printPdfHeader("Box score")
1913: 	#parse("soxml-monospace-template")
1914: 	#if ($hasPeriods)
1915: 		<p class="pagebreak">&nbsp;</p>
1916: 		#printPdfHeader("Play by Play")
1917: 		<div class="stats-fullbox">#printPlayByPlay()</div>
1918: 	#end                
1919: </div> ## stats-wrapper               
1920: 
1921: #else
1922: ## FULL BOXSCORE
1923: 
1924: #if ($showWiki == true)
1925: 	$!wiki.su
1926: #end
1927: 
1928: <article class="game-boxscore soc-fh clearfix">	
1929: 
1930: 	## BOX SCORE HEADER
1931: 	<div class="head">
1932: 		<h1>$visitorTeam #if ($isNeutralGame) vs. #else at #end $homeTeam #if ($dateVal.length() > 0)<span>$formatter.formatLongDate($date)</span>#end</h1>
1933: 	
1934: 		#set ($visClass = "")
1935:         #set ($homeClass = "")	    
1936: 	    #if ($visScore && $homeScore)
1937:             #if ($visScore > $homeScore)
1938:                 #set ($visClass = "winner")
1939:                 #set ($homeClass = "loser")
1940:             #elseif ($homeScore > $visScore)
1941:                 #set ($visClass = "loser")
1942:                 #set ($homeClass = "winner")
1943:             #end
1944: 	    #end
1945: 	    
1946:     	<div class="teams clearfix">
1947:     	
1948: 	    	#foreach ($teamNode in $document.selectNodes("sogame/team"))
1949: 				#set ($teamName = $teamNode.valueOf("@name"))
1950: 	        	#set ($teamId = $teamNode.valueOf("@teamId"))
1951: 				#set ($vh = $teamNode.valueOf("@vh"))
1952: 	        	#if ($vh == "V")
1953: 	        		#set ($teamClass = "visitor ${visClass}")
1954: 	        		#set ($teamLogo = $stats.visitorTeamLogo) 
1955: 	        	#else
1956: 	        		#set ($teamClass = "home ${homeClass}")
1957: 	        		#set ($teamLogo = $stats.homeTeamLogo)		                	
1958: 	        	#end
1959: 	        	    	
1960: 	    		<div class="team ${teamClass} clearfix">                                                   
1961: 	    			<div class="team-logo"><img src="$teamLogo" alt="${teamNode.valueOf("@name")}" role="presentation" /></div>
1962: 	    			#if ($teamNode.valueOf("@record").length() > 0)<span class="team-record">($teamNode.valueOf("@record"))</span>#end
1963: 	    			<div class="team-score">$teamNode.valueOf("linescore/@score")</div>
1964: 	    		</div>
1965: 		    		
1966: 		    #end
1967:     	   	
1968: 			## Mini boxscore
1969: 			<div class="linescore">
1970: 			<table>
1971: 				<tr>
1972: 					<th scope="col" class="col-head text">
1973: 						#if ($stats.final)
1974:                             Final
1975:                         #elseif ($stats.inProgress)
1976:                             #period($!status)- $!compClock
1977:                         #end
1978: 					</th>
1979: 					#printPeriods('class="col-head score"')
1980: 					<th scope="col" class="col-head score total" aria-label="Total">T</th>
1981: 				</tr>
1982: 
1983: 				## TEAM SCORES
1984: 				#foreach ($team in $document.selectNodes("sogame/team"))
1985: 				<tr #if($velocityCount == 1) class="$visClass" #else class="$homeClass" #end>
1986:                     <th scope="row" class="name row-head text">#showTeam($team)</th>                 
1987:                     #foreach ($prd in $team.selectNodes("linescore/lineprd"))
1988:                     	<td class="score">$prd.valueOf("@score")</td>
1989:                     #end
1990:                     <td class="score total">$team.valueOf("linescore/@score")</td>
1991: 				</tr>
1992: 				#end
1993: 			</table>
1994: 			</div> ## linescore
1995:     	</div> ## teams
1996:     </div> ## head
1997: 
1998:     ## TABS
1999:     <div class="tab-container primary clearfix" data-module="stats/tabs" data-type="primary">
2000:     	
2001: 		<div class="tab-nav" data-module="jscroll" data-momentum="false">
2002:     		<div class="clearfix">
2003:     			<ul class="clearfix">
2004:         			<li #if (!($stats.view.length() > 0) || $stats.view == "boxscore")class="active"#end><a href="${stats.pageUrl}" data-view="boxscore">Box Score</a></li>
2005:         			#if ($hasPeriods)
2006:           				<li #if ($stats.view == "plays")class="active"#end><a href="${stats.pageUrl}${paramSep}view=plays" data-view="plays" id="pbp">Play by Play</a></li>
2007:         			#end
2008:         			#if ($isDakStats)
2009:         				<li #if ($stats.view == "teamstats")class="active"#end><a href="${stats.pageUrl}${paramSep}view=teamstats" data-view="teamstats">Team Stats</a></li>
2010:         			#end
2011: 					<li data-skip="true"><a href="$stats.pageUrl${paramSep}tmpl=soxml-monospace-template" target="_blank">Coach's View</a></li>
2012:     			</ul>
2013:     		</div>
2014:     	</div>
2015:     	<div class="tab-panels">
2016:     	
2017:     		## FULL BOX SCORE
2018: 			#set ($class = "tab-panel boxscore clearfix")
2019: 			#if (!($stats.view.length() > 0) || $stats.view == "boxscore")
2020: 				#set ($class = "${class} active")
2021: 			#end								
2022: 			<section class="${class}">
2023: 				<h1 class="offscreen">Box Score</h1>
2024: 				<div class="player-stats">
2025: 					#printBoxScore
2026: 					#printGoalies
2027: 				</div>
2028: 				#printScoringSummary		
2029: 				#if ($isDakStats)
2030: 					#printTeamStats
2031: 				#else
2032: 					#printTabBoxscore
2033: 				#end
2034: 				#if ($shootouts.size() > 0 && $penalties.size() > 0)        
2035: 					#printPenaltySummary("full")
2036: 				#end
2037: 				#printGameInfo		
2038: 			</section>
2039:             
2040:             ## PAY BY PLAY
2041: 			#if ($hasPeriods)
2042: 				#set ($class = "tab-panel plays clearfix")
2043: 				#if ($stats.view == "plays")
2044: 					#set ($class = "${class} active")
2045: 				#end
2046: 				<section class="${class}">
2047: 					<h1 class="offscreen">Play By Play</h1>
2048: 					#printPlayByPlay
2049: 				</section>
2050: 			#end
2051:             
2052:             ## TEAM STATS
2053:             #if ($isDakStats)
2054: 	            #set ($class = "tab-panel team-stats clearfix")
2055: 	            #if ($stats.view == "teamstats")
2056: 	                #set ($class = "${class} active")
2057: 	            #end
2058: 	            <section class="${class}">
2059: 					<h1 class="offscreen">Team Statistics</h1>
2060: 					#printTeamStats
2061: 	            </section>
2062:             #end
2063:     	</div> ## tab panels
2064:     </div>
2065:     ## TABS END  
2066:     	
2067: </article> ## game-boxscore
2068: 
2069: #end ## pdf check
2070: 
2071: #set ($showWiki = true)
2072: #set ($showWiki = $showWikiVar)
2073: 
2074: #if ($showWiki == true)
2075:     $!wiki.su
2076: #end
2077: 
2078: #end ## pt check

PrestoSports