Commit d8f8d8c6 by Calen Pennington

Merge branch 'release/1.0'

Conflicts:
	common/djangoapps/student/views.py
	lms/djangoapps/courseware/courses.py
parents 1d1a9173 1d5e42f1
...@@ -132,10 +132,10 @@ IGNORABLE_404_ENDS = ('favicon.ico') ...@@ -132,10 +132,10 @@ IGNORABLE_404_ENDS = ('favicon.ico')
# Email # Email
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
DEFAULT_FROM_EMAIL = 'registration@mitx.mit.edu' DEFAULT_FROM_EMAIL = 'registration@edx.org'
DEFAULT_FEEDBACK_EMAIL = 'feedback@mitx.mit.edu' DEFAULT_FEEDBACK_EMAIL = 'feedback@edx.org'
ADMINS = ( ADMINS = (
('MITx Admins', 'admin@mitx.mit.edu'), ('edX Admins', 'admin@edx.org'),
) )
MANAGERS = ADMINS MANAGERS = ADMINS
......
<%! <%!
from staticfiles.storage import staticfiles_storage from staticfiles.storage import staticfiles_storage
from pipeline_mako import compressed_css, compressed_js from pipeline_mako import compressed_css, compressed_js
from static_replace import replace_urls
%> %>
<%def name='url(file)'>${staticfiles_storage.url(file)}</%def> <%def name='url(file)'>${staticfiles_storage.url(file)}</%def>
...@@ -24,5 +23,3 @@ from static_replace import replace_urls ...@@ -24,5 +23,3 @@ from static_replace import replace_urls
% endfor % endfor
%endif %endif
</%def> </%def>
<%def name='replace_urls(text)'>${replace_urls(text)}</%def>
...@@ -266,13 +266,13 @@ def create_account(request, post_override=None): ...@@ -266,13 +266,13 @@ def create_account(request, post_override=None):
# TODO: Check password is sane # TODO: Check password is sane
for a in ['username', 'email', 'name', 'password', 'terms_of_service', 'honor_code']: for a in ['username', 'email', 'name', 'password', 'terms_of_service', 'honor_code']:
if len(post_vars[a]) < 2: if len(post_vars[a]) < 2:
error_str = {'username': 'Username of length 2 or greater', error_str = {'username': 'Username must be minimum of two characters long.',
'email': 'Properly formatted e-mail', 'email': 'A properly formatted e-mail is required.',
'name': 'Your legal name ', 'name': 'Your legal name must be a minimum of two characters long.',
'password': 'Valid password ', 'password': 'A valid password is required.',
'terms_of_service': 'Accepting Terms of Service', 'terms_of_service': 'Accepting Terms of Service is required.',
'honor_code': 'Agreeing to the Honor Code'} 'honor_code': 'Agreeing to the Honor Code is required.'}
js['value'] = "{field} is required.".format(field=error_str[a]) js['value'] = error_str[a]
return HttpResponse(json.dumps(js)) return HttpResponse(json.dumps(js))
try: try:
...@@ -408,10 +408,11 @@ def password_reset(request): ...@@ -408,10 +408,11 @@ def password_reset(request):
raise Http404 raise Http404
form = PasswordResetForm(request.POST) form = PasswordResetForm(request.POST)
if form.is_valid(): if form.is_valid():
form.save(use_https=request.is_secure(), form.save(use_https = request.is_secure(),
from_email=settings.DEFAULT_FROM_EMAIL, from_email = settings.DEFAULT_FROM_EMAIL,
request=request) request = request,
return HttpResponse(json.dumps({'success': True, domain_override = settings.SITE_NAME)
return HttpResponse(json.dumps({'success':True,
'value': render_to_string('registration/password_reset_done.html', {})})) 'value': render_to_string('registration/password_reset_done.html', {})}))
else: else:
return HttpResponse(json.dumps({'success': False, return HttpResponse(json.dumps({'success': False,
......
...@@ -9,6 +9,8 @@ from django.http import Http404 ...@@ -9,6 +9,8 @@ from django.http import Http404
from xmodule.course_module import CourseDescriptor from xmodule.course_module import CourseDescriptor
from xmodule.modulestore.django import modulestore from xmodule.modulestore.django import modulestore
from xmodule.modulestore.exceptions import ItemNotFoundError from xmodule.modulestore.exceptions import ItemNotFoundError
from static_replace import replace_urls
from staticfiles.storage import staticfiles_storage
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
...@@ -40,15 +42,8 @@ def check_course(course_id, course_must_be_open=True, course_required=True): ...@@ -40,15 +42,8 @@ def check_course(course_id, course_must_be_open=True, course_required=True):
return course return course
### These methods look like they should be on the course_module object itself, but they rely
### on the lms. Maybe they should be added dynamically to the class?
def course_static_url(course):
return settings.STATIC_URL + "/" + course.metadata['data_dir'] + "/"
def course_image_url(course): def course_image_url(course):
return course_static_url(course) + "images/course_image.jpg" return staticfiles_storage.url(course.metadata['data_dir'] + "/images/course_image.jpg")
def get_course_about_section(course, section_key): def get_course_about_section(course, section_key):
...@@ -81,7 +76,7 @@ def get_course_about_section(course, section_key): ...@@ -81,7 +76,7 @@ def get_course_about_section(course, section_key):
'effort', 'end_date', 'prerequisites']: 'effort', 'end_date', 'prerequisites']:
try: try:
with course.system.resources_fs.open(path("about") / section_key + ".html") as htmlFile: with course.system.resources_fs.open(path("about") / section_key + ".html") as htmlFile:
return htmlFile.read().decode('utf-8').format(COURSE_STATIC_URL=course_static_url(course)) return replace_urls(htmlFile.read().decode('utf-8'), course.metadata['data_dir'])
except ResourceNotFoundError: except ResourceNotFoundError:
log.warning("Missing about section {key} in course {url}".format(key=section_key, url=course.location.url())) log.warning("Missing about section {key} in course {url}".format(key=section_key, url=course.location.url()))
return None return None
...@@ -111,11 +106,9 @@ def get_course_info_section(course, section_key): ...@@ -111,11 +106,9 @@ def get_course_info_section(course, section_key):
if section_key in ['handouts', 'guest_handouts', 'updates', 'guest_updates']: if section_key in ['handouts', 'guest_handouts', 'updates', 'guest_updates']:
try: try:
with course.system.resources_fs.open(path("info") / section_key + ".html") as htmlFile: with course.system.resources_fs.open(path("info") / section_key + ".html") as htmlFile:
return htmlFile.read().decode('utf-8') return replace_urls(htmlFile.read().decode('utf-8'), course.metadata['data_dir'])
except ResourceNotFoundError: except ResourceNotFoundError:
log.exception("Missing info section {key} in course {url}".format(key=section_key, url=course.location.url())) log.exception("Missing info section {key} in course {url}".format(key=section_key, url=course.location.url()))
return "! Info section missing !" return "! Info section missing !"
raise KeyError("Invalid about key " + str(section_key)) raise KeyError("Invalid about key " + str(section_key))
...@@ -158,17 +158,17 @@ TEMPLATE_DEBUG = False ...@@ -158,17 +158,17 @@ TEMPLATE_DEBUG = False
# Site info # Site info
SITE_ID = 1 SITE_ID = 1
SITE_NAME = "localhost:8000" SITE_NAME = "edx.org"
HTTPS = 'on' HTTPS = 'on'
ROOT_URLCONF = 'lms.urls' ROOT_URLCONF = 'lms.urls'
IGNORABLE_404_ENDS = ('favicon.ico') IGNORABLE_404_ENDS = ('favicon.ico')
# Email # Email
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
DEFAULT_FROM_EMAIL = 'registration@mitx.mit.edu' DEFAULT_FROM_EMAIL = 'registration@edx.org'
DEFAULT_FEEDBACK_EMAIL = 'feedback@mitx.mit.edu' DEFAULT_FEEDBACK_EMAIL = 'feedback@edx.org'
ADMINS = ( ADMINS = (
('MITx Admins', 'admin@mitx.mit.edu'), ('edX Admins', 'admin@edx.org'),
) )
MANAGERS = ADMINS MANAGERS = ADMINS
......
lms/static/images/askbot/search-icon.png

607 Bytes | W: | H:

lms/static/images/askbot/search-icon.png

473 Bytes | W: | H:

lms/static/images/askbot/search-icon.png
lms/static/images/askbot/search-icon.png
lms/static/images/askbot/search-icon.png
lms/static/images/askbot/search-icon.png
  • 2-up
  • Swipe
  • Onion skin
lms/static/images/askbot/vote-arrow-down.png

346 Bytes | W: | H:

lms/static/images/askbot/vote-arrow-down.png

216 Bytes | W: | H:

lms/static/images/askbot/vote-arrow-down.png
lms/static/images/askbot/vote-arrow-down.png
lms/static/images/askbot/vote-arrow-down.png
lms/static/images/askbot/vote-arrow-down.png
  • 2-up
  • Swipe
  • Onion skin
lms/static/images/askbot/vote-arrow-up.png

298 Bytes | W: | H:

lms/static/images/askbot/vote-arrow-up.png

200 Bytes | W: | H:

lms/static/images/askbot/vote-arrow-up.png
lms/static/images/askbot/vote-arrow-up.png
lms/static/images/askbot/vote-arrow-up.png
lms/static/images/askbot/vote-arrow-up.png
  • 2-up
  • Swipe
  • Onion skin
lms/static/images/bullet-triangle.png

1.28 KB | W: | H:

lms/static/images/bullet-triangle.png

259 Bytes | W: | H:

lms/static/images/bullet-triangle.png
lms/static/images/bullet-triangle.png
lms/static/images/bullet-triangle.png
lms/static/images/bullet-triangle.png
  • 2-up
  • Swipe
  • Onion skin
lms/static/images/calc-icon.png

152 Bytes | W: | H:

lms/static/images/calc-icon.png

150 Bytes | W: | H:

lms/static/images/calc-icon.png
lms/static/images/calc-icon.png
lms/static/images/calc-icon.png
lms/static/images/calc-icon.png
  • 2-up
  • Swipe
  • Onion skin
lms/static/images/contact-page.jpg

16.3 KB | W: | H:

lms/static/images/contact-page.jpg

15.9 KB | W: | H:

lms/static/images/contact-page.jpg
lms/static/images/contact-page.jpg
lms/static/images/contact-page.jpg
lms/static/images/contact-page.jpg
  • 2-up
  • Swipe
  • Onion skin
lms/static/images/courses/math.png

148 KB | W: | H:

lms/static/images/courses/math.png

123 KB | W: | H:

lms/static/images/courses/math.png
lms/static/images/courses/math.png
lms/static/images/courses/math.png
lms/static/images/courses/math.png
  • 2-up
  • Swipe
  • Onion skin
69017eed8a9ec5b9caf28814cadf01ba69b4b3bc
\ No newline at end of file
74bca798766449c9f2c87244410ca8fa30d5482e
\ No newline at end of file
184bae027b6853b575b8de2329f77089bcc87966
\ No newline at end of file
lms/static/images/document-download.png

1.05 KB | W: | H:

lms/static/images/document-download.png

131 Bytes | W: | H:

lms/static/images/document-download.png
lms/static/images/document-download.png
lms/static/images/document-download.png
lms/static/images/document-download.png
  • 2-up
  • Swipe
  • Onion skin
lms/static/images/edx-logo-large-bw.png

9.13 KB | W: | H:

lms/static/images/edx-logo-large-bw.png

5.54 KB | W: | H:

lms/static/images/edx-logo-large-bw.png
lms/static/images/edx-logo-large-bw.png
lms/static/images/edx-logo-large-bw.png
lms/static/images/edx-logo-large-bw.png
  • 2-up
  • Swipe
  • Onion skin
lms/static/images/edx.png

7.83 KB | W: | H:

lms/static/images/edx.png

4.57 KB | W: | H:

lms/static/images/edx.png
lms/static/images/edx.png
lms/static/images/edx.png
lms/static/images/edx.png
  • 2-up
  • Swipe
  • Onion skin
lms/static/images/edx_bw.png

7.72 KB | W: | H:

lms/static/images/edx_bw.png

4.47 KB | W: | H:

lms/static/images/edx_bw.png
lms/static/images/edx_bw.png
lms/static/images/edx_bw.png
lms/static/images/edx_bw.png
  • 2-up
  • Swipe
  • Onion skin
lms/static/images/fullscreen.png

114 Bytes | W: | H:

lms/static/images/fullscreen.png

112 Bytes | W: | H:

lms/static/images/fullscreen.png
lms/static/images/fullscreen.png
lms/static/images/fullscreen.png
lms/static/images/fullscreen.png
  • 2-up
  • Swipe
  • Onion skin
lms/static/images/header-logo.png

3 KB | W: | H:

lms/static/images/header-logo.png

1.51 KB | W: | H:

lms/static/images/header-logo.png
lms/static/images/header-logo.png
lms/static/images/header-logo.png
lms/static/images/header-logo.png
  • 2-up
  • Swipe
  • Onion skin
lms/static/images/home_bg.jpg

403 KB | W: | H:

lms/static/images/home_bg.jpg

402 KB | W: | H:

lms/static/images/home_bg.jpg
lms/static/images/home_bg.jpg
lms/static/images/home_bg.jpg
lms/static/images/home_bg.jpg
  • 2-up
  • Swipe
  • Onion skin
lms/static/images/homepage-bg.jpg

158 KB | W: | H:

lms/static/images/homepage-bg.jpg

157 KB | W: | H:

lms/static/images/homepage-bg.jpg
lms/static/images/homepage-bg.jpg
lms/static/images/homepage-bg.jpg
lms/static/images/homepage-bg.jpg
  • 2-up
  • Swipe
  • Onion skin
lms/static/images/jobs.jpeg

70 KB | W: | H:

lms/static/images/jobs.jpeg

66.6 KB | W: | H:

lms/static/images/jobs.jpeg
lms/static/images/jobs.jpeg
lms/static/images/jobs.jpeg
lms/static/images/jobs.jpeg
  • 2-up
  • Swipe
  • Onion skin
lms/static/images/logo.png

4.04 KB | W: | H:

lms/static/images/logo.png

2.43 KB | W: | H:

lms/static/images/logo.png
lms/static/images/logo.png
lms/static/images/logo.png
lms/static/images/logo.png
  • 2-up
  • Swipe
  • Onion skin
lms/static/images/logo_bw.png

2.41 KB | W: | H:

lms/static/images/logo_bw.png

1.19 KB | W: | H:

lms/static/images/logo_bw.png
lms/static/images/logo_bw.png
lms/static/images/logo_bw.png
lms/static/images/logo_bw.png
  • 2-up
  • Swipe
  • Onion skin
lms/static/images/logo_harvard_v5.png

7.59 KB | W: | H:

lms/static/images/logo_harvard_v5.png

2.65 KB | W: | H:

lms/static/images/logo_harvard_v5.png
lms/static/images/logo_harvard_v5.png
lms/static/images/logo_harvard_v5.png
lms/static/images/logo_harvard_v5.png
  • 2-up
  • Swipe
  • Onion skin
lms/static/images/mongolia_post.jpeg

282 KB | W: | H:

lms/static/images/mongolia_post.jpeg

275 KB | W: | H:

lms/static/images/mongolia_post.jpeg
lms/static/images/mongolia_post.jpeg
lms/static/images/mongolia_post.jpeg
lms/static/images/mongolia_post.jpeg
  • 2-up
  • Swipe
  • Onion skin
lms/static/images/open-arrow.png

2.76 KB | W: | H:

lms/static/images/open-arrow.png

101 Bytes | W: | H:

lms/static/images/open-arrow.png
lms/static/images/open-arrow.png
lms/static/images/open-arrow.png
lms/static/images/open-arrow.png
  • 2-up
  • Swipe
  • Onion skin
lms/static/images/pause-icon.png

102 Bytes | W: | H:

lms/static/images/pause-icon.png

90 Bytes | W: | H:

lms/static/images/pause-icon.png
lms/static/images/pause-icon.png
lms/static/images/pause-icon.png
lms/static/images/pause-icon.png
  • 2-up
  • Swipe
  • Onion skin
lms/static/images/play-icon.png

179 Bytes | W: | H:

lms/static/images/play-icon.png

172 Bytes | W: | H:

lms/static/images/play-icon.png
lms/static/images/play-icon.png
lms/static/images/play-icon.png
lms/static/images/play-icon.png
  • 2-up
  • Swipe
  • Onion skin
lms/static/images/profile.jpg

105 KB | W: | H:

lms/static/images/profile.jpg

83.4 KB | W: | H:

lms/static/images/profile.jpg
lms/static/images/profile.jpg
lms/static/images/profile.jpg
lms/static/images/profile.jpg
  • 2-up
  • Swipe
  • Onion skin
lms/static/images/schools.png

58.9 KB | W: | H:

lms/static/images/schools.png

46.7 KB | W: | H:

lms/static/images/schools.png
lms/static/images/schools.png
lms/static/images/schools.png
lms/static/images/schools.png
  • 2-up
  • Swipe
  • Onion skin
lms/static/images/sequence-nav/edit.png

292 Bytes | W: | H:

lms/static/images/sequence-nav/edit.png

168 Bytes | W: | H:

lms/static/images/sequence-nav/edit.png
lms/static/images/sequence-nav/edit.png
lms/static/images/sequence-nav/edit.png
lms/static/images/sequence-nav/edit.png
  • 2-up
  • Swipe
  • Onion skin
lms/static/images/sequence-nav/history.png

430 Bytes | W: | H:

lms/static/images/sequence-nav/history.png

276 Bytes | W: | H:

lms/static/images/sequence-nav/history.png
lms/static/images/sequence-nav/history.png
lms/static/images/sequence-nav/history.png
lms/static/images/sequence-nav/history.png
  • 2-up
  • Swipe
  • Onion skin
lms/static/images/sequence-nav/next-icon.png

271 Bytes | W: | H:

lms/static/images/sequence-nav/next-icon.png

264 Bytes | W: | H:

lms/static/images/sequence-nav/next-icon.png
lms/static/images/sequence-nav/next-icon.png
lms/static/images/sequence-nav/next-icon.png
lms/static/images/sequence-nav/next-icon.png
  • 2-up
  • Swipe
  • Onion skin
lms/static/images/sequence-nav/view.png

329 Bytes | W: | H:

lms/static/images/sequence-nav/view.png

229 Bytes | W: | H:

lms/static/images/sequence-nav/view.png
lms/static/images/sequence-nav/view.png
lms/static/images/sequence-nav/view.png
lms/static/images/sequence-nav/view.png
  • 2-up
  • Swipe
  • Onion skin
lms/static/images/slider-bars.png

116 Bytes | W: | H:

lms/static/images/slider-bars.png

105 Bytes | W: | H:

lms/static/images/slider-bars.png
lms/static/images/slider-bars.png
lms/static/images/slider-bars.png
lms/static/images/slider-bars.png
  • 2-up
  • Swipe
  • Onion skin
lms/static/images/slider-handle.png

177 Bytes | W: | H:

lms/static/images/slider-handle.png

169 Bytes | W: | H:

lms/static/images/slider-handle.png
lms/static/images/slider-handle.png
lms/static/images/slider-handle.png
lms/static/images/slider-handle.png
  • 2-up
  • Swipe
  • Onion skin
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