diff --git a/cms/djangoapps/contentstore/views/course.py b/cms/djangoapps/contentstore/views/course.py
index 5b5347158ee4..792e3ce8999b 100644
--- a/cms/djangoapps/contentstore/views/course.py
+++ b/cms/djangoapps/contentstore/views/course.py
@@ -30,7 +30,12 @@
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from opaque_keys.edx.locator import BlockUsageLocator
-from organizations.api import add_organization_course, ensure_organization
+from organizations.api import (
+ add_organization_course,
+ ensure_organization,
+ get_course_organization,
+ get_organization_institutions
+)
from organizations.exceptions import InvalidOrganizationException
from rest_framework.exceptions import ValidationError
@@ -1184,6 +1189,14 @@ def settings_handler(request, course_key_string): # lint-amnesty, pylint: disab
'upgrade_deadline': upgrade_deadline,
'mfe_proctored_exam_settings_url': get_proctored_exam_settings_url(course_module.id),
}
+
+ course_org = get_course_organization(course_key)
+ if course_org:
+ institutions = get_organization_institutions(course_org)
+ settings_context.update({'possible_organization_institutions': list(institutions)})
+ else:
+ settings_context.update({'possible_organization_institutions': []})
+
if is_prerequisite_courses_enabled():
courses, in_process_course_actions = get_courses_accessible_to_user(request)
# exclude current course from the list of available courses
diff --git a/cms/static/js/models/settings/course_details.js b/cms/static/js/models/settings/course_details.js
index 49531192787b..9b637ba92134 100644
--- a/cms/static/js/models/settings/course_details.js
+++ b/cms/static/js/models/settings/course_details.js
@@ -37,6 +37,7 @@ define(['backbone', 'underscore', 'gettext', 'js/models/validation_helpers', 'js
learning_info: [],
instructor_info: {},
self_paced: null,
+ course_institution: '',
revision_number: ''
},
diff --git a/cms/static/js/spec/views/settings/main_spec.js b/cms/static/js/spec/views/settings/main_spec.js
index aa0360672cec..bb47d9eca732 100644
--- a/cms/static/js/spec/views/settings/main_spec.js
+++ b/cms/static/js/spec/views/settings/main_spec.js
@@ -51,6 +51,7 @@ define([
instructors: [{name: '', title: '', organization: '', image: '', bio: ''}]
},
self_paced: false,
+ course_institution: '',
revision_number: ''
},
@@ -199,6 +200,19 @@ define([
);
});
+ it('should save institution as part of course details', function() {
+ var requests = AjaxHelpers.requests(this);
+ var expectedJson = $.extend(true, {}, modelData, {
+ course_institution: ''
+ });
+ $('#course-institution').val('').trigger('change');
+ expect(this.model.get('course_institution')).toEqual('');
+ this.view.saveView();
+ AjaxHelpers.expectJsonRequest(
+ requests, 'POST', urlRoot, expectedJson
+ );
+ });
+
it('should not error if about_page_editable is False', function() {
var requests = AjaxHelpers.requests(this);
// if about_page_editable is false, there is no section.course_details
diff --git a/cms/static/js/views/settings/main.js b/cms/static/js/views/settings/main.js
index 9e795b2de71d..1acc8a9114c5 100644
--- a/cms/static/js/views/settings/main.js
+++ b/cms/static/js/views/settings/main.js
@@ -134,6 +134,8 @@ define(['js/views/validation', 'codemirror', 'underscore', 'jquery', 'jquery.ui'
pre_requisite_courses = pre_requisite_courses.length > 0 ? pre_requisite_courses : '';
this.$el.find('#' + this.fieldToSelectorMap.pre_requisite_courses).val(pre_requisite_courses);
+ this.$el.find('#' + this.fieldToSelectorMap.course_institution).val(this.model.get('course_institution'));
+
if (this.model.get('entrance_exam_enabled') == 'true') {
this.$('#' + this.fieldToSelectorMap.entrance_exam_enabled).attr('checked', this.model.get('entrance_exam_enabled'));
this.$('.div-grade-requirements').show();
@@ -185,6 +187,7 @@ define(['js/views/validation', 'codemirror', 'underscore', 'jquery', 'jquery.ui'
banner_image_asset_path: 'banner-image-url',
video_thumbnail_image_asset_path: 'video-thumbnail-image-url',
pre_requisite_courses: 'pre-requisite-course',
+ course_institution: 'course-institution',
entrance_exam_enabled: 'entrance-exam-enabled',
entrance_exam_minimum_score_pct: 'entrance-exam-minimum-score-pct',
course_settings_learning_fields: 'course-settings-learning-fields',
@@ -318,6 +321,7 @@ define(['js/views/validation', 'codemirror', 'underscore', 'jquery', 'jquery.ui'
case 'course-version':
case 'course-revision-number':
case 'course-title':
+ case 'course-institution':
case 'course-subtitle':
case 'course-duration':
case 'course-description':
diff --git a/cms/templates/settings.html b/cms/templates/settings.html
index ca148fca5894..952ec3e0b43a 100644
--- a/cms/templates/settings.html
+++ b/cms/templates/settings.html
@@ -395,6 +395,17 @@
${_('Course Details')}
${_("Identify the course revision number here. This is used to assist with identifying what changes have been made for a course. Placeholder indicates a date format (YYYY.MM), however, we don't have to explicity tie this to a date for the number identification.")}
+
+
+
+ ${_("Institution that is hosting this course run")}
+
+
This program of courses equips learners for entry into the FAA mechanic pathway. Upon completion, they gain foundational knowledge in mathematics, aircraft drawings, weight and balance, aircraft materials, processes and tools, physics, electricity, inspection, ground operations, and FAA regulations governing maintenance technician certification and work.
+
+
+
+
+
Pre-Program
+
+
New Learner: Take this survey upon program entry.
+
This will help us understand your career awareness and interest, gauge where you are with FAA General maintenance knowledge and skill confidence, career plans, and demographic information.
Continuing Learner: Take this survey upon program exit.
+
This will help us understand your completion of FAA General maintenance program, career awareness and interest, knowledge and skill confidence, and demographic information.