Skip to content

Commit 9795a5a

Browse files
(nit): naming
1 parent b5202a1 commit 9795a5a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

tcf_website/templates/course/course_professor.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ <h2 class="mr-md-3">{{ course.title }}</h2>
6666
<div class="ratings-row">
6767
<div class="rating-card">
6868
<span class="rating-card-num rating-num">&mdash;</span>
69-
<p class="rating-card-desc"><i class="fa fa-star fa-fw"></i>&nbsp;{{ num_reviews }} {% if num_reviews == 1 %} Rating {% else %} Ratings {% endif %}</p>
69+
<p class="rating-card-desc"><i class="fa fa-star fa-fw"></i>&nbsp;{{ num_ratings }} {% if num_ratings == 1 %} Rating {% else %} Ratings {% endif %}</p>
7070
</div>
7171
<div class="info-container">
7272
<div class="info-row">
@@ -243,7 +243,7 @@ <h2 class="mr-md-3">{{ course.title }}</h2>
243243
<div class="tab-pane fade show active" id="reviewsTabContent" role="tabpanel" aria-labelledby="reviews-tab">
244244
<div class="reviews-container mb-5 mt-3">
245245
<div class="reviews-toolbar pb-2 d-flex flex-md-row flex-column justify-content-left justify-content-md-center">
246-
<h3 class="reviews-heading mb-0 mt-1 mr-4">{{ num_comments }} {% if num_comments == 1 %} Review {% else %} Reviews {% endif %}</h3>
246+
<h3 class="reviews-heading mb-0 mt-1 mr-4">{{ num_reviews }} {% if num_reviews == 1 %} Review {% else %} Reviews {% endif %}</h3>
247247
<div class="reviews-options d-flex flex-sm-row flex-column col p-0">
248248
{% if user.is_authenticated %}
249249
<a href="{% url 'new_review' %}?subdept_id={{course.subdepartment.id}}&course_id={{course.id}}&instr_id={{instructor.id}}" class="btn bg-tcf-orange text-white mb-3">

tcf_website/views/browse.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,11 @@ def course_instructor(request, course_id, instructor_id, method="Most Recent"):
194194
course = section_last_taught.course
195195
instructor = section_last_taught.instructors.get(pk=instructor_id)
196196

197-
# Find the total number of reviews (with or without text) for the given course
197+
# ratings: reviews with and without text; reviews: ratings with text
198198
reviews = Review.objects.filter(instructor=instructor_id, course=course_id).aggregate(
199-
num_reviews=Count("id"), num_comments=Count("id", filter=~Q(text=""))
199+
num_ratings=Count("id"), num_reviews=Count("id", filter=~Q(text=""))
200200
)
201-
num_comments, num_reviews = reviews["num_comments"], reviews["num_reviews"]
201+
num_reviews, num_ratings = reviews["num_reviews"], reviews["num_ratings"]
202202

203203
dept = course.subdepartment.department
204204

@@ -298,8 +298,8 @@ def course_instructor(request, course_id, instructor_id, method="Most Recent"):
298298
"course_id": course_id,
299299
"instructor": instructor,
300300
"semester_last_taught": section_last_taught.semester,
301+
"num_ratings": num_ratings,
301302
"num_reviews": num_reviews,
302-
"num_comments": num_comments,
303303
"paginated_reviews": paginated_reviews,
304304
"breadcrumbs": breadcrumbs,
305305
"data": json.dumps(data),

0 commit comments

Comments
 (0)