From 58c6b9bb6145f2ee0be447b47bc430790eb38685 Mon Sep 17 00:00:00 2001 From: Miles Steele Date: Thu, 8 Aug 2013 10:09:03 -0400 Subject: [PATCH 1/5] add privilege copy --- .../instructor_dashboard_2/membership.html | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/lms/templates/instructor/instructor_dashboard_2/membership.html b/lms/templates/instructor/instructor_dashboard_2/membership.html index c226f74215..b22d31e190 100644 --- a/lms/templates/instructor/instructor_dashboard_2/membership.html +++ b/lms/templates/instructor/instructor_dashboard_2/membership.html @@ -59,10 +59,10 @@ data-rolename="staff" data-display-name="Course Staff" data-info-text=" - Course staff can help you manage limited aspects of your course. Staff can - enroll and unenroll students, as well as modify their grades and see all - course data. Course staff are not given access to Studio will not be able to - edit your course." + Course staff can help you manage limited aspects of your course. Staff + can enroll and unenroll students, as well as modify their grades and + see all course data. Course staff are not automatically given access + to Studio and will not be able to edit your course." data-list-endpoint="${ section_data['list_course_role_members_url'] }" data-modify-endpoint="${ section_data['modify_access_url'] }" data-add-button-label="Add Staff" @@ -74,8 +74,7 @@ data-display-name="Instructors" data-info-text=" Instructors are the core administration of your course. Instructors can - add and remove course staff, as well as administer forum access. - " + add and remove course staff, as well as administer forum access." data-list-endpoint="${ section_data['list_course_role_members_url'] }" data-modify-endpoint="${ section_data['modify_access_url'] }" data-add-button-label="Add Instructor" @@ -88,7 +87,7 @@ data-info-text=" Beta testers can see course content before the rest of the students. They can make sure that the content works, but have no additional - privelages." + privileges." data-list-endpoint="${ section_data['list_course_role_members_url'] }" data-modify-endpoint="${ section_data['modify_access_url'] }" data-add-button-label="Add Beta Tester" @@ -99,6 +98,9 @@
Date: Thu, 8 Aug 2013 11:05:59 -0400 Subject: [PATCH 2/5] hide empty management list selector, add explanation text --- .../instructor_dashboard/membership.coffee | 2 + .../instructor_dashboard_2/membership.html | 52 ++++++++++--------- 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/lms/static/coffee/src/instructor_dashboard/membership.coffee b/lms/static/coffee/src/instructor_dashboard/membership.coffee index 733480e268..a50cd2c3dd 100644 --- a/lms/static/coffee/src/instructor_dashboard/membership.coffee +++ b/lms/static/coffee/src/instructor_dashboard/membership.coffee @@ -463,6 +463,8 @@ class Membership text: auth_list.$container.data 'display-name' data: auth_list: auth_list + if @auth_lists.length is 0 + @$list_selector.hide() @$list_selector.change => $opt = @$list_selector.children('option:selected') diff --git a/lms/templates/instructor/instructor_dashboard_2/membership.html b/lms/templates/instructor/instructor_dashboard_2/membership.html index b22d31e190..0a96d23a27 100644 --- a/lms/templates/instructor/instructor_dashboard_2/membership.html +++ b/lms/templates/instructor/instructor_dashboard_2/membership.html @@ -54,6 +54,14 @@
+ %if not section_data['access']['instructor']: +

+ Staff cannot modify staff or beta tester lists. To modify these lists, + contact your instructor and ask them to add you as an instructor for staff + and beta lists, or a forum admin for forum management. +

