diff --git a/lms/djangoapps/courseware/views.py b/lms/djangoapps/courseware/views.py index 385b27e7f1..21bd2281ec 100644 --- a/lms/djangoapps/courseware/views.py +++ b/lms/djangoapps/courseware/views.py @@ -531,6 +531,26 @@ def course_about(request, course_id): 'registered': registered, 'course_target': course_target, 'show_courseware_link': show_courseware_link}) +@ensure_csrf_cookie +@cache_if_anonymous +def mktg_course_about(request, course_id): + course = get_course_with_access(request.user, course_id, 'see_exists') + registered = registered_for_course(course, request.user) + + if has_access(request.user, course, 'load'): + course_target = reverse('info', args=[course.id]) + else: + course_target = reverse('about_course', args=[course.id]) + + show_courseware_link = (has_access(request.user, course, 'load') or + settings.MITX_FEATURES.get('ENABLE_LMS_MIGRATION')) + + return render_to_response('courseware/mktg_course_about.html', + {'course': course, + 'registered': registered, + 'course_target': course_target, + 'show_courseware_link': show_courseware_link}) + @ensure_csrf_cookie diff --git a/lms/static/sass/_shame.scss b/lms/static/sass/_shame.scss new file mode 100644 index 0000000000..d40b1d3fc1 --- /dev/null +++ b/lms/static/sass/_shame.scss @@ -0,0 +1,85 @@ +// edX LMS - shame +// shame file - used for any bad-form/orphaned scss that knowingly violate edX FED architecture/standards (see - http://csswizardry.com/2013/04/shame-css/) +// ==================== + +// marketing site - registration iframe band-aid (poor form enough to isolate out) +.view-partial-mktgregister { + background: transparent; + + // dimensions needed for course about page on marketing site + .wrapper-view { + overflow: hidden; + } + + // button elements - not a better place to put these, sadly + .btn { + display: block; + padding: $baseline/2 $baseline*2.5; + text-transform: lowercase; + color: $white !important; + letter-spacing: 0.1rem; + cursor: pointer; + text-align: center; + border: none !important; + text-shadow: none; + letter-spacing: 0.1rem; + font-size: 17px; + font-weight: 300; + box-shadow: 0 !important; + + strong { + font-weight: 400; + } + } + + .btn-primary { + @extend .btn; + @include linear-gradient($m-blue-s1 5%, $m-blue-d1 95%); + + // no hover state conventions to follow from marketing :/ + &:hover, &:active { + + } + } + + .btn-secondary { + @extend .btn; + @include linear-gradient($m-gray 5%, $m-gray-d1 95%); + + // no hover state conventions to follow from marketing :/ + &:hover, &:active { + + } + } + + // nav list + .list-actions { + list-style: none; + margin: 0; + padding: 0; + + .item { + margin: 0; + } + } + + // register actions + .action { + + } + + // not registered (default) + .action-register { + @extend .btn-primary; + } + + // not signed in + .is-not-signedin { + @extend .btn-primary; + } + + // already registered + .is-registered { + @extend .btn-secondary; + } +} diff --git a/lms/static/sass/application.scss b/lms/static/sass/application.scss index df93032045..6a1ef8743e 100644 --- a/lms/static/sass/application.scss +++ b/lms/static/sass/application.scss @@ -34,3 +34,5 @@ @import 'discussion'; @import 'news'; + +@import 'shame'; diff --git a/lms/templates/courseware/course_about.html b/lms/templates/courseware/course_about.html index dc1dc17532..cc22e37848 100644 --- a/lms/templates/courseware/course_about.html +++ b/lms/templates/courseware/course_about.html @@ -204,5 +204,4 @@ %endif - <%include file="../video_modal.html" /> diff --git a/lms/templates/courseware/mktg_course_about.html b/lms/templates/courseware/mktg_course_about.html new file mode 100644 index 0000000000..dc90b4e98c --- /dev/null +++ b/lms/templates/courseware/mktg_course_about.html @@ -0,0 +1,98 @@ +<%! + from django.core.urlresolvers import reverse + from courseware.courses import course_image_url, get_course_about_section + from courseware.access import has_access +%> +<%namespace name='static' file='../static_content.html'/> + +<%inherit file="../mktg_iframe.html" /> + +<%block name="title">About ${course.number} + +<%block name="bodyclass">view-partial-mktgregister + + +<%block name="headextra"> + <%include file="../google_analytics.html" /> + + +<%block name="js_extra"> + % if not registered: + %if user.is_authenticated(): + ## If the user is authenticated, clicking the enroll button just submits a form + + %else: + ## If the user is not authenticated, clicking the enroll button pops up the register + ## field. We also slip in the registration fields into the login/register fields so + ## the user is automatically registered after logging in / registering + + %endif + %endif + + +<%block name="content"> + + + + + + + +%if not registered: +
+
+
+ + + +
+
+ + + +
+
+
+%endif + diff --git a/lms/templates/main.html b/lms/templates/main.html index 42d5a71228..02e3c9fa46 100644 --- a/lms/templates/main.html +++ b/lms/templates/main.html @@ -3,6 +3,15 @@ <%block name="title">edX + diff --git a/lms/templates/mktg_iframe.html b/lms/templates/mktg_iframe.html new file mode 100644 index 0000000000..d37264825a --- /dev/null +++ b/lms/templates/mktg_iframe.html @@ -0,0 +1,39 @@ +<%namespace name='static' file='static_content.html'/> + + + + <%block name="title"> + + + + + + <%static:css group='application'/> + <%static:js group='main_vendor'/> + + + + + + <%block name="headextra"/> + + % if not course: + <%include file="google_analytics.html" /> + % endif + + + + + +
+ + <%block name="content"> +
+ + <%block name="js_extra"> + + diff --git a/lms/urls.py b/lms/urls.py index 49dae19d58..e1150169c7 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -185,6 +185,10 @@ if settings.COURSEWARE_ENABLED: #About the course url(r'^courses/(?P[^/]+/[^/]+/[^/]+)/about$', 'courseware.views.course_about', name="about_course"), + #View for mktg site + url(r'^courses/(?P[^/]+/[^/]+/[^/]+)/mktg-about$', + 'courseware.views.mktg_course_about', name="mktg_about_course"), + #Inside the course url(r'^courses/(?P[^/]+/[^/]+/[^/]+)/$',