Serve branded footer JSON/HTML/CSS/JS from an API endpoint in the branding app. Refactor OpenEdX and EdX.org footer templates to use the Python version of the API, ensuring that the API values are consistent with the footer included in main.html. Detailed changes: * Added footer API end-point to the branding app. * Footer API allows the language to be set with querystring parameters. * Footer API allows showing/hiding of the OpenEdX logo using querystring parameters. * Deprecate ENABLE_FOOTER_V3 in favor of the branding API configuration flag. * Move no referrer script into main.html from the edx footer template. * Rename rwd_header_footer.js to rwd_header.js * Cache API responses. Authors: Awais Qureshi, Aamir Khan, Will Daly
84 lines
2.9 KiB
HTML
84 lines
2.9 KiB
HTML
## mako
|
|
<%!
|
|
from django.core.urlresolvers import reverse
|
|
from django.utils.translation import ugettext as _
|
|
from branding.api import get_footer
|
|
%>
|
|
<% footer = get_footer(is_secure=is_secure) %>
|
|
<%namespace name='static' file='static_content.html'/>
|
|
|
|
<div class="wrapper wrapper-footer">
|
|
<footer id="footer-openedx"
|
|
## When rendering the footer through the branding API,
|
|
## the direction may not be set on the parent element,
|
|
## so we set it here.
|
|
% if bidi:
|
|
dir=${bidi}
|
|
% endif
|
|
>
|
|
<div class="colophon">
|
|
<nav class="nav-colophon" aria-label="${_('About')}">
|
|
<ol>
|
|
% for item_num, link in enumerate(footer['navigation_links'], start=1):
|
|
<li class="nav-colophon-0${item_num}">
|
|
<a id="${link['name']}" href="${link['url']}">${link['title']}</a>
|
|
</li>
|
|
% endfor
|
|
</ol>
|
|
</nav>
|
|
|
|
<div class="wrapper-logo">
|
|
<p>
|
|
<a href="/">
|
|
## The default logo is a placeholder.
|
|
## You can either replace this link entirely or update
|
|
## the FOOTER_ORGANIZATION_IMAGE in Django settings.
|
|
## If you customize FOOTER_ORGANIZATION_IMAGE, then the image
|
|
## can be included in the footer on other sites
|
|
## (e.g. a blog or marketing front-end) to provide a consistent
|
|
## user experience. See the branding app for details.
|
|
<img alt="organization logo" src="${footer['logo_image']}">
|
|
</a>
|
|
</p>
|
|
</div>
|
|
|
|
## Site operators: Please do not remove this paragraph! This attributes back to edX and makes your acknowledgement of edX's trademarks clear.
|
|
<p class="copyright">${footer['copyright']}</p>
|
|
|
|
<nav class="nav-legal" aria-label="${_('Legal')}">
|
|
<ul>
|
|
% for item_num, link in enumerate(footer['legal_links'], start=1):
|
|
<li class="nav-legal-0${item_num}">
|
|
<a href="${link['url']}">${link['title']}</a>
|
|
</li>
|
|
% endfor
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
|
|
## Please leave this link and use one of the logos provided
|
|
## The OpenEdX link may be hidden when this view is served
|
|
## through an API to partner sites (such as marketing sites or blogs),
|
|
## which are not technically powered by OpenEdX.
|
|
% if not hide_openedx_link:
|
|
<div class="footer-about-openedx">
|
|
<p>
|
|
<a href="${footer['openedx_link']['url']}">
|
|
<img src="${footer['openedx_link']['image']}" alt="${footer['openedx_link']['title']}" width="140" />
|
|
</a>
|
|
</p>
|
|
</div>
|
|
% endif
|
|
</footer>
|
|
</div>
|
|
% if include_dependencies:
|
|
<%static:js group='base_vendor'/>
|
|
<%static:css group='style-vendor'/>
|
|
<%include file="widgets/segment-io.html" />
|
|
% endif
|
|
% if footer_css_urls:
|
|
% for url in footer_css_urls:
|
|
<link rel="stylesheet" type="text/css" href="${url}"></link>
|
|
% endfor
|
|
% endif
|