diff --git a/lms/djangoapps/courseware/tests/test_footer.py b/lms/djangoapps/courseware/tests/test_footer.py new file mode 100644 index 0000000000..25d7d2f453 --- /dev/null +++ b/lms/djangoapps/courseware/tests/test_footer.py @@ -0,0 +1,35 @@ +""" +Tests related to the basic footer-switching based off SITE_NAME to ensure +edx.org uses an edx footer but other instances use an Open edX footer. +""" + +from django.test import TestCase +from django.test.utils import override_settings + + +class TestFooter(TestCase): + + @override_settings(SITE_NAME="edx.org") + def test_edx_footer(self): + """ + Verify that the homepage, when accessed at edx.org, has the edX footer + """ + + resp = self.client.get('/') + self.assertEqual(resp.status_code, 200) + + # assert that footer template has been properly overriden on homepage + self.assertContains(resp, 'EdX is a non-profit created by founding partners Harvard and MIT') + + @override_settings(SITE_NAME="example.com") + def test_openedx_footer(self): + """ + Verify that the homepage, when accessed at something other than + edx.org, has the Open edX footer + """ + + resp = self.client.get('/') + self.assertEqual(resp.status_code, 200) + + # assert that footer template has been properly overriden on homepage + self.assertContains(resp, 'Powered by Open edX') diff --git a/lms/djangoapps/courseware/tests/test_microsites.py b/lms/djangoapps/courseware/tests/test_microsites.py index 52105f33d8..c6e2f1d130 100644 --- a/lms/djangoapps/courseware/tests/test_microsites.py +++ b/lms/djangoapps/courseware/tests/test_microsites.py @@ -56,6 +56,7 @@ class TestMicrosites(ModuleStoreTestCase, LoginEnrollmentTestCase): self.activate_user(email) + @override_settings(SITE_NAME=MICROSITE_TEST_HOSTNAME) def test_microsite_anonymous_homepage_content(self): """ Verify that the homepage, when accessed via a Microsite domain, returns diff --git a/lms/static/images/edx-openedx-logo-tag-dark.png b/lms/static/images/edx-openedx-logo-tag-dark.png new file mode 100644 index 0000000000..a1da4e1c4b Binary files /dev/null and b/lms/static/images/edx-openedx-logo-tag-dark.png differ diff --git a/lms/static/images/edx-openedx-logo-tag-light.png b/lms/static/images/edx-openedx-logo-tag-light.png new file mode 100644 index 0000000000..64549da834 Binary files /dev/null and b/lms/static/images/edx-openedx-logo-tag-light.png differ diff --git a/lms/static/images/edx-openedx-logo-tag.png b/lms/static/images/edx-openedx-logo-tag.png new file mode 100644 index 0000000000..1ee962690e Binary files /dev/null and b/lms/static/images/edx-openedx-logo-tag.png differ diff --git a/lms/static/images/logo-placeholder.png b/lms/static/images/logo-placeholder.png new file mode 100644 index 0000000000..94099e3650 Binary files /dev/null and b/lms/static/images/logo-placeholder.png differ diff --git a/lms/static/sass/shared/_footer.scss b/lms/static/sass/shared/_footer.scss index f76e114cc4..223b926a23 100644 --- a/lms/static/sass/shared/_footer.scss +++ b/lms/static/sass/shared/_footer.scss @@ -84,63 +84,105 @@ .references { margin: -10px 0 0 0; width: flex-grid(4,12); - float: right; + display: inline-block; + } - .nav-social { - margin: 0; - text-align: right; + .wrapper-logo { + margin: ($baseline*.75) 0; - li { - display: inline-block; + a { + display: inline-block; - &:last-child { - margin-right: 0; - } - - a { - display: block; - - &:hover, &:focus, &:active { - border: none; - } - } - - img { - display: block; - } - } - } - - .copyright { - margin: -2px 0 8px 0; - font-size: em(11); - color: tint($m-gray,50%); - text-align: right; - } - - .nav-legal { - @include clearfix(); - text-align: right; - - li { - display: inline-block; - font-size: em(11); - - a { - display: block; - } - } - - .nav-legal-01 a { - - &:after { - margin-left: 5px; - content: "-"; - } + &:hover { + border-bottom: 0; } } } + .copyright { + margin: -2px 0 8px 0; + font-size: em(11); + color: $gray-l2; + text-align: left; + } + + .nav-legal { + @include clearfix(); + text-align: left; + + li { + display: inline-block; + font-size: em(11); + + a { + display: block; + } + } + + .nav-legal-01 a { + + &:after { + margin-left: 5px; + content: "-"; + } + } + } + + .nav-social { + margin: 0; + text-align: right; + + li { + display: inline-block; + + &:last-child { + margin-right: 0; + } + + a { + display: block; + + &:hover, &:focus, &:active { + border: none; + } + } + + img { + display: block; + } + } + } + + // platform Open edX logo and link + .powered-by { + width: flex-grid(3,12); + display: inline-block; + vertical-align: bottom; + text-align: right; + + a { + display: inline-block; + + &:hover { + border-bottom: none; + } + } + } + } + + // edx theme overrides + &.edx-footer { + + footer { + + .copyright { + text-align: right; + } + + .nav-legal { + text-align: right; + } + } } } diff --git a/lms/templates/edx_footer.html b/lms/templates/edx_footer.html new file mode 100644 index 0000000000..606c689f5c --- /dev/null +++ b/lms/templates/edx_footer.html @@ -0,0 +1,91 @@ +## mako +<%! from django.core.urlresolvers import reverse %> +<%! from django.utils.translation import ugettext as _ %> +<%namespace name='static' file='static_content.html'/> + + diff --git a/lms/templates/footer.html b/lms/templates/footer.html index b6bf2cd84a..9e1e43f2af 100644 --- a/lms/templates/footer.html +++ b/lms/templates/footer.html @@ -37,56 +37,41 @@ -
- ${_('{platform_name} Logo').format(platform_name=platform_name())} - -

