From a6a7b7edb77ef1ea60f6885184e399391e1935cc Mon Sep 17 00:00:00 2001
From: Gregory Martin
Date: Thu, 17 Nov 2016 14:30:06 -0500
Subject: [PATCH 1/2] instructor dash course start and end
---
.../instructor/views/instructor_dashboard.py | 5 ++---
lms/templates/courseware/accordion.html | 1 -
.../instructor_dashboard_2/course_info.html | 12 ++++++++----
.../instructor_dashboard_2.html | 4 ++++
4 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/lms/djangoapps/instructor/views/instructor_dashboard.py b/lms/djangoapps/instructor/views/instructor_dashboard.py
index 8c3327f3a2..aa5be26d96 100644
--- a/lms/djangoapps/instructor/views/instructor_dashboard.py
+++ b/lms/djangoapps/instructor/views/instructor_dashboard.py
@@ -48,7 +48,6 @@ from certificates.models import (
)
from certificates import api as certs_api
from bulk_email.models import BulkEmailFlag
-from util.date_utils import get_default_time_display
from class_dashboard.dashboard_data import get_section_display_name, get_array_section_has_problem
from .tools import get_units_with_due_date, title_or_url
@@ -430,8 +429,8 @@ def _section_course_info(course, access):
'course_display_name': course.display_name,
'has_started': course.has_started(),
'has_ended': course.has_ended(),
- 'start_date': get_default_time_display(course.start),
- 'end_date': get_default_time_display(course.end) or _('No end date set'),
+ 'start_date': course.start,
+ 'end_date': course.end or None,
'num_sections': len(course.children),
'list_instructor_tasks_url': reverse('list_instructor_tasks', kwargs={'course_id': unicode(course_key)}),
}
diff --git a/lms/templates/courseware/accordion.html b/lms/templates/courseware/accordion.html
index 2327f028de..b0c9cab9a5 100644
--- a/lms/templates/courseware/accordion.html
+++ b/lms/templates/courseware/accordion.html
@@ -2,7 +2,6 @@
<%namespace name='static' file='../static_content.html'/>
<%!
from django.core.urlresolvers import reverse
- from util.date_utils import get_time_display
from django.utils.translation import ugettext as _
from django.conf import settings
from openedx.core.djangolib.markup import HTML, Text
diff --git a/lms/templates/instructor/instructor_dashboard_2/course_info.html b/lms/templates/instructor/instructor_dashboard_2/course_info.html
index 357672bd22..11297601e1 100644
--- a/lms/templates/instructor/instructor_dashboard_2/course_info.html
+++ b/lms/templates/instructor/instructor_dashboard_2/course_info.html
@@ -66,14 +66,17 @@ from openedx.core.djangolib.markup import HTML, Text
- ${ section_data['start_date'] }
+
- ${ section_data['end_date'] }
+ % if course.end is None:
+ ${_("No end date set")}
+ % else:
+
+ % endif
-
@@ -110,8 +113,8 @@ from openedx.core.djangolib.markup import HTML, Text
)}
%endif
-
+
%if settings.FEATURES.get('ENABLE_INSTRUCTOR_BACKGROUND_TASKS'):
@@ -148,3 +151,4 @@ from openedx.core.djangolib.markup import HTML, Text
%endif
+
diff --git a/lms/templates/instructor/instructor_dashboard_2/instructor_dashboard_2.html b/lms/templates/instructor/instructor_dashboard_2/instructor_dashboard_2.html
index 4ee0efa67f..cda213d72d 100644
--- a/lms/templates/instructor/instructor_dashboard_2/instructor_dashboard_2.html
+++ b/lms/templates/instructor/instructor_dashboard_2/instructor_dashboard_2.html
@@ -126,3 +126,7 @@ from django.core.urlresolvers import reverse
+
+<%static:require_module_async module_name="js/dateutil_factory" class_name="DateUtilFactory">
+ DateUtilFactory.transform(iterationKey=".localized-datetime");
+%static:require_module_async>
From 2d60c65e7b6e8e7058732aabb401603b10334794 Mon Sep 17 00:00:00 2001
From: Gregory Martin
Date: Fri, 18 Nov 2016 13:56:52 -0500
Subject: [PATCH 2/2] review fix
---
lms/djangoapps/instructor/views/instructor_dashboard.py | 2 +-
.../instructor/instructor_dashboard_2/course_info.html | 5 ++---
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/lms/djangoapps/instructor/views/instructor_dashboard.py b/lms/djangoapps/instructor/views/instructor_dashboard.py
index aa5be26d96..75eeae3895 100644
--- a/lms/djangoapps/instructor/views/instructor_dashboard.py
+++ b/lms/djangoapps/instructor/views/instructor_dashboard.py
@@ -430,7 +430,7 @@ def _section_course_info(course, access):
'has_started': course.has_started(),
'has_ended': course.has_ended(),
'start_date': course.start,
- 'end_date': course.end or None,
+ 'end_date': course.end,
'num_sections': len(course.children),
'list_instructor_tasks_url': reverse('list_instructor_tasks', kwargs={'course_id': unicode(course_key)}),
}
diff --git a/lms/templates/instructor/instructor_dashboard_2/course_info.html b/lms/templates/instructor/instructor_dashboard_2/course_info.html
index 11297601e1..d3cd9ba5d9 100644
--- a/lms/templates/instructor/instructor_dashboard_2/course_info.html
+++ b/lms/templates/instructor/instructor_dashboard_2/course_info.html
@@ -66,7 +66,7 @@ from openedx.core.djangolib.markup import HTML, Text
-
+
@@ -74,7 +74,7 @@ from openedx.core.djangolib.markup import HTML, Text
% if course.end is None:
${_("No end date set")}
% else:
-
+
% endif
@@ -151,4 +151,3 @@ from openedx.core.djangolib.markup import HTML, Text
%endif
-