feat: add a coordinator contact list
Saved people can be imported and added to an open shift without becoming a signup on import. Real mail is set up to use SMTP2GO once the API key and sender are configured.
This commit is contained in:
1 parent
f1a46e2ba7
commit
e8a5f9e352
20 files changed
+1857
-40
No files matched your search
@@ -974,6 +974,7 @@ article.shift-card {
|
||||
.signup-form input[type="text"],
|
||||
.signup-form input[type="email"],
|
||||
.signup-form input[type="tel"],
|
||||
.signup-form input[type="search"],
|
||||
.signup-form input[type="date"],
|
||||
.signup-form input[type="time"],
|
||||
.signup-form input[type="number"],
|
||||
@@ -1823,6 +1824,50 @@ button.btn-quiet::before {
|
||||
max-width: 18rem;
|
||||
}
|
||||
|
||||
.signup-form input[type='file'] {
|
||||
font: inherit;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.contact-list {
|
||||
list-style: none;
|
||||
margin: 1rem 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.contact-row {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(10rem, 1.2fr) minmax(12rem, 1.6fr) minmax(7rem, 0.8fr) auto;
|
||||
gap: 0.35rem 1rem;
|
||||
align-items: baseline;
|
||||
padding: 0.75rem 0;
|
||||
border-top: 1px solid var(--hope-border-2);
|
||||
}
|
||||
|
||||
.contact-row p {
|
||||
margin: 0;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.contact-row[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.contact-more {
|
||||
margin: 0.35rem 0 0;
|
||||
}
|
||||
|
||||
#add-shift {
|
||||
border-radius: 1.25rem;
|
||||
padding-right: 2.5rem;
|
||||
}
|
||||
|
||||
@media (max-width: 42em) {
|
||||
.contact-row {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
/* Footer */
|
||||
|
||||
.site-footer {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
(function () {
|
||||
bindCalendar();
|
||||
document.querySelectorAll('[data-contact]').forEach(bindContact);
|
||||
document.querySelectorAll('[data-see-more]').forEach(bindSeeMore);
|
||||
var boxes = document.querySelectorAll('[data-under-18]');
|
||||
for (var i = 0; i < boxes.length; i += 1) bind(boxes[i]);
|
||||
|
||||
@@ -38,6 +40,41 @@
|
||||
}
|
||||
}
|
||||
|
||||
function bindSeeMore(link) {
|
||||
var list = document.getElementById('contacts-list');
|
||||
if (!list) return;
|
||||
var size = Number(link.getAttribute('data-see-more'));
|
||||
if (!size || size < 1) size = 20;
|
||||
link.addEventListener('click', function (event) {
|
||||
var hidden = list.querySelectorAll('[data-contact-row][hidden]');
|
||||
if (!hidden.length) return;
|
||||
event.preventDefault();
|
||||
var count = Math.min(size, hidden.length);
|
||||
for (var i = 0; i < count; i += 1) hidden[i].hidden = false;
|
||||
if (hidden.length <= count) {
|
||||
var more = link.parentNode;
|
||||
if (more && more.classList && more.classList.contains('contact-more')) more.hidden = true;
|
||||
else link.hidden = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function bindContact(picker) {
|
||||
picker.addEventListener('change', function () {
|
||||
var form = picker.form;
|
||||
var option = picker.options[picker.selectedIndex];
|
||||
if (!form || !option || !option.value) return;
|
||||
setField(form, 'name', option.getAttribute('data-name') || '');
|
||||
setField(form, 'email', option.getAttribute('data-email') || '');
|
||||
setField(form, 'phone', option.getAttribute('data-phone') || '');
|
||||
});
|
||||
}
|
||||
|
||||
function setField(form, name, value) {
|
||||
var input = form.elements[name];
|
||||
if (input && 'value' in input) input.value = value;
|
||||
}
|
||||
|
||||
function bind(box) {
|
||||
var form = box.form;
|
||||
if (!form) return;
|
||||
|
||||
Reference in new issue
Block a user