diff --git a/esp/esp/program/modules/handlers/jsondatamodule.py b/esp/esp/program/modules/handlers/jsondatamodule.py index 7a2c653d50..0feab03e1d 100644 --- a/esp/esp/program/modules/handlers/jsondatamodule.py +++ b/esp/esp/program/modules/handlers/jsondatamodule.py @@ -796,12 +796,12 @@ def mod_nums(prog): teachers = prog.teachers() moderator_list = [] if 'will_moderate' in teachers: - moderator_list.append(("Teachers who have offered to moderate", teachers['will_moderate'].count())) + moderator_list.append(("Teachers who have offered to be a " + Tag.getProgramTag("moderator_title", prog).lower(), teachers['will_moderate'].count())) if 'assigned_moderator' in teachers: - moderator_list.append(("Moderators who have been assigned to sections", teachers['assigned_moderator'].count())) - moderator_list.append(("Total number of time blocks offered by moderators", ModeratorRecord.objects.filter(program=prog).aggregate(Sum('num_slots'))['num_slots__sum'] or 0)) - moderator_list.append(("Total number of time blocks assigned moderators", ClassSection.objects.filter(parent_class__parent_program=prog, moderators__isnull=False).distinct().aggregate(Count('meeting_times'))['meeting_times__count'])) - moderator_list.append(("Total number of sections assigned moderators", ClassSection.objects.filter(parent_class__parent_program=prog, moderators__isnull=False).distinct().count())) + moderator_list.append((Tag.getProgramTag("moderator_title", prog).capitalize() + "s who have been assigned to sections", teachers['assigned_moderator'].count())) + moderator_list.append(("Total number of time blocks offered by " + Tag.getProgramTag("moderator_title", prog).lower() + "s", ModeratorRecord.objects.filter(program=prog).aggregate(Sum('num_slots'))['num_slots__sum'] or 0)) + moderator_list.append(("Total number of time blocks assigned " + Tag.getProgramTag("moderator_title", prog).lower() + "s", ClassSection.objects.filter(parent_class__parent_program=prog, moderators__isnull=False).distinct().aggregate(Count('meeting_times'))['meeting_times__count'])) + moderator_list.append(("Total number of sections assigned " + Tag.getProgramTag("moderator_title", prog).lower() + "s", ClassSection.objects.filter(parent_class__parent_program=prog, moderators__isnull=False).distinct().count())) return moderator_list mod_nums.depend_on_row(ModeratorRecord, lambda mr: {'prog': mr.program}) mod_nums.depend_on_m2m(ClassSection, 'moderators', lambda sec, moderator: {'prog': sec.parent_class.parent_program}) @@ -1058,6 +1058,7 @@ def stats(self, request, tl, one, two, module, extra, prog): dictOut["stats"].append(vitals) shirt_data = {"id": "shirtnum"}; + shirt_data["moderator_title"] = Tag.getProgramTag("moderator_title", prog).capitalize(); adminvitals_shirt = prog.getShirtInfo() shirt_data["types"] = adminvitals_shirt['shirt_types']; shirt_data["data"] = adminvitals_shirt['shirts']; diff --git a/esp/esp/program/modules/handlers/teachermoderatormodule.py b/esp/esp/program/modules/handlers/teachermoderatormodule.py index ed7498a9cd..7cd6e2e3d8 100644 --- a/esp/esp/program/modules/handlers/teachermoderatormodule.py +++ b/esp/esp/program/modules/handlers/teachermoderatormodule.py @@ -1,6 +1,7 @@ from esp.program.models import ModeratorRecord from esp.program.modules.base import ProgramModuleObj, needs_teacher, main_call, meets_deadline, needs_admin, aux_call from esp.program.modules.forms.moderate import ModeratorForm +from esp.tagdict.models import Tag from esp.users.models import ESPUser from esp.utils.web import render_to_response from django.db.models.query import Q @@ -68,8 +69,8 @@ def teachers(self, QObject = False): 'assigned_moderator': assigned_list} def teacherDesc(self): - return {'will_moderate': """Teachers who have also offered to moderate""", - 'assigned_moderator': """Teachers who are assigned as moderators"""} + return {'will_moderate': """Teachers who have also offered to be a """ + Tag.getProgramTag("moderator_title", self.program).lower(), + 'assigned_moderator': """Teachers who are assigned as """ + Tag.getProgramTag("moderator_title", self.program).lower() + """s"""} @aux_call @needs_admin diff --git a/esp/public/media/scripts/program/modules/adminvitals.js b/esp/public/media/scripts/program/modules/adminvitals.js index a4cf50ca69..145e1252fb 100644 --- a/esp/public/media/scripts/program/modules/adminvitals.js +++ b/esp/public/media/scripts/program/modules/adminvitals.js @@ -96,8 +96,15 @@ function fillStats(data) html_string = "" for (var group of shirtnum.data) { + if (group.name == "Assigned Moderators") + { + group_name = "Assigned " + shirtnum.moderator_title + "s"; + } else + { + group_name = group.name; + } var shirtsizes = group.shirt_sizes; - html_string = html_string.concat(""); + html_string = html_string.concat("
"+group.name+" T-Shirts
"); // Sizes header html_string = html_string.concat(""); for (var i = 0; i < shirtsizes.length; i++) diff --git a/esp/templates/program/modules/adminvitals/vitals.html b/esp/templates/program/modules/adminvitals/vitals.html index 1143734d54..42f0263612 100644 --- a/esp/templates/program/modules/adminvitals/vitals.html +++ b/esp/templates/program/modules/adminvitals/vitals.html @@ -60,7 +60,7 @@ {% if program|hasModule:"TeacherModeratorModule" %}
-
Moderators (click to expand)
+
{{ program.getModeratorTitle|capfirst }}s (click to expand)
"+group_name+" T-Shirts