Reorganize Course Info dash section
LMS-1242
This commit is contained in:
@@ -45,7 +45,7 @@ def instructor_dashboard_2(request, course_id):
|
||||
raise Http404()
|
||||
|
||||
sections = [
|
||||
_section_course_info(course_id, access),
|
||||
_section_course_info(course_id),
|
||||
_section_membership(course_id, access),
|
||||
_section_student_admin(course_id, access),
|
||||
_section_data_download(course_id),
|
||||
@@ -86,15 +86,19 @@ section_display_name will be used to generate link titles in the nav bar.
|
||||
""" # pylint: disable=W0105
|
||||
|
||||
|
||||
def _section_course_info(course_id, access):
|
||||
def _section_course_info(course_id):
|
||||
""" Provide data for the corresponding dashboard section """
|
||||
course = get_course_by_id(course_id, depth=None)
|
||||
|
||||
(course_org, course_num, course_name) = course_id.split('/')
|
||||
|
||||
section_data = {
|
||||
'section_key': 'course_info',
|
||||
'section_display_name': _('Course Info'),
|
||||
'course_id': course_id,
|
||||
'access': access,
|
||||
'course_org': course_org,
|
||||
'course_num': course_num,
|
||||
'course_name': course_name,
|
||||
'course_display_name': course.display_name,
|
||||
'enrollment_count': CourseEnrollment.objects.filter(course_id=course_id).count(),
|
||||
'has_started': course.has_started(),
|
||||
|
||||
@@ -41,7 +41,7 @@ class CourseInfo
|
||||
|
||||
### Pending Instructor Tasks Section ####
|
||||
# Currently running tasks
|
||||
@$table_running_tasks = @$section.find ".running-tasks-table"
|
||||
@$table_running_tasks = @$section.find ".running-tasks-table"
|
||||
|
||||
# start polling for task list
|
||||
# if the list is in the DOM
|
||||
|
||||
@@ -84,7 +84,7 @@ class DataDownload
|
||||
|
||||
### Pending Instructor Tasks Section ####
|
||||
# Currently running tasks
|
||||
@$table_running_tasks = @$section.find ".running-tasks-table"
|
||||
@$table_running_tasks = @$section.find ".running-tasks-table"
|
||||
|
||||
# start polling for task list
|
||||
# if the list is in the DOM
|
||||
|
||||
@@ -92,7 +92,7 @@ class Email
|
||||
|
||||
### Pending Instructor Tasks Section ####
|
||||
# Currently running tasks
|
||||
@$table_running_tasks = @$section.find ".running-tasks-table"
|
||||
@$table_running_tasks = @$section.find ".running-tasks-table"
|
||||
|
||||
# start polling for task list
|
||||
# if the list is in the DOM
|
||||
|
||||
@@ -1,44 +1,68 @@
|
||||
<%! from django.utils.translation import ugettext as _ %>
|
||||
<%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>
|
||||
<hr>
|
||||
|
||||
<div class="basic-wrapper">
|
||||
<h2>${_("Basic Course Information")}</h2>
|
||||
|
||||
<ul class="list-input">
|
||||
<li class="field text is-not-editable" id="field-course-organization">
|
||||
<label for="course-organization">${_("Organization:")}</label>
|
||||
<b>${ section_data['course_org'] }</b>
|
||||
</li>
|
||||
|
||||
<li class="field text is-not-editable" id="field-course-number">
|
||||
<label for="course-number">${_("Course Number:")}</label>
|
||||
<b>${ section_data['course_num'] }</b>
|
||||
</li>
|
||||
|
||||
<li class="field text is-not-editable" id="field-course-name">
|
||||
<label for="course-name">${_("Course Name:")}</label>
|
||||
<b>${ section_data['course_name'] }</b>
|
||||
</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>
|
||||
|
||||
%if section_data['has_started']:
|
||||
<b>${_("Yes")}</b>
|
||||
%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 class="basic-data">
|
||||
${_("Course ID")}:
|
||||
${ section_data['course_id'] }
|
||||
</div>
|
||||
|
||||
<div class="basic-data">
|
||||
${_("Students Enrolled")}:
|
||||
${ section_data['enrollment_count'] }
|
||||
</div>
|
||||
|
||||
<div class="basic-data">
|
||||
${_("Started")}:
|
||||
${ section_data['has_started'] }
|
||||
</div>
|
||||
|
||||
<div class="basic-data">
|
||||
${_("Ended")}:
|
||||
${ section_data['has_ended'] }
|
||||
</div>
|
||||
|
||||
<div class="basic-data">
|
||||
${_("Grade Cutoffs")}:
|
||||
${ section_data['grade_cutoffs'] }
|
||||
</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">
|
||||
<hr>
|
||||
<h2> ${_("Pending Instructor Tasks")} </h2>
|
||||
@@ -70,6 +94,3 @@
|
||||
</div>
|
||||
<br>
|
||||
%endif
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user