Updated URLs to course-authoring MFE (#24468)
* updated urls to course-authoring MFE * updates for requested changes * updated for pylint errors
This commit is contained in:
@@ -39,7 +39,11 @@ from opaque_keys import InvalidKeyError
|
||||
from opaque_keys.edx.keys import AssetKey, CourseKey
|
||||
from six import text_type
|
||||
|
||||
from contentstore.utils import get_lms_link_for_certificate_web_view, reverse_course_url
|
||||
from contentstore.utils import (
|
||||
get_lms_link_for_certificate_web_view,
|
||||
reverse_course_url,
|
||||
get_proctored_exam_settings_url
|
||||
)
|
||||
from contentstore.views.assets import delete_asset
|
||||
from contentstore.views.exception import AssetNotFoundException
|
||||
from course_modes.models import CourseMode
|
||||
@@ -416,6 +420,8 @@ def certificates_list_handler(request, course_key_string):
|
||||
|
||||
is_active, certificates = CertificateManager.is_activated(course)
|
||||
|
||||
course_authoring_microfrontend_url = get_proctored_exam_settings_url(course)
|
||||
|
||||
return render_to_response('certificates.html', {
|
||||
'context_course': course,
|
||||
'certificate_url': certificate_url,
|
||||
@@ -427,7 +433,8 @@ def certificates_list_handler(request, course_key_string):
|
||||
'certificate_web_view_url': certificate_web_view_url,
|
||||
'is_active': is_active,
|
||||
'is_global_staff': GlobalStaff().has_user(request.user),
|
||||
'certificate_activation_handler_url': activation_handler_url
|
||||
'certificate_activation_handler_url': activation_handler_url,
|
||||
'course_authoring_microfrontend_url': course_authoring_microfrontend_url,
|
||||
})
|
||||
elif "application/json" in request.META.get('HTTP_ACCEPT'):
|
||||
# Retrieve the list of certificates for the specified course
|
||||
|
||||
@@ -43,6 +43,7 @@ from contentstore.tasks import rerun_course as rerun_course_task
|
||||
from contentstore.utils import (
|
||||
add_instructor,
|
||||
get_lms_link_for_item,
|
||||
get_proctored_exam_settings_url,
|
||||
initialize_permissions,
|
||||
remove_all_instructors,
|
||||
reverse_course_url,
|
||||
@@ -653,6 +654,8 @@ def course_index(request, course_key):
|
||||
settings.FEATURES.get('FRONTEND_APP_PUBLISHER_URL', False)
|
||||
)
|
||||
|
||||
course_authoring_microfrontend_url = get_proctored_exam_settings_url(course_module)
|
||||
|
||||
return render_to_response('course_outline.html', {
|
||||
'language_code': request.LANGUAGE_CODE,
|
||||
'context_course': course_module,
|
||||
@@ -673,6 +676,7 @@ def course_index(request, course_key):
|
||||
},
|
||||
) if current_action else None,
|
||||
'frontend_app_publisher_url': frontend_app_publisher_url,
|
||||
'course_authoring_microfrontend_url': course_authoring_microfrontend_url,
|
||||
})
|
||||
|
||||
|
||||
@@ -1082,6 +1086,8 @@ def settings_handler(request, course_key_string):
|
||||
upgrade_deadline = (verified_mode and verified_mode.expiration_datetime and
|
||||
verified_mode.expiration_datetime.isoformat())
|
||||
|
||||
course_authoring_microfrontend_url = get_proctored_exam_settings_url(course_module)
|
||||
|
||||
settings_context = {
|
||||
'context_course': course_module,
|
||||
'course_locator': course_key,
|
||||
@@ -1105,6 +1111,7 @@ def settings_handler(request, course_key_string):
|
||||
'is_entrance_exams_enabled': is_entrance_exams_enabled(),
|
||||
'enable_extended_course_details': enable_extended_course_details,
|
||||
'upgrade_deadline': upgrade_deadline,
|
||||
'course_authoring_microfrontend_url': course_authoring_microfrontend_url,
|
||||
}
|
||||
if is_prerequisite_courses_enabled():
|
||||
courses, in_process_course_actions = get_courses_accessible_to_user(request)
|
||||
@@ -1219,12 +1226,15 @@ def grading_handler(request, course_key_string, grader_index=None):
|
||||
if 'text/html' in request.META.get('HTTP_ACCEPT', '') and request.method == 'GET':
|
||||
course_details = CourseGradingModel.fetch(course_key)
|
||||
|
||||
course_authoring_microfrontend_url = get_proctored_exam_settings_url(course_module)
|
||||
|
||||
return render_to_response('settings_graders.html', {
|
||||
'context_course': course_module,
|
||||
'course_locator': course_key,
|
||||
'course_details': course_details,
|
||||
'grading_url': reverse_course_url('grading_handler', course_key),
|
||||
'is_credit_course': is_credit_course(course_key),
|
||||
'course_authoring_microfrontend_url': course_authoring_microfrontend_url,
|
||||
})
|
||||
elif 'application/json' in request.META.get('HTTP_ACCEPT', ''):
|
||||
if request.method == 'GET':
|
||||
@@ -1322,11 +1332,14 @@ def advanced_settings_handler(request, course_key_string):
|
||||
settings.FEATURES.get('ENABLE_PUBLISHER', False)
|
||||
)
|
||||
|
||||
course_authoring_microfrontend_url = get_proctored_exam_settings_url(course_module)
|
||||
|
||||
return render_to_response('settings_advanced.html', {
|
||||
'context_course': course_module,
|
||||
'advanced_dict': advanced_dict,
|
||||
'advanced_settings_url': reverse_course_url('advanced_settings_handler', course_key),
|
||||
'publisher_enabled': publisher_enabled,
|
||||
'course_authoring_microfrontend_url': course_authoring_microfrontend_url,
|
||||
|
||||
})
|
||||
elif 'application/json' in request.META.get('HTTP_ACCEPT', ''):
|
||||
@@ -1671,6 +1684,8 @@ def group_configurations_list_handler(request, course_key_string):
|
||||
if not has_content_groups:
|
||||
displayable_partitions.append(GroupConfiguration.get_or_create_content_group(store, course))
|
||||
|
||||
course_authoring_microfrontend_url = get_proctored_exam_settings_url(course)
|
||||
|
||||
return render_to_response('group_configurations.html', {
|
||||
'context_course': course,
|
||||
'group_configuration_url': group_configuration_url,
|
||||
@@ -1678,7 +1693,8 @@ def group_configurations_list_handler(request, course_key_string):
|
||||
'experiment_group_configurations': experiment_group_configurations,
|
||||
'should_show_experiment_groups': should_show_experiment_groups,
|
||||
'all_group_configurations': displayable_partitions,
|
||||
'should_show_enrollment_track': should_show_enrollment_track
|
||||
'should_show_enrollment_track': should_show_enrollment_track,
|
||||
'course_authoring_microfrontend_url': course_authoring_microfrontend_url,
|
||||
})
|
||||
elif "application/json" in request.META.get('HTTP_ACCEPT'):
|
||||
if request.method == 'POST':
|
||||
|
||||
Reference in New Issue
Block a user