diff --git a/tin/apps/assignments/views.py b/tin/apps/assignments/views.py index f4d107e8..a2f262da 100644 --- a/tin/apps/assignments/views.py +++ b/tin/apps/assignments/views.py @@ -78,10 +78,17 @@ def show_view(request, assignment_id): teacher_last_login = request.user.last_login time_24_hours_ago = now() - datetime.timedelta(days=1) + query = request.GET.get("query", "") + period = request.GET.get("period", "") period_set = course.period_set.order_by("teacher", "name") - if course.period_set.exists(): + if query: + active_period = "query" + student_list = course.students.filter(full_name__icontains=query).order_by( + "periods", "last_name" + ) + elif course.period_set.exists(): if period == "": if request.user in course.teacher.all(): try: @@ -157,6 +164,7 @@ def show_view(request, assignment_id): ), "is_student": course.is_student_in_course(request.user), "is_teacher": request.user in course.teacher.all(), + "query": query, "period_set": period_set, "active_period": active_period, "quiz_accessible": quiz_accessible, diff --git a/tin/static/css/base.css b/tin/static/css/base.css index 11a2be81..18e20cf4 100644 --- a/tin/static/css/base.css +++ b/tin/static/css/base.css @@ -216,7 +216,7 @@ a:hover { text-align: center; } -a.tin-btn { +.tin-btn { border: 1px solid #cfcfcf; border-radius: 4px; diff --git a/tin/templates/assignments/show.html b/tin/templates/assignments/show.html index 6e589587..2dddbf95 100644 --- a/tin/templates/assignments/show.html +++ b/tin/templates/assignments/show.html @@ -96,6 +96,16 @@

Filter Submissions< href="{% url 'assignments:show' assignment.id %}?period=none">None All +   +
+ + +


{% for period in period_set %}