Added abaility for admins to add registrations

This commit is contained in:
Godwin
2016-08-25 22:29:44 -07:00
parent 68146a446b
commit 481c186e08
6 changed files with 366 additions and 155 deletions
+29
View File
@@ -52,6 +52,7 @@
request.open('POST', url, true);
cells = editRow.getElementsByClassName('cell-editor');
data.append('key', row.getAttribute('data-key'));
data.append('button', 'update');
var changed = false;
for (var i = 0; i < cells.length; i++) {
if (cells[i].value !== cells[i].getAttribute('data-value')) {
@@ -133,4 +134,32 @@
searchControl.addEventListener('keyup', filterTable);
searchControl.addEventListener('search', filterTable);
forEachElement('[data-expands]', function(button) {
button.addEventListener('click', function(event) {
var element = document.getElementById(event.target.getAttribute('data-expands'));
document.body.classList.add('expanded-element');
element.classList.add('expanded');
});
});
forEachElement('[data-contracts]', function(button) {
button.addEventListener('click', function(event) {
var element = document.getElementById(event.target.getAttribute('data-contracts'));
document.body.classList.remove('expanded-element');
element.classList.remove('expanded');
});
});
forEachElement('[data-opens-modal]', function(button) {
button.addEventListener('click', function(event) {
var element = document.getElementById(event.target.getAttribute('data-opens-modal'));
document.body.classList.add('modal-open');
element.classList.add('open');
});
});
forEachElement('[data-closes-modal]', function(element) {
element.addEventListener('click', function(event) {
document.getElementById(event.target.getAttribute('data-closes-modal')).classList.remove('open');
document.body.classList.remove('modal-open');
});
});
})();
+184 -76
View File
@@ -1,3 +1,5 @@
$bug-list: ("search-element-appearance": ());
@import "bumbleberry";
@import "settings";
@@ -186,102 +188,114 @@ table, .table {
tr[data-key] {
cursor: cell;
&:hover {
&.editable:hover {
background-color: lighten($colour-2, 33%);
}
&.editable {
+ .editor {
display: none;
background-color: lighten($colour-1, 50%);
td {
position: relative;
vertical-align: top;
background: inherit;
cursor: default;
opacity: 0.5;
+ .editor {
display: none;
background-color: lighten($colour-1, 50%);
&.has-editor {
opacity: 1;
td {
opacity: 0.5;
@include after {
content: '';
position: absolute;
top: 100%;
right: 0;
left: 0;
height: 0.25em;
background-color: rgba($black, 0.125);
}
}
&.has-editor {
opacity: 1;
.cell-editor {
top: 0;
@include after {
content: '';
position: absolute;
top: 100%;
right: 0;
bottom: 0;
left: 0;
padding: inherit;
font: inherit;
margin: inherit;
background: inherit;
border: 0;
min-height: 0;
width: 100% !important;
border-radius: 0;
line-height: inherit;
overflow: hidden;
box-shadow: none;
text-align: inherit;
&[type=number]::-webkit-inner-spin-button,
&[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
}
}
select.cell-editor {
-webkit-appearance: none;
-moz-appearance: none;
-ms-appearance: none;
appearance: none;
cursor: pointer;
}
&.date .cell-editor {
text-align-last: right;
height: 0.25em;
background-color: rgba($black, 0.125);
}
}
}
&.editing {
display: none;
+ .editor {
display: table-row;
.cell-editor {
position: absolute;
.cell-editor {
&[type=number]::-webkit-inner-spin-button,
&[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
}
}
select.cell-editor {
-webkit-appearance: none;
-moz-appearance: none;
-ms-appearance: none;
appearance: none;
cursor: pointer;
}
&.date .cell-editor {
text-align-last: right;
}
}
}
/*td[name] {
position: relative;
cursor: text;
+ .editor, &.always-edit {
td {
position: relative;
vertical-align: top;
background: inherit;
cursor: default;
.cell-editor {
top: 0;
right: 0;
bottom: 0;
left: 0;
padding: inherit;
font: inherit;
margin: inherit;
background: inherit;
border: 0;
min-height: 0;
width: 100% !important;
border-radius: 0;
line-height: inherit;
overflow: hidden;
box-shadow: none;
text-align: inherit;
}
}
}
&.always-edit td .cell-editor {
position: absolute;
}
&.editing {
display: none;
+ .editor {
display: table-row;
.cell-editor {
position: absolute;
}
}
}
}
&.always-editing {
tr {
cursor: default;
&:hover {
background-color: lighten($colour-2, 25%);
}
input, textarea, select {
background-color: transparent;
}
}
&[data-editing="1"] {
}*/
.cell-editor {
position: absolute;
}
td.text {
height: 5em;
}
}
tr.editable, tr.editor {
@@ -320,7 +334,97 @@ table, .table {
.table-scroller {
overflow: auto;
background-color: $white;
background-color: #F8F8F8;
@include _(box-shadow, inset 0 0 10em 0 rgba(0,0,0,0.125));
table {
background-color: $white;
margin: 0 0 8.5em;
}
body.expanded-element .expanded & {
overflow: visible;
}
}
.goes-fullscreen {
[data-contracts] {
display: none;
}
}
body.modal-open {
overflow: hidden;
}
body.expanded-element {
overflow: hidden;
.goes-fullscreen.expanded {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1000;
background-color: $white;
overflow: auto;
padding: 0 1em;
[data-expands] {
display: none;
}
[data-contracts] {
display: block;
}
}
}
#main .columns .modal-edit {
display: none;
position: fixed;
top: 0;
right: 0;
left: 0;
bottom: 0;
z-index: 1001;
margin: 0;
background-color: rgba($black, 0.5);
&.open {
display: block;
}
.modal-edit-overlay {
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
cursor: pointer;
}
table {
margin: 0;
}
.modal-edit-content {
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
max-width: 40em;
margin: auto;
overflow: auto;
z-index: 1002;
background-color: #F8F8F8;
}
table {
background-color: $white;
}
}
.table {
@@ -1111,6 +1215,10 @@ fieldset {
button, .button {
width: 100%;
text-align: center;
+ button, + .button {
margin-left: 0.75em;
}
}
}