Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Level moderation #1282

Merged
merged 12 commits into from
Jan 18, 2022
688 changes: 344 additions & 344 deletions Pipfile.lock

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions game/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ class LevelModerationForm(forms.Form):
def __init__(self, *args, **kwargs):
classes = kwargs.pop("classes")
super(LevelModerationForm, self).__init__(*args, **kwargs)
self.fields["classes"] = forms.ModelChoiceField(
queryset=classes,
required=True,
widget=forms.Select(),
classes_choices = [(c.id, c.name) for c in classes]

self.fields["classes"] = forms.MultipleChoiceField(
choices=classes_choices, widget=forms.CheckboxSelectMultiple()
)
self.fields["students"] = forms.CharField(required=False, widget=forms.Select())
34 changes: 34 additions & 0 deletions game/static/game/css/dataTables.custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.tableWrapper {
width: 100%;
}

div.DTFC_LeftBodyLiner,
div.DTFC_RightBodyLiner {
overflow: hidden;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_paginate span,
.dataTables_wrapper .dataTables_paginate .disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
display: none;
}

.dataTables_wrapper a.next {
margin-left: 10px;
}

.dataTables_wrapper a.next:focus,
.dataTables_wrapper a.previous:focus {
outline: none;
}

table.dataTable {
border-collapse: collapse;
}

table.dataTable thead th,
table.dataTable tfoot th {
font-weight: 500;
}
51 changes: 51 additions & 0 deletions game/static/game/css/dropdown.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
.open > .dropdown-menu {
display: flex;
flex-direction: column;
}

.button--dropdown,
.dropdown-menu {
width: 100%;
background-color: #fff;
}

.dropdown-menu {
overflow-x: hidden;
font-style: normal;
max-height: 380px;
}

.dropdown-menu > ul {
font-style: normal;
overflow-y: auto;
}

.dropdown-menu > .row {
padding: 15px 0 15px 0;
}

.dropdown-menu__option__text {
width: 100%;
}

.dropdown-menu__option__text label {
align-items: center;
cursor: pointer;
display: flex;
flex-direction: row-reverse;
font-weight: normal;
justify-content: space-between;
margin: 0;
}

.dropdown-menu .dropdown-menu__option .button--regular {
cursor: default;
}

.dropdown-menu
.dropdown-menu__option
.button--regular:hover
.dropdown-menu__option__text {
cursor: pointer;
text-decoration: none;
}
10 changes: 10 additions & 0 deletions game/static/game/css/input.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.input--icon > input[type="text"],
.input--icon > input[type="text"]:hover,
.input--icon > input[type="text"]:focus {
border: 2px solid #eab502;
}

input[type="checkbox"] {
cursor: pointer;
width: 20px;
}
22 changes: 4 additions & 18 deletions game/static/game/css/level_moderation.css
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
form label {
float:left;
width:auto;
font-size: 1.6rem;
line-height: 37px;
}

form span {
display: block;
overflow: hidden;
}

select {
font-size: 1.6rem;
}

.btn {
margin: 0px
.dropdown > .button--secondary,
.row > div > .button--secondary,
.row > div > .button--primary {
margin: 0;
}
4 changes: 0 additions & 4 deletions game/static/game/css/level_selection.css
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,3 @@
font-family: "Glyphicons Halflings";
margin-left: 10px;
}

.banner--rapid-router img {
width: 25%;
}
93 changes: 0 additions & 93 deletions game/static/game/css/scoreboard.css
Original file line number Diff line number Diff line change
@@ -1,102 +1,9 @@
.banner--rapid-router img {
width: 25%;
}

.dropdown > .button--secondary,
.row > div > .button--secondary,
.row > div > .button--primary {
margin: 0;
}

.input--icon > input[type="text"],
.input--icon > input[type="text"]:hover,
.input--icon > input[type="text"]:focus {
border: 2px solid #eab502;
}

input[type="checkbox"] {
cursor: pointer;
width: 20px;
}

.open > .dropdown-menu {
display: flex;
flex-direction: column;
}

.button--dropdown,
.dropdown-menu {
width: 100%;
background-color: #fff;
}

.dropdown-menu {
overflow-x: hidden;
font-style: normal;
max-height: 380px;
}

.dropdown-menu > ul {
font-style: normal;
overflow-y: auto;
}

.dropdown-menu > .row {
padding: 15px 0 15px 0;
}

.dropdown-menu__option__text {
width: 100%;
}

.dropdown-menu__option__text label {
align-items: center;
display: flex;
flex-direction: row-reverse;
font-weight: normal;
justify-content: space-between;
margin: 0;
}

#scoreboardForm .button--regular {
cursor: default;
}

#scoreboardForm label {
cursor: pointer;
}

#scoreboardForm .dropdown-menu__option__text {
cursor: pointer;
text-decoration: none;
}

.tableWrapper {
width: 100%;
}

div.DTFC_LeftBodyLiner,
div.DTFC_RightBodyLiner {
overflow: hidden;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_paginate span,
.dataTables_wrapper .dataTables_paginate .disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
display: none;
}

a.next {
margin-left: 10px;
}

a.next:focus,
a.previous:focus {
outline: none;
}

#scoreboardTable_wrapper table,
#scoreboardTable_wrapper th,
#scoreboardTable_wrapper td,
Expand Down
Loading