add blank lineupsheet

This commit is contained in:
2024-05-19 08:53:26 -05:00
parent c2b1898b91
commit c2c192bdc6
4 changed files with 257 additions and 1 deletions

View File

@@ -23,8 +23,14 @@ exports.getEventSheet = async (req,res) =>{
)
)
await Promise.all(req.promises)
const {sheet_size, sheet_layout} = req.query
const {user, team, team_preferences, members, event, event_lineup, event_lineup_entries, availabilities, availabilitySummary, timeline, recent_events, opponent_logo, upcoming_events} = req
res.render('eventsheet/sheet', {user, team, team_preferences, members, event, event_lineup, event_lineup_entries, availabilities, availabilitySummary, timeline, recent_events, opponent_logo,upcoming_events})
res.render('eventsheet/sheet', {sheet_size, sheet_layout, user, team, team_preferences, members, event, event_lineup, event_lineup_entries, availabilities, availabilitySummary, timeline, recent_events, opponent_logo,upcoming_events})
}
exports.getEventSheetBlank = (req,res) => {
res.render('eventsheet/sheet_blank')
}
exports.getLineupCard = (req, res, next) => {

View File

@@ -30,6 +30,8 @@ router.get("/:team_id([0-9]+)/event/:event_id([0-9]+)/sheet", async (req,res) =>
}
)
router.get("/lineup/sheet/blank", eventsSheetController.getEventSheetBlank )
router.post("/:team_id([0-9]+)/event/:event_id([0-9]+)/lineup/:event_lineup_id([0-9]+)/sheet", upload.none(), eventsSheetController.getEventSheet )
module.exports = {router}

View File

View File

