Compare commits
7 Commits
d72ff726a5
...
7c5630c5ba
| Author | SHA1 | Date | |
|---|---|---|---|
|
7c5630c5ba
|
|||
|
e4b4345cff
|
|||
|
dfab474f42
|
|||
|
053f6038f6
|
|||
|
cb69521875
|
|||
|
58c870ce7c
|
|||
|
61b6dc8a35
|
@@ -15,9 +15,11 @@ const statusCodeIcons = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exports.helpers = {
|
exports.helpers = {
|
||||||
flagsString: (flags) => flags?.join(","),
|
flagsString: (flags) => {
|
||||||
|
return flags != null ? Array.from(flags).join(",") : ''
|
||||||
|
},
|
||||||
plus1: (i) => Number(i)+1,
|
plus1: (i) => Number(i)+1,
|
||||||
positions: () => ["P", "C", "1B", "2B", "3B", "SS", "LF", "CF", "RF", "EH", "DH"],
|
positions: () => ["P", "C", "1B", "2B", "3B", "SS", "LF", "CF", "RF", "EH", "DH", "DR"],
|
||||||
defense_positions: () => ["C", "1B", "2B", "3B", "SS", "LF", "CF", "RF", "P"],
|
defense_positions: () => ["C", "1B", "2B", "3B", "SS", "LF", "CF", "RF", "P"],
|
||||||
avail_status_code_icon: (status_code) => {
|
avail_status_code_icon: (status_code) => {
|
||||||
const icon_classes = {
|
const icon_classes = {
|
||||||
@@ -39,7 +41,21 @@ exports.helpers = {
|
|||||||
return `<button class="Button Button--smallSquare ${button_classes[status_code]}" type="button"><span class="">${statusCodeIcons[status_code]}</span></button>`
|
return `<button class="Button Button--smallSquare ${button_classes[status_code]}" type="button"><span class="">${statusCodeIcons[status_code]}</span></button>`
|
||||||
},
|
},
|
||||||
positionLabelWithoutFlags: (label) => {
|
positionLabelWithoutFlags: (label) => {
|
||||||
return label.replace(/(.*?)\s\[(.*?)\]/, "$1");
|
const {positionLabelWithoutFlags} = parsePositionLabel(label);
|
||||||
|
return positionLabelWithoutFlags
|
||||||
|
},
|
||||||
|
positionLabelWithoutPOFlag: (label) => {
|
||||||
|
const {positionLabelWithoutFlags, positionFlags} = parsePositionLabel(label);
|
||||||
|
positionFlags.delete('PO')
|
||||||
|
return compilePositionLabel(positionLabelWithoutFlags, positionFlags)
|
||||||
|
},
|
||||||
|
positionFlags: (label)=> {
|
||||||
|
const {positionFlags} = parsePositionLabel(label);
|
||||||
|
return `[${Array.from(positionFlags).join(",")}]`
|
||||||
|
},
|
||||||
|
hasPositionFlags: (label) => {
|
||||||
|
const {positionLabelWithoutFlags, positionFlags} = parsePositionLabel(label);
|
||||||
|
return positionFlags.size > 0;
|
||||||
},
|
},
|
||||||
comparePositionWithFlags: (labelWithoutFlags, eventLineupEntry, options) => {
|
comparePositionWithFlags: (labelWithoutFlags, eventLineupEntry, options) => {
|
||||||
labelWithFlags = eventLineupEntry?.label
|
labelWithFlags = eventLineupEntry?.label
|
||||||
@@ -52,12 +68,12 @@ exports.helpers = {
|
|||||||
isInStartingLineup: (member) => {
|
isInStartingLineup: (member) => {
|
||||||
if (member.benchcoach.eventLineupEntry == null || member.benchcoach.eventLineupEntry.label == '') return false;
|
if (member.benchcoach.eventLineupEntry == null || member.benchcoach.eventLineupEntry.label == '') return false;
|
||||||
const {positionFlags} = parsePositionLabel(member.benchcoach.eventLineupEntry?.label);
|
const {positionFlags} = parsePositionLabel(member.benchcoach.eventLineupEntry?.label);
|
||||||
return (positionFlags != "PO")
|
return (!positionFlags.has("PO"))
|
||||||
},
|
},
|
||||||
isInPositionOnly: (member) => {
|
isInPositionOnly: (member) => {
|
||||||
if (!member.benchcoach || member.benchcoach.eventLineupEntry == null) return false;
|
if (!member.benchcoach || member.benchcoach.eventLineupEntry == null) return false;
|
||||||
const {positionFlags} = parsePositionLabel(member.benchcoach.eventLineupEntry?.label);
|
const {positionFlags} = parsePositionLabel(member.benchcoach.eventLineupEntry?.label);
|
||||||
return (member.benchcoach.eventLineupEntry != null && positionFlags == "PO")
|
return (member.benchcoach.eventLineupEntry != null && positionFlags.has("PO"))
|
||||||
},
|
},
|
||||||
isInBench: (member) => {
|
isInBench: (member) => {
|
||||||
if ((member.benchcoach.eventLineupEntry != null && member.benchcoach.eventLineupEntry.label != '') || member.isNonPlayer) return false;
|
if ((member.benchcoach.eventLineupEntry != null && member.benchcoach.eventLineupEntry.label != '') || member.isNonPlayer) return false;
|
||||||
@@ -143,29 +159,39 @@ exports.postEventLineup = async (req,res) => {
|
|||||||
if (body.memberId == null) {res.status(400).end();return}
|
if (body.memberId == null) {res.status(400).end();return}
|
||||||
await Promise.all(req.promises);
|
await Promise.all(req.promises);
|
||||||
const eventLineupEntries = req.event_lineup.eventLineupEntries
|
const eventLineupEntries = req.event_lineup.eventLineupEntries
|
||||||
const {newEventLineupEntries} = processPostedEventLineupEntries(body, eventLineupEntries, req.event_lineup)
|
const {newEventLineupEntries, deleteEventLineupEntries} = processPostedEventLineupEntries(body, eventLineupEntries, req.event_lineup)
|
||||||
newEventLineupEntries.forEach(e=>{
|
newEventLineupEntries.forEach(e=>{
|
||||||
teamsnap.saveEventLineupEntry(e)
|
teamsnap.saveEventLineupEntry(e)
|
||||||
})
|
})
|
||||||
|
deleteEventLineupEntries.forEach(e=>{
|
||||||
|
teamsnap.deleteEventLineupEntry(e)
|
||||||
|
})
|
||||||
|
|
||||||
eventLineup = await teamsnap.loadEventLineups(req.params.event_id)
|
eventLineup = await teamsnap.loadEventLineups(req.params.event_id)
|
||||||
res.status(201).end()
|
res.status(201).end()
|
||||||
}
|
}
|
||||||
|
|
||||||
const processPostedEventLineupEntries = (body, eventLineupEntries, eventLineup) => {
|
const processPostedEventLineupEntries = (body, eventLineupEntries, eventLineup) => {
|
||||||
const newEventLineupEntries = []
|
const newEventLineupEntries = []
|
||||||
|
const deleteEventLineupEntries = []
|
||||||
|
|
||||||
body.memberId.forEach((memberId, i)=>{
|
body.memberId.forEach((memberId, i)=>{
|
||||||
const lineupEntryId = body.eventLineupEntryId[i]
|
const lineupEntryId = body.eventLineupEntryId[i]
|
||||||
const lineupEntryLabel = body.label[i]
|
const lineupEntryLabel = body.label[i]
|
||||||
const lineupEntrySequence = body.sequence[i]
|
const lineupEntrySequence = body.sequence[i]
|
||||||
const lineupEntryFlags = body.flags[i]
|
const lineupEntryFlags = body.flags[i]
|
||||||
if (lineupEntryId != '') {
|
if (lineupEntryId != '' && lineupEntryLabel != '') {
|
||||||
// Update lineup entry
|
// Update lineup entry
|
||||||
const eventLineupEntry = eventLineupEntries.find((e)=>e.id==Number(lineupEntryId))
|
const eventLineupEntry = eventLineupEntries.find((e)=>e.id==Number(lineupEntryId))
|
||||||
eventLineupEntry.sequence = lineupEntrySequence
|
eventLineupEntry.sequence = lineupEntrySequence
|
||||||
eventLineupEntry.label = compilePositionLabel(lineupEntryLabel, lineupEntryFlags)
|
eventLineupEntry.label = compilePositionLabel(lineupEntryLabel, lineupEntryFlags)
|
||||||
newEventLineupEntries.push(eventLineupEntry)
|
newEventLineupEntries.push(eventLineupEntry)
|
||||||
}
|
}
|
||||||
|
else if (lineupEntryId != '') {
|
||||||
|
// Delete lineup entry
|
||||||
|
const eventLineupEntry = eventLineupEntries.find((e)=>e.id==Number(lineupEntryId))
|
||||||
|
deleteEventLineupEntries.push(eventLineupEntry)
|
||||||
|
}
|
||||||
else if (lineupEntryLabel != '') {
|
else if (lineupEntryLabel != '') {
|
||||||
// Create lineup entry
|
// Create lineup entry
|
||||||
const eventLineupEntry = teamsnap.createEventLineupEntry()
|
const eventLineupEntry = teamsnap.createEventLineupEntry()
|
||||||
@@ -179,5 +205,5 @@ const processPostedEventLineupEntries = (body, eventLineupEntries, eventLineup)
|
|||||||
// Skip lineup entry
|
// Skip lineup entry
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return {newEventLineupEntries, eventLineupEntries}
|
return {newEventLineupEntries, eventLineupEntries, deleteEventLineupEntries}
|
||||||
}
|
}
|
||||||
@@ -157,12 +157,13 @@ exports.parsePositionLabel = (label) => {
|
|||||||
const pattern = /(?<pos>[A-Z0-9]+)(?:\s\[(?<flags>.[A-z,]+)\])?/g
|
const pattern = /(?<pos>[A-Z0-9]+)(?:\s\[(?<flags>.[A-z,]+)\])?/g
|
||||||
const {pos, flags} = pattern.exec(label)?.groups || {}
|
const {pos, flags} = pattern.exec(label)?.groups || {}
|
||||||
const positionLabelWithoutFlags= pos
|
const positionLabelWithoutFlags= pos
|
||||||
const positionFlags = flags?.split(',').map(f=>f.trim()) || []
|
const positionFlags = new Set(flags?.split(',').map(f=>f.trim()) || [])
|
||||||
|
|
||||||
return {positionLabelWithoutFlags, positionFlags}
|
return {positionLabelWithoutFlags, positionFlags}
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.compilePositionLabel = (label, flags) => {
|
exports.compilePositionLabel = (label, flags) => {
|
||||||
if (flags == null || flags == '' || flags.lengh == 0) {
|
if (flags == null || flags == '' || flags.size == 0) {
|
||||||
return label
|
return label
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
*= require_tree .
|
*= require_tree .
|
||||||
*= require_self
|
*= require_self
|
||||||
*/
|
*/
|
||||||
|
@import url("/font/helvetica-now/stylesheet.css");
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: "MuseoSansRounded100Regular";
|
font-family: "MuseoSansRounded100Regular";
|
||||||
src: url("https://teamsnap-ui.teamsnap.com/assets/fonts/museo/MuseoSansRounded-100-webfont.eot");
|
src: url("https://teamsnap-ui.teamsnap.com/assets/fonts/museo/MuseoSansRounded-100-webfont.eot");
|
||||||
@@ -6908,12 +6909,46 @@ input:-webkit-autofill:focus {
|
|||||||
background-color: #d6d6d6;
|
background-color: #d6d6d6;
|
||||||
}
|
}
|
||||||
|
|
||||||
header.Header {
|
header {
|
||||||
background: #323669;
|
background: #323669;
|
||||||
padding: 8px 0;
|
padding: 8px 0;
|
||||||
box-shadow: 0 4px 0 rgba(0, 0, 25, 0.1);
|
box-shadow: 0 4px 0 rgba(0, 0, 25, 0.1);
|
||||||
border-bottom: 1px solid #d6d6d6;
|
border-bottom: 1px solid #d6d6d6;
|
||||||
color: white;
|
color: white;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
header .Header-banner {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
header .filler {
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
header :has(> .Header-bannerLogo):has(> .Header-bannerTitle) {
|
||||||
|
display: inline-flex;
|
||||||
|
}
|
||||||
|
header .Header-bannerLogo, header .Header-bannerTitle {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
margin-left: 0.5em;
|
||||||
|
}
|
||||||
|
header .Header-bannerLogo img {
|
||||||
|
height: 36px;
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
header .Header-bannerTitle {
|
||||||
|
font-family: "Helvetica", sans-serif;
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: left;
|
||||||
|
color: white;
|
||||||
|
font-size: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn--Full {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
@@ -6970,44 +7005,10 @@ body {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Header-bannerLogo, .Header-bannerTitle {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
margin-left: 0.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.Header-bannerLogo img {
|
|
||||||
height: 36px;
|
|
||||||
width: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.Header-bannerTitle {
|
|
||||||
font-family: "Helvetica", sans-serif;
|
|
||||||
text-transform: uppercase;
|
|
||||||
font-weight: bold;
|
|
||||||
text-align: left;
|
|
||||||
color: white;
|
|
||||||
font-size: 28px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.benchcoach-nav {
|
|
||||||
background-color: #323669;
|
|
||||||
margin-bottom: 2em;
|
|
||||||
padding: 0.5em;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
a.Panel-row {
|
a.Panel-row {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
.benchcoach-nav h3 {
|
|
||||||
font-family: "Helvetica", sans-serif;
|
|
||||||
font-weight: bolder;
|
|
||||||
color: white;
|
|
||||||
text-transform: uppercase;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lineup-slot .Panel-cell {
|
.lineup-slot .Panel-cell {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -39,6 +39,28 @@ function colorPositions() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function initFlagsCheckboxes(){
|
||||||
|
Array.from(document.querySelectorAll("[id^=event-lineup]")).forEach((bcLineup) => {
|
||||||
|
Array.from(
|
||||||
|
bcLineup.querySelectorAll(
|
||||||
|
".starting .lineup-slot, \
|
||||||
|
.position-only .lineup-slot, \
|
||||||
|
.bench .lineup-slot"
|
||||||
|
)
|
||||||
|
).forEach((slot, i) => {
|
||||||
|
const flags = new Set(slot.querySelector("input[name*=flags]")?.value?.split(',')?.map(s=>s.trim())) || new Set()
|
||||||
|
console.log(slot, flags)
|
||||||
|
if (flags.has('DHd')) {
|
||||||
|
slot.querySelector('[name=flag-dhd]').checked = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flags.has('DRd') ) {
|
||||||
|
slot.querySelector('[name=flag-drd]').checked = true;
|
||||||
|
}
|
||||||
|
})}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
function refreshLineup() {
|
function refreshLineup() {
|
||||||
Array.from(document.querySelectorAll("[id^=event-lineup]")).forEach((bcLineup) => {
|
Array.from(document.querySelectorAll("[id^=event-lineup]")).forEach((bcLineup) => {
|
||||||
Array.from(
|
Array.from(
|
||||||
@@ -50,25 +72,36 @@ function refreshLineup() {
|
|||||||
).forEach((slot, i) => {
|
).forEach((slot, i) => {
|
||||||
slot.querySelector("input[name*=sequence]").value = i;
|
slot.querySelector("input[name*=sequence]").value = i;
|
||||||
selected_position = slot.querySelector(".position-select-box option:checked");
|
selected_position = slot.querySelector(".position-select-box option:checked");
|
||||||
|
const flags = new Set(slot.querySelector("input[name*=flags]")?.value?.split(',')?.map(s=>s.trim())) || new Set()
|
||||||
|
|
||||||
|
if (slot.querySelector('[name=flag-dhd]').checked) {
|
||||||
|
flags.add('DHd')
|
||||||
|
} else {
|
||||||
|
flags.delete('DHd')
|
||||||
|
}
|
||||||
|
|
||||||
|
if (slot.querySelector('[name=flag-drd]').checked) {
|
||||||
|
flags.add('DRd')
|
||||||
|
} else {
|
||||||
|
flags.delete('DRd')
|
||||||
|
}
|
||||||
|
|
||||||
if (selected_position && selected_position.text != "--") {
|
if (selected_position && selected_position.text != "--") {
|
||||||
slot.querySelector("input[name*=label]").value = selected_position.text;
|
slot.querySelector("input[name*=label]").value = selected_position.text;
|
||||||
} else {
|
} else {
|
||||||
slot.querySelector("input[name*=label]").value = null;
|
slot.querySelector("input[name*=label]").value = null;
|
||||||
}
|
}
|
||||||
if (slot.closest('.position-only')){
|
if (slot.closest('.position-only')){
|
||||||
const flags = new Set(slot.querySelector("input[name*=flags]").value.split(',').map(s=>s.trim()))
|
|
||||||
flags.add('PO');flags.delete('')
|
flags.add('PO');flags.delete('')
|
||||||
slot.querySelector("input[name*=flags]").value = Array.from(flags).join(",");
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const flags = new Set(slot.querySelector("input[name*=flags]").value.split(',').map(s=>s.trim()))
|
|
||||||
flags.delete('PO');flags.delete('')
|
flags.delete('PO');flags.delete('')
|
||||||
slot.querySelector("input[name*=flags]").value = Array.from(flags).join(",");
|
|
||||||
}
|
}
|
||||||
if (slot.closest('.bench')){
|
if (slot.closest('.bench')){
|
||||||
slot.querySelector("input[name*=sequence]").value = '';
|
slot.querySelector("input[name*=sequence]").value = '';
|
||||||
slot.querySelector("input[name*=label]").value = '';
|
slot.querySelector("input[name*=label]").value = '';
|
||||||
}
|
}
|
||||||
|
slot.querySelector("input[name*=flags]").value = Array.from(flags).join(",");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -105,7 +138,7 @@ for (bcLineup of document.querySelectorAll("[id^=event-lineup]")) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (lineup_slot of document.querySelectorAll("[id^=lineup-out] .lineup-slot")) {
|
for (lineup_slot of document.querySelectorAll("[id^=lineup-out] .lineup-slot")) {
|
||||||
const cells = lineup_slot.querySelectorAll('.Panel-cell:has(.sequence), .Panel-cell:has(.drag-handle), .Panel-cell:has(.position-select-box) ')
|
const cells = lineup_slot.querySelectorAll('.Panel-cell:has(.sequence), .Panel-cell:has(.drag-handle), .Panel-cell:has(.position-select-box), div.position-label-flags')
|
||||||
Array.from(cells).forEach(cell=>{
|
Array.from(cells).forEach(cell=>{
|
||||||
cell.classList.add('u-hidden')
|
cell.classList.add('u-hidden')
|
||||||
})
|
})
|
||||||
@@ -503,7 +536,7 @@ function toggleChildSlots (element) {
|
|||||||
console.log(element.closest(".slot-set"))
|
console.log(element.closest(".slot-set"))
|
||||||
for (lineup_slot of document.querySelectorAll("[id^=lineup-out] .lineup-slot")) {
|
for (lineup_slot of document.querySelectorAll("[id^=lineup-out] .lineup-slot")) {
|
||||||
console.log(lineup_slot)
|
console.log(lineup_slot)
|
||||||
const cells = lineup_slot.querySelectorAll('.Panel-cell:has(.sequence), .Panel-cell:has(.drag-handle), .Panel-cell:has(.position-select-box) ')
|
const cells = lineup_slot.querySelectorAll('.Panel-cell:has(.sequence), .Panel-cell:has(.drag-handle), .Panel-cell:has(.position-select-box), div.position-label-flags ')
|
||||||
Array.from(cells).forEach(cell=>{
|
Array.from(cells).forEach(cell=>{
|
||||||
cell.classList.toggle('u-hidden')
|
cell.classList.toggle('u-hidden')
|
||||||
})
|
})
|
||||||
|
|||||||
23
src/public/manifest.json
Normal file
23
src/public/manifest.json
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"short_name": "BenchCoach",
|
||||||
|
"name": "BenchCoach: An assitant for TeamSnap",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "/media/benchcoach.svg",
|
||||||
|
"type": "image/svg+xml",
|
||||||
|
"sizes": "800x800"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/media/apple-touch-icon.png",
|
||||||
|
"type": "image/png",
|
||||||
|
"sizes": "120x120 180x180 167x167 152x152 80x80 120x120 58x58 87x87 76x76 114x114"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"id": "/",
|
||||||
|
"start_url": "/",
|
||||||
|
"background_color": "#323669",
|
||||||
|
"display": "standalone",
|
||||||
|
"scope": "/",
|
||||||
|
"theme_color": "#323669",
|
||||||
|
"description": "An assitant for TeamSnap"
|
||||||
|
}
|
||||||
@@ -15,6 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
@import "../../node_modules/@teamsnap/teamsnap-ui/src/css/teamsnap-ui.scss";
|
@import "../../node_modules/@teamsnap/teamsnap-ui/src/css/teamsnap-ui.scss";
|
||||||
|
@import url('/font/helvetica-now/stylesheet.css');
|
||||||
|
|
||||||
|
|
||||||
$color-success: #b7e1cd;
|
$color-success: #b7e1cd;
|
||||||
@@ -62,12 +63,54 @@ $monospace-font: "Inconsolata", monospace;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
header.Header {
|
header {
|
||||||
background: #323669;
|
background: #323669;
|
||||||
padding: 8px 0;
|
padding: 8px 0;
|
||||||
|
// margin: 0 0 16px 0;
|
||||||
box-shadow: 0 4px 0 rgba(0, 0, 25, 0.1);
|
box-shadow: 0 4px 0 rgba(0, 0, 25, 0.1);
|
||||||
border-bottom: 1px solid #d6d6d6;
|
border-bottom: 1px solid #d6d6d6;
|
||||||
color: white;
|
color: white;
|
||||||
|
text-decoration: none;
|
||||||
|
|
||||||
|
.Header-banner {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.filler {
|
||||||
|
flex-grow:1,
|
||||||
|
}
|
||||||
|
|
||||||
|
:has(>.Header-bannerLogo):has(>.Header-bannerTitle) {
|
||||||
|
display: inline-flex
|
||||||
|
}
|
||||||
|
|
||||||
|
.Header-bannerLogo, .Header-bannerTitle {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
margin-left: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Header-bannerLogo img {
|
||||||
|
height: 36px;
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Header-bannerTitle {
|
||||||
|
font-family: "Helvetica", sans-serif;
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: left;
|
||||||
|
color: white;
|
||||||
|
font-size: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn--Full {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
@@ -137,44 +180,10 @@ body {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Header-bannerLogo, .Header-bannerTitle {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
margin-left: 0.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.Header-bannerLogo img {
|
|
||||||
height: 36px;
|
|
||||||
width: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.Header-bannerTitle {
|
|
||||||
font-family: "Helvetica", sans-serif;
|
|
||||||
text-transform: uppercase;
|
|
||||||
font-weight: bold;
|
|
||||||
text-align: left;
|
|
||||||
color: white;
|
|
||||||
font-size: 28px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.benchcoach-nav {
|
|
||||||
background-color: #323669;
|
|
||||||
margin-bottom: 2em;
|
|
||||||
padding: 0.5em;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
a.Panel-row {
|
a.Panel-row {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
.benchcoach-nav h3 {
|
|
||||||
font-family: "Helvetica", sans-serif;
|
|
||||||
font-weight: bolder;
|
|
||||||
color: white;
|
|
||||||
text-transform: uppercase;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lineup-slot .Panel-cell {
|
.lineup-slot .Panel-cell {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{{>emailmodal}}
|
{{>emailmodal}}
|
||||||
<div id="event-lineup-{{event.id}}" data-event-lineup-id="{{event_lineup.id}}" data-event-id="{{event.id}}">
|
<div class="u-spaceAuto" id="event-lineup-{{event.id}}" data-event-lineup-id="{{event_lineup.id}}" data-event-id="{{event.id}}">
|
||||||
<form onsubmit="onSubmit(this,event)" action="#">
|
<form onsubmit="onSubmit(this,event)" action="#">
|
||||||
<input type="hidden" name="event_lineup_id" value="{{event_lineup.id}}">
|
<input type="hidden" name="event_lineup_id" value="{{event_lineup.id}}">
|
||||||
{{!-- <input type="hidden" name="_csrf" value="{{csrfToken}}"> --}}
|
{{!-- <input type="hidden" name="_csrf" value="{{csrfToken}}"> --}}
|
||||||
@@ -92,11 +92,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="lineup-out-{{event.id}}" class="Panel u-maxWidthSm out Panel--full">
|
<div id="lineup-out-{{event.id}}" class="Panel u-maxWidthSm out Panel--full">
|
||||||
<div class="Panel-row Panel-title u-padXs">
|
<div class="Panel-row Panel-title u-padXs u-flex">
|
||||||
<span style="flex: 1 1 0%;">{{{embeddedSvgFromPath "/bootstrap-icons/clipboard-x.svg"}}}Out</span>
|
<div><span style="flex: 1 1 0%;">{{{embeddedSvgFromPath "/bootstrap-icons/clipboard-x.svg"}}}Out</span></div>
|
||||||
|
<div class="u-flexGrow1"></div>
|
||||||
<div class="Toggle">
|
<div class="Toggle">
|
||||||
<input class="Toggle-input" type="checkbox" id="enable-slots" onclick="toggleChildSlots(this);">
|
<input class="Toggle-input" type="checkbox" id="enable-slots" onclick="toggleChildSlots(this);">
|
||||||
<label class="Toggle-label" for="availability-tab"></label>
|
<label class="Toggle-label" for="enable-slots"></label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="slot-set">
|
<div class="slot-set">
|
||||||
@@ -115,6 +116,7 @@
|
|||||||
<script>
|
<script>
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
colorPositions();
|
colorPositions();
|
||||||
|
initFlagsCheckboxes();
|
||||||
refreshLineup();
|
refreshLineup();
|
||||||
tinymce.init({
|
tinymce.init({
|
||||||
selector:"#email-editor",
|
selector:"#email-editor",
|
||||||
|
|||||||
@@ -11,10 +11,10 @@
|
|||||||
{{#if (isInStartingLineup this)}}
|
{{#if (isInStartingLineup this)}}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="sequence-cell">
|
<td class="sequence-cell">
|
||||||
{{plus1 this.benchcoach.eventLineupEntry.sequence}}
|
{{plus1 this.benchcoach.eventLineupEntry.sequence}}{{#if (hasPositionFlags this.benchcoach.eventLineupEntry.label)}} {{positionFlags this.benchcoach.eventLineupEntry.label}}{{/if}}
|
||||||
</td>
|
</td>
|
||||||
<td class="name-cell">{{this.lastName}}, {{this.firstName}} – #{{this.jerseyNumber}}</td>
|
<td class="name-cell">{{this.lastName}}, {{this.firstName}} – #{{this.jerseyNumber}}</td>
|
||||||
<td class="position-label-cell">{{this.benchcoach.eventLineupEntry.label}}</td>
|
<td class="position-label-cell">{{positionLabelWithoutFlags this.benchcoach.eventLineupEntry.label}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="sequence-cell"></td>
|
<td class="sequence-cell"></td>
|
||||||
<td class="name-cell">{{this.lastName}}, {{this.firstName}} – #{{this.jerseyNumber}}</td>
|
<td class="name-cell">{{this.lastName}}, {{this.firstName}} – #{{this.jerseyNumber}}</td>
|
||||||
<td class="position-label-cell">{{this.benchcoach.eventLineupEntry.label}}</td>
|
<td class="position-label-cell">{{positionLabelWithoutPOFlag this.benchcoach.eventLineupEntry.label}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|||||||
@@ -15,14 +15,15 @@
|
|||||||
class="Panel-cell Panel-cell--header">
|
class="Panel-cell Panel-cell--header">
|
||||||
<div class="sequence u-textNoWrap u-fontSizeLg"></div>
|
<div class="sequence u-textNoWrap u-fontSizeLg"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="Panel-cell u-padXs u-sizeFill">
|
<div class="Panel-cell u-padXs u-sizeFill u-flex">
|
||||||
<div
|
<div
|
||||||
class="d-flex availability-status-code-{{
|
class="availability-status-code-{{
|
||||||
member.benchcoach.availability?.statusCode
|
member.benchcoach.availability?.statusCode
|
||||||
}}"
|
}}"
|
||||||
>
|
>
|
||||||
<div class="u-flexInline u-fontSizeLg u-textNoWrap">
|
{{#if member.benchcoach.availability}}{{{avail_status_code_icon member.benchcoach.availability.statusCode}}}{{/if}}
|
||||||
{{#if member.benchcoach.availability}}{{{avail_status_code_icon member.benchcoach.availability.statusCode}}}{{/if}}
|
</div>
|
||||||
|
<div class="u-fontSizeLg u-textNoWrap">
|
||||||
<span class="lastname">
|
<span class="lastname">
|
||||||
{{member.lastName}}
|
{{member.lastName}}
|
||||||
</span>
|
</span>
|
||||||
@@ -32,6 +33,16 @@
|
|||||||
<span class="jerseynumber u-hidden u-sm-inline u-fontSizeSm">
|
<span class="jerseynumber u-hidden u-sm-inline u-fontSizeSm">
|
||||||
#{{member.jerseyNumber}}
|
#{{member.jerseyNumber}}
|
||||||
</span>
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="u-flexGrow1"></div>
|
||||||
|
<div class="position-label-flags">
|
||||||
|
<div class="Checkbox Checkbox--inline">
|
||||||
|
<input class="Checkbox-input" type="checkbox" name="flag-drd" id="flag-drd-{{member.id}}-{{member.benchcoach.eventLineupEntry.id}}" onclick="refreshLineup()">
|
||||||
|
<label class="Checkbox-label" for="flag-drd-{{member.id}}-{{member.benchcoach.eventLineupEntry.id}}">DR<small>d</small></label>
|
||||||
|
</div>
|
||||||
|
<div class="Checkbox Checkbox--inline">
|
||||||
|
<input class="Checkbox-input" type="checkbox" name="flag-dhd" id="flag-dhd-{{member.id}}-{{member.benchcoach.eventLineupEntry.id}}" onclick="refreshLineup()">
|
||||||
|
<label class="Checkbox-label" for="flag-dhd-{{member.id}}-{{member.benchcoach.eventLineupEntry.id}}">DH<small>d</small></label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -174,7 +174,7 @@
|
|||||||
<th>{{event.opponentName}}</th>
|
<th>{{event.opponentName}}</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="height:5em;"></td>
|
<td style="height:5em;width: 50%;"></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
|
<link rel="manifest" href="/manifest.json">
|
||||||
<link rel="stylesheet" href="/css/application.css">
|
<link rel="stylesheet" href="/css/application.css">
|
||||||
{{#if style}}<link rel="stylesheet" href="/css/{{style}}">{{/if}}
|
{{#if style}}<link rel="stylesheet" href="/css/{{style}}">{{/if}}
|
||||||
<title>{{#if title}}{{title}}{{else}}BenchCoach{{/if}}</title>
|
<title>{{#if title}}{{title}}{{else}}BenchCoach{{/if}}</title>
|
||||||
@@ -19,13 +20,13 @@
|
|||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="bg-light">
|
<body>
|
||||||
<header class="Header">
|
<header>
|
||||||
{{> navbar }}
|
{{> navbar }}
|
||||||
{{{_sections.header}}}
|
{{{_sections.header}}}
|
||||||
</header>
|
</header>
|
||||||
<div class="u-padSidesMd u-xs-padSidesLg">
|
<div class="u-padSidesMd u-xs-padSidesLg">
|
||||||
<div class="u-max1200 u-flexExpandSides u-xs-size5of6 u-sm-size2of3 u-md-sizeFull u-padBottomMd u-xs-padEndsLg u-sm-padEndsXl">
|
<div class="u-max1200 u-flexExpandSides u-xs-size5of6 u-sm-size2of3 u-md-sizeFull u-padEndsLg u-sm-padEndsXl">
|
||||||
{{{ body }}}
|
{{{ body }}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,27 +1,10 @@
|
|||||||
<div class="Grid Grid--fit Grid--withGutter u-max1200 u-flexExpandSides u-xs-size5of6 u-sm-size2of3 u-md-sizeFull u-padBottomMd u-xs-padEndsLg u-sm-padEndsXl">
|
<div class="Panel u-maxWidthXs u-padLg u-spaceSidesAuto">
|
||||||
<div class="Grid-cell u-size5of12">
|
<h1 class="u-textCenter">Sign in</h1>
|
||||||
<div class="Panel u-padLg u-spaceSidesAuto">
|
<p class="u-spaceEndsMd">Sign into BenchCoach using your TeamSnap account</p>
|
||||||
<h1 class="u-spaceSidesAuto u-spaceBottomLg">Sign in</h1>
|
<a class="Button Button--large Button--orange u-spaceSidesAuto btn--Full" href="/login/federated/teamsnap">
|
||||||
<div>
|
{{{embeddedSvgFromPath "/media/teamsnap_star.svg"}}}
|
||||||
<a class="Button Button--large Button--orange u-spaceSidesAuto" href="/login/federated/teamsnap">
|
<span>TeamSnap</span>
|
||||||
{{{embeddedSvgFromPath "/media/teamsnap_star.svg"}}}
|
</a>
|
||||||
<span>TeamSnap</span>
|
</div>
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="Grid-cell u-size7of12 u-textCenter">
|
|
||||||
<h1>
|
|
||||||
<img src="/media/benchcoach.svg" style="width: 2.5em;">
|
|
||||||
</h1>
|
|
||||||
<h1>
|
|
||||||
<strong>
|
|
||||||
Welcome to
|
|
||||||
<span class="text-nowrap">BenchCoach</span>
|
|
||||||
</strong>
|
|
||||||
</h1>
|
|
||||||
<div class="lead fst-italic fw-light">
|
|
||||||
An assistant coach for TeamSnap
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@@ -1,40 +1,39 @@
|
|||||||
<div class="Header-container Grid u-flexAlignItemsCenter">
|
<div class="Header-banner">
|
||||||
<div class="Grid-cell u-sizeFill">
|
<a href="/" class="">
|
||||||
<div class="Header-banner Grid u-flexAlignItemsCenter">
|
<div class="Header-bannerLogo">
|
||||||
<a href="/" class="Grid-cell u-sizeFit u-flexInline u-flexAlignItemsCenter u-textDecorationNone">
|
<img class="logo" src="/media/benchcoach.svg" alt="BenchCoach Logo">
|
||||||
<div class="Header-bannerLogo">
|
</div>
|
||||||
<img class="logo" src="/media/benchcoach.svg" alt="BenchCoach Logo">
|
<div class="Header-bannerTitle">
|
||||||
</div>
|
BenchCoach
|
||||||
</a>
|
</div>
|
||||||
<div class="Grid-cell u-flexInline u-flexJustifyEnd u-sizeFill u-padSidesSm">
|
</a>
|
||||||
{{#if user}}
|
{{#if user}}
|
||||||
<div class="Popup">
|
<div class="filler"></div>
|
||||||
<div class="Button Button--small Popup-toggle" onclick="this.closest('.Popup').querySelector('.Popup-container').classList.toggle('is-open')">
|
<div class="u-padSidesSm u-spaceAuto">
|
||||||
Account
|
<div class="Popup">
|
||||||
</div>
|
<div class="Button Button--small Popup-toggle" onclick="this.closest('.Popup').querySelector('.Popup-container').classList.toggle('is-open')">
|
||||||
<div class="Popup-container Popup-container--down Popup-container--right u-sizeFit">
|
Account
|
||||||
<div class="Popup-content u-padXs u-sizeFit u-fontSizeSm">
|
</div>
|
||||||
<h6 class="h6 title u-textNoWrap u-fontSizeSm u-textSemiBold">{{user.first_name}} {{user.last_name}}</h6>
|
<div class="Popup-container Popup-container--down Popup-container--right u-sizeFit">
|
||||||
<div class="u-textNoWrap u-fontSizeSm">{{user.email}}</div>
|
<div class="Popup-content u-padXs u-sizeFit u-fontSizeSm">
|
||||||
<hr class="Divider u-spaceEndsNone">
|
<h6 class="h6 title u-textNoWrap u-fontSizeSm u-textSemiBold">{{user.first_name}} {{user.last_name}}</h6>
|
||||||
<div class="u-padBottomSm u-padTopSm">
|
<div class="u-textNoWrap u-fontSizeSm">{{user.email}}</div>
|
||||||
<a href="/user/{{user.id}}/teams" class="u-spaceBottomSm Button Button--small">
|
<hr class="Divider u-spaceEndsNone">
|
||||||
<span>{{{embeddedSvgFromPath "/teamsnap-ui/assets/icons/team.svg"}}}</span>
|
<div class="u-padBottomSm u-padTopSm">
|
||||||
Teams
|
<a href="/user/{{user.id}}/teams" class="u-spaceBottomSm Button Button--small">
|
||||||
</a>
|
<span>{{{embeddedSvgFromPath "/teamsnap-ui/assets/icons/team.svg"}}}</span>
|
||||||
<form method="post" action="/logout">
|
Teams
|
||||||
<button type="submit" name="logout" class="u-spaceBottomSm Button Button--small">
|
</a>
|
||||||
Logout
|
<form method="post" action="/logout">
|
||||||
</button>
|
<button type="submit" name="logout" class="u-spaceBottomSm Button Button--small">
|
||||||
</form>
|
Logout
|
||||||
</div>
|
</button>
|
||||||
</div>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{/if}}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{{/if}}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user