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
fa5da136
Commit
fa5da136
authored
Oct 20, 2017
by
Waheed Ahmed
Committed by
GitHub
Oct 20, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16258 from edx/waheed/LEARNER-2881-fix-edx-logo-link
Fix edX logo links to home page instead of dashboard.
parents
41862cf1
c56f7287
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
3 deletions
+31
-3
lms/djangoapps/branding/api.py
+14
-0
lms/djangoapps/branding/tests/test_api.py
+15
-1
lms/templates/header/brand.html
+1
-1
lms/templates/navigation/navbar-logo-header.html
+1
-1
No files found.
lms/djangoapps/branding/api.py
View file @
fa5da136
...
@@ -17,6 +17,7 @@ import urlparse
...
@@ -17,6 +17,7 @@ import urlparse
from
django.conf
import
settings
from
django.conf
import
settings
from
django.contrib.staticfiles.storage
import
staticfiles_storage
from
django.contrib.staticfiles.storage
import
staticfiles_storage
from
django.core.urlresolvers
import
reverse
from
django.utils.translation
import
ugettext
as
_
from
django.utils.translation
import
ugettext
as
_
from
branding.models
import
BrandingApiConfig
from
branding.models
import
BrandingApiConfig
...
@@ -418,3 +419,16 @@ def get_about_url():
...
@@ -418,3 +419,16 @@ def get_about_url():
Lookup and return About page url
Lookup and return About page url
"""
"""
return
get_url
(
"ABOUT"
)
return
get_url
(
"ABOUT"
)
def
get_home_url
():
"""
Lookup and return home page url, lookup is performed in the following order
1. return marketing root URL, If marketing is enabled
2. Otherwise return dashboard URL.
"""
if
settings
.
FEATURES
.
get
(
'ENABLE_MKTG_SITE'
,
False
):
return
marketing_link
(
'ROOT'
)
return
reverse
(
'dashboard'
)
lms/djangoapps/branding/tests/test_api.py
View file @
fa5da136
...
@@ -3,10 +3,12 @@
...
@@ -3,10 +3,12 @@
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
import
mock
import
mock
from
django.core.urlresolvers
import
reverse
from
django.test
import
TestCase
from
django.test
import
TestCase
from
django.test.utils
import
override_settings
from
django.test.utils
import
override_settings
from
branding.api
import
get_footer
,
get_logo_url
from
branding.api
import
get_footer
,
get_home_url
,
get_logo_url
from
edxmako.shortcuts
import
marketing_link
class
TestHeader
(
TestCase
):
class
TestHeader
(
TestCase
):
...
@@ -24,6 +26,18 @@ class TestHeader(TestCase):
...
@@ -24,6 +26,18 @@ class TestHeader(TestCase):
self
.
assertEqual
(
logo_url
,
cdn_url
)
self
.
assertEqual
(
logo_url
,
cdn_url
)
def
test_home_url_with_mktg_disabled
(
self
):
expected_url
=
get_home_url
()
self
.
assertEqual
(
reverse
(
'dashboard'
),
expected_url
)
@mock.patch.dict
(
'django.conf.settings.FEATURES'
,
{
'ENABLE_MKTG_SITE'
:
True
})
@mock.patch.dict
(
'django.conf.settings.MKTG_URLS'
,
{
"ROOT"
:
"https://edx.org"
,
})
def
test_home_url_with_mktg_enabled
(
self
):
expected_url
=
get_home_url
()
self
.
assertEqual
(
marketing_link
(
'ROOT'
),
expected_url
)
class
TestFooter
(
TestCase
):
class
TestFooter
(
TestCase
):
"""Test retrieving the footer. """
"""Test retrieving the footer. """
...
...
lms/templates/header/brand.html
View file @
fa5da136
...
@@ -14,7 +14,7 @@ from branding import api as branding_api
...
@@ -14,7 +14,7 @@ from branding import api as branding_api
<h1
class=
"hd logo-header navbar-brand"
>
<h1
class=
"hd logo-header navbar-brand"
>
<div
class=
"logo"
>
<div
class=
"logo"
>
<a
class=
"navbar-brand"
href=
"${
reverse('dashboard'
)}"
itemprop=
"url"
>
<a
class=
"navbar-brand"
href=
"${
branding_api.get_home_url(
)}"
itemprop=
"url"
>
<img
class=
"logo-image"
src=
"${static.url("
images
/
logo
.
png
")}"
alt=
"${_("
{
platform_name
}
Home
Page
").
format
(
platform_name=
static.get_platform_name())}"
itemprop=
"logo"
/>
<img
class=
"logo-image"
src=
"${static.url("
images
/
logo
.
png
")}"
alt=
"${_("
{
platform_name
}
Home
Page
").
format
(
platform_name=
static.get_platform_name())}"
itemprop=
"logo"
/>
</a>
</a>
</div>
</div>
...
...
lms/templates/navigation/navbar-logo-header.html
View file @
fa5da136
...
@@ -14,7 +14,7 @@ from branding import api as branding_api
...
@@ -14,7 +14,7 @@ from branding import api as branding_api
<h1
class=
"hd logo-header"
>
<h1
class=
"hd logo-header"
>
<div
class=
"logo"
>
<div
class=
"logo"
>
<a
href=
"${
reverse('dashboard'
)}"
>
<a
href=
"${
branding_api.get_home_url(
)}"
>
<
%
block
name=
"navigation_logo"
>
<
%
block
name=
"navigation_logo"
>
<img
src=
"${branding_api.get_logo_url(is_secure)}"
alt=
"${_("
{
platform_name
}
Home
Page
").
format
(
platform_name=
static.get_platform_name())}"/
>
<img
src=
"${branding_api.get_logo_url(is_secure)}"
alt=
"${_("
{
platform_name
}
Home
Page
").
format
(
platform_name=
static.get_platform_name())}"/
>
</
%
block>
</
%
block>
...
...
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