Commit 8148b016 by David Ormsbee

Merge branch 'hotfix/1.0.3' into stable

parents 432fdd18 442fb6e8
......@@ -35,9 +35,10 @@ from xmodule.modulestore.exceptions import ItemNotFoundError
from models import Registration, UserProfile, PendingNameChange, PendingEmailChange, CourseEnrollment
from datetime import date
from collections import namedtuple
log = logging.getLogger("mitx.student")
Article = namedtuple('Article', 'title url author image deck publication publish_date')
def csrf_token(context):
''' A csrf token that can be included in a form.
......@@ -84,6 +85,19 @@ def course_from_id(id):
course_loc = CourseDescriptor.id_to_location(id)
return modulestore().get_item(course_loc)
def press(request):
json_articles = cache.get("student_press_json_articles")
if json_articles == None:
if hasattr(settings, 'RSS_URL'):
content = urllib.urlopen(settings.PRESS_URL).read()
json_articles = json.loads(content)
else:
content = open(settings.PROJECT_ROOT / "templates" / "press.json").read()
json_articles = json.loads(content)
cache.set("student_press_json_articles", json_articles)
articles = [Article(**article) for article in json_articles]
return render_to_response('static_templates/press.html', {'articles': articles})
@login_required
@ensure_csrf_cookie
def dashboard(request):
......
from django.db import models
# Create your models here.
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
"""
self.assertEqual(1 + 1, 2)
# Create your views here.
import json
from datetime import datetime
from django.http import HttpResponse, Http404
def dictfetchall(cursor):
'''Returns all rows from a cursor as a dict.
Borrowed from Django documentation'''
desc = cursor.description
return [
dict(zip([col[0] for col in desc], row))
for row in cursor.fetchall()
]
def dashboard(request):
"""
Quick hack to show staff enrollment numbers. This should be
replaced with a real dashboard later. This version is a short-term
bandaid for the next couple weeks.
"""
if not request.user.is_staff:
raise Http404
query = "select count(user_id) as students, course_id from student_courseenrollment group by course_id order by students desc"
from django.db import connection
cursor = connection.cursor()
cursor.execute(query)
results = dictfetchall(cursor)
return HttpResponse(json.dumps(results, indent=4))
......@@ -105,6 +105,7 @@ LIB_URL = '/static/js/'
# BOOK_URL = '/static/book/'
BOOK_URL = 'https://mitxstatic.s3.amazonaws.com/book_images/' # For AWS deploys
# RSS_URL = r'lms/templates/feed.rss'
# PRESS_URL = r''
RSS_TIMEOUT = 600
# Configuration option for when we want to grab server error pages
......
......@@ -85,7 +85,7 @@
}
.success-message-colors {
background: rgb(99, 236, 137);
border: 1px solid rgb(17, 202, 54);
color: rgb(35, 143, 14);
background: rgb(19, 159, 58);
border: 1px solid rgb(6, 65, 18);
color: rgb(255, 255, 255);
}
......@@ -27,14 +27,17 @@
max-width: 1200px;
min-width: 760px;
position: relative;
width: 100%;
z-index: 2;
> div.table {
display: table;
width: 100%;
}
.intro {
@include box-sizing(border-box);
@include clearfix;
float: left;
display: table-cell;
vertical-align: middle;
padding: 20px 20px;
position: relative;
width: flex-grid(8) + flex-gutter();
......@@ -130,9 +133,7 @@
.media {
background: transparent;
@include box-sizing(border-box);
display: block;
float: right;
height: 180px;
display: table-cell;
padding: 20px;
position: relative;
width: flex-grid(4);
......@@ -273,6 +274,24 @@
}
}
}
.faq {
@include clearfix;
.responses {
float: left;
}
.response {
margin-bottom: 40px;
h3 {
font-family: $sans-serif;
font-weight: 700;
margin-bottom: 15px;
}
}
}
}
}
......
......@@ -2,6 +2,27 @@
@include clearfix;
padding: 60px 0px 120px;
.dashboard-banner {
background: $yellow;
border: 1px solid rgb(200,200,200);
@include box-shadow(0 1px 0 0 rgba(255,255,255, 0.6));
padding: 10px;
margin-bottom: 30px;
&:empty {
display: none;
background-color: #FFF;
}
h2 {
margin-bottom: 0;
}
p {
margin-bottom: 0;
}
}
.profile-sidebar {
background: transparent;
float: left;
......
......@@ -34,10 +34,11 @@
<section class="container dashboard">
<section class="dashboard-banner">
${message}
<br/>
</section>
%if message:
<section class="dashboard-banner">
${message}
</section>
%endif
<section class="profile-sidebar">
<header class="profile">
......
......@@ -126,7 +126,10 @@
<a target="_blank" href="http://www.huffingtonpost.co.uk/2012/06/20/harvard-and-mit-create-edx-free-university-courses_n_1612143.html?utm_hp_ref=uk">Huffington Post</a>,
<a target="_blank" href="http://gigaom.com/cloud/everybody-codes/">GigaOM</a>,
<a target="_blank" href="http://web.mit.edu/newsoffice/2012/mitx-edx-first-course-recap-0716.html">MIT News</a>,
<a target="_blank" href="http://spectrum.ieee.org/at-work/education/review-mitxs-online-circuit-design-and-analysis-course">IEEE Spectrum</a>
##<a target="_blank" href="http://spectrum.ieee.org/at-work/education/review-mitxs-online-circuit-design-and-analysis-course">IEEE Spectrum</a>,
<a target="_blank" href="http://harvardmagazine.com/2012/07/harvard-extended">Harvard Magazine</a>,
<a target="_blank" href="http://www.bloomberg.com/news/2012-07-24/berkeley-joins-harvard-mit-offering-free-online-classes.html">Bloomberg</a>
## <a target="_blank" href="http://chronicle.com/blogs/wiredcampus/uc-berkeley-joins-edx-effort-to-offer-free-open-courses/37969">The Chronicle of Higher Education</a>
<a href="${reverse('press')}" class="read-more">Read More &rarr;</a>
</section>
......
......@@ -51,6 +51,7 @@
<section class="course-info">
<header class="course-profile">
<div class="intro-inner-wrapper">
<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>
......@@ -84,6 +85,7 @@
</div>
% endif
</div>
</div>
</header>
<section class="container">
......@@ -107,7 +109,7 @@
<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://edx.org/${reverse('about_course', args=[course.id])}" class="share">
<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')}">
......
......@@ -27,7 +27,7 @@
</div>
<article>
<h2>About <span class="edx">edX</span></h2>
<p>EdX is a not-for-profit enterprise of its founding partners Harvard University and the Massachusetts Institute of Technology that features learning designed specifically for interactive study via the web. Based on a long history of collaboration and their shared educational missions, the founders are creating a new distance-learning experience. Anant Agarwal, former Director of MIT's Computer Science and Artificial Intelligence Laboratory, serves as the first president of edX. Along with offering online courses, the institutions will use edX to research how students learn and how technology can transform learning&mdash;both on-campus and worldwide. EdX is based in Cambridge, Massachusetts and is governed by MIT and Harvard.</p>
<p>EdX is a not-for-profit enterprise of its founding partners Harvard University and the Massachusetts Institute of Technology that features learning designed specifically for interactive study via the web. Based on a long history of collaboration and their shared educational missions, the founders are creating a new online-learning experience with online courses that reflect their disciplinary breadth. Along with offering online courses, the institutions will use edX to research how students learn and how technology can transform learning&ndash;both on-campus and worldwide. Anant Agarwal, former Director of MIT's Computer Science and Artificial Intelligence Laboratory, serves as the first president of edX. EdX's goals combine the desire to reach out to students of all ages, means, and nations, and to deliver these teachings from a faculty who reflect the diversity of its audience. EdX is based in Cambridge, Massachusetts and is governed by MIT and Harvard.</p>
</article>
<hr class="fade-right-hr-divider">
</section>
......
......@@ -49,8 +49,8 @@
<p>EdX will be available to anyone in the world with an internet connection, and in general, there will not be an admissions process.</p>
</article>
<article class="response">
<h3>Will certificates be awarded? </h3>
<p>Yes. Online learners who demonstrate mastery of subjects can earn a certificate of completion. Certificates will be issued by edX under the name of the underlying "X University" from where the course originated, i.e. HarvardX, <em>MITx</em> or BerkeleyX. For the courses in Fall 2012, those certificates will be free. There is a plan to charge a modest fee for certificates in the future</p>
<h3>Will certificates be awarded?</h3>
<p>Yes. Online learners who demonstrate mastery of subjects can earn a certificate of completion. Certificates will be issued by edX under the name of the underlying "X University" from where the course originated, i.e. HarvardX, <em>MITx</em> or BerkeleyX. For the courses in Fall 2012, those certificates will be free. There is a plan to charge a modest fee for certificates in the future.</p>
</article>
<article class="response">
<h3>What will the scope of the online courses be? How many? Which faculty?</h3>
......
......@@ -17,7 +17,7 @@
<h2>Our mission is to transform learning.</h2>
<blockquote>
<p>&ldquo;EdX represents a unique opportunity to improve education on our campuses though online learning, while simultaneously creating a bold new educational path for millions of learners worldwide.&rdquo;</p>
<p>&ldquo;EdX represents a unique opportunity to improve education on our campuses through online learning, while simultaneously creating a bold new educational path for millions of learners worldwide.&rdquo;</p>
<cite>&mdash;Rafael Reif, MIT President </cite>
</blockquote>
......
......@@ -5,129 +5,6 @@
<%block name="title"><title>edX in the Press</title></%block>
<%!
from collections import namedtuple
Article = namedtuple('Article',
'title url author image deck publication publish_date')
articles = [
Article(title="Review: MITx's Online Circuit Design and Analysis Course",
url="http://spectrum.ieee.org/at-work/education/review-mitxs-online-circuit-design-and-analysis-course",
author="Steven J. Frank",
image="ieee_logo_178x138.jpeg",
deck="This latest experiment in remote learning is not for a casual audience.",
publication="IEEE Spectrum",
publish_date="July 2012"),
Article(title="More universities sign on to free online course initiative",
url="http://www.universityworldnews.com/article.php?story=20120719082235228",
author="Alison Moodie",
image="univworldnews_logo_178x138.jpeg",
deck=None,
publication="University World News",
publish_date="July 19, 2012 Issue No:231"),
Article(title="One Course, 150,000 Students",
url="http://nyti.ms/LtlQ5k",
author="Tamar Lewin",
image="nyt_logo_178x138.jpeg",
deck=None,
publication="The New York Times",
publish_date="July 18, 2012"),
Article(title="Lessons learned from MITx's prototype course",
url="http://mitne.ws/Mdabcp",
author="Larry Hardesty, MIT News Office",
image="mit_logo_178x138.jpeg",
deck="As the team behind MIT's ambitious online learning program gears up to introduce new courses in the fall, it takes stock of its initial experiences.",
publication="MIT News",
publish_date="7/16/2012"),
Article(title="Software coding: not just for programmers anymore",
url="http://gigaom.com/cloud/everybody-codes/",
author="Barb Darrow",
image="gigaom_logo_178x138.jpeg",
deck=None,
publication="GigaOM",
publish_date="July 16, 2012"),
Article(title="Anant Agarwal believes an online education from MIT and Harvard should be available to all",
url="http://b.globe.com/P6XKlB",
author="Jon Marcus",
image="bostonglobe_logo_178x138.jpeg",
deck=None,
publication="The Boston Globe",
publish_date="July 15, 2012"),
Article(title="Online Classes Cut Costs, But Do They Dilute Brands?",
url="http://n.pr/Lt5ydM",
author="Tovia Smith",
image="npr_logo_178x138.jpeg",
deck=None,
publication="NPR",
publish_date="July 02, 2012"),
Article(title="Coming Your Way: Free Virtual Courses From Top U.S. Universities",
url="http://www.openequalfree.org/coming-your-way-free-virtual-courses-from-top-u-s-universities/13993",
author=None,
image="oef_logo_178x138.jpeg",
deck=None,
publication="Open Equal Free",
publish_date="June 29, 2012"),
Article(title="Open Online Courses Are No Substitute for Classroom Learning",
url="http://bit.ly/MMEdEX",
author="Joshua Kim",
image="usnews_logo_178x138.jpeg",
deck=None,
publication="US News",
publish_date="June 29, 2012"),
Article(title="Harvard and MIT create edX to offer free video online courses to the world",
url="http://huff.to/LBucd3",
author="Lucy Sheriff",
image="huffpost_logo_178x138.jpeg",
deck=None,
publication="The Huffington Post",
publish_date="June 20, 2012"),
Article(title="Top universities put their reputations online",
url="http://bbc.in/M5avea",
author="Irina Khokhlova",
image="bbc_logo_178x138.jpeg",
deck=None,
publication="BBC News",
publish_date="June 20, 2012"),
Article(title="MIT receives $1 million to support edX partnership",
url="http://mitne.ws/Md5Aaa",
author=None,
image="mit_logo_178x138.jpeg",
deck="Institute receives award as part of Gates Foundation efforts to boost postsecondary graduation rates.",
publication="MIT News",
publish_date="June 19, 2012"),
Article(title="Column: Ivy League education? Online is the new option",
url="http://usat.ly/J73NW7",
author="Katrina Trinko",
image="usa_logo_178x138.jpeg",
deck=None,
publication="USA Today",
publish_date="May 15, 2012"),
Article(title="What is edX?",
url="http://mitne.ws/PgYhya",
author=None,
image="mit_logo_178x138.jpeg",
deck="Answering common questions about MIT and Harvard's new partnership in online education.",
publication="MIT News",
publish_date="May 02, 2012"),
Article(title="MIT and Harvard announce edX",
url="http://mitne.ws/Md5yit",
author=None,
image="mit_logo_178x138.jpeg",
deck="Joint partnership builds on MITx and Harvard distance learning; aims to benefit campus-based education and beyond.",
publication="MIT News",
publish_date="May 02, 2012"),
Article(title="MIT and Harvard launch a 'revolution in education'",
url="http://mitne.ws/PgZQvY",
author=None,
image="mit_logo_178x138.jpeg",
deck="Online edX courses will open both universities' classrooms to the world while enhancing on-campus learning.",
publication="MIT News",
publish_date="May 02, 2012"),
]
%>
<section class="container about">
<nav>
<a href="${reverse('about_edx')}">Vision</a>
......
......@@ -100,7 +100,7 @@
<div class="social-sharing">
<hr class="horizontal-divider">
<p>Share with friends and family:</p>
<a href="http://twitter.com/intent/tweet?text=UC+Berkeley+joins+Harvard+and+MIT+not-for-profit+online+learning+collaborative:+http://edx.org/press/uc-berkeley-joins-edx" class="share">
<a href="http://twitter.com/intent/tweet?text=UC+Berkeley+joins+Harvard+and+MIT+not-for-profit+online+learning+collaborative:+http://www.edx.org/press/uc-berkeley-joins-edx" class="share">
<img src="${static.url('images/social/twitter-sharing.png')}">
</a>
</a>
......
......@@ -13,6 +13,7 @@ if settings.DEBUG:
urlpatterns = ('',
url(r'^$', 'student.views.index', name="root"), # Main marketing page, or redirect to courseware
url(r'^dashboard$', 'student.views.dashboard', name="dashboard"),
url(r'^admin_dashboard$', 'dashboard.views.dashboard'),
url(r'^change_email$', 'student.views.change_email_request'),
url(r'^email_confirm/(?P<key>[^/]*)$', 'student.views.confirm_email_change'),
......@@ -58,8 +59,7 @@ urlpatterns = ('',
{'template': 'jobs.html'}, name="jobs"),
url(r'^contact$', 'static_template_view.views.render',
{'template': 'contact.html'}, name="contact"),
url(r'^press$', 'static_template_view.views.render',
{'template': 'press.html'}, name="press"),
url(r'^press$', 'student.views.press', name="press"),
url(r'^faq$', 'static_template_view.views.render',
{'template': 'faq.html'}, name="faq_edx"),
url(r'^help$', 'static_template_view.views.render',
......
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