diff --git a/cms/templates/widgets/header.html b/cms/templates/widgets/header.html index 36665df0ff5d1249c0ee414bb55b833225929f54..4594f113b11263ca1a385782063ec0b40ad808c9 100644 --- a/cms/templates/widgets/header.html +++ b/cms/templates/widgets/header.html @@ -236,9 +236,11 @@ <nav class="nav-account nav-is-signedin nav-dd ui-right" aria-label="${_('Account')}"> <h2 class="sr-only">${_("Account Navigation")}</h2> <ol> - <li class="nav-item nav-account-help"> - <h3 class="title"><span class="label"><a href="${get_online_help_info(online_help_token)['doc_url']}" title="${_('Contextual Online Help')}" rel="noopener" target="_blank">${_("Help")}</a></span></h3> - </li> + % if settings.FEATURES.get('ENABLE_HELP_LINK'): + <li class="nav-item nav-account-help"> + <h3 class="title"><span class="label"><a href="${get_online_help_info(online_help_token)['doc_url']}" title="${_('Contextual Online Help')}" rel="noopener" target="_blank">${_("Help")}</a></span></h3> + </li> + % endif <li class="nav-item nav-account-user"> <%include file="user_dropdown.html" args="online_help_token=online_help_token" /> </li> diff --git a/lms/envs/common.py b/lms/envs/common.py index 01f5e55c118168be738caf1b0daef8965376a796..d9c5b58ebcaba34e5d4fc1a441afd967d629082c 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -263,6 +263,17 @@ FEATURES = { # .. toggle_tickets: https://github.com/edx/edx-platform/pull/1073 'COURSES_ARE_BROWSABLE': True, + # Can be turned off to disable the help link in the navbar + # .. toggle_name: FEATURES['ENABLE_HELP_LINK'] + # .. toggle_implementation: DjangoSetting + # .. toggle_default: True + # .. toggle_description: When True, a help link is displayed on the main navbar. Set False to hide it. + # .. toggle_use_cases: open_edx + # .. toggle_creation_date: 2021-03-05 + # .. toggle_tickets: https://github.com/edx/edx-platform/pull/26106 + 'ENABLE_HELP_LINK': True, + + # .. toggle_name: FEATURES['HIDE_DASHBOARD_COURSES_UNTIL_ACTIVATED'] # .. toggle_implementation: DjangoSetting # .. toggle_default: False diff --git a/lms/templates/header/navbar-authenticated.html b/lms/templates/header/navbar-authenticated.html index 24c7cfc219ada71750245504b283ed0329c62573..4c522824412db4bf1420317a64a863a5a451dde6 100644 --- a/lms/templates/header/navbar-authenticated.html +++ b/lms/templates/header/navbar-authenticated.html @@ -14,6 +14,7 @@ from openedx.core.djangoapps.site_configuration import helpers as configuration_ show_explore_courses = settings.FEATURES.get('COURSES_ARE_BROWSABLE') show_sysadmin_dashboard = settings.FEATURES.get('ENABLE_SYSADMIN_DASHBOARD','') and user.is_staff self.real_user = getattr(user, 'real_user', user) + enable_help_link = settings.FEATURES.get('ENABLE_HELP_LINK') support_link = configuration_helpers.get_value('SUPPORT_SITE_LINK', settings.SUPPORT_SITE_LINK) doc_link = get_online_help_info(online_help_token)['doc_url'] @@ -60,9 +61,11 @@ from openedx.core.djangoapps.site_configuration import helpers as configuration_ % endif </div> <div class="secondary"> - <div class="mobile-nav-item hidden-mobile nav-item"> - <a class="help-link" href="${help_link}" rel="noopener" target="_blank">${_("Help")}</a> - </div> + % if enable_help_link: + <div class="mobile-nav-item hidden-mobile nav-item"> + <a class="help-link" href="${help_link}" rel="noopener" target="_blank">${_("Help")}</a> + </div> + % endif <%include file="user_dropdown.html"/> </div> </div> diff --git a/lms/templates/navigation/bootstrap/navbar-authenticated.html b/lms/templates/navigation/bootstrap/navbar-authenticated.html index 529f7984e25a80731fac3498596c9104ac901b9f..d895f4d9a89fb8e5b77a877d79206dc7d199f517 100644 --- a/lms/templates/navigation/bootstrap/navbar-authenticated.html +++ b/lms/templates/navigation/bootstrap/navbar-authenticated.html @@ -57,12 +57,14 @@ from django.utils.translation import ugettext as _ </ul> <ul class="navbar-nav navbar-right"> - <li class="nav-item mt-2 nav-item-open-collapsed"> - <a href="${get_online_help_info(online_help_token)['doc_url']}" - rel="noopener" - target="_blank" - class="nav-link">${_("Help")}</a> - </li> + % if settings.FEATURES.get('ENABLE_HELP_LINK'): + <li class="nav-item mt-2 nav-item-open-collapsed"> + <a href="${get_online_help_info(online_help_token)['doc_url']}" + rel="noopener" + target="_blank" + class="nav-link">${_("Help")}</a> + </li> + % endif <%include file="../../user_dropdown.html"/> </ul> diff --git a/lms/templates/navigation/navbar-authenticated.html b/lms/templates/navigation/navbar-authenticated.html index b27f17bd4281fd7208876772d22b4370fb3b1052..1873805ec9d6b7c68f6768b0cd3a9fa63309faab 100644 --- a/lms/templates/navigation/navbar-authenticated.html +++ b/lms/templates/navigation/navbar-authenticated.html @@ -41,7 +41,9 @@ from django.utils.translation import ugettext as _ <%include file="../user_dropdown.html"/> -<a href="${get_online_help_info(online_help_token)['doc_url']}" - rel="noopener" - target="_blank" - class="doc-link">${_("Help")}</a> +% if settings.FEATURES.get('ENABLE_HELP_LINK'): + <a href="${get_online_help_info(online_help_token)['doc_url']}" + rel="noopener" + target="_blank" + class="doc-link">${_("Help")}</a> +% endif diff --git a/themes/edx.org/lms/templates/header/navbar-authenticated.html b/themes/edx.org/lms/templates/header/navbar-authenticated.html index 5d595aadb7502767d67f5047d86f1494d81a6ced..1e54026ca943c1bbab820e87c2725b74a09e977c 100644 --- a/themes/edx.org/lms/templates/header/navbar-authenticated.html +++ b/themes/edx.org/lms/templates/header/navbar-authenticated.html @@ -14,6 +14,7 @@ from openedx.core.djangoapps.site_configuration import helpers as configuration_ show_explore_courses = settings.FEATURES.get('COURSES_ARE_BROWSABLE') show_sysadmin_dashboard = settings.FEATURES.get('ENABLE_SYSADMIN_DASHBOARD','') and user.is_staff self.real_user = getattr(user, 'real_user', user) + enable_help_link = settings.FEATURES.get('ENABLE_HELP_LINK') %> <div class="nav-links"> @@ -58,13 +59,15 @@ from openedx.core.djangoapps.site_configuration import helpers as configuration_ </div> <div class="secondary"> - <div class="mobile-nav-item hidden-mobile nav-item"> - % if online_help_token == "instructor": - <a class="help-link" href="${get_online_help_info(online_help_token)['doc_url']}" rel="noopener" target="_blank">${_("Help")}</a> - % else: - <a class="help-link" href="${configuration_helpers.get_value('SUPPORT_SITE_LINK', settings.SUPPORT_SITE_LINK)}" rel="noopener" target="_blank">${_("Help")}</a> - % endif - </div> + % if enable_help_link: + <div class="mobile-nav-item hidden-mobile nav-item"> + % if online_help_token == "instructor": + <a class="help-link" href="${get_online_help_info(online_help_token)['doc_url']}" rel="noopener" target="_blank">${_("Help")}</a> + % else: + <a class="help-link" href="${configuration_helpers.get_value('SUPPORT_SITE_LINK', settings.SUPPORT_SITE_LINK)}" rel="noopener" target="_blank">${_("Help")}</a> + % endif + </div> + % endif <%include file="user_dropdown.html"/> </div> </div>