Create a theme named 'stanford-style' to be used by comprehensive theming
This commit is contained in:
@@ -111,9 +111,7 @@ from openedx.core.lib.courses import course_image_url
|
||||
<hgroup>
|
||||
<h1>
|
||||
${course.display_name_with_default_escaped}
|
||||
% if not self.theme_enabled():
|
||||
<a href="#">${course.display_org_with_default | h}</a>
|
||||
% endif
|
||||
<a href="#">${course.display_org_with_default | h}</a>
|
||||
</h1>
|
||||
</hgroup>
|
||||
|
||||
@@ -211,66 +209,8 @@ from openedx.core.lib.courses import course_image_url
|
||||
|
||||
<section class="course-sidebar">
|
||||
<section class="course-summary">
|
||||
<header>
|
||||
% if static.get_value('course_about_show_social_links', True):
|
||||
<div class="social-sharing">
|
||||
<div class="sharing-message">${_("Share with friends and family!")}</div>
|
||||
## TODO: this should probably be an overrideable block,
|
||||
## or something allowing themes to do whatever they
|
||||
## want here (and on this whole page, really).
|
||||
% if self.stanford_theme_enabled():
|
||||
<a href="http://twitter.com/intent/tweet?text=I+just+enrolled+in+${course.number}+${course.display_name_with_default_escaped}!+(http://class.stanford.edu)" class="share">
|
||||
<i class="icon fa fa-twitter"></i><span class="sr">${_("Tweet that you've enrolled in this course")}</span>
|
||||
</a>
|
||||
<a href="mailto:?subject=Take%20a%20course%20at%20Stanford%20online!&body=I%20just%20enrolled%20in%20${course.number}%20${course.display_name_with_default_escaped}+(http://class.stanford.edu)" class="share">
|
||||
<i class="icon fa fa-envelope"></i><span class="sr">${_("Email someone to say you've enrolled in this course")}</span>
|
||||
</a>
|
||||
% else:
|
||||
<%
|
||||
site_domain = static.get_value('site_domain', settings.SITE_NAME)
|
||||
platform_name = static.get_platform_name()
|
||||
|
||||
## Translators: This text will be automatically posted to the student's
|
||||
## Twitter account. {url} should appear at the end of the text.
|
||||
tweet_text = _("I just enrolled in {number} {title} through {account}: {url}").format(
|
||||
number=course.number,
|
||||
title=course.display_name_with_default_escaped,
|
||||
account=static.get_value('course_about_twitter_account', settings.PLATFORM_TWITTER_ACCOUNT),
|
||||
url=u"http://{domain}{path}".format(
|
||||
domain=site_domain,
|
||||
path=reverse('about_course', args=[course.id.to_deprecated_string()])
|
||||
)
|
||||
).replace(u" ", u"+")
|
||||
tweet_action = u"http://twitter.com/intent/tweet?text={tweet_text}".format(tweet_text=tweet_text)
|
||||
|
||||
facebook_link = static.get_value('course_about_facebook_link', settings.PLATFORM_FACEBOOK_ACCOUNT)
|
||||
|
||||
email_subject = u"mailto:?subject={subject}&body={body}".format(
|
||||
subject=_("Take a course with {platform} online").format(platform=platform_name),
|
||||
body=_("I just enrolled in {number} {title} through {platform} {url}").format(
|
||||
number=course.number,
|
||||
title=course.display_name_with_default_escaped,
|
||||
platform=platform_name,
|
||||
url=u"http://{domain}{path}".format(
|
||||
domain=site_domain,
|
||||
path=reverse('about_course', args=[course.id.to_deprecated_string()]),
|
||||
)
|
||||
)
|
||||
).replace(u" ", u"%20")
|
||||
%>
|
||||
<a href="${tweet_action}" class="share">
|
||||
<i class="icon fa fa-twitter"></i><span class="sr">${_("Tweet that you've enrolled in this course")}</span>
|
||||
</a>
|
||||
<a href="${facebook_link}" class="share">
|
||||
<i class="icon fa fa-thumbs-up"></i><span class="sr">${_("Post a Facebook message to say you've enrolled in this course")}</span>
|
||||
</a>
|
||||
<a href="${email_subject}" class="share">
|
||||
<i class="icon fa fa-envelope"></i><span class="sr">${_("Email someone to say you've enrolled in this course")}</span>
|
||||
</a>
|
||||
% endif
|
||||
</div>
|
||||
% endif
|
||||
</header>
|
||||
<%include file="course_about_sidebar_header.html" />
|
||||
|
||||
<ol class="important-dates">
|
||||
<li class="important-dates-item"><i class="icon fa fa-info-circle"></i><p class="important-dates-item-title">${_("Course Number")}</p><span class="important-dates-item-text course-number">${course.display_number_with_default | h}</span></li>
|
||||
|
||||
58
lms/templates/courseware/course_about_sidebar_header.html
Normal file
58
lms/templates/courseware/course_about_sidebar_header.html
Normal file
@@ -0,0 +1,58 @@
|
||||
<%namespace name='static' file='../static_content.html'/>
|
||||
<%!
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.conf import settings
|
||||
%>
|
||||
|
||||
<header>
|
||||
% if static.get_value('course_about_show_social_links', True):
|
||||
<div class="social-sharing">
|
||||
<div class="sharing-message">${_("Share with friends and family!")}</div>
|
||||
## TODO: this should probably be an overrideable block,
|
||||
## or something allowing themes to do whatever they
|
||||
## want here (and on this whole page, really).
|
||||
<%
|
||||
site_domain = static.get_value('site_domain', settings.SITE_NAME)
|
||||
platform_name = static.get_platform_name()
|
||||
|
||||
## Translators: This text will be automatically posted to the student's
|
||||
## Twitter account. {url} should appear at the end of the text.
|
||||
tweet_text = _("I just enrolled in {number} {title} through {account}: {url}").format(
|
||||
number=course.number,
|
||||
title=course.display_name_with_default_escaped,
|
||||
account=static.get_value('course_about_twitter_account', settings.PLATFORM_TWITTER_ACCOUNT),
|
||||
url=u"http://{domain}{path}".format(
|
||||
domain=site_domain,
|
||||
path=reverse('about_course', args=[course.id.to_deprecated_string()])
|
||||
)
|
||||
).replace(u" ", u"+")
|
||||
tweet_action = u"http://twitter.com/intent/tweet?text={tweet_text}".format(tweet_text=tweet_text)
|
||||
|
||||
facebook_link = static.get_value('course_about_facebook_link', settings.PLATFORM_FACEBOOK_ACCOUNT)
|
||||
|
||||
email_subject = u"mailto:?subject={subject}&body={body}".format(
|
||||
subject=_("Take a course with {platform} online").format(platform=platform_name),
|
||||
body=_("I just enrolled in {number} {title} through {platform} {url}").format(
|
||||
number=course.number,
|
||||
title=course.display_name_with_default_escaped,
|
||||
platform=platform_name,
|
||||
url=u"http://{domain}{path}".format(
|
||||
domain=site_domain,
|
||||
path=reverse('about_course', args=[course.id.to_deprecated_string()]),
|
||||
)
|
||||
)
|
||||
).replace(u" ", u"%20")
|
||||
%>
|
||||
<a href="${tweet_action}" class="share">
|
||||
<i class="icon fa fa-twitter"></i><span class="sr">${_("Tweet that you've enrolled in this course")}</span>
|
||||
</a>
|
||||
<a href="${facebook_link}" class="share">
|
||||
<i class="icon fa fa-thumbs-up"></i><span class="sr">${_("Post a Facebook message to say you've enrolled in this course")}</span>
|
||||
</a>
|
||||
<a href="${email_subject}" class="share">
|
||||
<i class="icon fa fa-envelope"></i><span class="sr">${_("Email someone to say you've enrolled in this course")}</span>
|
||||
</a>
|
||||
</div>
|
||||
% endif
|
||||
</header>
|
||||
@@ -1,4 +1,3 @@
|
||||
<%namespace file="../main.html" import="stanford_theme_enabled" />
|
||||
<%! from django.utils.translation import ugettext as _ %>
|
||||
${_("Thank you for signing up for {platform_name}.").format(platform_name=settings.PLATFORM_NAME)}
|
||||
|
||||
@@ -13,17 +12,7 @@ ${_("Change your life and start learning today by activating your "
|
||||
% else:
|
||||
http://${ site }/activate/${ key }
|
||||
% endif
|
||||
|
||||
% if stanford_theme_enabled(): ## Temporary hack until we develop a better way to adjust language
|
||||
${_("If you didn't request this, you don't need to do anything; you won't "
|
||||
"receive any more email from us. Please do not reply to this e-mail; "
|
||||
"if you require assistance, check the about section of the "
|
||||
"{platform_name} Courses web site.").format(platform_name=settings.PLATFORM_NAME)}
|
||||
|
||||
% else:
|
||||
${_("If you didn't request this, you don't need to do anything; you won't "
|
||||
"receive any more email from us. Please do not reply to this e-mail; "
|
||||
"if you require assistance, check the help section of the "
|
||||
"{platform_name} website.").format(platform_name=settings.PLATFORM_NAME)}
|
||||
|
||||
% endif
|
||||
|
||||
@@ -1,26 +1,14 @@
|
||||
<%! from django.core.urlresolvers import reverse %>
|
||||
<%! from django.utils.translation import ugettext as _ %>
|
||||
<%namespace file="../main.html" import="stanford_theme_enabled" />
|
||||
## Again, ugly hack that needs to be changed
|
||||
## TODO: this probably needs better formatting to look nice in an
|
||||
## email client (Mako leaves awkward whitespace)
|
||||
% if stanford_theme_enabled():
|
||||
${_("This is to confirm that you changed the e-mail associated with "
|
||||
"{platform_name} from {old_email} to {new_email}. If you "
|
||||
"did not make this request, please contact us at").format(platform_name=settings.PLATFORM_NAME, old_email=old_email, new_email=new_email)}
|
||||
${_("This is to confirm that you changed the e-mail associated with "
|
||||
"{platform_name} from {old_email} to {new_email}. If you "
|
||||
"did not make this request, please contact us immediately. Contact "
|
||||
"information is listed at:").format(platform_name=settings.PLATFORM_NAME, old_email=old_email, new_email=new_email)}
|
||||
|
||||
${settings.CONTACT_EMAIL}
|
||||
% else:
|
||||
${_("This is to confirm that you changed the e-mail associated with "
|
||||
"{platform_name} from {old_email} to {new_email}. If you "
|
||||
"did not make this request, please contact us immediately. Contact "
|
||||
"information is listed at:").format(platform_name=settings.PLATFORM_NAME, old_email=old_email, new_email=new_email)}
|
||||
|
||||
% if is_secure:
|
||||
% if is_secure:
|
||||
https://${ site }${reverse('contact')}
|
||||
% else:
|
||||
% else:
|
||||
http://${ site }${reverse('contact')}
|
||||
% endif
|
||||
% endif
|
||||
|
||||
${_("We keep a log of old e-mails, so if this request was unintentional, we "
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<%! from django.utils.translation import ugettext as _ %>
|
||||
<%namespace file="../main.html" import="stanford_theme_enabled" />
|
||||
${_("We received a request to change the e-mail associated with your "
|
||||
"{platform_name} account from {old_email} to {new_email}. "
|
||||
"If this is correct, please confirm your new e-mail address by "
|
||||
@@ -11,15 +10,7 @@ ${_("We received a request to change the e-mail associated with your "
|
||||
http://${ site }/email_confirm/${ key }
|
||||
% endif
|
||||
|
||||
## TODO: fix this ugly hack
|
||||
% if stanford_theme_enabled():
|
||||
${_("If you didn't request this, you don't need to do anything; you won't "
|
||||
"receive any more email from us. Please do not reply to this e-mail; "
|
||||
"if you require assistance, check the about section of the "
|
||||
"{platform_name} Courses web site.").format(platform_name=settings.PLATFORM_NAME)}
|
||||
% else:
|
||||
${_("If you didn't request this, you don't need to do anything; you won't "
|
||||
"receive any more email from us. Please do not reply to this e-mail; "
|
||||
"if you require assistance, check the help section of the "
|
||||
"{platform_name} web site.").format(platform_name=settings.PLATFORM_NAME)}
|
||||
% endif
|
||||
${_("If you didn't request this, you don't need to do anything; you won't "
|
||||
"receive any more email from us. Please do not reply to this e-mail; "
|
||||
"if you require assistance, check the help section of the "
|
||||
"{platform_name} web site.").format(platform_name=settings.PLATFORM_NAME)}
|
||||
|
||||
@@ -1,24 +1,12 @@
|
||||
<%! from django.utils.translation import ugettext as _ %>
|
||||
<%namespace file="../main.html" import="stanford_theme_enabled" />
|
||||
<%namespace name='static' file='../static_content.html'/>
|
||||
(Not currently used)
|
||||
|
||||
## TODO: fix this ugly hack
|
||||
% if stanford_theme_enabled():
|
||||
${_("We are sorry. Our course staff did not approve your request to change "
|
||||
"your name from {old_name} to {new_name}. If you need further "
|
||||
"assistance, please e-mail the tech support at {email}"
|
||||
).format(
|
||||
old_name=old_name,
|
||||
new_name=new_name,
|
||||
email=settings.TECH_SUPPORT_EMAIL,
|
||||
)}
|
||||
% else:
|
||||
${_("We are sorry. Our course staff did not approve your request to change "
|
||||
"your name from {old_name} to {new_name}. If you need further "
|
||||
"assistance, please e-mail the course staff at {email}."
|
||||
).format(
|
||||
old_name=old_name,
|
||||
new_name=new_name,
|
||||
email="ta@edx.org",
|
||||
)}
|
||||
% endif
|
||||
${_("We are sorry. Our course staff did not approve your request to change "
|
||||
"your name from {old_name} to {new_name}. If you need further "
|
||||
"assistance, please e-mail the course staff at {email}."
|
||||
).format(
|
||||
old_name=old_name,
|
||||
new_name=new_name,
|
||||
email=static.get_tech_support_email_address(),
|
||||
)}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
<%namespace file="../main.html" import="stanford_theme_enabled" />
|
||||
<%! from django.utils.translation import ugettext as _ %>
|
||||
% if status == "approved":
|
||||
${_("We have successfully verified your identity for the {assessment} assessment in the {course_name} course."
|
||||
|
||||
@@ -13,15 +13,10 @@ from django.core.urlresolvers import reverse
|
||||
% if homepage_overlay_html:
|
||||
${homepage_overlay_html}
|
||||
% else:
|
||||
% if self.stanford_theme_enabled():
|
||||
<h1>${_("Free courses from <strong>{university_name}</strong>").format(university_name="Stanford")}</h1>
|
||||
<h2>${_("For anyone, anywhere, anytime")}</h2>
|
||||
% else:
|
||||
## Translators: 'Open edX' is a brand, please keep this untranslated. See http://openedx.org for more information.
|
||||
<h1>${_("Welcome to Open edX!")}</h1>
|
||||
## Translators: 'Open edX' is a brand, please keep this untranslated. See http://openedx.org for more information.
|
||||
<h2>${_("It works! This is the default homepage for this Open edX instance.")}</h2>
|
||||
% endif
|
||||
% endif
|
||||
</hgroup>
|
||||
% if settings.FEATURES.get('ENABLE_COURSE_DISCOVERY'):
|
||||
@@ -56,12 +51,7 @@ from django.core.urlresolvers import reverse
|
||||
% if show_homepage_promo_video:
|
||||
<section id="video-modal" class="modal home-page-video-modal video-modal">
|
||||
<div class="inner-wrapper">
|
||||
<%
|
||||
youtube_video_id = homepage_promo_video_youtube_id
|
||||
if self.stanford_theme_enabled():
|
||||
youtube_video_id = "2gmreZObCY4"
|
||||
%>
|
||||
<iframe title="YouTube Video" width="640" height="360" src="//www.youtube.com/embed/${youtube_video_id}?showinfo=0" frameborder="0" allowfullscreen></iframe>
|
||||
<iframe title="YouTube Video" width="640" height="360" src="//www.youtube.com/embed/${homepage_promo_video_youtube_id}?showinfo=0" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
</section>
|
||||
% endif
|
||||
|
||||
@@ -19,18 +19,6 @@ from branding import api as branding_api
|
||||
## embedding theme conditionals into templates. All inheriting
|
||||
## templates have access to these functions, and we can import these
|
||||
## into non-inheriting templates via the %namespace tag.
|
||||
<%def name="theme_enabled()">
|
||||
<% return settings.FEATURES.get("USE_CUSTOM_THEME", False) %>
|
||||
</%def>
|
||||
|
||||
<%def name="stanford_theme_enabled()">
|
||||
<%
|
||||
if not theme_enabled():
|
||||
return False
|
||||
|
||||
return getattr(settings, "THEME_NAME", None) == "stanford"
|
||||
%>
|
||||
</%def>
|
||||
|
||||
## this needs to be here to prevent the title from mysteriously appearing in the body, in one case
|
||||
<%def name="pagetitle()" />
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## mako
|
||||
<%namespace name='static' file='static_content.html'/>
|
||||
<%namespace file='main.html' import="login_query, stanford_theme_enabled"/>
|
||||
<%namespace file='main.html' import="login_query"/>
|
||||
<%!
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## mako
|
||||
<%namespace name='static' file='static_content.html'/>
|
||||
<%namespace file='main.html' import="login_query, stanford_theme_enabled"/>
|
||||
<%namespace file='main.html' import="login_query"/>
|
||||
<%!
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
@@ -5,7 +5,6 @@ from django.utils.translation import ugettext as _
|
||||
from django_countries import countries
|
||||
from student.models import UserProfile
|
||||
%>
|
||||
<%namespace file='main.html' import="stanford_theme_enabled"/>
|
||||
|
||||
<input type="hidden" name="csrfmiddlewaretoken" value="${ csrf_token }">
|
||||
|
||||
@@ -240,16 +239,12 @@ from student.models import UserProfile
|
||||
% endif
|
||||
|
||||
% if settings.REGISTRATION_EXTRA_FIELDS['honor_code'] != 'hidden':
|
||||
## If the stanford theme isn't enabled, check if we have an Honor Code link in our marketing map
|
||||
% if not stanford_theme_enabled() and marketing_link('HONOR') and marketing_link('HONOR') != '#':
|
||||
## check if we have an Honor Code link in our marketing map
|
||||
% if marketing_link('HONOR') and marketing_link('HONOR') != '#':
|
||||
<div class="field ${settings.REGISTRATION_EXTRA_FIELDS['honor_code']} checkbox" id="field-honorcode">
|
||||
<input id="honorcode-yes" type="checkbox" name="honor_code" value="true" />
|
||||
<%
|
||||
## TODO: provide a better way to override these links
|
||||
if stanford_theme_enabled():
|
||||
honor_code_path = marketing_link('TOS') + "#honor"
|
||||
else:
|
||||
honor_code_path = marketing_link('HONOR')
|
||||
honor_code_path = marketing_link('HONOR')
|
||||
%>
|
||||
<label for="honorcode-yes">${_('I agree to the {link_start}Honor Code{link_end}').format(
|
||||
link_start='<a href="{url}" class="new-vp" tabindex="-1">'.format(url=honor_code_path),
|
||||
|
||||
@@ -169,11 +169,7 @@ import calendar
|
||||
<div class="field required checkbox" id="field-honorcode">
|
||||
<input id="honorcode-yes" type="checkbox" name="honor_code" value="true" />
|
||||
<%
|
||||
## TODO: provide a better way to override these links
|
||||
if self.stanford_theme_enabled():
|
||||
honor_code_path = marketing_link('TOS') + "#honor"
|
||||
else:
|
||||
honor_code_path = marketing_link('HONOR')
|
||||
honor_code_path = marketing_link('HONOR')
|
||||
%>
|
||||
<label for="honorcode-yes">${_('I agree to the {link_start}Honor Code{link_end}').format(
|
||||
link_start='<a href="{url}" class="new-vp">'.format(url=honor_code_path),
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.core.urlresolvers import reverse
|
||||
%>
|
||||
<%namespace file='main.html' import="login_query, stanford_theme_enabled"/>
|
||||
<%namespace file='main.html' import="login_query"/>
|
||||
<%namespace name='static' file='static_content.html'/>
|
||||
|
||||
|
||||
@@ -25,20 +25,14 @@ from django.core.urlresolvers import reverse
|
||||
|
||||
## TODO: Use a %block tag or something to allow themes to
|
||||
## override in a more generalizable fashion.
|
||||
% if not stanford_theme_enabled():
|
||||
<div class="cta cta-welcome">
|
||||
<h3>${_("Welcome to {platform_name}").format(platform_name=platform_name)}</h3>
|
||||
<p>${_("Registering with {platform_name} gives you access to all of our current and future free courses. Not ready to take a course just yet? Registering puts you on our mailing list - we will update you as courses are added.").format(platform_name=platform_name)}</p>
|
||||
</div>
|
||||
% endif
|
||||
<div class="cta cta-welcome">
|
||||
<h3>${_("Welcome to {platform_name}").format(platform_name=platform_name)}</h3>
|
||||
<p>${_("Registering with {platform_name} gives you access to all of our current and future free courses. Not ready to take a course just yet? Registering puts you on our mailing list - we will update you as courses are added.").format(platform_name=platform_name)}</p>
|
||||
</div>
|
||||
|
||||
<div class="cta cta-nextsteps">
|
||||
<h3>${_("Next Steps")}</h3>
|
||||
% if stanford_theme_enabled():
|
||||
<p>${_("You will receive an activation email. You must click on the activation link to complete the process. Don't see the email? Check your spam folder and mark emails from class.stanford.edu as 'not spam', since you'll want to be able to receive email from your courses.")}</p>
|
||||
% else:
|
||||
<p>${_("As part of joining {platform_name}, you will receive an activation email. You must click on the activation link to complete the process. Don't see the email? Check your spam folder and mark {platform_name} emails as 'not spam'. At {platform_name}, we communicate mostly through email.").format(platform_name=platform_name)}</p>
|
||||
% endif
|
||||
</div>
|
||||
|
||||
% if settings.MKTG_URL_LINK_MAP.get('FAQ'):
|
||||
|
||||
Reference in New Issue
Block a user