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): ...@@ -29,13 +29,18 @@ def marketing_link(name):
which URL should be provided. 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'): 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) return settings.MKTG_URLS.get('ROOT') + settings.MKTG_URLS.get(name)
elif name in link_map: elif name in link_map:
return reverse(link_map[name]) return reverse(link_map[name])
else: else:
return '' return '#'
def render_to_string(template_name, dictionary, context=None, namespace='main'): def render_to_string(template_name, dictionary, context=None, namespace='main'):
......
...@@ -595,7 +595,8 @@ MKTG_URLS = {'ROOT': '', ...@@ -595,7 +595,8 @@ MKTG_URLS = {'ROOT': '',
'CONTACT': '/contact', 'CONTACT': '/contact',
'HOW_IT_WORKS': '/how-it-works', 'HOW_IT_WORKS': '/how-it-works',
'SCHOOLS': '/schools'} 'SCHOOLS': '/schools'}
MKTG_URLS['LINK_MAP'] = {'ABOUT': 'about_edx', MKTG_URL_LINK_MAP = {'ABOUT': 'about_edx',
'CONTACT': 'contact', 'CONTACT': 'contact',
'FAQ': 'help_edx', 'FAQ': 'help_edx',
'COURSES': 'courses'} 'COURSES': 'courses',
'ROOT': 'root'}
...@@ -326,9 +326,9 @@ ...@@ -326,9 +326,9 @@
% else: % else:
<section class="empty-dashboard-message"> <section class="empty-dashboard-message">
<p>Looks like you haven't registered for any courses yet.</p> <p>Looks like you haven't registered for any courses yet.</p>
<a href="${marketing_link('COURSES')}"> <a href="${marketing_link('COURSES')}">
Find courses now! Find courses now!
</a> </a>
</section> </section>
% endif % endif
......
...@@ -8,17 +8,19 @@ ...@@ -8,17 +8,19 @@
<nav class="nav-colophon"> <nav class="nav-colophon">
<ol> <ol>
<li class="nav-colophon-01"> <li class="nav-colophon-01">
<a href="${marketing_link('ABOUT')}"> <a href="${marketing_link('ABOUT')}">
About About
</a> </a>
</li> </li>
<li class="nav-colophon-02"> <li class="nav-colophon-02">
<a href="${marketing_link('JOBS')}"> <a href="${marketing_link('JOBS')}">
Jobs</a> Jobs
</a>
</li> </li>
<li class="nav-colophon-03"> <li class="nav-colophon-03">
<a href="${marketing_link('PRESS')}"> <a href="${marketing_link('PRESS')}">
Press</a> Press
</a>
</li> </li>
<li class="nav-colophon-04"> <li class="nav-colophon-04">
<a href="${marketing_link('FAQ')}"> <a href="${marketing_link('FAQ')}">
......
...@@ -40,11 +40,7 @@ site_status_msg = get_site_status_msg(course_id) ...@@ -40,11 +40,7 @@ site_status_msg = get_site_status_msg(course_id)
<nav> <nav>
<h1 class="logo"> <h1 class="logo">
% if settings.MITX_FEATURES.get('ENABLE_MKTG_SITE'): <a href="${marketing_link('ROOT')}">
<a href="${settings.MKTG_URLS.get('ROOT')}">
% else:
<a href="${reverse('root')}">
%endif
<img src="${static.url(branding.get_logo_url(request.META.get('HTTP_HOST')))}"/> <img src="${static.url(branding.get_logo_url(request.META.get('HTTP_HOST')))}"/>
</a></h1> </a></h1>
......
...@@ -239,7 +239,8 @@ ...@@ -239,7 +239,8 @@
<p>Need help in registering with edX? <p>Need help in registering with edX?
<a href="${marketing_link('FAQ')}"> <a href="${marketing_link('FAQ')}">
View our FAQs for answers to commonly asked questions. 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> </div>
</aside> </aside>
</section> </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