Skip to content

Commit 852e9fc

Browse files
Merge branch 'dev' into add-raymond-logo
2 parents 6bc5dcf + 23907c6 commit 852e9fc

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

src/contestadmin/templates/contestadmin/statistics_dashboard.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ <h1 class="text-center">Contest Statistics</h1>
151151
<tr>
152152
<td>{{ course.code }}</td>
153153
<td>{{ course.name }}</td>
154-
<td>{{ course.instructor.last_name }}</td>
154+
<td>{{ course.instructor.get_first_initial }}. {{ course.instructor.last_name }}</td>
155155
<td class="text-center">{{ course.num_registered }}</td>
156156
</tr>
157157
{% endfor %}

src/core/templates/core/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ <h5>Faculty Division</h5>
296296
<div class="card-body">
297297
{% for course in courses|slice:"5" %}
298298
<p class="card-text mb-1">
299-
<span class="font-weight-bold">{{ course.code }} </span><i>{{ course.name }}</i> - {{course.instructor.last_name }}
299+
<span class="font-weight-bold">{{ course.code }} </span><i>{{ course.name }}</i> - {{ course.instructor.get_first_initial }}. {{ course.instructor.last_name }}
300300
</p>
301301
{% empty %}
302302
<p class="card-text">No courses have been confirmed at this time.</p>
@@ -361,7 +361,7 @@ <h6 class="modal-title" id="displayCoursesModalLongTitle">Extra Credit Courses</
361361
<div class="col-lg-10">
362362
<ul class="list-group list-group-flush">
363363
{% for course in courses %}
364-
<li class="list-group-item"><span class="font-weight-bold">{{ course.code }} </span><i>{{ course.name }}</i> - {{ course.instructor.last_name }}</li>
364+
<li class="list-group-item"><span class="font-weight-bold">{{ course.code }} </span><i>{{ course.name }}</i> - {{ course.instructor.get_first_initial }}. {{ course.instructor.last_name }}</li>
365365
{% empty %}
366366
<li class="list-group-item">No courses have been confirmed at this time.</li>
367367
{% endfor %}

src/manager/models.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ class Faculty(models.Model):
2121
email = models.EmailField(max_length=50, primary_key=True)
2222
first_name = models.CharField(max_length=50)
2323
last_name = models.CharField(max_length=50)
24-
24+
2525
def __str__(self):
2626
return (str(self.first_name) + ' ' + str(self.last_name))
27+
28+
def get_first_initial(self):
29+
return(self.first_name[0])
2730

2831

2932
class Course(models.Model):
@@ -45,7 +48,7 @@ class Meta:
4548
ordering = ['code']
4649

4750
def __str__(self):
48-
return (str(self.code) + ' : ' + str(self.name) + ' - ' + str(self.instructor.last_name) + ', ' + str(self.instructor.first_name)[0])
51+
return (str(self.code) + ' : ' + str(self.name) + ' - ' + str(self.instructor.last_name) + ', ' + str(self.instructor.get_first_initial()))
4952

5053
def num_checkedin(self):
5154
"""

src/manager/templates/manager/dashboard.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ <h4 class="card-title mb-0">{{ announcement.title }}</h4>
106106
<tr>
107107
<td><small class="font-weight-bold">{{ course.code }}</small></td>
108108
<td><small><i>{{ course.name }}</i></small></td>
109-
<td><small>{{ course.instructor.last_name }}</small></td>
109+
<td><small>{{ course.instructor.get_first_initial }}. {{ course.instructor.last_name }}</small></td>
110110
</tr>
111111
{% endfor %}
112112
</tbody>

0 commit comments

Comments
 (0)