+ %endif + %if section_data['access']['instructor']:
- %if section_data['access']['instructor']: -
- %endif +
- %endif - %if section_data['access']['instructor']: -
+
%endif %if section_data['access']['instructor'] or section_data['access']['forum_admin']: From e9aca1363641481f450683300c4f00f5efc78573 Mon Sep 17 00:00:00 2001 From: Miles Steele Date: Thu, 8 Aug 2013 10:09:47 -0400 Subject: [PATCH 3/5] enable beta dashboard --- lms/envs/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lms/envs/common.py b/lms/envs/common.py index 0cbcbb774a..de78816a10 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -145,7 +145,7 @@ MITX_FEATURES = { 'ENABLE_INSTRUCTOR_BACKGROUND_TASKS': True, # Enable instructor dash beta version link - 'ENABLE_INSTRUCTOR_BETA_DASHBOARD': False, + 'ENABLE_INSTRUCTOR_BETA_DASHBOARD': True, # Allow use of the hint managment instructor view. 'ENABLE_HINTER_INSTRUCTOR_VIEW': False, From b1074ff1acc0d05a28569550cf5c1c188e860be6 Mon Sep 17 00:00:00 2001 From: Miles Steele Date: Fri, 9 Aug 2013 16:56:35 -0400 Subject: [PATCH 4/5] add i18n --- .../instructor/views/instructor_dashboard.py | 13 +-- .../instructor_dashboard_2/analytics.html | 13 +-- .../instructor_dashboard_2/course_info.html | 15 ++-- .../instructor_dashboard_2/data_download.html | 5 +- .../instructor_dashboard_2.html | 3 +- .../instructor_dashboard_2/membership.html | 84 +++++++++---------- .../instructor_dashboard_2/student_admin.html | 62 +++++++------- 7 files changed, 101 insertions(+), 94 deletions(-) diff --git a/lms/djangoapps/instructor/views/instructor_dashboard.py b/lms/djangoapps/instructor/views/instructor_dashboard.py index c37fb1bc9f..9a1bea222e 100644 --- a/lms/djangoapps/instructor/views/instructor_dashboard.py +++ b/lms/djangoapps/instructor/views/instructor_dashboard.py @@ -2,6 +2,7 @@ Instructor Dashboard Views """ +from django.utils.translation import ugettext as _ from django_future.csrf import ensure_csrf_cookie from django.views.decorators.cache import cache_control from mitxmako.shortcuts import render_to_response @@ -72,7 +73,7 @@ def _section_course_info(course_id): section_data = {} section_data['section_key'] = 'course_info' - section_data['section_display_name'] = 'Course Info' + section_data['section_display_name'] = _('Course Info') section_data['course_id'] = course_id section_data['course_display_name'] = course.display_name section_data['enrollment_count'] = CourseEnrollment.objects.filter(course_id=course_id).count() @@ -87,7 +88,7 @@ def _section_course_info(course_id): # section_data['offline_grades'] = offline_grades_available(course_id) try: - section_data['course_errors'] = [(escape(a), '') for (a, _) in modulestore().get_item_errors(course.location)] + section_data['course_errors'] = [(escape(a), '') for (a, _unused) in modulestore().get_item_errors(course.location)] except Exception: section_data['course_errors'] = [('Error fetching errors', '')] @@ -98,7 +99,7 @@ def _section_membership(course_id, access): """ Provide data for the corresponding dashboard section """ section_data = { 'section_key': 'membership', - 'section_display_name': 'Membership', + 'section_display_name': _('Membership'), 'access': access, 'enroll_button_url': reverse('students_update_enrollment', kwargs={'course_id': course_id}), 'unenroll_button_url': reverse('students_update_enrollment', kwargs={'course_id': course_id}), @@ -114,7 +115,7 @@ def _section_student_admin(course_id, access): """ Provide data for the corresponding dashboard section """ section_data = { 'section_key': 'student_admin', - 'section_display_name': 'Student Admin', + 'section_display_name': _('Student Admin'), 'access': access, 'get_student_progress_url_url': reverse('get_student_progress_url', kwargs={'course_id': course_id}), 'enrollment_url': reverse('students_update_enrollment', kwargs={'course_id': course_id}), @@ -129,7 +130,7 @@ def _section_data_download(course_id): """ Provide data for the corresponding dashboard section """ section_data = { 'section_key': 'data_download', - 'section_display_name': 'Data Download', + 'section_display_name': _('Data Download'), 'get_grading_config_url': reverse('get_grading_config', kwargs={'course_id': course_id}), 'get_students_features_url': reverse('get_students_features', kwargs={'course_id': course_id}), } @@ -140,7 +141,7 @@ def _section_analytics(course_id): """ Provide data for the corresponding dashboard section """ section_data = { 'section_key': 'analytics', - 'section_display_name': 'Analytics', + 'section_display_name': _('Analytics'), 'get_distribution_url': reverse('get_distribution', kwargs={'course_id': course_id}), 'proxy_legacy_analytics_url': reverse('proxy_legacy_analytics', kwargs={'course_id': course_id}), } diff --git a/lms/templates/instructor/instructor_dashboard_2/analytics.html b/lms/templates/instructor/instructor_dashboard_2/analytics.html index 8469c1db93..baa446cf74 100644 --- a/lms/templates/instructor/instructor_dashboard_2/analytics.html +++ b/lms/templates/instructor/instructor_dashboard_2/analytics.html @@ -1,3 +1,4 @@ +<%! from django.utils.translation import ugettext as _ %> <%page args="section_data"/>
-

Batch Enrollment

-

Enter student emails separated by new lines or commas.

- +

${_("Batch Enrollment")}

+

${_("Enter student emails separated by new lines or commas.")}

+
- - - - + + + +
-

If auto enroll is checked, students who have not yet registered for edX will be automatically enrolled. - If auto enroll is left unchecked, students who have not yet registered for edX will not be enrolled, - but will be allowed to enroll. +

${_("If auto enroll is")} ${_("checked")}${_(", students who have not yet registered for edX will be automatically enrolled.")} + ${_("If auto enroll is left")} ${_("unchecked")}, ${_("students who have not yet registered for edX will not be enrolled, but will be allowed to enroll.")}

@@ -46,92 +46,92 @@
-

Administration List Management

+

${_("Administration List Management")}

%if not section_data['access']['instructor']:

- Staff cannot modify staff or beta tester lists. To modify these lists, - contact your instructor and ask them to add you as an instructor for staff - and beta lists, or a forum admin for forum management. + ${_("Staff cannot modify staff or beta tester lists. To modify these lists, " + "contact your instructor and ask them to add you as an instructor for staff " + "and beta lists, or a forum admin for forum management.")}

%endif %if section_data['access']['instructor']:
%endif %if section_data['access']['instructor'] or section_data['access']['forum_admin']:
%endif diff --git a/lms/templates/instructor/instructor_dashboard_2/student_admin.html b/lms/templates/instructor/instructor_dashboard_2/student_admin.html index bf99fcea57..047369fc46 100644 --- a/lms/templates/instructor/instructor_dashboard_2/student_admin.html +++ b/lms/templates/instructor/instructor_dashboard_2/student_admin.html @@ -1,50 +1,51 @@ +<%! from django.utils.translation import ugettext as _ %> <%page args="section_data"/>
-

Student-specific grade adjustment

+

${_("Student-specific grade adjustment")}

- +

- - + + ##

Specify a particular problem in the course here by its url:

- +

- You may use just the "urlname" if a problem, or "modulename/urlname" if not. - (For example, if the location is i4x://university/course/problem/problemname, - then just provide the problemname. - If the location is i4x://university/course/notaproblem/someothername, then - provide notaproblem/someothername.) + ${_('You may use just the "urlname" if a problem, or "modulename/urlname" if not. ' + '(For example, if the location is i4x://university/course/problem/problemname, ' + 'then just provide the problemname. ' + 'If the location is i4x://university/course/notaproblem/someothername, then ' + 'provide notaproblem/someothername.)')}

- + %if section_data['access']['instructor']:

You may also delete the entire state of a student for the specified module:

- + %endif %if settings.MITX_FEATURES.get('ENABLE_INSTRUCTOR_BACKGROUND_TASKS') and section_data['access']['instructor']: - + %endif %if settings.MITX_FEATURES.get('ENABLE_INSTRUCTOR_BACKGROUND_TASKS') and section_data['access']['instructor']:

- Rescoring runs in the background, and status for active tasks will appear in a table below. - To see status for all tasks submitted for this course and student, click on this button: + ${_("Rescoring runs in the background, and status for active tasks will appear in a table below. " + "To see status for all tasks submitted for this problem and student, click on this button:")}

- +
%endif
@@ -56,26 +57,27 @@

- Specify a particular problem in the course here by its url: + ${_("Specify a particular problem in the course here by its url:")}

- You may use just the "urlname" if a problem, or "modulename/urlname" if not. - (For example, if the location is i4x://university/course/problem/problemname, - then just provide the problemname. - If the location is i4x://university/course/notaproblem/someothername, then - provide notaproblem/someothername.) + ${_('You may use just the "urlname" if a problem, or "modulename/urlname" if not. ' + '(For example, if the location is i4x://university/course/problem/problemname, ' + 'then just provide the problemname. ' + 'If the location is i4x://university/course/notaproblem/someothername, then ' + 'provide notaproblem/someothername.)')}

- Then select an action: - - + ${_("Then select an action")}: + +

-

These actions run in the background, and status for active tasks will appear in a table below. - To see status for all tasks submitted for this problem, click on this button: +

+ ${_("These actions run in the background, and status for active tasks will appear in a table below. " + "To see status for all tasks submitted for this problem, click on this button")}:

- +

@@ -83,7 +85,7 @@

-

Pending Instructor Tasks

+

${_("Pending Instructor Tasks")}

%endif From 43afb9a940a2dca044091c5099d36aa0b3fd473c Mon Sep 17 00:00:00 2001 From: Miles Steele Date: Mon, 12 Aug 2013 13:21:39 -0400 Subject: [PATCH 5/5] fix i18n --- .../instructor_dashboard_2/membership.html | 4 ++-- .../instructor_dashboard_2/student_admin.html | 22 ++++++++++--------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/lms/templates/instructor/instructor_dashboard_2/membership.html b/lms/templates/instructor/instructor_dashboard_2/membership.html index bcccb7fede..eea52cdfc6 100644 --- a/lms/templates/instructor/instructor_dashboard_2/membership.html +++ b/lms/templates/instructor/instructor_dashboard_2/membership.html @@ -37,8 +37,8 @@
-

${_("If auto enroll is")} ${_("checked")}${_(", students who have not yet registered for edX will be automatically enrolled.")} - ${_("If auto enroll is left")} ${_("unchecked")}, ${_("students who have not yet registered for edX will not be enrolled, but will be allowed to enroll.")} +

${_("If auto enroll is checked, students who have not yet registered for edX will be automatically enrolled.")} + ${_("If auto enroll is left unchecked, students who have not yet registered for edX will not be enrolled, but will be allowed to enroll.")}

diff --git a/lms/templates/instructor/instructor_dashboard_2/student_admin.html b/lms/templates/instructor/instructor_dashboard_2/student_admin.html index 047369fc46..2ccef2164c 100644 --- a/lms/templates/instructor/instructor_dashboard_2/student_admin.html +++ b/lms/templates/instructor/instructor_dashboard_2/student_admin.html @@ -22,11 +22,12 @@

Specify a particular problem in the course here by its url:

- ${_('You may use just the "urlname" if a problem, or "modulename/urlname" if not. ' - '(For example, if the location is i4x://university/course/problem/problemname, ' - 'then just provide the problemname. ' - 'If the location is i4x://university/course/notaproblem/someothername, then ' - 'provide notaproblem/someothername.)')} + ${_('You may use just the "urlname" if a problem, or "modulename/urlname" if not. (For example, if the location is {location1}, then just provide the {urlname1}. If the location is {location2}, then provide {urlname2}.)').format( + location1="i4x://university/course/problem/problemname", + urlname1="problemname", + location2="i4x://university/course/notaproblem/someothername", + urlname2="notaproblem/someothername") + }

@@ -61,11 +62,12 @@

- ${_('You may use just the "urlname" if a problem, or "modulename/urlname" if not. ' - '(For example, if the location is i4x://university/course/problem/problemname, ' - 'then just provide the problemname. ' - 'If the location is i4x://university/course/notaproblem/someothername, then ' - 'provide notaproblem/someothername.)')} + ${_('You may use just the "urlname" if a problem, or "modulename/urlname" if not. (For example, if the location is {location1}, then just provide the {urlname1}. If the location is {location2}, then provide {urlname2}.)').format( + location1="i4x://university/course/problem/problemname", + urlname1="problemname", + location2="i4x://university/course/notaproblem/someothername", + urlname2="notaproblem/someothername") + }

${_("Then select an action")}: