Commit b2d70e28 by chrisndodge

Merge pull request #872 from MITx/feature/cale/edge-landing-page

Edge landing page, styled, not wired up yet
parents c8147587 51a19b3d
......@@ -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)
......
......@@ -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))
......
......@@ -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",'')
......
......@@ -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',
}
}
......@@ -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"
......
......@@ -27,6 +27,7 @@
@import 'multicourse/password_reset';
@import 'multicourse/error-pages';
@import 'multicourse/help';
@import 'multicourse/edge';
@import 'discussion';
@import 'news';
.edge-landing {
$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 {
......@@ -7,14 +72,20 @@
border-bottom: 3px solid $blue;
}
a:hover {
text-decoration: none;
}
.main-wrapper {
width: 942px;
margin: auto;
.content {
@extend .window;
padding: 24px 60px 36px;
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;
}
......@@ -31,12 +102,18 @@
}
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;
}
......@@ -49,6 +126,7 @@
.forgot-button {
font-size: 12px;
line-height: 41px;
margin-left: 10px;
}
}
......@@ -59,20 +137,31 @@
.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;
font-weight: 300;
color: #3c3c3c;
}
p {
font-family: $sans-serif;
}
}
......@@ -81,6 +170,8 @@
width: 263px;
height: 72px;
margin: 150px auto 50px;
background: url(../img/edge-logo-large.png) no-repeat;
background: url(../images/edge-logo-large.png) no-repeat;
text-indent: -9999px;
overflow: hidden;
}
}
\ No newline at end of file
<%namespace name='static' file='static_content.html'/>
<!DOCTYPE html>
<html>
<head>
<%block name="title"><title>edX</title></%block>
<link rel="icon" type="image/x-icon" href="${static.url('images/favicon.ico')}" />
<%static:css group='application'/>
<%static:js group='main_vendor'/>
<%block name="headextra"/>
<!--[if lt IE 9]>
<script src="${static.url('js/html5shiv.js')}"></script>
<![endif]-->
<!--[if lte IE 9]>
<%static:css group='ie-fixes'/>
<![endif]-->
<meta name="path_prefix" content="${MITX_ROOT_URL}">
</head>
<body class="<%block name='bodyclass'/>">
${self.body()}
<%block name="bodyextra"/>
<%static:js group='application'/>
<%static:js group='module-js'/>
<%block name="js_extra"/>
</body>
</html>
<%inherit file="base.html" />
<%! from django.core.urlresolvers import reverse %>
<%block name="title">edX edge</%block>
<%inherit file="../stripped-main.html" />
<%block name="title"><title>edX edge</title></%block>
<%block name="bodyclass">no-header edge-landing</%block>
<%block name="content">
<div class="main-wrapper">
<div class="edx-edge-logo-large"></div>
<div class="edx-edge-logo-large">edX edge</div>
<div class="content">
<div class="log-in-form">
<h2>Log in to your courses</h2>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment