Commit 6110b54c by Diana Huang

Address code review feedback

* Fix indentation/line break issues
* Handle marketing root URL as a separate case in marketing_link
* Move link map to its own setting.
parent a8ea201b
......@@ -29,13 +29,18 @@ def marketing_link(name):
which URL should be provided.
"""
link_map = settings.MKTG_URLS.get('LINK_MAP')
# link_map maps URLs from the marketing site to the old equivalent on
# the Django site
link_map = settings.MKTG_URL_LINK_MAP
if settings.MITX_FEATURES.get('ENABLE_MKTG_SITE'):
# special case for when we only want the root marketing URL
if name == 'ROOT':
return settings.MKTG_URLS.get('ROOT')
return settings.MKTG_URLS.get('ROOT') + settings.MKTG_URLS.get(name)
elif name in link_map:
return reverse(link_map[name])
else:
return ''
return '#'
def render_to_string(template_name, dictionary, context=None, namespace='main'):
......
......@@ -595,7 +595,8 @@ MKTG_URLS = {'ROOT': '',
'CONTACT': '/contact',
'HOW_IT_WORKS': '/how-it-works',
'SCHOOLS': '/schools'}
MKTG_URLS['LINK_MAP'] = {'ABOUT': 'about_edx',
'CONTACT': 'contact',
'FAQ': 'help_edx',
'COURSES': 'courses'}
MKTG_URL_LINK_MAP = {'ABOUT': 'about_edx',
'CONTACT': 'contact',
'FAQ': 'help_edx',
'COURSES': 'courses',
'ROOT': 'root'}
......@@ -326,9 +326,9 @@
% else:
<section class="empty-dashboard-message">
<p>Looks like you haven't registered for any courses yet.</p>
<a href="${marketing_link('COURSES')}">
Find courses now!
</a>
<a href="${marketing_link('COURSES')}">
Find courses now!
</a>
</section>
% endif
......
......@@ -8,17 +8,19 @@
<nav class="nav-colophon">
<ol>
<li class="nav-colophon-01">
<a href="${marketing_link('ABOUT')}">
About
</a>
<a href="${marketing_link('ABOUT')}">
About
</a>
</li>
<li class="nav-colophon-02">
<a href="${marketing_link('JOBS')}">
Jobs</a>
Jobs
</a>
</li>
<li class="nav-colophon-03">
<a href="${marketing_link('PRESS')}">
Press</a>
Press
</a>
</li>
<li class="nav-colophon-04">
<a href="${marketing_link('FAQ')}">
......
......@@ -40,11 +40,7 @@ site_status_msg = get_site_status_msg(course_id)
<nav>
<h1 class="logo">
% if settings.MITX_FEATURES.get('ENABLE_MKTG_SITE'):
<a href="${settings.MKTG_URLS.get('ROOT')}">
% else:
<a href="${reverse('root')}">
%endif
<a href="${marketing_link('ROOT')}">
<img src="${static.url(branding.get_logo_url(request.META.get('HTTP_HOST')))}"/>
</a></h1>
......
......@@ -239,7 +239,8 @@
<p>Need help in registering with edX?
<a href="${marketing_link('FAQ')}">
View our FAQs for answers to commonly asked questions.
</a>. Once registered, most questions can be answered in the course specific discussion forums or through the FAQs.</p>
</a>
Once registered, most questions can be answered in the course specific discussion forums or through the FAQs.</p>
</div>
</aside>
</section>
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