Skip to content

Commit 435c445

Browse files
Polish homework UI audit blockers
1 parent e8345bc commit 435c445

4 files changed

Lines changed: 44 additions & 23 deletions

File tree

courses/static/courses.css

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,10 @@ header nav li:not(:last-child) {
180180

181181
/* Style each list item */
182182
.breadcrumbs ul li {
183+
align-items: center;
184+
display: inline-flex;
183185
margin-right: 0.5rem;
186+
min-width: 0;
184187
font-size: 0.9rem;
185188
white-space: nowrap;
186189
}
@@ -406,15 +409,15 @@ form select {
406409
}
407410

408411
.cadmin-shell .primer-button-success {
409-
background: #1f883d;
410-
border-color: #1f883d;
411-
color: #ffffff;
412+
background: #f6f8fa;
413+
border-color: #d0d7de;
414+
color: #116329;
412415
}
413416

414417
.cadmin-shell .primer-button-success:hover {
415-
background: #1a7f37;
416-
border-color: #1a7f37;
417-
color: #ffffff;
418+
background: #eef1f4;
419+
border-color: #d0d7de;
420+
color: #116329;
418421
}
419422

420423
.cadmin-meta-grid > * {
@@ -635,23 +638,27 @@ body.dark-mode [class*="text-red-700"] {
635638

636639
/* Adjustments for smaller screens */
637640
@media (max-width: 768px) {
638-
nav .breadcrumbs ul {
641+
.breadcrumbs ul {
639642
flex-wrap: wrap;
640643
gap: 0.25rem 0;
641644
}
642645

643-
nav .breadcrumbs ul li a {
646+
.breadcrumbs ul li a {
644647
max-width: 150px;
645648
}
646649
}
647650

648651
@media (max-width: 480px) {
649-
nav .breadcrumbs ul li {
652+
.breadcrumbs ul li:not(:first-child):not(:last-child) {
653+
display: none;
654+
}
655+
656+
.breadcrumbs ul li {
650657
font-size: 0.8rem;
651658
}
652659

653-
nav .breadcrumbs ul li a {
654-
max-width: 100px;
660+
.breadcrumbs ul li a {
661+
max-width: 220px;
655662
}
656663
}
657664

@@ -663,6 +670,15 @@ body.dark-mode [class*="text-red-700"] {
663670
margin-bottom: 0;
664671
}
665672

673+
.invalid-feedback {
674+
display: none;
675+
}
676+
677+
.was-validated .form-control:invalid ~ .invalid-feedback,
678+
.form-control.is-invalid ~ .invalid-feedback {
679+
display: block;
680+
}
681+
666682

667683
.option-answer-correct {
668684
align-items: center;
@@ -960,9 +976,9 @@ body.dark-mode .cadmin-shell .primer-button.cadmin-primary:hover {
960976
}
961977

962978
body.dark-mode .cadmin-shell .primer-button-success {
963-
background: #238636;
964-
border-color: #238636;
965-
color: #ffffff;
979+
background: #21262d;
980+
border-color: #30363d;
981+
color: #7ee787;
966982
}
967983

968984
body.dark-mode .cadmin-shell table tbody tr:hover {
@@ -1030,13 +1046,13 @@ body.dark-mode .alert-danger {
10301046

10311047
/* Subtle correct/incorrect answer colors for dark mode */
10321048
body.dark-mode .option-answer-correct {
1033-
background-color: rgba(31, 111, 59, 0.28);
1034-
color: #7ee787;
1049+
background: transparent;
1050+
color: var(--text-primary);
10351051
}
10361052

10371053
body.dark-mode .option-answer-incorrect {
1038-
background-color: rgba(218, 54, 51, 0.18);
1039-
color: #ff7b72;
1054+
background: transparent;
1055+
color: var(--text-primary);
10401056
}
10411057

10421058
body.dark-mode .error-message {

courses/static/time_left.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ document.addEventListener('DOMContentLoaded', function() {
4444
var diff = deadline - new Date();
4545
var days = Math.floor(diff / (1000 * 60 * 60 * 24));
4646

47-
el.classList.remove('text-slate-500', 'text-[#9a6700]', 'text-[#cf222e]', 'dark:text-[#8b949e]');
47+
el.classList.remove('text-slate-500', 'text-[#9a6700]', 'text-[#cf222e]', 'dark:text-[#8b949e]', 'app-muted');
48+
49+
if (diff <= 0 && el.getAttribute('data-past-tone') === 'muted') {
50+
el.classList.add('app-muted');
51+
return;
52+
}
4853

4954
if (diff <= 0 || days < 1) {
5055
el.classList.add('text-[#cf222e]');

courses/templates/courses/course.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ <h2 class="text-2xl font-semibold">Homework</h2>
9292
<div class="text-sm app-text">
9393
<i class="far fa-calendar-alt mr-2 hidden app-muted md:inline"></i>
9494
<span>Deadline: <span class="local-date" data-timestamp="{{ hw.due_date|date:'U' }}">{{ hw.due_date | date:"j F Y, H:i" }}</span></span>
95-
<div class="time-left mt-1 text-xs app-muted" data-deadline="{{ hw.due_date | date:"c" }}"></div>
95+
<div class="time-left mt-1 text-xs app-muted" data-deadline="{{ hw.due_date | date:"c" }}" data-past-tone="muted"></div>
9696
</div>
9797

9898
<div class="md:text-right">
@@ -149,12 +149,12 @@ <h2 class="text-2xl font-semibold">Projects</h2>
149149
<i class="far fa-calendar-alt mr-2 hidden app-muted md:inline"></i>
150150
{% if project.state == 'PR' and project.submitted %}
151151
<span>Review due: <span class="local-date" data-timestamp="{{ project.peer_review_due_date|date:'U' }}">{{ project.peer_review_due_date | date:"j F Y, H:i" }}</span></span>
152-
<div class="time-left mt-1 text-xs app-muted" data-deadline="{{ project.peer_review_due_date | date:"c" }}"></div>
152+
<div class="time-left mt-1 text-xs app-muted" data-deadline="{{ project.peer_review_due_date | date:"c" }}" data-past-tone="muted"></div>
153153
{% elif project.state == 'CO' %}
154154
<span>Completed: <span class="local-date" data-timestamp="{{ project.peer_review_due_date|date:'U' }}">{{ project.peer_review_due_date | date:"j F Y, H:i" }}</span></span>
155155
{% else %}
156156
<span>Due: <span class="local-date" data-timestamp="{{ project.submission_due_date|date:'U' }}">{{ project.submission_due_date | date:"j F Y, H:i" }}</span></span>
157-
<div class="time-left mt-1 text-xs app-muted" data-deadline="{{ project.submission_due_date | date:"c" }}"></div>
157+
<div class="time-left mt-1 text-xs app-muted" data-deadline="{{ project.submission_due_date | date:"c" }}" data-past-tone="muted"></div>
158158
{% endif %}
159159
</div>
160160

0 commit comments

Comments
 (0)