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
3967d809
Commit
3967d809
authored
Dec 22, 2015
by
Saleem Latif
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move get_logo_url from branding/__init__.py to branding/api.py for consistency.
parent
475429c0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
31 deletions
+31
-31
lms/djangoapps/branding/__init__.py
+0
-25
lms/djangoapps/branding/api.py
+25
-0
lms/djangoapps/certificates/api.py
+2
-2
lms/templates/navigation-edx.html
+2
-2
lms/templates/navigation.html
+2
-2
No files found.
lms/djangoapps/branding/__init__.py
View file @
3967d809
...
...
@@ -64,28 +64,3 @@ def get_university_for_request():
if no university was specified
"""
return
microsite
.
get_value
(
'university'
)
def
get_logo_url
():
"""
Return the url for the branded logo image to be used
"""
# if the MicrositeConfiguration has a value for the logo_image_url
# let's use that
image_url
=
microsite
.
get_value
(
'logo_image_url'
)
if
image_url
:
return
'{static_url}{image_url}'
.
format
(
static_url
=
settings
.
STATIC_URL
,
image_url
=
image_url
)
# otherwise, use the legacy means to configure this
university
=
microsite
.
get_value
(
'university'
)
if
university
is
None
and
settings
.
FEATURES
.
get
(
'IS_EDX_DOMAIN'
,
False
):
return
staticfiles_storage
.
url
(
'images/edx-theme/edx-logo-77x36.png'
)
elif
university
:
return
staticfiles_storage
.
url
(
'images/{uni}-on-edx-logo.png'
.
format
(
uni
=
university
))
else
:
return
staticfiles_storage
.
url
(
'images/logo.png'
)
lms/djangoapps/branding/api.py
View file @
3967d809
...
...
@@ -372,6 +372,31 @@ def get_base_url(is_secure):
return
_absolute_url
(
is_secure
=
is_secure
,
url_path
=
""
)
def
get_logo_url
():
"""
Return the url for the branded logo image to be used
"""
# if the MicrositeConfiguration has a value for the logo_image_url
# let's use that
image_url
=
microsite
.
get_value
(
'logo_image_url'
)
if
image_url
:
return
'{static_url}{image_url}'
.
format
(
static_url
=
settings
.
STATIC_URL
,
image_url
=
image_url
)
# otherwise, use the legacy means to configure this
university
=
microsite
.
get_value
(
'university'
)
if
university
is
None
and
settings
.
FEATURES
.
get
(
'IS_EDX_DOMAIN'
,
False
):
return
staticfiles_storage
.
url
(
'images/edx-theme/edx-logo-77x36.png'
)
elif
university
:
return
staticfiles_storage
.
url
(
'images/{uni}-on-edx-logo.png'
.
format
(
uni
=
university
))
else
:
return
staticfiles_storage
.
url
(
'images/logo.png'
)
def
get_tos_and_honor_code_url
():
"""
Lookup and return terms of services page url
...
...
lms/djangoapps/certificates/api.py
View file @
3967d809
...
...
@@ -29,7 +29,7 @@ from certificates.models import (
CertificateTemplateAsset
,
)
from
certificates.queue
import
XQueueCertInterface
from
branding
import
api
as
branding_api
,
get_logo_url
from
branding
import
api
as
branding_api
log
=
logging
.
getLogger
(
"edx.certificate"
)
...
...
@@ -499,7 +499,7 @@ def get_certificate_header_context(is_secure=True):
data returned should be customized according to the microsite settings
"""
data
=
dict
(
logo_src
=
get_logo_url
(),
logo_src
=
branding_api
.
get_logo_url
(),
logo_url
=
branding_api
.
get_base_url
(
is_secure
),
)
...
...
lms/templates/navigation-edx.html
View file @
3967d809
...
...
@@ -9,7 +9,7 @@ from microsite_configuration import microsite
from
microsite_configuration
.
templatetags
.
microsite
import
platform_name
#
App
that
handles
subdomain
specific
branding
import
branding
from
branding
import
api
as
branding_api
#
app
that
handles
site
status
messages
from
status
.
status
import
get_site_status_msg
%
>
...
...
@@ -41,7 +41,7 @@ site_status_msg = get_site_status_msg(course_id)
<h1
class=
"logo"
itemscope=
""
itemtype=
"http://schema.org/Organization"
>
<a
href=
"${marketing_link('ROOT')}"
itemprop=
"url"
>
<
%
block
name=
"navigation_logo"
>
<img
src=
"${static.url(branding.get_logo_url())}"
alt=
"${_("
{
platform_name
}
Home
Page
").
format
(
platform_name=
platform_name())}"
itemprop=
"logo"
/>
<img
src=
"${static.url(branding
_api
.get_logo_url())}"
alt=
"${_("
{
platform_name
}
Home
Page
").
format
(
platform_name=
platform_name())}"
itemprop=
"logo"
/>
</
%
block>
</a>
</h1>
...
...
lms/templates/navigation.html
View file @
3967d809
...
...
@@ -10,7 +10,7 @@ from microsite_configuration.templatetags.microsite import platform_name
from
lms
.
djangoapps
.
ccx
.
overrides
import
get_current_ccx
#
App
that
handles
subdomain
specific
branding
import
branding
from
branding
import
api
as
branding_api
#
app
that
handles
site
status
messages
from
status
.
status
import
get_site_status_msg
%
>
...
...
@@ -42,7 +42,7 @@ site_status_msg = get_site_status_msg(course_id)
<h1
class=
"logo"
>
<a
href=
"${marketing_link('ROOT')}"
>
<
%
block
name=
"navigation_logo"
>
<img
src=
"${static.url(branding.get_logo_url())}"
alt=
"${_("
{
platform_name
}
Home
Page
").
format
(
platform_name=
platform_name())}"/
>
<img
src=
"${static.url(branding
_api
.get_logo_url())}"
alt=
"${_("
{
platform_name
}
Home
Page
").
format
(
platform_name=
platform_name())}"/
>
</
%
block>
</a>
</h1>
...
...
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