-
Notifications
You must be signed in to change notification settings - Fork 4.2k
LMS template theming for Stanford 6/11/13 launch #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
426e9e0
f243dd2
708db25
08421bd
f004512
82d5dbd
bd02fcd
ebe991c
3949674
606e059
836d902
dbcee9a
be89d40
f4e7a4f
62bbff1
94d10d5
9ed5111
b0c6a7e
30457de
e96ca11
0bedf62
52123d9
1216f3e
efee0ca
64866ec
c997fc5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,20 @@ | |
| @import 'base/font_face'; | ||
| @import 'base/mixins'; | ||
| @import 'base/variables'; | ||
|
|
||
| ## THEMING | ||
| ## ------- | ||
| ## Set up this file to import an edX theme library if the environment | ||
| ## indicates that a theme should be used. The assumption is that the | ||
| ## theme resides outside of this main edX repository, in a directory | ||
| ## called themes/<theme-name>/, with its base Sass file in | ||
| ## themes/<theme-name>/static/sass/_<theme-name>.scss. That one entry | ||
| ## point can be used to @import in as many other things as needed. | ||
| % if env.get('THEME_NAME') is not None: | ||
| // import theme's Sass overrides | ||
| @import '${env.get('THEME_NAME')}'; | ||
| % endif | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I realize the % if theme:
@import '${theme}';
% endif
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. In #5, I set up a Django management command that will pass in some whitelisted settings. This really depends on how @cpennington wants to implement the Django settings context processor that he introduced. |
||
|
|
||
| @import 'base/base'; | ||
| @import 'base/extends'; | ||
| @import 'base/animations'; | ||
|
|
@@ -36,16 +50,3 @@ | |
| @import 'news'; | ||
|
|
||
| @import 'shame'; | ||
|
|
||
| ## THEMING | ||
| ## ------- | ||
| ## Set up this file to import an edX theme library if the environment | ||
| ## indicates that a theme should be used. The assumption is that the | ||
| ## theme resides outside of this main edX repository, in a directory | ||
| ## called themes/<theme-name>/, with its base Sass file in | ||
| ## themes/<theme-name>/static/sass/_<theme-name>.scss. That one entry | ||
| ## point can be used to @import in as many other things as needed. | ||
| % if env.get('THEME_NAME') is not None: | ||
| // import theme's Sass overrides | ||
| @import '${env.get('THEME_NAME')}' | ||
| % endif | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,11 @@ | |
| <%inherit file="../main.html" /> | ||
|
|
||
| <%block name="headextra"> | ||
| <%include file="../google_analytics.html" /> | ||
| % if self.theme_enabled(): | ||
| <%include file="../theme-google-analytics.html" /> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sefk had a good question about why I prefixed the theme template file (and all theme templates, actually) with What would be really nice would be a way to namespace the theme template files, just like you can do with static files. The way to do this right now would be to have a theme directory structure like |
||
| % else: | ||
| <%include file="../google_analytics.html" /> | ||
| % endif | ||
| </%block> | ||
|
|
||
| <%block name="js_extra"> | ||
|
|
@@ -46,7 +50,12 @@ | |
| <div class="table"> | ||
| <section class="intro"> | ||
| <hgroup> | ||
| <h1>${course.number}: ${get_course_about_section(course, "title")}<a href="${reverse('university_profile', args=[course.org])}">${get_course_about_section(course, "university")}</a></h1> | ||
| <h1> | ||
| ${course.number}: ${get_course_about_section(course, "title")} | ||
| % if not self.theme_enabled(): | ||
| <a href="${reverse('university_profile', args=[course.org])}">${get_course_about_section(course, "university")}</a> | ||
| % endif | ||
| </h1> | ||
| </hgroup> | ||
|
|
||
| <div class="main-cta"> | ||
|
|
@@ -105,14 +114,26 @@ <h1>${course.number}: ${get_course_about_section(course, "title")}<a href="${rev | |
| <header> | ||
| <div class="social-sharing"> | ||
| <div class="sharing-message">Share with friends and family!</div> | ||
| <a href="http://twitter.com/intent/tweet?text=I+just+registered+for+${course.number}+${get_course_about_section(course, 'title')}+through+@edxonline:+http://www.edx.org${reverse('about_course', args=[course.id])}" class="share"> | ||
| <img src="${static.url('images/social/twitter-sharing.png')}"> | ||
| </a> | ||
| <a href="http://www.facebook.com/EdxOnline" class="share"> <img src="${static.url('images/social/facebook-sharing.png')}"> | ||
| </a> | ||
| <a href="mailto:?subject=Take%20a%20course%20with%20edX%20online&body=I%20just%20registered%20for%20${course.number}%20${get_course_about_section(course, 'title')}%20through%20edX:+http://edx.org/${reverse('about_course', args=[course.id])}" class="share"> | ||
| <img src="${static.url('images/social/email-sharing.png')}"> | ||
| </a> | ||
| ## 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+registered+for+${course.number}+${get_course_about_section(course, 'title')}!+(http://class.stanford.edu)" class="share"> | ||
| <img src="${static.url('images/social/twitter-sharing.png')}"> | ||
| </a> | ||
| <a href="mailto:?subject=Take%20a%20course%20at%20Stanford%20online!&body=I%20just%20registered%20for%20${course.number}%20${get_course_about_section(course, 'title')}+(http://class.stanford.edu)" class="share"> | ||
| <img src="${static.url('images/social/email-sharing.png')}"> | ||
| </a> | ||
| % else: | ||
| <a href="http://twitter.com/intent/tweet?text=I+just+registered+for+${course.number}+${get_course_about_section(course, 'title')}+through+@edxonline:+http://www.edx.org${reverse('about_course', args=[course.id])}" class="share"> | ||
| <img src="${static.url('images/social/twitter-sharing.png')}"> | ||
| </a> | ||
| <a href="http://www.facebook.com/EdxOnline" class="share"> <img src="${static.url('images/social/facebook-sharing.png')}"> | ||
| </a> | ||
| <a href="mailto:?subject=Take%20a%20course%20with%20edX%20online&body=I%20just%20registered%20for%20${course.number}%20${get_course_about_section(course, 'title')}%20through%20edX:+http://edx.org/${reverse('about_course', args=[course.id])}" class="share"> | ||
| <img src="${static.url('images/social/email-sharing.png')}"> | ||
| </a> | ||
| % endif | ||
| </div> | ||
| </header> | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,13 @@ | ||
| <h1>E-mail change failed.</h1> | ||
| <%inherit file="main.html" /> | ||
|
|
||
| <p>We were unable to send a confirmation email to ${email}</p> | ||
| <section class="container activation"> | ||
|
|
||
| <section class="message"> | ||
| <h1 class="invalid">E-mail change failed</h1> | ||
| <hr class="horizontal-divider"> | ||
|
|
||
| <p>We were unable to send a confirmation email to ${email}</p> | ||
|
|
||
| <p>Go back to the <a href="/">home page</a>.</p> | ||
| </section> | ||
| </section> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,12 @@ | ||
| <h1>E-mail change successful!</h1> | ||
| <%! from django.core.urlresolvers import reverse %> | ||
| <%inherit file="main.html" /> | ||
|
|
||
| <p>You should see your new email in your <a href="/dashboard">dashboard</a>.</p> | ||
| <section class="container activation"> | ||
|
|
||
| <section class="message"> | ||
| <h1 class="valid">E-mail change successful!</h1> | ||
| <hr class="horizontal-divider"> | ||
|
|
||
| <p>You should see your new email in your <a href="${reverse('dashboard')}">dashboard</a>.</p> | ||
| </section> | ||
| </section> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,13 @@ | ||
| <h1> Could not change e-mail </h1> | ||
| <%inherit file="main.html" /> | ||
|
|
||
| An account with the new e-mail address already exists. Sorry. | ||
| <section class="container activation"> | ||
|
|
||
| <section class="message"> | ||
| <h1 class="invalid">E-mail change failed</h1> | ||
| <hr class="horizontal-divider"> | ||
|
|
||
| <p>An account with the new e-mail address already exists.</p> | ||
|
|
||
| <p>Go back to the <a href="/">home page</a>.</p> | ||
| </section> | ||
| </section> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,24 @@ | ||
| Thank you for signing up for edX! To activate your account, | ||
| please copy and paste this address into your web browser's | ||
| address bar: | ||
| <%namespace file="../main.html" import="stanford_theme_enabled" /> | ||
|
|
||
| Thank you for signing up for ${settings.PLATFORM_NAME}! To activate | ||
| your account, please copy and paste this address into your web | ||
| browser's address bar: | ||
|
|
||
| % if is_secure: | ||
| https://${ site }/activate/${ key } | ||
| % else: | ||
| http://${ site }/activate/${ key } | ||
| % 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 edX web site. | ||
| ## Temporary hack until we develop a better way to adjust language | ||
| % 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 | ||
| ${settings.PLATFORM_NAME} Courses web site. | ||
| % 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 | ||
| ${settings.PLATFORM_NAME} web site. | ||
| % endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| Your account for edX | ||
| Your account for ${settings.PLATFORM_NAME} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not blocking, but FWIW, this can just be be written as
MKTG_URL_LINK_MAP.update(ENV_TOKENS.get('MKTG_URL_LINK_MAP', {}))