Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update social media links in EdX footer. #7383

Merged
merged 1 commit into from
Mar 17, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions lms/djangoapps/courseware/tests/test_footer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,24 @@

from mock import patch

from django.conf import settings
from django.test import TestCase
from django.test.utils import override_settings


class TestFooter(TestCase):

SOCIAL_MEDIA_URLS = {
"facebook": "http://www.facebook.com/",
"google_plus": "https://plus.google.com/",
"twitter": "https://twitter.com/",
"linkedin": "http://www.linkedin.com/",
"tumblr": "http://www.tumblr.com/",
"meetup": "http://www.meetup.com/",
"reddit": "http://www.reddit.com/",
"youtube": "https://www.youtube.com/"
}

def test_edx_footer(self):
"""
Verify that the homepage, when accessed at edx.org, has the edX footer
Expand All @@ -35,3 +47,12 @@ def test_openedx_footer(self):
# assert that footer template has been properly overridden on homepage
# test the top-level element class; which is less likely to change than copy.
self.assertContains(resp, 'wrapper-footer')

@patch.dict(settings.FEATURES, {'IS_EDX_DOMAIN': True})
@override_settings(SOCIAL_MEDIA_FOOTER_URLS=SOCIAL_MEDIA_URLS)
def test_edx_footer_social_links(self):
resp = self.client.get('/')
for name, url in self.SOCIAL_MEDIA_URLS.iteritems():
self.assertContains(resp, url)
self.assertContains(resp, settings.SOCIAL_MEDIA_FOOTER_DISPLAY[name]['title'])
self.assertContains(resp, settings.SOCIAL_MEDIA_FOOTER_DISPLAY[name]['icon'])
8 changes: 3 additions & 5 deletions lms/envs/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,9 @@
# For displaying on the receipt. At Stanford PLATFORM_NAME != MERCHANT_NAME, but PLATFORM_NAME is a fine default
PLATFORM_TWITTER_ACCOUNT = ENV_TOKENS.get('PLATFORM_TWITTER_ACCOUNT', PLATFORM_TWITTER_ACCOUNT)
PLATFORM_FACEBOOK_ACCOUNT = ENV_TOKENS.get('PLATFORM_FACEBOOK_ACCOUNT', PLATFORM_FACEBOOK_ACCOUNT)
# Used for social media links.
PLATFORM_TWITTER_URL = ENV_TOKENS.get('PLATFORM_TWITTER_URL', PLATFORM_TWITTER_URL)
PLATFORM_MEETUP_URL = ENV_TOKENS.get('PLATFORM_MEETUP_URL', PLATFORM_MEETUP_URL)
PLATFORM_LINKEDIN_URL = ENV_TOKENS.get('PLATFORM_LINKEDIN_URL', PLATFORM_LINKEDIN_URL)
PLATFORM_GOOGLE_PLUS_URL = ENV_TOKENS.get('PLATFORM_GOOGLE_PLUS_URL', PLATFORM_GOOGLE_PLUS_URL)

# Social media links for the page footer
SOCIAL_MEDIA_FOOTER_URLS = ENV_TOKENS.get('SOCIAL_MEDIA_FOOTER_URLS', SOCIAL_MEDIA_FOOTER_URLS)

CC_MERCHANT_NAME = ENV_TOKENS.get('CC_MERCHANT_NAME', PLATFORM_NAME)
EMAIL_BACKEND = ENV_TOKENS.get('EMAIL_BACKEND', EMAIL_BACKEND)
Expand Down
76 changes: 71 additions & 5 deletions lms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@

PLATFORM_FACEBOOK_ACCOUNT = "http://www.facebook.com/YourPlatformFacebookAccount"
PLATFORM_TWITTER_ACCOUNT = "@YourPlatformTwitterAccount"
PLATFORM_TWITTER_URL = "https://twitter.com/YourPlatformTwitterAccount"
PLATFORM_MEETUP_URL = "http://www.meetup.com/YourMeetup"
PLATFORM_LINKEDIN_URL = "http://www.linkedin.com/company/YourPlatform"
PLATFORM_GOOGLE_PLUS_URL = "https://plus.google.com/YourGooglePlusAccount/"


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like these are still used on the LMS course about page for white label.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I can't seem to find them when I grep the code base. (I'm finding the _ACCOUNT settings, which aren't deleted, but not the _URL settings).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah my mistake, I found PLATFORM_TWITTER_ACCOUNT, not URL. You should be all
set!

On Tue, Mar 17, 2015 at 1:37 PM, Will Daly [email protected] wrote:

In lms/envs/common.py
https://github.com/edx/edx-platform/pull/7383#discussion_r26595974:

@@ -51,11 +51,6 @@

PLATFORM_FACEBOOK_ACCOUNT = "http://www.facebook.com/YourPlatformFacebookAccount"
PLATFORM_TWITTER_ACCOUNT = "@YourPlatformTwitterAccount"
-PLATFORM_TWITTER_URL = "https://twitter.com/YourPlatformTwitterAccount"

Hmm, I can't seem to find them when I grep the code base. (I'm finding the
_ACCOUNT settings, which aren't deleted, but not the _URL settings).


Reply to this email directly or view it on GitHub
https://github.com/edx/edx-platform/pull/7383/files#r26595974.

COURSEWARE_ENABLED = True
ENABLE_JASMINE = False
Expand Down Expand Up @@ -1688,6 +1683,77 @@
'WHAT_IS_VERIFIED_CERT': 'verified-certificate',
}

################# Social Media Footer Links #######################
# The names list controls the order of social media
# links in the footer.
SOCIAL_MEDIA_FOOTER_NAMES = [
"facebook",
"twitter",
"linkedin",
"google_plus",
"tumblr",
"meetup",
"reddit",
"youtube",
]

# The footer URLs dictionary maps social footer names
# to URLs defined in configuration.
SOCIAL_MEDIA_FOOTER_URLS = {}

# The display dictionary defines the title
# and icon class for each social media link.
SOCIAL_MEDIA_FOOTER_DISPLAY = {
"facebook": {
# Translators: This is the website name of www.facebook.com. Please
# translate this the way that Facebook advertises in your language.
"title": _("Facebook"),
"icon": "fa-facebook-square"
},
"twitter": {
# Translators: This is the website name of www.twitter.com. Please
# translate this the way that Twitter advertises in your language.
"title": _("Twitter"),
"icon": "fa-twitter"
},
"linkedin": {
# Translators: This is the website name of www.linkedin.com. Please
# translate this the way that LinkedIn advertises in your language.
"title": _("LinkedIn"),
"icon": "fa-linkedin-square"
},
"google_plus": {
# Translators: This is the website name of plus.google.com. Please
# translate this the way that Google+ advertises in your language.
"title": _("Google+"),
"icon": "fa-google-plus-square"
},
"tumblr": {
# Translators: This is the website name of www.tumblr.com. Please
# translate this the way that Tumblr advertises in your language.
"title": _("Tumblr"),
"icon": "fa-tumblr-square"
},
"meetup": {
# Translators: This is the website name of www.meetup.com. Please
# translate this the way that MeetUp advertises in your language.
"title": _("Meetup"),
"icon": "fa-calendar"
},
"reddit": {
# Translators: This is the website name of www.reddit.com. Please
# translate this the way that Reddit advertises in your language.
"title": _("Reddit"),
"icon": "fa-reddit-square"
},
"youtube": {
# Translators: This is the website name of www.youtube.com. Please
# translate this the way that YouTube advertises in your language.
"title": _("Youtube"),
"icon": "fa-youtube-square"
}
}

################# Mobile URLS ##########################

# These are URLs to the app store for mobile.
Expand Down
40 changes: 11 additions & 29 deletions lms/templates/footer-edx-new.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,36 +74,18 @@ <h2 class="footer-nav-title">${_("About edX")}</h2>
<h2 class="footer-follow-title">${_("Follow Us")}</h2>

<div class="footer-follow-links">
## Translators: This is the website name of www.twitter.com. Please
## translate this the way that Twitter advertises in your language.
<a href="${settings.PLATFORM_TWITTER_URL}" title="${_("Twitter")}" rel="noreferrer">
<i class="icon fa fa-twitter element-invisible"></i>
<span class="copy">${_("Twitter")}</span>
</a>
## Translators: This is the website name of www.facebook.com. Please
## translate this the way that Facebook advertises in your language.
<a href="${settings.PLATFORM_FACEBOOK_ACCOUNT}" title="${_("Facebook")}" rel="noreferrer">
<i class="icon fa fa-facebook element-invisible"></i>
<span class="copy">${_("Facebook")}</span>
</a>
## Translators: This is the website name of www.meetup.com. Please
## translate this the way that Meetup advertises in your language.
<a href="${settings.PLATFORM_MEETUP_URL}" title="${_("Meetup")}" rel="noreferrer">
<i class="icon fa fa-calendar element-invisible"></i>
<span class="copy">${_("Meetup")}</span>
</a>
## Translators: This is the website name of www.linked.com. Please
## translate this the way that LinkedIn advertises in your language.
<a href="${settings.PLATFORM_LINKEDIN_URL}" title="${_("LinkedIn")}" rel="noreferrer">
<i class="icon fa fa-linkedin element-invisible"></i>
<span class="copy">${_("LinkedIn")}</span>
</a>
## Translators: This is the website name of plus.google.com. Please
## translate this the way that Google+ advertises in your language.
<a href="${settings.PLATFORM_GOOGLE_PLUS_URL}" title="${_("Google+")}" rel="noreferrer">
<i class="icon fa fa-google-plus element-invisible"></i>
<span class="copy">${_("Google+")}</span>
% for social_name in settings.SOCIAL_MEDIA_FOOTER_NAMES:
<% social_url, social_title, social_icon = (
settings.SOCIAL_MEDIA_FOOTER_URLS.get(social_name, "#"),
unicode(settings.SOCIAL_MEDIA_FOOTER_DISPLAY.get(social_name, {}).get("title", "")),
settings.SOCIAL_MEDIA_FOOTER_DISPLAY.get(social_name).get("icon", "")
)
%>
<a href="${social_url}" title="${social_title}" rel="noreferrer">
<i class="icon fa ${social_icon} element-invisible"></i>
<span class="copy">${social_title}</span>
</a>
% endfor
</div>

% if settings.FEATURES.get('ENABLE_FOOTER_MOBILE_APP_LINKS'):
Expand Down