@@ -0,0 +1,248 @@
<link rel="stylesheet" href="/css/eventsheet.css">
<body class="{{page_size}} ">
<div class="sheet eventsheet {{layout}}" id="page-1">
<section class="NW" id="roster-and-history">
<div class="roster-and-history">
{{> roster_and_history
event=event
event_lineup_entries=event_lineup_entries
members=members availabilities=availabilities
recent_events=recent_events
upcoming_events=upcoming_events
}}
</div>
</section>
<section class="NE blank" id="defense-card">
<header>
<div class="event-title float-left">
</div>
<div class="homeaway float-right">
</div>
</header>
<div>
<div id="defense-pane">
{{> defense_pane event_lineup_entries=event_lineup_entries members=members}}
</div>
<div class="footer">
<table class="notes">
<tbody>
<tr>
<th>Notes</th>
</tr>
{{#repeat 3}}
<tr>
<td></td>
</tr>
{{/repeat}}
</tbody>
</table>
</div>
</div>
</section>
<section class="SW lineup-card dugout blank" id="lineup-card-dugout">
<header>
<div class="float-left event-title">{{event.formattedTitle}}</div>
<div class="float-right homeaway">{{event.gameType}}</div>
</header>
<div class="starting-lineup-table">
<table>
<thead>
<tr>
<th colspan="4">Starting</th>
<th class="substitution">Substitution</th>
</tr>
</thead>
<tbody>
{{#offenseLineup 11 event_lineup_entries members}}
<tr class="slot">
<th class="sequence{{#if this.member.lastName}} counter{{/if}}"></th>
<td class="player-name">{{this.member.lastName}}</td>
<td class="jersey-number">{{this.member.jerseyNumber}}</td>
<td class="position">{{this.label}}</td>
<td class="substitution"></td>
</tr>
{{/offenseLineup }}
{{#defenseLineup event_lineup_entries members}}
<tr class="slot">
{{#if (isInPositionOnly this.member)}}{{#if (comparePositionWithFlags "P" this.eventLineupEntry)}}
<th class="sequence">PO</th>
<td class="player-name">{{this.member.lastName}}</td>
<td class="jersey-number">{{this.member.jerseyNumber}}</td>
<td class="position">{{positionLabelWithoutFlags this.eventLineupEntry.label}}</td>
<td class="substitution"></td>
{{/if}}{{/if}}
</tr>
{{/defenseLineup}}
</tbody>
</table>
</div>
</section>
<section class="SE lineup-card exchange blank" id="lineup-card-exchange">
<header>
<div class="float-left event-title">{{event.formattedTitle}}</div>
<div class="float-right homeaway">{{event.gameType}}</div>
</header>
<div class="starting-lineup-table">
<table>
<thead>
<tr>
<th colspan="4">Starting</th>
<th class="substitution">Substitution</th>
</tr>
</thead>
<tbody>
{{#offenseLineup 11 event_lineup_entries members}}
<tr class="slot">
<th class="sequence {{#if this.member.lastName}}counter{{/if}}"></th>
<td class="player-name">{{this.member.lastName}}</td>
<td class="jersey-number">{{this.member.jerseyNumber}}</td>
<td class="position">{{this.label}}</td>
<td class="substitution"></td>
</tr>
{{/offenseLineup}}
{{#defenseLineup event_lineup_entries members}}
<tr class="slot">
{{#if (isInPositionOnly this.member)}}{{#if (comparePositionWithFlags "P" this.eventLineupEntry)}}
<th class="sequence">PO</th>
<td class="player-name">{{this.member.lastName}}</td>
<td class="jersey-number">{{this.member.jerseyNumber}}</td>
<td class="position">{{positionLabelWithoutFlags this.eventLineupEntry.label}}</td>
<td class="substitution"></td>
{{/if}}{{/if}}
</tr>
{{/defenseLineup}}
</tbody>
</table>
</div>
</section>
</div>
<div class="sheet eventsheet {{layout}}" id="page-2">
<section class="NW blank" id="defense-card">
<header>
<div class="event-title float-left">
&nbsp;
</div>
<div class="homeaway float-right">
&nbsp;
</div>
</header>
<div>
<div id="defense-pane">
{{> defense_pane event_lineup_entries=null members=null}}
</div>
<div class="footer">
<table class="notes">
<tbody>
<tr>
<th>Notes</th>
</tr>
{{#repeat 3}}
<tr>
<td></td>
</tr>
{{/repeat}}
</tbody>
</table>
</div>
</div>
</section>
<section class="NE blank" id="defense-card">
<header>
<div class="event-title float-left">
&nbsp;
</div>
<div class="homeaway float-right">
&nbsp;
</div>
</header>
<div>
<div id="defense-pane">
{{> defense_pane event_lineup_entries=null members=null}}
</div>
<div class="footer">
<table class="notes">
<tbody>
<tr>
<th>Notes</th>
</tr>
{{#repeat 3}}
<tr>
<td></td>
</tr>
{{/repeat}}
</tbody>
</table>
</div>
</div>
</section>
<section class="SW lineup-card exchange blank" id="lineup-card-exchange-blank">
<header></header>
<div class="starting-lineup-table">
<table>
<thead>
<tr>
<th colspan="4">
Starting
</th>
<th class="substitution">
Substitution
</th>
</tr>
</thead>
<tbody>
{{#repeat 12}}
<tr class="slot">
<th class="sequence">
</th>
<td class="player-name">
</td>
<td class="jersey-number">
</td>
<td class="position">
</td>
<td class="substitution">
</td>
</tr>
{{/repeat}}
</tbody>
</table>
</div>
</section>
<section class="SE lineup-card dugout blank" id="lineup-card-dugout-blank">
<header></header>
<div class="starting-lineup-table">
<table>
<thead>
<tr>
<th colspan="4">
Starting
</th>
<th class="substitution">
Substitution
</th>
</tr>
</thead>
<tbody>
{{!-- <% for i in (0...12) do%> --}}
{{#repeat 12}}
<tr class="slot">
<th class="sequence">
</th>
<td class="player-name">
</td>
<td class="jersey-number">
</td>
<td class="position">
</td>
<td class="substitution">
</td>
</tr>
{{/repeat}}
{{!-- <% end %> --}}
</tbody>
</table>
</div>
</section>
</div>
</body>