From 93be67d49a5bd1f8c6458b2c5709571176955f9d Mon Sep 17 00:00:00 2001 From: cahrens Date: Mon, 3 Jun 2013 15:21:02 -0400 Subject: [PATCH 1/3] Fix bug STUD-103. The url base for about page links needs to be www.edx.org for Drupal site, vs. LMS_BASE which is used for Studio. Note that the complete URL is still not correct, but a redirect exists to take it to the new location. --- .../contentstore/tests/test_utils.py | 23 ++++++++++++++++--- cms/djangoapps/contentstore/utils.py | 15 +++++++++--- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/cms/djangoapps/contentstore/tests/test_utils.py b/cms/djangoapps/contentstore/tests/test_utils.py index 0757992f2f..26aca14130 100644 --- a/cms/djangoapps/contentstore/tests/test_utils.py +++ b/cms/djangoapps/contentstore/tests/test_utils.py @@ -4,6 +4,7 @@ import mock import collections import copy from django.test import TestCase +from django.test.utils import override_settings from xmodule.modulestore.tests.factories import CourseFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase @@ -11,11 +12,27 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase class LMSLinksTestCase(TestCase): """ Tests for LMS links. """ def about_page_test(self): - """ Get URL for about page. """ + """ Get URL for about page, no marketing site """ + # default for ENABLE_MKTG_SITE is False. + self.assertEquals(self.get_about_page_link(), "//localhost:8000/courses/mitX/101/test/about") + + @override_settings(MKTG_URLS={'ROOT': 'dummy-root'}) + def about_page_marketing_site_test(self): + """ Get URL for about page, marketing root present. """ + with mock.patch.dict('django.conf.settings.MITX_FEATURES', {'ENABLE_MKTG_SITE': True}): + self.assertEquals(self.get_about_page_link(), "//dummy-root/courses/mitX/101/test/about") + with mock.patch.dict('django.conf.settings.MITX_FEATURES', {'ENABLE_MKTG_SITE': False}): + self.assertEquals(self.get_about_page_link(), "//localhost:8000/courses/mitX/101/test/about") + + @override_settings(LMS_BASE=None) + def about_page_no_lms_base_test(self): + """ No LMS_BASE, nor is ENABLE_MKTG_SITE True """ + self.assertEquals(self.get_about_page_link(), None) + + def get_about_page_link(self): location = 'i4x', 'mitX', '101', 'course', 'test' utils.get_course_id = mock.Mock(return_value="mitX/101/test") - link = utils.get_lms_link_for_about_page(location) - self.assertEquals(link, "//localhost:8000/courses/mitX/101/test/about") + return utils.get_lms_link_for_about_page(location) def lms_link_test(self): """ Tests get_lms_link_for_item. """ diff --git a/cms/djangoapps/contentstore/utils.py b/cms/djangoapps/contentstore/utils.py index 35451cf7cc..703e9a266a 100644 --- a/cms/djangoapps/contentstore/utils.py +++ b/cms/djangoapps/contentstore/utils.py @@ -107,9 +107,18 @@ def get_lms_link_for_about_page(location): """ Returns the url to the course about page from the location tuple. """ - if settings.LMS_BASE is not None: - lms_link = "//{lms_base}/courses/{course_id}/about".format( - lms_base=settings.LMS_BASE, + if settings.MITX_FEATURES.get('ENABLE_MKTG_SITE', False): + # Root will be "www.edx.org". The complete URL will still not be exactly correct, + # but redirects exist from www.edx.org to get to the drupal course about page URL. + about_base = settings.MKTG_URLS.get('ROOT') + elif settings.LMS_BASE is not None: + about_base = settings.LMS_BASE + else: + about_base = None + + if about_base is not None: + lms_link = "//{about_base_url}/courses/{course_id}/about".format( + about_base_url=about_base, course_id=get_course_id(location) ) else: From 38e3ff13ed91fd8c2ab04224de09e692ff2a9050 Mon Sep 17 00:00:00 2001 From: cahrens Date: Mon, 3 Jun 2013 15:32:42 -0400 Subject: [PATCH 2/3] pep8 cleanup. --- cms/djangoapps/contentstore/tests/test_utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cms/djangoapps/contentstore/tests/test_utils.py b/cms/djangoapps/contentstore/tests/test_utils.py index 26aca14130..c4b0f4bb51 100644 --- a/cms/djangoapps/contentstore/tests/test_utils.py +++ b/cms/djangoapps/contentstore/tests/test_utils.py @@ -30,6 +30,7 @@ class LMSLinksTestCase(TestCase): self.assertEquals(self.get_about_page_link(), None) def get_about_page_link(self): + """ create mock course and return the about page link """ location = 'i4x', 'mitX', '101', 'course', 'test' utils.get_course_id = mock.Mock(return_value="mitX/101/test") return utils.get_lms_link_for_about_page(location) From 3bcbc9f979b909defd32437f866182bc7696eb9a Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Tue, 4 Jun 2013 11:26:16 -0400 Subject: [PATCH 3/3] studio - replaces iconography for advanced component button within the unit view --- cms/static/img/large-advanced-icon.png | Bin 342 -> 633 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/cms/static/img/large-advanced-icon.png b/cms/static/img/large-advanced-icon.png index c6a19ea5a931e4a65daecb30ab6e741238db9b62..97442f5aa0db565e0ffccfbcff2e9160c9bdb99d 100644 GIT binary patch literal 633 zcmeAS@N?(olHy`uVBq!ia0vp^vOp}y!3-py-+Ve5Nc{=$332^DA_36%Kz}p!8u#}nc!e8JK@5F68Ot>Y!DX}jr zd?=fjsPFq}o%G`XbH#rVOkYozpS{HV#OU*%lnwoVS-$WDs-*EVXn4Qz1{#0U)5S5Q zBJS?F(7YoK0&EW>IgEio$5@gn_WOSCM=3e)j~R=5*#5nwzBQ`z-8#n^<=VSEtdGR1 zeA%;^Cv$4k&a0Cn7TY~^zW31g$@~|quX#?swt7m@qrOMJ(j~lF2U**1F3H=nV&}mb zjYnI`POkrNx7{K6eShBJW%Il@*su7f7j3=B`hca>1vwEFo$y6b?=Pp#cJ5q#Aa%`A zqvh$fudZdpx>q@G%3I;jFHv>zSI5fq|L*S%uXBI-aca@qXWQ2$WY>B9l)Kh;mF1gJ omQMclHItkw?|7U$5%7^aOpoI`?|~9-peGqTUHx3vIVCg!0P3@&-~a#s literal 342 zcmeAS@N?(olHy`uVBq!ia0vp^av;pX3?zBp#Z3TG#sNMduK!5^Kutj9qFbB30a*ei zL4Lsn{R!(0?w=P>2$;YBy+b{NjoN-`pxhx(7srr_TWc?#Eo)KWX?s}mgO~Hi-Tzmw zZF%L;yZO~_&h~V{zDs2$23ODDu77lE`Kj6K7j^JX%y@iEb^~L{^q(nZmJ4rYc*yZ* zY>X65e)_e{;dQU{rA?_%?QCbf-BaXtV;xIn>ZaOo(FHTRmA