diff --git a/cms/djangoapps/contentstore/rest_api/v1/views/tests/test_course_index.py b/cms/djangoapps/contentstore/rest_api/v1/views/tests/test_course_index.py index c9ff5f9c36e3..eebb6cd90ebb 100644 --- a/cms/djangoapps/contentstore/rest_api/v1/views/tests/test_course_index.py +++ b/cms/djangoapps/contentstore/rest_api/v1/views/tests/test_course_index.py @@ -10,7 +10,7 @@ from cms.djangoapps.contentstore.config.waffle import CUSTOM_RELATIVE_DATES from cms.djangoapps.contentstore.rest_api.v1.mixins import PermissionAccessMixin from cms.djangoapps.contentstore.tests.utils import CourseTestCase -from cms.djangoapps.contentstore.utils import get_lms_link_for_item +from cms.djangoapps.contentstore.utils import get_lms_link_for_item, get_pages_and_resources_url from cms.djangoapps.contentstore.views.course import _course_outline_json from common.djangoapps.student.tests.factories import UserFactory from openedx.core.djangoapps.waffle_utils.testutils import WAFFLE_TABLES @@ -82,6 +82,7 @@ def test_course_index_response(self): "enable_in_context": True, "enable_graded_units": False, "unit_level_visibility": True, + 'discussion_configuration_url': f'{get_pages_and_resources_url(self.course.id)}/discussion/settings', }, "advance_settings_url": f"/settings/advanced/{self.course.id}", } @@ -128,6 +129,7 @@ def test_course_index_response_with_show_locators(self): "enable_in_context": True, "enable_graded_units": False, "unit_level_visibility": True, + 'discussion_configuration_url': f'{get_pages_and_resources_url(self.course.id)}/discussion/settings', }, "advance_settings_url": f"/settings/advanced/{self.course.id}", } diff --git a/cms/djangoapps/contentstore/utils.py b/cms/djangoapps/contentstore/utils.py index 91e85f8df660..c72a7e3c3aa0 100644 --- a/cms/djangoapps/contentstore/utils.py +++ b/cms/djangoapps/contentstore/utils.py @@ -1756,6 +1756,9 @@ def _get_course_index_context(request, course_key, course_block): proctoring_errors = CourseMetadata.validate_proctoring_settings(course_block, advanced_dict, request.user) user_clipboard = content_staging_api.get_user_clipboard_json(request.user.id, request) + course_block.discussions_settings['discussion_configuration_url'] = ( + f'{get_pages_and_resources_url(course_block.id)}/discussion/settings' + ) course_index_context = { 'language_code': request.LANGUAGE_CODE, diff --git a/cms/static/js/views/modals/course_outline_modals.js b/cms/static/js/views/modals/course_outline_modals.js index 1e90b8455f41..f79e65d20779 100644 --- a/cms/static/js/views/modals/course_outline_modals.js +++ b/cms/static/js/views/modals/course_outline_modals.js @@ -985,9 +985,14 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview', } }, getContext: function() { - return { - hasDiscussionEnabled: this.currentValue() - }; + return $.extend( + {}, + AbstractEditor.prototype.getContext.call(this), + { + hasDiscussionEnabled: this.currentValue(), + discussion_configuration_url: course.get('discussions_settings').discussion_configuration_url + } + ); } }); diff --git a/cms/templates/js/discussion-editor.underscore b/cms/templates/js/discussion-editor.underscore index cbc734e9bf33..4ccbbeb346bd 100644 --- a/cms/templates/js/discussion-editor.underscore +++ b/cms/templates/js/discussion-editor.underscore @@ -12,7 +12,19 @@ <%- gettext('Topics for unpublished units would not be created') %>
- <%- gettext('Please enable discussions for graded units from course authoring app') %> + + <%- gettext('Please enable discussions for graded units from the') %> + + <%- gettext('Discussion Configuration') %> + + +