Skip to content

Commit

Permalink
Merge pull request openedx#464 from xavierchan/refactor-i-theme
Browse files Browse the repository at this point in the history
refactor(theme): migrate theme code to the theme dir
  • Loading branch information
xavierchan authored Jun 5, 2019
2 parents 899dba1 + 8835861 commit c6f6de2
Show file tree
Hide file tree
Showing 120 changed files with 5,427 additions and 1,754 deletions.
23 changes: 0 additions & 23 deletions cms/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<%namespace name='static' file='static_content.html'/>
<%!
from django.utils.translation import ugettext as _
from django.conf import settings

from openedx.core.djangoapps.util.user_messages import PageLevelMessages
from openedx.core.djangolib.js_utils import (
Expand Down Expand Up @@ -42,15 +41,6 @@
jsi18n_path = "js/i18n/{language}/djangojs.js".format(language=LANGUAGE_CODE)
%>

<% sentry_dsn_frontend = getattr(settings, 'SENTRY_DSN_FRONTEND', '') %>
% if sentry_dsn_frontend:
<script src="https://browser.sentry-cdn.com/4.4.2/bundle.min.js" crossorigin="anonymous"></script>
<script type="text/javascript">
// Sentry Settings
Sentry.init({ dsn: '${sentry_dsn_frontend}' });
</script>
% endif

% if getattr(settings, 'CAPTURE_CONSOLE_LOG', False):
<script type="text/javascript">
var oldOnError = window.onerror;
Expand Down Expand Up @@ -85,19 +75,6 @@
<%include file="widgets/segment-io.html" />

<%block name="header_extras"></%block>

<% ga_acct = getattr(settings, 'GOOGLE_ANALYTICS_ACCOUNT', None) %>
<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', '${ga_acct}', 'auto');
ga('send', 'pageview');
</script>
<!-- End Google Analytics -->
</head>

<body class="${static.dir_rtl()} <%block name='bodyclass'></%block> lang_${LANGUAGE_CODE}">
Expand Down
2 changes: 0 additions & 2 deletions cms/templates/emails/activation_email.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@ ${_("Thank you for signing up for {studio_name}! To activate your account, pleas
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 {studio_name} web site.").format(studio_name=settings.STUDIO_NAME)}
2 changes: 1 addition & 1 deletion cms/templates/register.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ <h1 class="title title-1">${_("Sign Up for {studio_name}").format(studio_name=se
<li class="field checkbox required" id="field-tos">
<input id="tos" name="terms_of_service" type="checkbox" value="true" />
<label for="tos">
${_("I agree to the {a_start} Terms of Service {a_end}").format(a_start='<a data-rel="edx.org" href="{}">'.format('https://www.elitemba.cn/honor'), a_end="</a>")}
${_("I agree to the {a_start} Terms of Service {a_end}").format(a_start='<a data-rel="edx.org" href="{}">'.format(marketing_link('TOS')), a_end="</a>")}
</label>
</li>
</ol>
Expand Down
2 changes: 1 addition & 1 deletion cms/templates/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ <h2 class="title-2">${_('Course Schedule')}</h2>
<span class="tip tip-stacked">
${_("Last day students can enroll.")}
% if not enrollment_end_editable:
${_("Contact your EliteMBA partner manager to update these settings.")}
${_("Contact your edX partner manager to update these settings.")}
% endif
</span>
</div>
Expand Down
16 changes: 15 additions & 1 deletion lms/templates/certificates/_accomplishment-footer.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
<%page expression_filter="h"/>
<div class="wrapper-footer">


<footer class="footer-app" role="contentinfo" id="company-info">
<div class="footer-app-copyright">
<p class="copy copy-micro">${copyright_text | n, decode.utf8 }</p>
</div>
<nav class="footer-app-nav">
<ul class="list list-legal">
<li class="nav-item">
<a class="action btn btn-small btn-link" href="${company_tos_url}">${company_tos_urltext}</a>
</li>
<li class="nav-item">
<a class="action btn btn-small btn-link" href="${company_privacy_url}">${company_privacy_urltext}</a>
</li>
</ul>
</nav>
</footer>

</div>
2 changes: 1 addition & 1 deletion lms/templates/certificates/_accomplishment-rendering.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ <h3 class="recipient-name">${accomplishment_copy_name}</h3>
</dd>
</dl>
<dl class="metadata accomplishment-id">
<dt class="label copy copy-meta">${certificate_id_number_title}</dt>
<dt class="label copy copy-meta">${certificate_id_number_title}:</dt>
<dd class="value copy copy-base">${certificate_id_number}</dd>
</dl>
<dl class="metadata accomplishment-date">
Expand Down
1 change: 0 additions & 1 deletion lms/templates/certificates/accomplishment-base.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
<title>${document_title}</title>

<%static:css group='style-certificates'/>
<link rel="icon" type="image/x-icon" href="${static.url(static.get_value('favicon_path', settings.FAVICON_PATH))}" />
</head>

<body class="layout-accomplishment view-valid-accomplishment ${dir_rtl} certificate certificate-${course_mode_class}" data-view="valid-accomplishment">
Expand Down
22 changes: 10 additions & 12 deletions lms/templates/certificates/valid.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@
<%inherit file="accomplishment-base.html" />
<%! from django.utils.translation import ugettext as _ %>

% if user.is_authenticated and user.id == int(accomplishment_user_id):
<%include file="_accomplishment-banner.html" />
% endif
<%include file="_accomplishment-introduction.html" />

<div class="wrap-h5">
% if user.is_authenticated and user.id == int(accomplishment_user_id):
<%include file="_accomplishment-banner.html" />
% endif

<%include file="_accomplishment-rendering.html" />
<div class="wrapper-about">
<aside role="complementary" class="about" aria-label=${_("About EliteMBA Certificates")}>
<%include file="_about-edx.html" />
<%include file="_about-accomplishments.html" />
</aside>
</div>
<%include file="_accomplishment-rendering.html" />
<div class="wrapper-about">
<aside role="complementary" class="about" aria-label=${_("About edX Certificates")}>
<%include file="_about-edx.html" />
<%include file="_about-accomplishments.html" />
</aside>
</div>
16 changes: 6 additions & 10 deletions lms/templates/course.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,11 @@ <h2 class="course-name">
else:
course_date_string = ''
%>

<div class="course-date localized_datetime"
aria-hidden="true"
data-format="shortDate"
data-datetime="${course_date_string}"
data-language="${LANGUAGE_CODE}"
data-string="${_("Starts: {date}")}">
</div>

% if course.advertised_start is not None:
<div class="course-date" aria-hidden="true">${_("Starts")}: ${course.advertised_start}</div>
% else:
<div class="course-date localized_datetime" aria-hidden="true" data-format="shortDate" data-datetime="${course_date_string}" data-string="${_("Starts: {date}")}"></div>
% endif
</div>
<div class="sr">
<ul>
Expand All @@ -43,7 +39,7 @@ <h2 class="course-name">
% if course.advertised_start is not None:
<li>${_("Starts")}: <time itemprop="startDate">${course.advertised_start}</time></li>
% else:
<li>${_("Starts")}: <time class="localized_datetime" itemprop="startDate" data-format="shortDate" data-datetime="${course_date_string}" data-language="${LANGUAGE_CODE}"></time></li>
<li>${_("Starts")}: <time class="localized_datetime" itemprop="startDate" data-format="shortDate" data-datetime="${course_date_string}"></time></li>
% endif
</ul>
</div>
Expand Down
41 changes: 13 additions & 28 deletions lms/templates/course_modes/choose.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ <h3 class="title">
<div class="wrapper-copy">
<span class="deco-ribbon"></span>
% if has_credit_upsell:
% if content_gating_enabled or course_duration_limit_enabled:
% if content_gating_enabled:
<h4 class="title">${_("Pursue Academic Credit with the Verified Track")}</h4>
% else:
<h4 class="title">${_("Pursue Academic Credit with a Verified Certificate")}</h4>
Expand All @@ -97,16 +97,12 @@ <h4 class="title">${_("Pursue Academic Credit with a Verified Certificate")}</h4
<p>
<div class="wrapper-copy-inline">
<div class="copy-inline">
% if content_gating_enabled or course_duration_limit_enabled:
% if content_gating_enabled:
<h4>${_("Benefits of the Verified Track")}</h4>
<ul>
<li>${Text(_("{b_start}Eligible for credit:{b_end} Receive academic credit after successfully completing the course")).format(**b_tag_kwargs)}</li>
% if course_duration_limit_enabled:
<li>${Text(_("{b_start}Unlimited Course Access: {b_end}Learn at your own pace, and access materials anytime to brush up on what you've learned.")).format(**b_tag_kwargs)}</li>
% endif
% if content_gating_enabled:
<li>${Text(_("{b_start}Graded Assignments: {b_end}Build your skills through graded assignments and projects.")).format(**b_tag_kwargs)}</li>
% endif
<li>${Text(_("{b_start}Unlimited Course Access: {b_end}Learn at your own pace, and access materials anytime to brush up on what you've learned.")).format(**b_tag_kwargs)}</li>
<li>${Text(_("{b_start}Graded Assignments: {b_end}Build your skills through graded assignments and projects.")).format(**b_tag_kwargs)}</li>
<li>${Text(_("{b_start}Easily Sharable: {b_end}Add the certificate to your CV or resume, or post it directly on LinkedIn.")).format(**b_tag_kwargs)}</li>
</ul>
% else:
Expand All @@ -122,16 +118,15 @@ <h4>${_("Benefits of a Verified Certificate")}</h4>
<ul class="list-actions">
<li class="action action-select">
<input type="hidden" name="contribution" value="${min_price}" />
<input type="submit" name="verified_mode"
value="${_('Pursue a Verified Certificate')} (${currency_symbol}${min_price} ${currency_code})" />
<input type="submit" name="verified_mode" value="${_('Pursue a Verified Certificate')} ($${min_price} USD)" />
</li>
</ul>
</div>
</div>
</p>
</div>
% else:
% if content_gating_enabled or course_duration_limit_enabled:
% if content_gating_enabled:
<h4 class="title">${_("Pursue the Verified Track")}</h4>
% else:
<h4 class="title">${_("Pursue a Verified Certificate")}</h4>
Expand All @@ -143,15 +138,11 @@ <h4 class="title">${_("Pursue a Verified Certificate")}</h4>
<p>
<div class="wrapper-copy-inline">
<div class="copy-inline">
% if content_gating_enabled or course_duration_limit_enabled:
% if content_gating_enabled:
<h4>${_("Benefits of the Verified Track")}</h4>
<ul>
% if course_duration_limit_enabled:
<li>${Text(_("{b_start}Unlimited Course Access: {b_end}Learn at your own pace, and access materials anytime to brush up on what you've learned.")).format(**b_tag_kwargs)}</li>
% endif
% if content_gating_enabled:
<li>${Text(_("{b_start}Graded Assignments: {b_end}Build your skills through graded assignments and projects.")).format(**b_tag_kwargs)}</li>
% endif
<li>${Text(_("{b_start}Unlimited Course Access: {b_end}Learn at your own pace, and access materials anytime to brush up on what you've learned.")).format(**b_tag_kwargs)}</li>
<li>${Text(_("{b_start}Graded Assignments: {b_end}Build your skills through graded assignments and projects.")).format(**b_tag_kwargs)}</li>
<li>${Text(_("{b_start}Easily Sharable: {b_end}Add the certificate to your CV or resume, or post it directly on LinkedIn.")).format(**b_tag_kwargs)}</li>
</ul>
% else:
Expand All @@ -167,12 +158,10 @@ <h4>${_("Benefits of a Verified Certificate")}</h4>
<ul class="list-actions">
<li class="action action-select">
<input type="hidden" name="contribution" value="${min_price}" />

% if content_gating_enabled or course_duration_limit_enabled:
<input type="submit" name="verified_mode" value="${_('Pursue the Verified Track')} (${currency_symbol}${min_price} ${currency_code})" />

% if content_gating_enabled:
<input type="submit" name="verified_mode" value="${_('Pursue the Verified Track')} ($${min_price} USD)" />
% else:
<input type="submit" name="verified_mode" value="${_('Pursue a Verified Certificate')} (${currency_symbol}${min_price} ${currency_code})" />
<input type="submit" name="verified_mode" value="${_('Pursue a Verified Certificate')} ($${min_price} USD)" />
% endif
</li>
</ul>
Expand Down Expand Up @@ -216,12 +205,8 @@ <h4 class="title">${_("Audit This Course")}</h4>
<h4 class="title">${_("Audit This Course (No Certificate)")}</h4>
<div class="copy">
## Translators: b_start notes the beginning of a section of text bolded for emphasis, and b_end marks the end of the bolded text.
% if content_gating_enabled and course_duration_limit_enabled:
% if content_gating_enabled:
<p>${Text(_("Audit this course for free and have access to course materials and discussions forums. {b_start}This track does not include graded assignments, or unlimited course access.{b_end}")).format(**b_tag_kwargs)}</p>
% elif content_gating_enabled and not course_duration_limit_enabled:
<p>${Text(_("Audit this course for free and have access to course materials and discussions forums. {b_start}This track does not include graded assignments.{b_end}")).format(**b_tag_kwargs)}</p>
% elif not content_gating_enabled and course_duration_limit_enabled:
<p>${Text(_("Audit this course for free and have access to course materials and discussions forums. {b_start}This track does not include unlimited course access.{b_end}")).format(**b_tag_kwargs)}</p>
% else:
<p>${Text(_("Audit this course for free and have complete access to all the course material, activities, tests, and forums. {b_start}Please note that this track does not offer a certificate for learners who earn a passing grade.{b_end}")).format(**b_tag_kwargs)}</p>
% endif
Expand Down
Loading

0 comments on commit c6f6de2

Please sign in to comment.