Commit e276ae2d by Peter Desjardins

Adds a context-sensitive link to learner documentation from the LMS. The base…

Adds a context-sensitive link to learner documentation from the LMS. The base URL defaults to Open edX learner doc and can be overridden with the base URL for edx.org learner doc.  Also relabels the tab for support from help to support.
parent 33ae93ec
......@@ -455,3 +455,7 @@ PARTNER_SUPPORT_EMAIL = ENV_TOKENS.get('PARTNER_SUPPORT_EMAIL', PARTNER_SUPPORT_
# Affiliate cookie tracking
AFFILIATE_COOKIE_NAME = ENV_TOKENS.get('AFFILIATE_COOKIE_NAME', AFFILIATE_COOKIE_NAME)
############## Settings for Studio Context Sensitive Help ##############
DOC_LINK_BASE_URL = ENV_TOKENS.get('DOC_LINK_BASE_URL', DOC_LINK_BASE_URL)
......@@ -1190,3 +1190,7 @@ PARTNER_SUPPORT_EMAIL = ''
# Affiliate cookie tracking
AFFILIATE_COOKIE_NAME = 'affiliate_id'
############## Settings for Studio Context Sensitive Help ##############
DOC_LINK_BASE_URL = None
......@@ -59,8 +59,22 @@ def common_doc_url(request, config_file_object): # pylint: disable=unused-argum
Returns:
The URL for the documentation
"""
# Read an optional configuration property that sets the base
# URL of documentation links. By default, DOC_LINK_BASE_URL
# is null, this test determines whether it is set to a non-null
# value. If it is set, this funtion will use its string value
# as the base of documentation link URLs. If it is not set, the
# function reads the base of the documentation link URLs from
# the .ini configuration file, lms_config.ini or cms_config.ini.
if settings.DOC_LINK_BASE_URL:
doc_base_url = settings.DOC_LINK_BASE_URL
else:
doc_base_url = config_file_object.get("help_settings", "url_base")
# Construct and return the URL for the documentation link.
return "{url_base}/{language}/{version}/{page_path}".format(
url_base=config_file_object.get("help_settings", "url_base"),
url_base=doc_base_url,
language=get_config_value_with_default("locales", settings.LANGUAGE_CODE),
version=config_file_object.get("help_settings", "version"),
page_path=get_config_value_with_default("pages", page_token),
......@@ -69,10 +83,25 @@ def common_doc_url(request, config_file_object): # pylint: disable=unused-argum
def get_pdf_url():
"""
Returns:
The URL for the PDF document using the pdf_settings and the help_settings (version) in the configuration
The URL for the PDF document using the pdf_settings and the
help_settings (version) in the configuration
"""
# Read an optional configuration property that sets the base
# URL of pdf links. By default, DOC_LINK_BASE_URL
# is null, this test determines whether it is set to a non-null
# value. If it is set, this funtion will use its string value
# as the base of documentation link URLs. If it is not set, the
# function reads the base of the documentation link URLs from
# the .ini configuration file, lms_config.ini or cms_config.ini.
if settings.DOC_LINK_BASE_URL:
pdf_base_url = settings.DOC_LINK_BASE_URL
else:
pdf_base_url = config_file_object.get("pdf_settings", "pdf_base")
# Construct and return the URL for the PDF link.
return "{pdf_base}/{version}/{pdf_file}".format(
pdf_base=config_file_object.get("pdf_settings", "pdf_base"),
pdf_base=pdf_base_url,
version=config_file_object.get("help_settings", "version"),
pdf_file=config_file_object.get("pdf_settings", "pdf_file"),
)
......
# below are the server-wide settings for documentation
[help_settings]
url_base = http://edx.readthedocs.org/projects/edx-partner-course-staff
# The optional DOC_LINK_BASE_URL configuration property will override url_base
url_base = http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course
version = latest
......
# below are the server-wide settings for documentation
[help_settings]
# The optional DOC_LINK_BASE_URL configuration property will override url_base
url_base = http://edx.readthedocs.io/projects/open-edx-learner-guide
version = latest
......@@ -17,9 +18,9 @@ pdf_file = open-edx-learner-guide.pdf
default = index.html
instructor = set_up_course/creating_course_certificates.html
instructor = index.html
course = set_up_course/creating_course_certificates.html
course = index.html
profile = sfd_dashboard_profile/index.html
......
......@@ -865,4 +865,9 @@ APP_UPGRADE_CACHE_TIMEOUT = ENV_TOKENS.get('APP_UPGRADE_CACHE_TIMEOUT', APP_UPGR
AFFILIATE_COOKIE_NAME = ENV_TOKENS.get('AFFILIATE_COOKIE_NAME', AFFILIATE_COOKIE_NAME)
############## Settings for Neo4j ############################
NEO4J_CONFIG = AUTH_TOKENS.get('NEO4J_CONFIG')
############## Settings for LMS Context Sensitive Help ##############
DOC_LINK_BASE_URL = ENV_TOKENS.get('DOC_LINK_BASE_URL', DOC_LINK_BASE_URL)
......@@ -2965,3 +2965,7 @@ REDIRECT_CACHE_KEY_PREFIX = 'redirects'
# This should be set in configuration
NEO4J_CONFIG = None
############## Settings for LMS Context Sensitive Help ##############
DOC_LINK_BASE_URL = None
......@@ -10,6 +10,30 @@
width: 100%;
height: 76px;
.doc-link {
position: relative;
@include float(right);
@include margin(($baseline*0.75), ($baseline*0.75), ($baseline*0.75), ($baseline*0.75));
padding: 0;
text-transform: none;
font-size: 14px;
font-weight: bold;
letter-spacing: 0;
color: $base-font-color;
text-decoration: none;
&:hover,
&:focus {
text-decoration: none;
color: $base-font-color;
}
&:visited {
text-decoration: none;
color: $base-font-color;
}
}
.wrapper-header {
@include clearfix();
height: 40px;
......
......@@ -15,7 +15,7 @@ from xmodule.tabs import CourseTabList
% if settings.FEATURES.get('ENABLE_FEEDBACK_SUBMISSION', False):
<div class="help-tab">
<a href="#help-modal" rel="leanModal" role="button">${_("Help")}</a>
<a href="#help-modal" rel="leanModal" role="button">${_("Support")}</a>
</div>
<section id="help-modal" class="modal" aria-hidden="true" role="dialog" tabindex="-1" aria-label="${_("{platform_name} Help").format(platform_name=static.get_platform_name())}">
......
......@@ -100,6 +100,10 @@ site_status_msg = get_site_status_msg(course_id)
<%include file="user_dropdown.html"/>
<a href="${get_online_help_info(online_help_token)['doc_url']}"
target="_blank"
class="doc-link">${_("Help")}</a>
% if should_display_shopping_cart_func() and not (course and static.is_request_in_themed_site()): # see shoppingcart.context_processor.user_has_cart_context_processor
<ol class="user">
<li class="primary">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment