From 545d5eddc8f17b7bbfa5de9c84c1eab95dfb5a1c Mon Sep 17 00:00:00 2001 From: Nicholas D'Alfonso Date: Thu, 3 Oct 2019 14:16:59 -0400 Subject: [PATCH] DISCO-188 publisher link Add publisher link to settings dropdown if the features setting is set. --- cms/djangoapps/contentstore/views/course.py | 7 +++++++ cms/envs/devstack.py | 3 +++ cms/templates/widgets/header.html | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/cms/djangoapps/contentstore/views/course.py b/cms/djangoapps/contentstore/views/course.py index 36d018aac4..28ae7eea8f 100644 --- a/cms/djangoapps/contentstore/views/course.py +++ b/cms/djangoapps/contentstore/views/course.py @@ -648,6 +648,12 @@ def course_index(request, course_key): deprecated_block_names = [block.name for block in deprecated_xblocks()] deprecated_blocks_info = _deprecated_blocks_info(course_module, deprecated_block_names) + frontend_app_publisher_url = configuration_helpers.get_value_for_org( + course_module.location.org, + 'FRONTEND_APP_PUBLISHER_URL', + settings.FEATURES.get('FRONTEND_APP_PUBLISHER_URL', False) + ) + return render_to_response('course_outline.html', { 'language_code': request.LANGUAGE_CODE, 'context_course': course_module, @@ -667,6 +673,7 @@ def course_index(request, course_key): 'action_state_id': current_action.id, }, ) if current_action else None, + 'frontend_app_publisher_url': frontend_app_publisher_url, }) diff --git a/cms/envs/devstack.py b/cms/envs/devstack.py index 78b3939f7b..1f178ccefb 100644 --- a/cms/envs/devstack.py +++ b/cms/envs/devstack.py @@ -128,6 +128,9 @@ FEATURES['CERTIFICATES_HTML_VIEW'] = True ########################## AUTHOR PERMISSION ####################### FEATURES['ENABLE_CREATOR_GROUP'] = False +################### FRONTEND APPLICATION PUBLISHER URL ################### +FEATURES['FRONTEND_APP_PUBLISHER_URL'] = 'http://localhost:18400' + ################################# DJANGO-REQUIRE ############################### # Whether to run django-require in debug mode. diff --git a/cms/templates/widgets/header.html b/cms/templates/widgets/header.html index 156b490e76..ade1805677 100644 --- a/cms/templates/widgets/header.html +++ b/cms/templates/widgets/header.html @@ -106,6 +106,11 @@ ${_("Certificates")} % endif + % if frontend_app_publisher_url: + + % endif