${_("{platform_name} is a non-profit created by founding partners {Harvard} and {MIT} whose mission is to bring the best of higher education to students of all ages anywhere in the world, wherever there is Internet access. {platform_name}'s free online MOOCs are interactive and subjects include computer science, public health, and artificial intelligence.").format(platform_name="EdX", Harvard="Harvard", MIT="MIT")}

+ + + +
-
- - - - - + ## please leave this link and use one of the logos provided +
+

+ + ## standard powered-by logo + Powered by Open edX + ## greyscale logo for dark background + ## Powered by Open edX + ## greyscale logo for light background + ## Powered by Open edX + +

diff --git a/lms/templates/main.html b/lms/templates/main.html index 8b1603f83a..4ccbb888d6 100644 --- a/lms/templates/main.html +++ b/lms/templates/main.html @@ -73,7 +73,11 @@ header_extra_file = None header_file = microsite.get_template_path('navigation.html') google_analytics_file = microsite.get_template_path('google_analytics.html') - footer_file = microsite.get_template_path('footer.html') + + if getattr(settings, 'SITE_NAME', '').endswith('edx.org'): + footer_file = microsite.get_template_path('edx_footer.html') + else: + footer_file = microsite.get_template_path('footer.html') style_overrides_file = microsite.get_value('css_overrides_file') %> @@ -130,5 +134,3 @@ html.escape(enrollment_action) ) if course_id and enrollment_action else "" } - - diff --git a/lms/templates/main_django.html b/lms/templates/main_django.html index ceef729d6e..43b7afe02c 100644 --- a/lms/templates/main_django.html +++ b/lms/templates/main_django.html @@ -36,7 +36,7 @@ {% block bodyextra %}{% endblock %} - {% include "footer.html" %} + {% include "edx_footer.html" %} {% compressed_js 'application' %} {% compressed_js 'module-js' %}