Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
7a3c1f04
Commit
7a3c1f04
authored
Jun 12, 2015
by
Will Daly
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8502 from edx/alasdair/ECOM-1724-footer-a11y-update
ECOM-1724 a11y footer updates
parents
c1ace044
2fd68dc9
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
15 deletions
+35
-15
lms/djangoapps/branding/api.py
+19
-8
lms/djangoapps/branding/tests/test_views.py
+1
-0
lms/djangoapps/branding/views.py
+2
-1
lms/envs/common.py
+12
-6
lms/templates/footer-edx-v3.html
+1
-0
No files found.
lms/djangoapps/branding/api.py
View file @
7a3c1f04
...
@@ -55,7 +55,8 @@ def get_footer(is_secure=True):
...
@@ -55,7 +55,8 @@ def get_footer(is_secure=True):
"name": "facebook",
"name": "facebook",
"title": "Facebook",
"title": "Facebook",
"url": "http://www.facebook.com/example",
"url": "http://www.facebook.com/example",
"icon-class": "fa-facebook-square"
"icon-class": "fa-facebook-square",
"action": "Sign up on Facebook!"
},
},
...
...
],
],
...
@@ -71,7 +72,7 @@ def get_footer(is_secure=True):
...
@@ -71,7 +72,7 @@ def get_footer(is_secure=True):
{
{
"name": "apple",
"name": "apple",
"title": "Apple",
"title": "Apple",
"url": "http://store.apple.com/example_app"
"url": "http://store.apple.com/example_app"
,
"image": "http://example.com/static/apple_logo.png"
"image": "http://example.com/static/apple_logo.png"
},
},
...
...
...
@@ -148,14 +149,18 @@ def _footer_social_links():
...
@@ -148,14 +149,18 @@ def _footer_social_links():
Returns: list
Returns: list
"""
"""
platform_name
=
microsite
.
get_value
(
'platform_name'
,
settings
.
PLATFORM_NAME
)
links
=
[]
links
=
[]
for
social_name
in
settings
.
SOCIAL_MEDIA_FOOTER_NAMES
:
for
social_name
in
settings
.
SOCIAL_MEDIA_FOOTER_NAMES
:
display
=
settings
.
SOCIAL_MEDIA_FOOTER_DISPLAY
.
get
(
social_name
,
{})
links
.
append
(
links
.
append
(
{
{
"name"
:
social_name
,
"name"
:
social_name
,
"title"
:
unicode
(
settings
.
SOCIAL_MEDIA_FOOTER_DISPLAY
.
get
(
social_name
,
{})
.
get
(
"title"
,
""
)),
"title"
:
unicode
(
display
.
get
(
"title"
,
""
)),
"url"
:
settings
.
SOCIAL_MEDIA_FOOTER_URLS
.
get
(
social_name
,
"#"
),
"url"
:
settings
.
SOCIAL_MEDIA_FOOTER_URLS
.
get
(
social_name
,
"#"
),
"icon-class"
:
settings
.
SOCIAL_MEDIA_FOOTER_DISPLAY
.
get
(
social_name
,
{})
.
get
(
"icon"
,
""
),
"icon-class"
:
display
.
get
(
"icon"
,
""
),
"action"
:
unicode
(
display
.
get
(
"action"
,
""
))
.
format
(
platform_name
=
platform_name
),
}
}
)
)
return
links
return
links
...
@@ -221,20 +226,26 @@ def _footer_mobile_links(is_secure):
...
@@ -221,20 +226,26 @@ def _footer_mobile_links(is_secure):
Returns: list
Returns: list
"""
"""
platform_name
=
microsite
.
get_value
(
'platform_name'
,
settings
.
PLATFORM_NAME
)
mobile_links
=
[]
mobile_links
=
[]
if
settings
.
FEATURES
.
get
(
'ENABLE_FOOTER_MOBILE_APP_LINKS'
):
if
settings
.
FEATURES
.
get
(
'ENABLE_FOOTER_MOBILE_APP_LINKS'
):
mobile_links
=
[
mobile_links
=
[
{
{
"name"
:
"apple"
,
"name"
:
"apple"
,
"title"
:
"Apple"
,
"title"
:
_
(
"Download the {platform_name} mobile app from the Apple App Store"
)
.
format
(
platform_name
=
platform_name
),
"url"
:
settings
.
MOBILE_STORE_URLS
.
get
(
'apple'
,
'#'
),
"url"
:
settings
.
MOBILE_STORE_URLS
.
get
(
'apple'
,
'#'
),
"image"
:
_absolute_url_staticfile
(
is_secure
,
'images/app/app_store_badge_135x40.svg'
)
"image"
:
_absolute_url_staticfile
(
is_secure
,
'images/app/app_store_badge_135x40.svg'
)
,
},
},
{
{
"name"
:
"google"
,
"name"
:
"google"
,
"title"
:
"Google"
,
"title"
:
_
(
"Download the {platform_name} mobile app from Google Play"
)
.
format
(
platform_name
=
platform_name
),
"url"
:
settings
.
MOBILE_STORE_URLS
.
get
(
'google'
,
'#'
),
"url"
:
settings
.
MOBILE_STORE_URLS
.
get
(
'google'
,
'#'
),
"image"
:
_absolute_url_staticfile
(
is_secure
,
'images/app/google_play_badge_45.png'
)
"image"
:
_absolute_url_staticfile
(
is_secure
,
'images/app/google_play_badge_45.png'
)
,
}
}
]
]
return
mobile_links
return
mobile_links
...
...
lms/djangoapps/branding/tests/test_views.py
View file @
7a3c1f04
...
@@ -77,6 +77,7 @@ class TestFooter(TestCase):
...
@@ -77,6 +77,7 @@ class TestFooter(TestCase):
self
.
assertIn
(
"title"
,
link
)
self
.
assertIn
(
"title"
,
link
)
self
.
assertIn
(
"url"
,
link
)
self
.
assertIn
(
"url"
,
link
)
self
.
assertIn
(
"icon-class"
,
link
)
self
.
assertIn
(
"icon-class"
,
link
)
self
.
assertIn
(
"action"
,
link
)
# Mobile links
# Mobile links
self
.
assertIn
(
"mobile_links"
,
json_data
)
self
.
assertIn
(
"mobile_links"
,
json_data
)
...
...
lms/djangoapps/branding/views.py
View file @
7a3c1f04
...
@@ -206,7 +206,8 @@ def footer(request):
...
@@ -206,7 +206,8 @@ def footer(request):
"url": "http://example.com/social",
"url": "http://example.com/social",
"name": "facebook",
"name": "facebook",
"icon-class": "fa-facebook-square",
"icon-class": "fa-facebook-square",
"title": "Facebook"
"title": "Facebook",
"action": "Sign up on Facebook!"
},
},
# ...
# ...
],
],
...
...
lms/envs/common.py
View file @
7a3c1f04
...
@@ -1914,25 +1914,29 @@ SOCIAL_MEDIA_FOOTER_DISPLAY = {
...
@@ -1914,25 +1914,29 @@ SOCIAL_MEDIA_FOOTER_DISPLAY = {
# Translators: This is the website name of www.facebook.com. Please
# Translators: This is the website name of www.facebook.com. Please
# translate this the way that Facebook advertises in your language.
# translate this the way that Facebook advertises in your language.
"title"
:
_
(
"Facebook"
),
"title"
:
_
(
"Facebook"
),
"icon"
:
"fa-facebook-square"
"icon"
:
"fa-facebook-square"
,
"action"
:
_
(
"Like {platform_name} on Facebook"
)
},
},
"twitter"
:
{
"twitter"
:
{
# Translators: This is the website name of www.twitter.com. Please
# Translators: This is the website name of www.twitter.com. Please
# translate this the way that Twitter advertises in your language.
# translate this the way that Twitter advertises in your language.
"title"
:
_
(
"Twitter"
),
"title"
:
_
(
"Twitter"
),
"icon"
:
"fa-twitter"
"icon"
:
"fa-twitter"
,
"action"
:
_
(
"Follow {platform_name} on Twitter"
)
},
},
"linkedin"
:
{
"linkedin"
:
{
# Translators: This is the website name of www.linkedin.com. Please
# Translators: This is the website name of www.linkedin.com. Please
# translate this the way that LinkedIn advertises in your language.
# translate this the way that LinkedIn advertises in your language.
"title"
:
_
(
"LinkedIn"
),
"title"
:
_
(
"LinkedIn"
),
"icon"
:
"fa-linkedin-square"
"icon"
:
"fa-linkedin-square"
,
"action"
:
_
(
"Follow {platform_name} on LinkedIn"
)
},
},
"google_plus"
:
{
"google_plus"
:
{
# Translators: This is the website name of plus.google.com. Please
# Translators: This is the website name of plus.google.com. Please
# translate this the way that Google+ advertises in your language.
# translate this the way that Google+ advertises in your language.
"title"
:
_
(
"Google+"
),
"title"
:
_
(
"Google+"
),
"icon"
:
"fa-google-plus-square"
"icon"
:
"fa-google-plus-square"
,
"action"
:
_
(
"Follow {platform_name} on Google+"
)
},
},
"tumblr"
:
{
"tumblr"
:
{
# Translators: This is the website name of www.tumblr.com. Please
# Translators: This is the website name of www.tumblr.com. Please
...
@@ -1950,7 +1954,8 @@ SOCIAL_MEDIA_FOOTER_DISPLAY = {
...
@@ -1950,7 +1954,8 @@ SOCIAL_MEDIA_FOOTER_DISPLAY = {
# Translators: This is the website name of www.reddit.com. Please
# Translators: This is the website name of www.reddit.com. Please
# translate this the way that Reddit advertises in your language.
# translate this the way that Reddit advertises in your language.
"title"
:
_
(
"Reddit"
),
"title"
:
_
(
"Reddit"
),
"icon"
:
"fa-reddit"
"icon"
:
"fa-reddit"
,
"action"
:
_
(
"Subscribe to the {platform_name} subreddit"
),
},
},
"vk"
:
{
"vk"
:
{
# Translators: This is the website name of https://vk.com. Please
# Translators: This is the website name of https://vk.com. Please
...
@@ -1968,7 +1973,8 @@ SOCIAL_MEDIA_FOOTER_DISPLAY = {
...
@@ -1968,7 +1973,8 @@ SOCIAL_MEDIA_FOOTER_DISPLAY = {
# Translators: This is the website name of www.youtube.com. Please
# Translators: This is the website name of www.youtube.com. Please
# translate this the way that YouTube advertises in your language.
# translate this the way that YouTube advertises in your language.
"title"
:
_
(
"Youtube"
),
"title"
:
_
(
"Youtube"
),
"icon"
:
"fa-youtube"
"icon"
:
"fa-youtube"
,
"action"
:
_
(
"Subscribe to the {platform_name} YouTube channel"
)
}
}
}
}
...
...
lms/templates/footer-edx-v3.html
View file @
7a3c1f04
...
@@ -51,6 +51,7 @@
...
@@ -51,6 +51,7 @@
% for link in footer['social_links']:
% for link in footer['social_links']:
<a
href=
"${link['url']}"
class=
"sm-link external"
title=
"${link['title']}"
rel=
"noreferrer"
>
<a
href=
"${link['url']}"
class=
"sm-link external"
title=
"${link['title']}"
rel=
"noreferrer"
>
<span
class=
"icon fa ${link['icon-class']}"
aria-hidden=
"true"
></span>
<span
class=
"icon fa ${link['icon-class']}"
aria-hidden=
"true"
></span>
<span
class=
"sr"
>
${link['action']}
</span>
</a>
</a>
% endfor
% endfor
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment