resolve merge conflicts

This commit is contained in:
2022-06-10 08:59:22 -05:00
126 changed files with 1459 additions and 299 deletions

View File

@@ -1,38 +0,0 @@
@page { margin: 0 }
body { margin: 0 }
.sheet {
margin: 0;
overflow: hidden;
position: relative;
box-sizing: border-box;
page-break-after: always;
}
/** Paper sizes **/
body.A3 .sheet { width: 297mm; height: 419mm }
body.A3.landscape .sheet { width: 420mm; height: 296mm }
body.A4 .sheet { width: 210mm; height: 296mm }
body.A4.landscape .sheet { width: 297mm; height: 209mm }
body.A5 .sheet { width: 148mm; height: 209mm }
body.A5.landscape .sheet { width: 210mm; height: 147mm }
body.letter .sheet { width: 216mm; height: 279mm }
body.letter.landscape .sheet { width: 280mm; height: 215mm }
body.legal .sheet { width: 216mm; height: 356mm }
body.legal.landscape .sheet { width: 357mm; height: 215mm }
/** Padding area **/
.sheet.padding-10mm { padding: 10mm }
.sheet.padding-15mm { padding: 15mm }
.sheet.padding-20mm { padding: 20mm }
.sheet.padding-25mm { padding: 25mm }
/** Fix for Chrome issue #273306 **/
@media print {
body.A3.landscape { width: 420mm }
body.A3, body.A4.landscape { width: 297mm }
body.A4, body.A5.landscape { width: 210mm }
body.A5 { width: 148mm }
body.letter, body.legal { width: 216mm }
body.letter.landscape { width: 280mm }
body.legal.landscape { width: 357mm }
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,123 @@
@font-face {
font-family: "DINPro";
font-weight: 800;
src: url("DINPro-Black.otf") format("opentype");
}
@font-face {
font-family: "DINPro";
font-weight: 800;
font-style: italic;
src: url("DINPro-BlackItalic.otf") format("opentype");
}
@font-face {
font-family: "DINPro";
font-weight: bold;
src: url("DINPro-Bold.otf") format("opentype");
}
@font-face {
font-family: "DINPro";
font-weight: bold;
font-style: italic;
src: url("DINPro-BoldItalic.otf") format("opentype");
}
@font-face {
font-family: "DINPro";
font-stretch: condensed;
src: url("DINPro-Cond.otf") format("opentype");
}
@font-face {
font-family: "DINPro";
font-stretch: condensed;
font-weight: 800;
src: url("DINPro-CondBlack.otf") format("opentype");
}
@font-face {
font-family: "DINPro";
font-stretch: condensed;
font-weight: 800;
font-style: italic;
src: url("DINPro-CondBlackIta.otf") format("opentype");
}
@font-face {
font-family: "DINPro";
font-stretch: condensed;
font-weight: bold;
src: url("DINPro-CondBold.otf") format("opentype");
}
@font-face {
font-family: "DINPro";
font-stretch: condensed;
font-weight: bold;
font-style: italic;
src: url("DINPro-CondBoldIta.otf") format("opentype");
}
@font-face {
font-family: "DINPro";
font-stretch: condensed;
font-style: italic;
src: url("DINPro-CondIta.otf") format("opentype");
}
@font-face {
font-family: "DINPro";
font-stretch: condensed;
font-weight: 300;
src: url("DINPro-CondLight.otf") format("opentype");
}
@font-face {
font-family: "DINPro";
font-stretch: condensed;
font-weight: 300;
font-style: italic;
src: url("DINPro-CondLightIta.otf") format("opentype");
}
@font-face {
font-family: "DINPro";
font-stretch: condensed;
font-: Medi;
font-style: italic;
src: url("DINPro-CondMediIta.otf") format("opentype");
}
@font-face {
font-family: "DINPro";
font-stretch: condensed;
font-: Medium;
src: url("DINPro-CondMedium.otf") format("opentype");
}
@font-face {
font-family: "DINPro";
font-style: italic;
src: url("DINPro-Italic.otf") format("opentype");
}
@font-face {
font-family: "DINPro";
font-weight: 300;
src: url("DINPro-Light.otf") format("opentype");
}
@font-face {
font-family: "DINPro";
font-weight: 300;
font-style: italic;
src: url("DINPro-LightItalic.otf") format("opentype");
}
@font-face {
font-family: "DINPro";
font-: Medium;
src: url("DINPro-Medium.otf") format("opentype");
}
@font-face {
font-family: "DINPro";
font-: Medium;
font-style: italic;
src: url("DINPro-MediumItalic.otf") format("opentype");
}
@font-face {
font-family: "DINPro";
font-style: normal;
font-weight: normal;
src: url("DINPro.otf") format("opentype");
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,26 @@
@font-face {
font-family: "refigerator";
font-weight: bold;
src: url("refrigerator-deluxe-bold.otf") format("opentype");
}
@font-face {
font-family: "refigerator";
font-weight: extrabold;
src: url("refrigerator-deluxe-extrabold.otf") format("opentype");
}
@font-face {
font-family: "refigerator";
font-weight: heavy;
src: url("refrigerator-deluxe-heavy.otf") format("opentype");
}
@font-face {
font-family: "refigerator";
font-weight: light;
src: url("refrigerator-deluxe-light.otf") format("opentype");
}
@font-face {
font-family: "refigerator";
font-weight: normal;
font-style: normal;
src: url("refrigerator-deluxe.otf") format("opentype");
}

View File

@@ -1,432 +0,0 @@
/* Project specific Javascript goes here. */
function positionSelectChanged(elem) {
let row = elem.parentElement.parentElement
let original_table = elem.parentElement.parentElement.parentElement
let lineup_table = document.getElementById('lineup')
let bench_table = document.getElementById('bench')
let dhd_table = document.getElementById('dhd')
let player_order = row.querySelector('[id^="player-order"]')
let player_available = row.querySelector('[id^="player-availability"]')
console.dir(original_table == bench_table)
if (elem.value == "P" && original_table == bench_table ) {
dhd_table.appendChild(row)
player_order.classList.remove('d-none')
// player_available.classList.add('d-none')
refresh_lineup_order()
}
else if (elem.value && original_table == dhd_table ) {
dhd_table.appendChild(row)
player_order.classList.remove('d-none')
// player_available.classList.add('d-none')
refresh_lineup_order()
}
else if (elem.value) {
lineup_table.appendChild(row)
player_order.classList.remove('d-none')
// player_available.classList.add('d-none')
refresh_lineup_order()
}
else {
bench_table.prepend(row)
// player_order.classList.add('d-none')
player_available.classList.remove('d-none')
}
}
function colorPositions() {
for (bcLineup of document.getElementsByClassName("benchcoach-lineup")) {
var player_rows = bcLineup.querySelectorAll('tr');
// player_rows.push.apply(player_rows, document.getElementsByClassName('benchcoach-lineup').querySelectorAll('tr'));
// player_rows.push.apply(player_rows, document.getElementsByClassName('benchcoach-bench').querySelectorAll('tr'));
var label_value_array = []
player_rows.forEach(function (player_row, index) {
if (player_row.querySelector('[name$="label"]')) {
label_value_array.push(
player_row.querySelector('select[name$="label"]').value)
}
}
)
bcLineup.querySelectorAll('[id^="position-status"]').forEach(function (position_status, index) {
if (label_value_array.includes(position_status.innerHTML)) {
if (position_status.classList.contains("text-danger")) {
position_status.classList.remove('text-danger')
}
position_status.classList.add('text-success')
} else {
if (position_status.classList.contains("text-success")) {
position_status.classList.remove('text-success')
}
position_status.classList.add('text-danger')
}
// console.dir(position_status)
})
// console.dir(label_value_array)
}
}
function refresh_lineup_order (itemEl){
let bcLineup = itemEl.closest(".benchcoach-lineup")
var player_rows = []
for (tbody of bcLineup.querySelectorAll("[class*='tbody-benchcoach-starting']")){
for (row of tbody.rows){
player_rows.push(row)
}
}
for (let i = 0; i < player_rows.length; i++) {
var player_order = player_rows[i].querySelector('[id^="sequence"]')
var form_element_order = player_rows[i].querySelector('[id$="sequence"]')
player_order.innerText = parseInt(player_rows[i].dataset.order)
player_rows[i].dataset.order = i
form_element_order.value = i
player_order.innerHTML = i+1
}
var player_rows = bcLineup.getElementsByClassName("tbody-benchcoach-bench")[0].rows
for (let i = 0; i < player_rows.length; i++) {
var player_order = player_rows[i].querySelector('[id^="sequence"]')
var form_element_order = player_rows[i].querySelector('[id$="sequence"]')
player_rows[i].dataset.order = null
form_element_order.value = null
player_order.innerHTML = null
}
}
function sendToClipboard(itemEl){
let bcLineup = itemEl.closest(".benchcoach-lineup")
player_rows = bcLineup.querySelectorAll("[data-position=P]")
lineup_export = []
if (player_rows.length > 0){
lineup_export.push(player_rows[0].dataset.playerName)
lineup_export.push("","")
} else {
lineup_export.push("","","")
}
lineup_export.push("")
for (position of [
'C',
'1B',
'2B',
'3B',
'SS',
'LF',
'CF',
'RF',
'DH',
]
) {
var player_rows = bcLineup.querySelectorAll(`[data-position=${CSS.escape(position)}]`)
if (player_rows.length > 0){
lineup_export.push(player_rows[0].dataset.playerName)
} else {
lineup_export.push('')
}
}
for (position of [
'EH',
]
) {
var player_rows = bcLineup.querySelectorAll(`[data-position=${CSS.escape(position)}]`)
for (var i = 0; i < 2; i++) {
if (i < player_rows.length){
lineup_export.push(player_rows[i].dataset.playerName)
} else {
lineup_export.push("")
}
}
}
for (position of [
'DR',
]
) {
let player_rows = bcLineup.querySelectorAll(`[data-position=${CSS.escape(position)}]`)
if (player_rows.length > 0){
lineup_export.push(player_rows[0].dataset.playerName)
} else {
lineup_export.push('')
}
}
lineup_export.push("")
lineup_export.push("","")
lineup_export.push("")
for (var i = 0; i < 11; i++) {
let player_rows = bcLineup.querySelector('.table-benchcoach-startinglineup').querySelectorAll(`[data-order=${CSS.escape(i)}]`)
if (player_rows.length > 0){
lineup_export.push(player_rows[0].dataset.playerName)
} else {
lineup_export.push("")
}
}
console.dir(lineup_export)
var textArea = document.createElement("textarea");
textArea.value = lineup_export.join("\n");
// Avoid scrolling to bottom
textArea.style.top = "0";
textArea.style.left = "0";
textArea.style.position = "fixed";
document.body.appendChild(textArea);
textArea.focus();
textArea.select();
try {
var successful = document.execCommand('copy');
var msg = successful ? 'successful' : 'unsuccessful';
console.log('Copying text command was ' + msg);
} catch (err) {
console.error('Oops, unable to copy', err);
}
document.body.removeChild(textArea);
}
benchcoach_lineups = document.getElementsByClassName("benchcoach-lineup")
for (bcLineup of document.getElementsByClassName("benchcoach-lineup")) {
var startinglineup = new Sortable.create(
bcLineup.getElementsByClassName("tbody-benchcoach-startinglineup")[0], {
animation: 150,
handle: ".drag-handle",
ghostClass:"ghost",
group:{
name:bcLineup.id,
put:[bcLineup.id],
pull:[bcLineup.id]
},
onAdd: function (/**Event*/evt) {
// Add to Lineup
var itemEl = evt.item; // dragged HTMLElement
var player_order = itemEl.querySelector('[id^="sequence-member"]')
var player_available =itemEl.querySelector('[class^="member-availability-status"]')
refresh_lineup_order(itemEl)
if (player_order.classList.contains('d-none')){
player_order.classList.remove('d-none')
}
// player_available.classList.add('d-none')
},
onUpdate: function (/**Event*/evt) {
console.log('update to lineup')
var itemEl = evt.item; // dragged HTMLElement
refresh_lineup_order(itemEl)
},
});
var bench = new Sortable.create(
bcLineup.getElementsByClassName("tbody-benchcoach-bench")[0], {
animation: 150,
ghostClass:"ghost",
sort: false,
handle: ".drag-handle",
// handle: ".bars-move",
group:{
name:bcLineup.id,
put:[bcLineup.id],
pull:[bcLineup.id]
},
onAdd: function (/**Event*/evt) {
var itemEl = evt.item; // dragged HTMLElement
var player_order = itemEl.querySelector('[id^="sequence-member"]')
var player_available =itemEl.querySelector('[class^="member-availability-status"]')
refresh_lineup_order(itemEl)
// player_order.classList.add('d-none')
if (player_order.classList.contains('d-none')){
player_available.classList.remove('d-none')
}
}
});
var positionalonlylineup = new Sortable.create(
bcLineup.getElementsByClassName("tbody-benchcoach-startingpositionalonly")[0], {
handle: ".drag-handle",
group:{
name:bcLineup.id,
put:[bcLineup.id],
pull:[bcLineup.id]
},
onAdd: function (/**Event*/evt) {
var itemEl = evt.item; // dragged HTMLElement
var player_order = itemEl.querySelector('[id^="sequence-member"]')
var position_only = itemEl.querySelector('[id$="position_only"]')
position_only.value = true
var player_available =itemEl.querySelector('[class^="member-availability-status"]')
refresh_lineup_order(itemEl)
// player_order.classList.add('d-none')
if (player_order.classList.contains('d-none')){
player_available.classList.remove('d-none')
}
},
onRemove: function (/**Event*/evt) {
var itemEl = evt.item; // dragged HTMLElement
var player_order = itemEl.querySelector('[id^="sequence-member"]')
var player_available =itemEl.querySelector('[class^="member-availability-status"]')
var position_only = itemEl.querySelector('[id$="position_only"]')
position_only.value = false
if (player_order.classList.contains('d-none')){
player_available.classList.remove('d-none')
}
},
onUpdate: function (/**Event*/evt) {
var itemEl = evt.item; // dragged HTMLElement
refresh_lineup_order(itemEl)
},
}
)
}
function copyEmailTable(itemEl, subject, recipients){
// Create container for the HTML
// [1]
let bcLineup = itemEl.closest(".benchcoach-lineup")
var container = document.createElement('div')
var tbl = document.createElement('table')
let thead = tbl.createTHead()
let thead_row = thead.insertRow()
let thead_row_cell = thead_row.insertCell()
thead_row_cell.appendChild(document.createElement("h3").appendChild(document.createTextNode("STARTING LINEUP")))
thead_row_cell.colSpan=3;
thead_row_cell.classList.add('title-cell')
var tbody = tbl.createTBody()
for (row of bcLineup.querySelector(".table-benchcoach-startinglineup").rows) {
let tr = tbody.insertRow()
cell = tr.insertCell()
cell.classList.add('sequence-cell')
cell.appendChild(document.createTextNode((parseInt(row.dataset.order) + 1)))
cell = tr.insertCell()
cell.appendChild(document.createTextNode(row.dataset.playerName))
cell.classList.add('name-cell')
tr.insertCell().appendChild(document.createTextNode(row.dataset.position))
}
if (bcLineup.querySelector('.table-benchcoach-startingpositionalonly').rows.length > 0) {
var tr = tbody.insertRow()
cell = tr.insertCell()
cell.colSpan=3
cell.appendChild(document.createTextNode("STARTING (POS. ONLY)"))
cell.classList.add('title-cell')
for (row of bcLineup.querySelector('.table-benchcoach-startingpositionalonly').rows) {
var tr = tbody.insertRow()
cell = tr.insertCell()
cell.classList.add('sequence-cell')
cell.appendChild(document.createTextNode(""))
cell=tr.insertCell()
cell.appendChild(document.createTextNode(row.dataset.playerName))
cell.classList.add('name-cell')
tr.insertCell().appendChild(document.createTextNode(row.dataset.position))
}
}
if (bcLineup.querySelector('.table-benchcoach-bench').rows.length > 0) {
var tr = tbody.insertRow()
cell = tr.insertCell()
cell.colSpan=3
cell.appendChild(document.createTextNode("SUBS"))
cell.classList.add('title-cell')
for (row of bcLineup.querySelector('.table-benchcoach-bench').rows) {
var tr = tbody.insertRow()
cell = tr.insertCell()
cell.classList.add('sequence-cell')
availability_status = {
None: "UNK",
"0": "NO",
"2": "MAY",
"1":"YES"
}[row.dataset.availabilityStatuscode]
cell.appendChild(document.createTextNode(availability_status))
cell=tr.insertCell()
cell.appendChild(document.createTextNode(row.dataset.playerName))
cell.classList.add('name-cell')
tr.insertCell().appendChild(document.createTextNode(""))
}
}
if (bcLineup.querySelector('.table-benchcoach-out').rows.length > 0) {
var tr = tbody.insertRow()
cell = tr.insertCell()
cell.colSpan=3
cell.appendChild(document.createTextNode("OUT"))
cell.classList.add('title-cell')
for (row of bcLineup.querySelector('.table-benchcoach-out').rows) {
var tr = tbody.insertRow()
cell = tr.insertCell()
cell.classList.add('sequence-cell')
availability_status = {
"None": "UNK",
"0": "NO",
"1": "MAY",
"2":"YES"
}[row.dataset.availabilityStatuscode]
cell.appendChild(document.createTextNode(availability_status))
tr.insertCell().appendChild(document.createTextNode(row.dataset.playerName))
tr.insertCell().appendChild(document.createTextNode(""))
}
}
container.appendChild(tbl)
for (cell of container.getElementsByClassName('title-cell')){
cell.setAttribute (
"style",
"font-weight:bold;background-color:#323669;color:#fff;padding:2px 5px;"
)}
for (cell of container.getElementsByClassName('sequence-cell')){
cell.setAttribute (
"style",
"font-weight:bold;padding:2px 5px;"
)}
for (cell of container.getElementsByClassName('name-cell')){
cell.setAttribute (
"style",
"width:200px;"
)}
// Detect all style sheets of the page
var activeSheets = Array.prototype.slice.call(document.styleSheets)
.filter(function (sheet) {
return !sheet.disabled
})
// Mount the container to the DOM to make `contentWindow` available
// [3]
document.body.appendChild(container)
// Copy to clipboard
// [4]
window.getSelection().removeAllRanges()
var range = document.createRange()
range.selectNode(container)
window.getSelection().addRange(range)
// [5.1]
document.execCommand('copy')
// [5.2]
for (var i = 0; i < activeSheets.length; i++) activeSheets[i].disabled = true
// [5.3]
// document.execCommand('copy')
// [5.4]
for (var i = 0; i < activeSheets.length; i++) activeSheets[i].disabled = false
// Remove the container
// [6]
document.body.removeChild(container)
subject_encoded = encodeURIComponent(subject)
window.open("readdle-spark://compose?recipient=manager@chihounds.com&subject="+subject+"&bcc="+recipients)
}
colorPositions()

View File

@@ -28,8 +28,6 @@
<!-- Your stuff: Third-party javascript libraries go here -->
<!-- place project specific Javascript in this file -->
<script defer src="{% static 'js/project.js' %}"></script>
<script defer src="{% static 'js/Sortable.js' %}"></script>
<script src="{% static 'js/chart.js' %}"></script>
{% endblock javascript %}