Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonGrace2282 committed May 9, 2024
1 parent 6eb929b commit 63b0afd
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
3 changes: 3 additions & 0 deletions tin/apps/assignments/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ def __init__(self, course, *args, **kwargs):
"issues."
)

# prevent description from getting too bix
self.fields["description"].widget.attrs.update({"id": "description"})

def get_sections(self) -> Iterable[Dict[str, str | Tuple[str, ...] | bool]]:
for section in self.Meta.sections:
if section["name"]:
Expand Down
21 changes: 16 additions & 5 deletions tin/static/css/edit.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
color: white;
cursor: pointer;
padding: 18px;
width: 100%;
max-width: 90%;
width: 90%;
border: none;
border-radius: 10px;
text-align: center;
Expand All @@ -19,7 +20,9 @@

.content {
display: none;
padding: 18px 18px;
max-width: 90%;
width: 90%;
padding-top: 18px;
overflow: hidden;
background-color: #F2F2F4;
border-radius: 10px;
Expand Down Expand Up @@ -63,15 +66,22 @@
float: left;
}

/* Style the description box */
#description {
max-width: 90%;
width: 90%;
height: 300px;
}

@media (max-width: 900.02px) {

.right-col {
width: 100%;
width: 90%;
float: left;
}

#required {
width: 100%;
width: 90%;
float: left;
padding-bottom: 20px;
}
Expand All @@ -80,12 +90,13 @@
.field {
display: flex;
flex-direction: row;
width: 100%;
width: 90%;
padding-bottom: 15px;
}

.tag {
width: 30%;
padding: 18px;
}

.field-input {
Expand Down
11 changes: 6 additions & 5 deletions tin/templates/assignments/edit_create.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
</style>
<script>
$(document).ready(function () {
var coll = $('.collapsible');
var i;
const coll = $('.collapsible');
let i;

for (i = 0; i < coll.length; i++) {
coll[i].addEventListener("click", function() {
this.classList.toggle("active");
var content = this.nextElementSibling;
const content = this.nextElementSibling;
content.classList.toggle("block");
});
}
Expand Down Expand Up @@ -70,6 +70,7 @@ <h3 class="errors">Please correct the errors below.</h3>
<span class="field-input">{{ field }}{% if field.help_text %}<br>{{ field.help_text }}{% endif %}</span>
</div>
{% endfor %}
<br>
{% if action == "add" %}
<div>Note: You'll be able to upload a grader script after you create the assignment.</div>
{% else %}
Expand All @@ -83,8 +84,8 @@ <h3 class="errors">Please correct the errors below.</h3>

<div class="right-col">
{% for category in assignment_form.get_sections %}
<button type="button" class="collapsible {% if not category.collapsed %} active {% endif %}">{{ category.name }}</button>
<div class="content {% if not category.collapsed %} block {% endif %}">
<button type="button" class="collapsible {% if not category.collapsed %}active{% endif %}">{{ category.name }}</button>
<div class="content {% if not category.collapsed %}block{% endif %}">
{% if category.description %}
<span style="font-size:20px">{{ category.description }}</span>
<br><br>
Expand Down

0 comments on commit 63b0afd

Please sign in to comment.