Commit 6c8c67ca by Saleem Latif

Remove microsite_configuration/templatetags/microsite.py references from individual templates.

parent 22e01a8c
...@@ -5,6 +5,7 @@ from django.utils.translation import get_language_bidi ...@@ -5,6 +5,7 @@ from django.utils.translation import get_language_bidi
from mako.exceptions import TemplateLookupException from mako.exceptions import TemplateLookupException
from microsite_configuration import microsite from microsite_configuration import microsite
from openedx.core.djangoapps.theming.helpers import get_page_title_breadcrumbs, get_value
from certificates.api import get_asset_url_by_slug from certificates.api import get_asset_url_by_slug
%> %>
...@@ -99,3 +100,12 @@ except TemplateLookupException: ...@@ -99,3 +100,12 @@ except TemplateLookupException:
else: else:
tmpl.render_context(context) tmpl.render_context(context)
%></%def> %></%def>
<%def name="get_page_title_breadcrumbs(*args)"><%
return get_page_title_breadcrumbs(*args)
%></%def>
<%def name="get_platform_name()"><%
return get_value('platform_name', settings.PLATFORM_NAME)
%></%def>
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
<%! <%!
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from django.template.defaultfilters import escapejs from django.template.defaultfilters import escapejs
from microsite_configuration import page_title_breadcrumbs
from edxnotes.helpers import is_feature_enabled as is_edxnotes_enabled from edxnotes.helpers import is_feature_enabled as is_edxnotes_enabled
%> %>
<%def name="course_name()"> <%def name="course_name()">
...@@ -13,9 +12,9 @@ from edxnotes.helpers import is_feature_enabled as is_edxnotes_enabled ...@@ -13,9 +12,9 @@ from edxnotes.helpers import is_feature_enabled as is_edxnotes_enabled
<%block name="bodyclass">view-in-course view-courseware courseware ${course.css_class or ''}</%block> <%block name="bodyclass">view-in-course view-courseware courseware ${course.css_class or ''}</%block>
<%block name="title"><title> <%block name="title"><title>
% if section_title: % if section_title:
${page_title_breadcrumbs(section_title, course_name())} ${static.get_page_title_breadcrumbs(section_title, course_name())}
% else: % else:
${page_title_breadcrumbs(course_name())} ${static.get_page_title_breadcrumbs(course_name())}
%endif %endif
</title></%block> </title></%block>
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
<%! <%!
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from django.template.defaultfilters import escapejs from django.template.defaultfilters import escapejs
from microsite_configuration import page_title_breadcrumbs
from django.conf import settings from django.conf import settings
from edxnotes.helpers import is_feature_enabled as is_edxnotes_enabled from edxnotes.helpers import is_feature_enabled as is_edxnotes_enabled
%> %>
...@@ -17,9 +16,9 @@ from edxnotes.helpers import is_feature_enabled as is_edxnotes_enabled ...@@ -17,9 +16,9 @@ from edxnotes.helpers import is_feature_enabled as is_edxnotes_enabled
<%block name="bodyclass">view-in-course view-courseware courseware ${course.css_class or ''}</%block> <%block name="bodyclass">view-in-course view-courseware courseware ${course.css_class or ''}</%block>
<%block name="title"><title> <%block name="title"><title>
% if section_title: % if section_title:
${page_title_breadcrumbs(section_title, course_name())} ${static.get_page_title_breadcrumbs(section_title, course_name())}
% else: % else:
${page_title_breadcrumbs(course_name())} ${static.get_page_title_breadcrumbs(course_name())}
%endif %endif
</title></%block> </title></%block>
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
<%! <%!
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from microsite_configuration.templatetags.microsite import platform_name
%> %>
%if verification_status == 'approved': %if verification_status == 'approved':
...@@ -40,7 +39,7 @@ from microsite_configuration.templatetags.microsite import platform_name ...@@ -40,7 +39,7 @@ from microsite_configuration.templatetags.microsite import platform_name
%if verification_status in ['must_reverify', 'expired']: %if verification_status in ['must_reverify', 'expired']:
<li class="status status-verification is-denied"> <li class="status status-verification is-denied">
<span class="title status-title">${_("{platform_name} Verification Status").format(platform_name=platform_name())}</span> <span class="title status-title">${_("{platform_name} Verification Status").format(platform_name=static.get_platform_name())}</span>
<div class="status-data"> <div class="status-data">
<span class="status-data-message">${verification_msg}</span> <span class="status-data-message">${verification_msg}</span>
......
...@@ -8,7 +8,6 @@ from django.utils.translation import ugettext as _ ...@@ -8,7 +8,6 @@ from django.utils.translation import ugettext as _
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from xmodule.tabs import CourseTabList from xmodule.tabs import CourseTabList
from microsite_configuration import microsite from microsite_configuration import microsite
from microsite_configuration.templatetags.microsite import platform_name
%> %>
% if settings.FEATURES.get('ENABLE_FEEDBACK_SUBMISSION', False): % if settings.FEATURES.get('ENABLE_FEEDBACK_SUBMISSION', False):
...@@ -17,7 +16,7 @@ from microsite_configuration.templatetags.microsite import platform_name ...@@ -17,7 +16,7 @@ from microsite_configuration.templatetags.microsite import platform_name
<a href="#help-modal" rel="leanModal" role="button">${_("Help")}</a> <a href="#help-modal" rel="leanModal" role="button">${_("Help")}</a>
</div> </div>
<section id="help-modal" class="modal" aria-hidden="true" role="dialog" aria-label="${_("{platform_name} Help").format(platform_name=platform_name())}"> <section id="help-modal" class="modal" aria-hidden="true" role="dialog" aria-label="${_("{platform_name} Help").format(platform_name=static.get_platform_name())}">
<div class="inner-wrapper" id="help_wrapper"> <div class="inner-wrapper" id="help_wrapper">
## TODO: find a way to refactor this ## TODO: find a way to refactor this
<button class="close-modal "tabindex="0"> <button class="close-modal "tabindex="0">
...@@ -31,7 +30,7 @@ from microsite_configuration.templatetags.microsite import platform_name ...@@ -31,7 +30,7 @@ from microsite_configuration.templatetags.microsite import platform_name
<header> <header>
<h2> <h2>
${_('{platform_name} Help').format( ${_('{platform_name} Help').format(
platform_name=u'<span class="edx">{}</span>'.format(platform_name()) platform_name=u'<span class="edx">{}</span>'.format(static.get_platform_name())
)} )}
</h2> </h2>
<hr> <hr>
...@@ -55,11 +54,11 @@ from microsite_configuration.templatetags.microsite import platform_name ...@@ -55,11 +54,11 @@ from microsite_configuration.templatetags.microsite import platform_name
url=marketing_link('FAQ') url=marketing_link('FAQ')
), ),
link_end='</a>', link_end='</a>',
platform_name=platform_name())} platform_name=static.get_platform_name())}
</p> </p>
<p>${_('Have a <strong>question about something specific</strong>? You can contact the {platform_name} general support team directly:').format( <p>${_('Have a <strong>question about something specific</strong>? You can contact the {platform_name} general support team directly:').format(
platform_name=platform_name() platform_name=static.get_platform_name()
)}</p> )}</p>
<hr> <hr>
...@@ -70,7 +69,7 @@ from microsite_configuration.templatetags.microsite import platform_name ...@@ -70,7 +69,7 @@ from microsite_configuration.templatetags.microsite import platform_name
</div> </div>
<p class="note">${_('Please note: The {platform_name} support team is English speaking. While we will do our best to address your inquiry in any language, our responses will be in English.').format( <p class="note">${_('Please note: The {platform_name} support team is English speaking. While we will do our best to address your inquiry in any language, our responses will be in English.').format(
platform_name=platform_name() platform_name=static.get_platform_name()
)}</p> )}</p>
</div> </div>
......
...@@ -6,7 +6,6 @@ from django.utils.http import urlquote_plus ...@@ -6,7 +6,6 @@ from django.utils.http import urlquote_plus
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from django.utils.translation import get_language_bidi from django.utils.translation import get_language_bidi
from microsite_configuration import microsite from microsite_configuration import microsite
from microsite_configuration import page_title_breadcrumbs
from branding import api as branding_api from branding import api as branding_api
%> %>
<!DOCTYPE html> <!DOCTYPE html>
...@@ -41,7 +40,7 @@ from branding import api as branding_api ...@@ -41,7 +40,7 @@ from branding import api as branding_api
<%def name="pagetitle()" /> <%def name="pagetitle()" />
<%block name="title"> <%block name="title">
<title> <title>
${page_title_breadcrumbs(self.pagetitle())} ${static.get_page_title_breadcrumbs(self.pagetitle())}
</title> </title>
</%block> </%block>
......
...@@ -6,7 +6,6 @@ from django.core.urlresolvers import reverse ...@@ -6,7 +6,6 @@ from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from microsite_configuration import microsite from microsite_configuration import microsite
from microsite_configuration.templatetags.microsite import platform_name
# App that handles subdomain specific branding # App that handles subdomain specific branding
from branding import api as branding_api from branding import api as branding_api
...@@ -41,7 +40,7 @@ site_status_msg = get_site_status_msg(course_id) ...@@ -41,7 +40,7 @@ site_status_msg = get_site_status_msg(course_id)
<h1 class="logo" itemscope="" itemtype="http://schema.org/Organization"> <h1 class="logo" itemscope="" itemtype="http://schema.org/Organization">
<a href="${marketing_link('ROOT')}" itemprop="url"> <a href="${marketing_link('ROOT')}" itemprop="url">
<%block name="navigation_logo"> <%block name="navigation_logo">
<img src="${static.url(branding_api.get_logo_url())}" alt="${_("{platform_name} Home Page").format(platform_name=platform_name())}" itemprop="logo" /> <img src="${static.url(branding_api.get_logo_url())}" alt="${_("{platform_name} Home Page").format(platform_name=static.get_platform_name())}" itemprop="logo" />
</%block> </%block>
</a> </a>
</h1> </h1>
......
...@@ -6,7 +6,6 @@ from django.core.urlresolvers import reverse ...@@ -6,7 +6,6 @@ from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from microsite_configuration import microsite from microsite_configuration import microsite
from microsite_configuration.templatetags.microsite import platform_name
from lms.djangoapps.ccx.overrides import get_current_ccx from lms.djangoapps.ccx.overrides import get_current_ccx
# App that handles subdomain specific branding # App that handles subdomain specific branding
...@@ -42,7 +41,7 @@ site_status_msg = get_site_status_msg(course_id) ...@@ -42,7 +41,7 @@ site_status_msg = get_site_status_msg(course_id)
<h1 class="logo"> <h1 class="logo">
<a href="${marketing_link('ROOT')}"> <a href="${marketing_link('ROOT')}">
<%block name="navigation_logo"> <%block name="navigation_logo">
<img src="${static.url(branding_api.get_logo_url())}" alt="${_("{platform_name} Home Page").format(platform_name=platform_name())}"/> <img src="${static.url(branding_api.get_logo_url())}" alt="${_("{platform_name} Home Page").format(platform_name=static.get_platform_name())}"/>
</%block> </%block>
</a> </a>
</h1> </h1>
......
<%! from django.utils.translation import ugettext as _ %> <%! from django.utils.translation import ugettext as _ %>
<%! from django.template.defaultfilters import escapejs %> <%! from django.template.defaultfilters import escapejs %>
<%! from microsite_configuration import page_title_breadcrumbs %>
<%! from edxnotes.helpers import is_feature_enabled as is_edxnotes_enabled %> <%! from edxnotes.helpers import is_feature_enabled as is_edxnotes_enabled %>
<%inherit file="/main.html" /> <%inherit file="/main.html" />
<%namespace name='static' file='/static_content.html'/> <%namespace name='static' file='/static_content.html'/>
......
<%! from django.utils.translation import ugettext as _ %> <%! from django.utils.translation import ugettext as _ %>
<%! from django.template.defaultfilters import escapejs %> <%! from django.template.defaultfilters import escapejs %>
<%! from microsite_configuration import page_title_breadcrumbs %>
<%! from edxnotes.helpers import is_feature_enabled as is_edxnotes_enabled %> <%! from edxnotes.helpers import is_feature_enabled as is_edxnotes_enabled %>
<%inherit file="/main.html" /> <%inherit file="/main.html" />
<%namespace name='static' file='/static_content.html'/> <%namespace name='static' file='/static_content.html'/>
......
"""
Helpers for accessing comprehensive theming related variables.
"""
from microsite_configuration import microsite
from microsite_configuration import page_title_breadcrumbs
def get_page_title_breadcrumbs(*args):
"""
This is a proxy function to hide microsite_configuration behind comprehensive theming.
"""
return page_title_breadcrumbs(*args)
def get_value(val_name, default=None, **kwargs):
"""
This is a proxy function to hide microsite_configuration behind comprehensive theming.
"""
return microsite.get_value(val_name, default=default, **kwargs)
...@@ -6,7 +6,6 @@ from django.core.urlresolvers import reverse ...@@ -6,7 +6,6 @@ from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from microsite_configuration import microsite from microsite_configuration import microsite
from microsite_configuration.templatetags.microsite import platform_name
# App that handles subdomain specific branding # App that handles subdomain specific branding
import branding import branding
...@@ -41,7 +40,7 @@ site_status_msg = get_site_status_msg(course_id) ...@@ -41,7 +40,7 @@ site_status_msg = get_site_status_msg(course_id)
<h1 class="logo" itemscope="" itemtype="http://schema.org/Organization"> <h1 class="logo" itemscope="" itemtype="http://schema.org/Organization">
<a href="${marketing_link('ROOT')}" itemprop="url"> <a href="${marketing_link('ROOT')}" itemprop="url">
<%block name="navigation_logo"> <%block name="navigation_logo">
<img src="${static.url("images/logo.png")}" alt="${_("{platform_name} Home Page").format(platform_name=platform_name())}" itemprop="logo" /> <img src="${static.url("images/logo.png")}" alt="${_("{platform_name} Home Page").format(platform_name=static.get_platform_name())}" itemprop="logo" />
</%block> </%block>
</a> </a>
</h1> </h1>
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
<%! <%!
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from microsite_configuration.templatetags.microsite import platform_name
%> %>
<div class="wrapper wrapper-footer"> <div class="wrapper wrapper-footer">
......
...@@ -11,7 +11,6 @@ import branding ...@@ -11,7 +11,6 @@ import branding
from status.status import get_site_status_msg from status.status import get_site_status_msg
from microsite_configuration import microsite from microsite_configuration import microsite
from microsite_configuration.templatetags.microsite import platform_name
from ccx.overrides import get_current_ccx from ccx.overrides import get_current_ccx
%> %>
...@@ -43,7 +42,7 @@ site_status_msg = get_site_status_msg(course_id) ...@@ -43,7 +42,7 @@ site_status_msg = get_site_status_msg(course_id)
<h1 class="logo"> <h1 class="logo">
<a href="${marketing_link('ROOT')}"> <a href="${marketing_link('ROOT')}">
<%block name="navigation_logo"> <%block name="navigation_logo">
<img src="${static.url("images/logo.png")}" alt="${_("{platform_name} Home Page").format(platform_name=platform_name())}"/> <img src="${static.url("images/logo.png")}" alt="${_("{platform_name} Home Page").format(platform_name=static.get_platform_name())}"/>
</%block> </%block>
</a> </a>
</h1> </h1>
......
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