Commit 123e1810 by Sarina Canelake

Reorganize Course Info dash section

LMS-1242
parent 9330ef65
...@@ -45,7 +45,7 @@ def instructor_dashboard_2(request, course_id): ...@@ -45,7 +45,7 @@ def instructor_dashboard_2(request, course_id):
raise Http404() raise Http404()
sections = [ sections = [
_section_course_info(course_id, access), _section_course_info(course_id),
_section_membership(course_id, access), _section_membership(course_id, access),
_section_student_admin(course_id, access), _section_student_admin(course_id, access),
_section_data_download(course_id), _section_data_download(course_id),
...@@ -86,15 +86,19 @@ section_display_name will be used to generate link titles in the nav bar. ...@@ -86,15 +86,19 @@ section_display_name will be used to generate link titles in the nav bar.
""" # pylint: disable=W0105 """ # pylint: disable=W0105
def _section_course_info(course_id, access): def _section_course_info(course_id):
""" Provide data for the corresponding dashboard section """ """ Provide data for the corresponding dashboard section """
course = get_course_by_id(course_id, depth=None) course = get_course_by_id(course_id, depth=None)
(course_org, course_num, course_name) = course_id.split('/')
section_data = { section_data = {
'section_key': 'course_info', 'section_key': 'course_info',
'section_display_name': _('Course Info'), 'section_display_name': _('Course Info'),
'course_id': course_id, 'course_id': course_id,
'access': access, 'course_org': course_org,
'course_num': course_num,
'course_name': course_name,
'course_display_name': course.display_name, 'course_display_name': course.display_name,
'enrollment_count': CourseEnrollment.objects.filter(course_id=course_id).count(), 'enrollment_count': CourseEnrollment.objects.filter(course_id=course_id).count(),
'has_started': course.has_started(), 'has_started': course.has_started(),
......
<%! from django.utils.translation import ugettext as _ %> <%! from django.utils.translation import ugettext as _ %>
<%page args="section_data"/> <%page args="section_data"/>
<h2>${_("Course Information")}</h2> <div class="enrollment-wrapper">
<h2>${_("Enrollment Information")}</h2>
<span class="tip">${_("Total number of enrollees (instructors, staff members, and students)")}</span>
<br/><br/>
<span style="color: green;"><b>${ section_data['enrollment_count'] }</b></span>
<div class="basic-data">
${_("Course Name")}:
${ section_data['course_display_name'] }
</div> </div>
<hr>
<div class="basic-data"> <div class="basic-wrapper">
${_("Course ID")}: <h2>${_("Basic Course Information")}</h2>
${ section_data['course_id'] }
</div>
<div class="basic-data"> <ul class="list-input">
${_("Students Enrolled")}: <li class="field text is-not-editable" id="field-course-organization">
${ section_data['enrollment_count'] } <label for="course-organization">${_("Organization:")}</label>
</div> <b>${ section_data['course_org'] }</b>
</li>
<div class="basic-data"> <li class="field text is-not-editable" id="field-course-number">
${_("Started")}: <label for="course-number">${_("Course Number:")}</label>
${ section_data['has_started'] } <b>${ section_data['course_num'] }</b>
</div> </li>
<div class="basic-data"> <li class="field text is-not-editable" id="field-course-name">
${_("Ended")}: <label for="course-name">${_("Course Name:")}</label>
${ section_data['has_ended'] } <b>${ section_data['course_name'] }</b>
</div> </li>
<li class="field text is-not-editable" id="field-course-display-name">
<label for="course-display-name">${_("Course Display Name:")}</label>
<b>${ section_data['course_display_name'] }</b>
</li>
<li class="field text is-not-editable" id="field-course-started">
<label for="start-date">${_("Has the course started?")}</label>
<div class="basic-data"> %if section_data['has_started']:
${_("Grade Cutoffs")}: <b>${_("Yes")}</b>
${ section_data['grade_cutoffs'] } %else:
<b>${_("No")}</b>
%endif
</li>
<li class="field text is-not-editable" id="field-course-ended">
<label for="start-date">${_("Has the course ended?")}</label>
%if section_data['has_ended']:
<b>${_("Yes")}</b>
%else:
<b>${_("No")}</b>
%endif
</li>
<li class="field text is-not-editable" id="field-grade-cutoffs">
<label for="start-date">${_("Grade Cutoffs:")}</label>
<b>${ section_data['grade_cutoffs'] }</b>
</li>
</ul>
</div> </div>
## <div class="basic-data">
## Offline Grades Available:
## ${ section_data['offline_grades'] }
## </div>
%if settings.MITX_FEATURES.get('ENABLE_INSTRUCTOR_BACKGROUND_TASKS') and section_data['access']['instructor']: %if settings.MITX_FEATURES.get('ENABLE_INSTRUCTOR_BACKGROUND_TASKS'):
<div class="running-tasks-container action-type-container"> <div class="running-tasks-container action-type-container">
<hr> <hr>
<h2> ${_("Pending Instructor Tasks")} </h2> <h2> ${_("Pending Instructor Tasks")} </h2>
...@@ -70,6 +94,3 @@ ...@@ -70,6 +94,3 @@
</div> </div>
<br> <br>
%endif %endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment