add compose box to email

This commit is contained in:
2024-03-09 16:41:08 -06:00
parent 35d6eba599
commit 39d1a37043
10 changed files with 231 additions and 97 deletions

View File

@@ -111,10 +111,19 @@
</div>
<script src="https://cdn.jsdelivr.net/npm/sortablejs@latest/Sortable.min.js"></script>
<script src="/js/eventlineup.js"></script>
<script src="/js/tinymce.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
colorPositions();
refreshLineup();
tinymce.init({
selector:"#email-editor",
content_css:"/css/application.css",
plugins: 'image',
menubar: false,
toolbar: 'undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | outdent indent | image',
paste_data_images: true,
statusbar:false})
})
</script>

View File

@@ -1,90 +1,70 @@
<div class="lineup-email">
<table>
<thead>
<tr>
<th class="title-cell" colSpan=3>
STARTING LINEUP
</th>
</tr>
</thead>
<tbody>
{{#each members}}
{{#if (isInStartingLineup this)}}
<div>
<p>Team,</p>
<p></p>
</div>
<div>
<table>
<thead>
<tr>
<th class="title-cell" colSpan=3>
STARTING LINEUP
</th>
</tr>
</thead>
<tbody>
{{#each members}}
{{#if (isInStartingLineup this)}}
<tr>
<td class="sequence-cell">
{{plus1 this.benchcoach.eventLineupEntry.sequence}}
</td>
<td class="name-cell">{{this.lastName}}, {{this.firstName}} #{{this.jerseyNumber}}</td>
<td class="position-label-cell">{{this.benchcoach.eventLineupEntry.label}}</td>
</tr>
{{/if}}
{{/each}}
<tr>
<td class="sequence-cell">
{{plus1 this.benchcoach.eventLineupEntry.sequence}}
</td>
<td class="name-cell">{{this.lastName}}, {{this.firstName}} #{{this.jerseyNumber}}</td>
<td class="position-label-cell">{{this.benchcoach.eventLineupEntry.label}}</td>
</tr>
{{/if}}
{{/each}}
<tr>
<th class="title-cell" colSpan=3>Starting (Pos. Only)</th>
</tr>
{{#each members}}
{{#if (isInPositionOnly this)}}
<th class="title-cell" colSpan=3>Starting (Pos. Only)</th>
</tr>
{{#each members}}
{{#if (isInPositionOnly this)}}
<tr>
<td class="sequence-cell"></td>
<td class="name-cell">{{this.lastName}}, {{this.firstName}} #{{this.jerseyNumber}}</td>
<td class="position-label-cell">{{this.benchcoach.eventLineupEntry.label}}</td>
</tr>
{{/if}}
{{/each}}
<tr>
<td class="sequence-cell"></td>
<td class="name-cell">{{this.lastName}}, {{this.firstName}} #{{this.jerseyNumber}}</td>
<td class="position-label-cell">{{this.benchcoach.eventLineupEntry.label}}</td>
</tr>
{{/if}}
{{/each}}
<tr>
<th class="title-cell" colSpan=3>Subs</th>
</tr>
{{#each members}}
{{#if (isInBench this)}}
<th class="title-cell" colSpan=3>Subs</th>
</tr>
{{#each members}}
{{#if (isInBench this)}}
<tr>
<td class="sequence-cell">
{{availabilityStatusShort this.benchcoach.availability}}
</td>
<td class="name-cell">{{this.lastName}}, {{this.firstName}} #{{this.jerseyNumber}}</td>
<td class="position-label-cell">{{this.benchcoach.eventLineupEntry.label}}</td>
</tr>
{{/if}}
{{/each}}
<tr>
<td class="sequence-cell">
{{availabilityStatusShort this.benchcoach.availability}}
</td>
<td class="name-cell">{{this.lastName}}, {{this.firstName}} #{{this.jerseyNumber}}</td>
<td class="position-label-cell">{{this.benchcoach.eventLineupEntry.label}}</td>
</tr>
{{/if}}
{{/each}}
<tr>
<th class="title-cell out" colSpan=3>Out</th>
</tr>
{{#each members}}
{{#if (isInOut this)}}
<tr>
<td class="sequence-cell">
{{availabilityStatusShort this.benchcoach.availability}}
</td>
<td class="name-cell">{{this.lastName}}, {{this.firstName}} #{{this.jerseyNumber}}</td>
<td class="position-label-cell">{{this.benchcoach.eventLineupEntry.label}}</td>
</tr>
{{/if}}
{{/each}}
{{!-- <tr>
<tr>
<th>.title-cell colSpan=3 Subs
- for entry in event_lineup_entries.select{|e| e[:label].blank? and !(e[:availability_status_code] == "0" or e[:availability_status_code]== "")}
<tr>
<td>.sequence-cell
- if entry[:availability_status_code] == "1"
| YES
- if entry[:availability_status_code] == "2"
| MAY
<td>.name-cell
| #{entry[:member][:last_name]}, #{entry[:member][:first_name]} - ##{entry[:member][:jersey_number]}
<td>
<tr>
<th>.title-cell.out colSpan=3 Out
- for entry in event_lineup_entries.select{|e| e[:label].blank? and (e[:availability_status_code] == "0" or e[:availability_status_code]== "")}
<tr>
<td>.sequence-cell
- if entry[:availability_status_code] == "0"
| NO
- if entry[:availability_status_code] == ""
| UNK
<td>.name-cell
| #{entry[:member][:last_name]}, #{entry[:member][:first_name]} - ##{entry[:member][:jersey_number]}
<td> --}}
</tbody>
</table>
<th class="title-cell out" colSpan=3>Out</th>
</tr>
{{#each members}}
{{#if (isInOut this)}}
<tr>
<td class="sequence-cell">
{{availabilityStatusShort this.benchcoach.availability}}
</td>
<td class="name-cell">{{this.lastName}}, {{this.firstName}} #{{this.jerseyNumber}}</td>
<td class="position-label-cell">{{this.benchcoach.eventLineupEntry.label}}</td>
</tr>
{{/if}}
{{/each}}
</tbody>
</table>
</div>
</div>

View File

@@ -0,0 +1,62 @@
<table>
<thead>
<tr>
<th class="title-cell" colSpan=3>
STARTING LINEUP
</th>
</tr>
</thead>
<tbody>
{{#each members}}
{{#if (isInStartingLineup this)}}
<tr>
<td class="sequence-cell">
{{plus1 this.benchcoach.eventLineupEntry.sequence}}
</td>
<td class="name-cell">{{this.lastName}}, {{this.firstName}} #{{this.jerseyNumber}}</td>
<td class="position-label-cell">{{this.benchcoach.eventLineupEntry.label}}</td>
</tr>
{{/if}}
{{/each}}
<tr>
<th class="title-cell" colSpan=3>Starting (Pos. Only)</th>
</tr>
{{#each members}}
{{#if (isInPositionOnly this)}}
<tr>
<td class="sequence-cell"></td>
<td class="name-cell">{{this.lastName}}, {{this.firstName}} #{{this.jerseyNumber}}</td>
<td class="position-label-cell">{{this.benchcoach.eventLineupEntry.label}}</td>
</tr>
{{/if}}
{{/each}}
<tr>
<th class="title-cell" colSpan=3>Subs</th>
</tr>
{{#each members}}
{{#if (isInBench this)}}
<tr>
<td class="sequence-cell">
{{availabilityStatusShort this.benchcoach.availability}}
</td>
<td class="name-cell">{{this.lastName}}, {{this.firstName}} #{{this.jerseyNumber}}</td>
<td class="position-label-cell">{{this.benchcoach.eventLineupEntry.label}}</td>
</tr>
{{/if}}
{{/each}}
<tr>
<th class="title-cell out" colSpan=3>Out</th>
</tr>
{{#each members}}
{{#if (isInOut this)}}
<tr>
<td class="sequence-cell">
{{availabilityStatusShort this.benchcoach.availability}}
</td>
<td class="name-cell">{{this.lastName}}, {{this.firstName}} #{{this.jerseyNumber}}</td>
<td class="position-label-cell">{{this.benchcoach.eventLineupEntry.label}}</td>
</tr>
{{/if}}
{{/each}}
</tbody>
</table>

View File

@@ -4,13 +4,25 @@
<div onclick="javascript:this.closest('.Modal').classList.toggle('is-open')">{{{embeddedSvgFromPath "/teamsnap-ui/assets/icons/dismiss.svg" "Modal-iconDismiss"}}}</div>
<div class="Modal-header">
<div class="Modal-title">Email</div>
<div class="ButtonGroup">
<div class="Button" role="button" onclick="javascript:range=document.createRange();window.getSelection().removeAllRanges();range.selectNode(document.querySelector('.Modal').querySelector('.Modal-body')); window.getSelection().addRange(range);document.execCommand('copy');window.getSelection().removeAllRanges();">
{{{embeddedSvgFromPath "/bootstrap-icons/clipboard.svg"}}}
Copy to clipboard
</div>
</div>
<div class="Modal-body"></div>
</div>
<div class="Modal-body">
<form>
<div class="FieldGroup">
<label class="FieldGroup-label">Subject</label>
<input class="Input" type="text" value="{{dateFormat event.startDate "ddd, MMM D, YYYY h:mm A" }}, {{ event.locationName }}, ({{#if (isAway event) }}@{{/if}}{{ event.opponentName }})">
</div>
<div class="FieldGroup">
<label class="FieldGroup-label">Body</label>
<textarea id="email-editor" class="Input"></textarea>
</div>
<div class="FieldGroup">
<label class="FieldGroup-label">Lineup</label>
<div class="lineup-email"></div>
</div>
<div class="FieldGroup">
<button class="Button" role="button" onclick="submitEmail();">Submit</button>
</div>
</form>
</div>
</div>
</div>