Skip to content

Commit 6fe58f5

Browse files
Add term_start_date to course home page. Warn instructors of old courses
1 parent 140f811 commit 6fe58f5

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

bases/rsptx/book_server_api/routers/course.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ def sort_key(assignment):
151151
"assignment_list": assignments,
152152
"stats": stats,
153153
"course": course,
154+
"is_old_course": course.term_start_date
155+
< (datetime.datetime.now() - datetime.timedelta(weeks=52)).date(),
154156
"user": user,
155157
"request": request,
156158
"institution": course.institution,

components/rsptx/templates/book/course/current_course.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ <h2>{{course.course_name}}</h2>
3636
{% if course_description %}
3737
<p>{{course_description}}</p>
3838
{% endif %}
39+
<p><strong>Course start date:</strong> {{course.term_start_date}}</p>
40+
{% if is_old_course and is_instructor %}
41+
<div class="alert alert-warning">
42+
<strong>Warning</strong>: Course is over one year old.
43+
</div>
44+
{% endif %}
3945
<p><b>School:</b> {{institution}}</p>
4046
<p><b>Student:</b> {{user.first_name}} {{user.last_name}} (<a href="/runestone/default/user/logout">Not you?</a>)</p>
4147
<h2>Instructors</h2>
@@ -46,6 +52,7 @@ <h2>Instructors</h2>
4652
</li>
4753
{% endfor %}
4854
</ul>
55+
<p>{{course}}</p>
4956
</div>
5057
<div>
5158
<h2>Textbooks</h2>

0 commit comments

Comments
 (0)