diff --git a/cms/static/sass/_edge.scss b/cms/static/sass/_edge.scss deleted file mode 100644 index 9d8562b62a..0000000000 --- a/cms/static/sass/_edge.scss +++ /dev/null @@ -1,86 +0,0 @@ -.edge-landing { - border-top: 5px solid $blue; - - header { - @include clearfix; - background: $extraDarkGrey; - border-bottom: 3px solid $blue; - } - - .main-wrapper { - width: 942px; - margin: auto; - - .content { - @extend .window; - padding: 24px 60px 36px; - border-radius: 3px; - @include clearfix; - } - - .log-in-form { - float: left; - width: 470px; - margin-right: 50px; - padding-right: 49px; - border-right: 1px solid $lightGrey; - - .row { - margin-bottom: 20px; - border-bottom: none; - } - - label { - font-weight: 700; - } - - input { - width: 100%; - font-size: 21px; - font-weight: 300; - } - - .log-in-submit-button { - @include blue-button; - width: 130px; - padding: 8px 20px 10px; - font-size: 16px; - } - - .forgot-button { - font-size: 12px; - margin-left: 10px; - } - } - - .sign-up { - float: left; - width: 250px; - - .register-button { - @include grey-button; - margin-top: 20px; - } - } - - h2 { - margin-bottom: 30px; - font-size: 24px; - font-weight: 300; - } - - h3 { - margin-bottom: 30px; - font-size: 24px; - font-weight: 300; - } - } - - .edx-edge-logo-large { - display: block; - width: 263px; - height: 72px; - margin: 150px auto 50px; - background: url(../img/edge-logo-large.png) no-repeat; - } -} \ No newline at end of file diff --git a/lms/djangoapps/branding/__init__.py b/lms/djangoapps/branding/__init__.py index 3a4acd2964..b2ac874020 100644 --- a/lms/djangoapps/branding/__init__.py +++ b/lms/djangoapps/branding/__init__.py @@ -4,8 +4,11 @@ from xmodule.course_module import CourseDescriptor from django.conf import settings -def get_subdomain(domain): - return domain.split(".")[0] +def pick_subdomain(domain, options, default='default'): + for option in options: + if domain.startswith(option): + return option + return default def get_visible_courses(domain=None): @@ -17,9 +20,7 @@ def get_visible_courses(domain=None): courses = sorted(courses, key=lambda course: course.number) if domain and settings.MITX_FEATURES.get('SUBDOMAIN_COURSE_LISTINGS'): - subdomain = get_subdomain(domain) - if subdomain not in settings.COURSE_LISTINGS: - subdomain = 'default' + subdomain = pick_subdomain(domain, settings.COURSE_LISTINGS.keys()) visible_ids = frozenset(settings.COURSE_LISTINGS[subdomain]) return [course for course in courses if course.id in visible_ids] else: @@ -34,7 +35,7 @@ def get_university(domain=None): if not settings.MITX_FEATURES['SUBDOMAIN_BRANDING'] or domain is None: return None - subdomain = get_subdomain(domain) + subdomain = pick_subdomain(domain, settings.SUBDOMAIN_BRANDING.keys()) return settings.SUBDOMAIN_BRANDING.get(subdomain) diff --git a/lms/djangoapps/courseware/views.py b/lms/djangoapps/courseware/views.py index d5b7ae0893..b8c8f5e912 100644 --- a/lms/djangoapps/courseware/views.py +++ b/lms/djangoapps/courseware/views.py @@ -420,7 +420,7 @@ def university_profile(request, org_id): Return the profile for the particular org_id. 404 if it's not valid. """ all_courses = modulestore().get_courses() - valid_org_ids = set(c.org for c in all_courses) + valid_org_ids = set(c.org for c in all_courses).union(settings.VIRTUAL_UNIVERSITIES) if org_id not in valid_org_ids: raise Http404("University Profile not found for {0}".format(org_id)) diff --git a/lms/envs/aws.py b/lms/envs/aws.py index 8794cb0581..eb8533395e 100644 --- a/lms/envs/aws.py +++ b/lms/envs/aws.py @@ -58,6 +58,7 @@ LOGGING = get_logger_config(LOG_DIR, COURSE_LISTINGS = ENV_TOKENS.get('COURSE_LISTINGS', {}) SUBDOMAIN_BRANDING = ENV_TOKENS.get('SUBDOMAIN_BRANDING', {}) +VIRTUAL_UNIVERSITIES = ENV_TOKENS.get('VIRTUAL_UNIVERSITIES', []) COMMENTS_SERVICE_URL = ENV_TOKENS.get("COMMENTS_SERVICE_URL",'') COMMENTS_SERVICE_KEY = ENV_TOKENS.get("COMMENTS_SERVICE_KEY",'') diff --git a/lms/envs/cms/dev.py b/lms/envs/cms/dev.py index ded3471ea2..3d2c0c3c3b 100644 --- a/lms/envs/cms/dev.py +++ b/lms/envs/cms/dev.py @@ -4,6 +4,12 @@ Settings for the LMS that runs alongside the CMS on AWS from ..dev import * +MITX_FEATURES['AUTH_USE_MIT_CERTIFICATES'] = False + +SUBDOMAIN_BRANDING['edge'] = 'edge' +SUBDOMAIN_BRANDING['preview.edge'] = 'edge' +VIRTUAL_UNIVERSITIES = ['edge'] + modulestore_options = { 'default_class': 'xmodule.raw_module.RawDescriptor', 'host': 'localhost', @@ -24,6 +30,6 @@ CONTENTSTORE = { 'ENGINE': 'xmodule.contentstore.mongo.MongoContentStore', 'OPTIONS': { 'host': 'localhost', - 'db' : 'xcontent', + 'db': 'xcontent', } } diff --git a/lms/envs/dev.py b/lms/envs/dev.py index b89b0246f3..1cc9ee4b88 100644 --- a/lms/envs/dev.py +++ b/lms/envs/dev.py @@ -101,6 +101,10 @@ SUBDOMAIN_BRANDING = { 'harvard': 'HarvardX', } +# List of `university` landing pages to display, even though they may not +# have an actual course with that org set +VIRTUAL_UNIVERSITIES = [] + COMMENTS_SERVICE_KEY = "PUT_YOUR_API_KEY_HERE" diff --git a/lms/static/images/edge-logo-large.png b/lms/static/images/edge-logo-large.png new file mode 100644 index 0000000000..2933ec5349 Binary files /dev/null and b/lms/static/images/edge-logo-large.png differ diff --git a/lms/static/sass/application.scss b/lms/static/sass/application.scss index 944d3b2884..ba485a4633 100644 --- a/lms/static/sass/application.scss +++ b/lms/static/sass/application.scss @@ -27,6 +27,7 @@ @import 'multicourse/password_reset'; @import 'multicourse/error-pages'; @import 'multicourse/help'; +@import 'multicourse/edge'; @import 'discussion'; @import 'news'; diff --git a/lms/static/sass/multicourse/_edge.scss b/lms/static/sass/multicourse/_edge.scss new file mode 100644 index 0000000000..32580b964b --- /dev/null +++ b/lms/static/sass/multicourse/_edge.scss @@ -0,0 +1,177 @@ +$blue: #5597dd; +$lightGrey: #edf1f5; +$mediumGrey: #ced2db; +$darkGrey: #8891a1; +$extraDarkGrey: #3d4043; +$paleYellow: #fffcf1; + +@mixin button { + display: inline-block; + padding: 4px 20px 6px; + font-family: $sans-serif; + font-size: 14px; + font-weight: 700; + text-transform: none; + letter-spacing: 0; + @include box-shadow(0 1px 0 rgba(255, 255, 255, .3) inset, 0 0 0 rgba(0, 0, 0, 0)); + @include transition(background-color .15s, box-shadow .15s); + + &.disabled { + border: 1px solid $lightGrey !important; + border-radius: 3px !important; + background: $lightGrey !important; + color: $darkGrey !important; + pointer-events: none; + cursor: none; + &:hover { + box-shadow: 0 0 0 0 !important; + } + } + + &:hover { + @include box-shadow(0 1px 0 rgba(255, 255, 255, .3) inset, 0 1px 1px rgba(0, 0, 0, .15)); + text-decoration: none; + } +} + +@mixin blue-button { + @include button; + border: 1px solid #437fbf; + border-radius: 3px; + @include linear-gradient(top, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0)); + background-color: $blue; + color: #fff; + + &:hover { + background-color: #62aaf5; + color: #fff; + } +} + +@mixin grey-button { + @include button; + border: 1px solid $darkGrey; + border-radius: 3px; + @include linear-gradient(top, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0)); + background-color: #d1dae3; + @include box-shadow(0 1px 0 rgba(255, 255, 255, .3) inset); + color: #6d788b; + + &:hover { + background-color: #d9e3ee; + color: #6d788b; + } +} + +.edge-landing { + border-top: 5px solid $blue; + + header { + @include clearfix; + background: $extraDarkGrey; + border-bottom: 3px solid $blue; + } + + a:hover { + text-decoration: none; + } + + .main-wrapper { + width: 942px; + margin: auto; + + .content { + padding: 40px 60px 36px; + background: #fff; + border: 1px solid $darkGrey; + border-radius: 3px; + @include box-shadow(0 1px 2px rgba(0, 0, 0, .1)); + @include clearfix; + } + + .log-in-form { + float: left; + width: 470px; + margin-right: 50px; + padding-right: 49px; + border-right: 1px solid $lightGrey; + + .row { + margin-bottom: 20px; + border-bottom: none; + } + + label { + font-family: $sans-serif; + font-size: 13px; + font-weight: 700; + font-style: normal; + } + + input { + width: 100%; + height: 43px; + font-family: $sans-serif; + font-size: 21px; + font-style: normal; + font-weight: 300; + } + + .log-in-submit-button { + @include blue-button; + width: 130px; + padding: 8px 20px 10px; + font-size: 16px; + } + + .forgot-button { + font-size: 12px; + line-height: 41px; + margin-left: 10px; + } + } + + .sign-up { + float: left; + width: 250px; + + .register-button { + @include grey-button; + padding: 10px 20px 12px; + margin-top: 20px; + } + } + + h2 { + margin-bottom: 30px; + font-family: $sans-serif; + font-size: 24px; + font-weight: 300; + text-transform: none; + letter-spacing: 0; + color: #3c3c3c; + } + + h3 { + margin-bottom: 30px; + font-family: $sans-serif; + font-size: 24px; + font-weight: 300; + color: #3c3c3c; + } + + p { + font-family: $sans-serif; + } + } + + .edx-edge-logo-large { + display: block; + width: 263px; + height: 72px; + margin: 150px auto 50px; + background: url(../images/edge-logo-large.png) no-repeat; + text-indent: -9999px; + overflow: hidden; + } +} \ No newline at end of file diff --git a/lms/templates/stripped-main.html b/lms/templates/stripped-main.html new file mode 100644 index 0000000000..1c1a28fec1 --- /dev/null +++ b/lms/templates/stripped-main.html @@ -0,0 +1,34 @@ +<%namespace name='static' file='static_content.html'/> + + + + <%block name="title">edX + + + + <%static:css group='application'/> + + <%static:js group='main_vendor'/> + <%block name="headextra"/> + + + + + + + + + + ${self.body()} + <%block name="bodyextra"/> + + <%static:js group='application'/> + <%static:js group='module-js'/> + + <%block name="js_extra"/> + + diff --git a/lms/templates/university_profile/edge.html b/lms/templates/university_profile/edge.html index c8f0b69242..e102555975 100644 --- a/lms/templates/university_profile/edge.html +++ b/lms/templates/university_profile/edge.html @@ -1,12 +1,11 @@ -<%inherit file="base.html" /> -<%! from django.core.urlresolvers import reverse %> -<%block name="title">edX edge +<%inherit file="../stripped-main.html" /> +<%block name="title">edX edge <%block name="bodyclass">no-header edge-landing <%block name="content">
-
+
edX edge