change todays-game to defense card

This commit is contained in:
2024-03-09 16:44:35 -06:00
parent 54dac93da5
commit b9f9c8455f

View File

@@ -2,62 +2,18 @@
<body class="B5"> <body class="B5">
<div class="sheet eventsheet" id="page-1"> <div class="sheet eventsheet" id="page-1">
<section id="todays-game"> <section id="defense-card">
<header> <header>
<div class="event-title float-left"> <div class="event-title float-left">
{{event.formattedTitle}} {{dateFormat event.startDate "ddd, MMM D h:mm A" }} {{event.formattedTitle}} {{dateFormat event.startDate "ddd, MMM D h:mm A" }}
</div> </div>
<div class="homeaway float-right"> <div class="homeaway float-right">
{{event.game_type}} {{event.gameType}}
</div> </div>
</header> </header>
<div class="grid-container"> <div>
<div id="offense-pane">
<table id="starting-lineup-offense">
<tbody>
<div class="slot-set">
{{!-- <% offensive_lineup_entries = by_member.select{|m,d| d[:event_lineup_entry] and d[:event_lineup_entry].label.exclude?("[PO]")}.sort_by{|m,d| d[:event_lineup_entry].sequence}.each_with_index do |(member, d), i| if i < 11%> --}}
{{#offenseLineup 11}}
<tr class="slot">
<th class="sequence counter" rowspan="2"></th>
<td class="player-name">{{this.member.lastName}}</td>
<td class="jersey-number">{{this.member.jerseyNumber}}</td>
<td class="position">{{positionLabelWithoutFlags this.label}}</td>
</tr>
<tr class="slot substitute">
<td></td>
<td></td>
<td></td>
</tr>
{{/offenseLineup}}
</div>
</tbody>
</table>
</div>
<div id="defense-pane"> <div id="defense-pane">
<div class="field-container"> {{> defense_pane event_lineup_entries=event_lineup_entries members=members}}
<img src="/media/baseball-diamond.svg" />
{{#defenseLineup}}
{{!-- <% for pos in ["CF", "LF", "RF", "SS", "2B", "3B", "1B", "C"] do (member, d) = by_member.find{|m,d| d[:event_lineup_entry] and d[:event_lineup_entry].label == pos}%> --}}
<div class="slot-set pos-{{this.position}}">
<table>
<tbody>
<tr class="slot">
<th class="position"></th>
<td class="player-name">{{this.member.lastName}}</td>
</tr>
<tr class="slot substitute">
<th class="position"></th>
<td></td>
</tr>
<tr class="slot substitute">
<th class="position"></th><td></td>
</tr>
</tbody>
</table>
</div>
{{/defenseLineup}}
</div>
</div> </div>
<div class="footer"> <div class="footer">
<table class="notes"> <table class="notes">
@@ -65,102 +21,25 @@
<tr> <tr>
<th>Notes</th> <th>Notes</th>
</tr> </tr>
{{#repeat 3}}
<tr> <tr>
<td></td> <td></td>
</tr> </tr>
<tr> {{/repeat}}
<td></td>
</tr>
<tr>
<td></td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</section> </section>
<section id="roster-and-history"> <section id="roster-and-history">
<div> <div class="roster-and-history">
<table> {{> roster_and_history
<colgroup><col span="3" class="player"></colgroup> event=event
{{!-- <colgroup><col span="0" class="player-stats"></colgroup> --}} event_lineup_entries=event_lineup_entries
<colgroup><col span="4" class="position-capability"></colgroup> members=members availabilities=availabilities
<colgroup><col span="4" class="availability-on-day future"></colgroup> recent_events=recent_events
<colgroup><col span="4" class="availability-on-day past"></colgroup> upcoming_events=upcoming_events
<thead> }}
<tr>
<th colspan="3" id="today-availability">
Available ({{availabilitySummary.playerGoingCount}}|{{availabilitySummary.playerMaybeCount}})
</th>
<th class="player-stats">
<span class="decimal-point">.</span>AVG
<span class="delimiter">/</span>
<span class="decimal-point">.</span>OBP
<span class="delimiter">/</span>
<span class="decimal-point">.</span>SLG
<span class="delimiter">:</span>PA
</th>
<th class="position-capability pitcher">P</th>
<th class="position-capability catcher">C</th>
<th class="position-capability infield">I</th>
<th class="position-capability outfield">O</th>
{{!-- <% for timepoint, i in timeline.select{|tp| tp[:comparison_to_selected]>0}.sort{|tp| -tp[:comparison_to_selected]}.each_with_index do%> --}}
{{#loopEvents upcoming_events}}
<th class="availability-on-day avail-today-plus-{{@index}}" date="{{this.startDate}}"><div>{{dateFormat this.startDate "ddd" }}</div></th>
{{/loopEvents}}
{{#loopEvents recent_events}}
<th class="availability-on-day avail-today-minus-{{@index}}" date="{{this.startDate}}"><div>{{dateFormat this.startDate "ddd" }}</div></th>
{{/loopEvents}}
</tr>
</thead>
<tbody>
{{!-- <% by_member.select{|m,d| !m.is_non_player}.each_with_index do |(member, d), i|%> --}}
{{#rosterHistory}}
<tr id="roster-history-slot-<%= ::Temple::Utils.escape_html((i)) %>">
<td class="is-present-checkbox available-status-code-{{this.benchcoach.availability.statusCode}}">
<span>■</span>
</td>
<td class="jersey-number available-status-code-{{this.benchcoach.availability.statusCode}}{{#if (isStarting this)}} starting{{/if}}">
{{this.jerseyNumber}}
</td>
<td class="player-name available-status-code-{{this.benchcoach.availability.statusCode}}{{#if (isStarting this)}} starting{{/if}}">
{{this.lastName}}
</td>
<td class="player-stats border-left border-right">
<span class="decimal-point">.</span>
<span class="avg">000</span>
<span class="delimiter">/</span>
<span class="decimal-point">.</span>
<span class="obp">000</span>
<span class="delimiter">/</span>
<span class="decimal-point">.</span>
<span class="slg">000</span>
<span class="delimiter">:</span>
<span class="pa">00</span>
</td>
<td class="position-capability pitcher">{{positionCapabilityFor this "P"}}</td>
<td class="position-capability catcher">{{positionCapabilityFor this "C"}}</td>
<td class="position-capability infield">{{positionCapabilityFor this "IF"}}</td>
<td class="position-capability outfield">{{positionCapabilityFor this "OF"}}</td>
{{#loopEvents ../upcoming_events}}
{{#timepointForMember ../this ../../timeline this}}
<td class="availability-on-day future available-status-code-{{this.availability.statusCode}}">
{{this.value}}
</td>
{{/timepointForMember}}
{{/loopEvents}}
{{#loopEvents ../recent_events}}
{{#timepointForMember ../this ../../timeline this}}
<td class="availability-on-day past available-status-code-{{this.availability.statusCode}}">
{{this.value}}
</td>
{{/timepointForMember}}
{{/loopEvents}}
</tr>
{{/rosterHistory}}
</tbody>
</table>
</div> </div>
</section> </section>
<section class="lineup-card" id="lineup-card-dugout"> <section class="lineup-card" id="lineup-card-dugout">
@@ -177,7 +56,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{{#offenseLineup 11}} {{#offenseLineup 11 event_lineup_entries members}}
<tr class="slot"> <tr class="slot">
<th class="sequence{{#if this.member.lastName}} counter{{/if}}"></th> <th class="sequence{{#if this.member.lastName}} counter{{/if}}"></th>
<td class="player-name">{{this.member.lastName}}</td> <td class="player-name">{{this.member.lastName}}</td>
@@ -186,7 +65,7 @@
<td class="substitution"></td> <td class="substitution"></td>
</tr> </tr>
{{/offenseLineup }} {{/offenseLineup }}
{{#defenseLineup}} {{#defenseLineup event_lineup_entries members}}
<tr class="slot"> <tr class="slot">
{{#if (isInPositionOnly this.member)}}{{#if (comparePositionWithFlags "P" this.eventLineupEntry)}} {{#if (isInPositionOnly this.member)}}{{#if (comparePositionWithFlags "P" this.eventLineupEntry)}}
<th class="sequence">PO</th> <th class="sequence">PO</th>
@@ -215,7 +94,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{{#offenseLineup 11}} {{#offenseLineup 11 event_lineup_entries members}}
<tr class="slot"> <tr class="slot">
<th class="sequence {{#if this.member.lastName}}counter{{/if}}"></th> <th class="sequence {{#if this.member.lastName}}counter{{/if}}"></th>
<td class="player-name">{{this.member.lastName}}</td> <td class="player-name">{{this.member.lastName}}</td>
@@ -224,7 +103,7 @@
<td class="substitution"></td> <td class="substitution"></td>
</tr> </tr>
{{/offenseLineup}} {{/offenseLineup}}
{{#defenseLineup}} {{#defenseLineup event_lineup_entries members}}
<tr class="slot"> <tr class="slot">
{{#if (isInPositionOnly this.member)}}{{#if (comparePositionWithFlags "P" this.eventLineupEntry)}} {{#if (isInPositionOnly this.member)}}{{#if (comparePositionWithFlags "P" this.eventLineupEntry)}}
<th class="sequence">PO</th> <th class="sequence">PO</th>
@@ -241,7 +120,10 @@
</section> </section>
</div> </div>
<div class="sheet eventsheet" id="page-2"> <div class="sheet eventsheet" id="page-2">
<section id="back-cover" style="border:solid black;"> <section id="defense-card" style="border:solid black;">
<div id="defense-pane">
{{> defense_pane}}
</div>
</section> </section>
<section id="front-cover"> <section id="front-cover">
<header> <header>
@@ -276,8 +158,28 @@
<div> <div>
<span class="name">{{event.opponentName}}</span> <span class="name">{{event.opponentName}}</span>
</div> </div>
<img src="{{opponent_logo.mediumUrl}}">
{{!-- <%= ::Temple::Utils.escape_html((image_tag opponent_logos[event.opponent.id].medium_url)) %> --}} {{!-- <%= ::Temple::Utils.escape_html((image_tag opponent_logos[event.opponent.id].medium_url)) %> --}}
</div> </div>
<div class="">
<table>
<thead>
<tr>
<th colspan="2">Final Score</th>
</tr>
</thead>
<tbody>
<tr>
<th>{{team.name}}</th>
<th>{{event.opponentName}}</th>
</tr>
<tr>
<td style="height:5em;"></td>
<td></td>
</tr>
</tbody>
</table>
</div>
{{/if}} {{/if}}
</div> </div>
</section> </section>