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
c1162864
Commit
c1162864
authored
Aug 31, 2015
by
asadiqbal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SOL-1158
parent
035bf4fb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
15 deletions
+27
-15
lms/djangoapps/certificates/tests/test_views.py
+3
-2
lms/djangoapps/certificates/views/webview.py
+23
-12
requirements/edx/github.txt
+1
-1
No files found.
lms/djangoapps/certificates/tests/test_views.py
View file @
c1162864
...
@@ -479,7 +479,8 @@ class CertificatesViewsTests(ModuleStoreTestCase, EventTrackingTestCase):
...
@@ -479,7 +479,8 @@ class CertificatesViewsTests(ModuleStoreTestCase, EventTrackingTestCase):
Test: organization data should render on certificate web view if course has organization.
Test: organization data should render on certificate web view if course has organization.
"""
"""
test_organization_data
=
{
test_organization_data
=
{
'name'
:
'test_organization'
,
'name'
:
'test organization'
,
'short_name'
:
'test_organization'
,
'description'
:
'Test Organization Description'
,
'description'
:
'Test Organization Description'
,
'active'
:
True
,
'active'
:
True
,
'logo'
:
'/logo_test1.png/'
'logo'
:
'/logo_test1.png/'
...
@@ -493,7 +494,7 @@ class CertificatesViewsTests(ModuleStoreTestCase, EventTrackingTestCase):
...
@@ -493,7 +494,7 @@ class CertificatesViewsTests(ModuleStoreTestCase, EventTrackingTestCase):
)
)
response
=
self
.
client
.
get
(
test_url
)
response
=
self
.
client
.
get
(
test_url
)
self
.
assertIn
(
self
.
assertIn
(
'a course of study offered by test_organization'
,
'a course of study offered by test_organization
, an online learning initiative of test organization
'
,
response
.
content
response
.
content
)
)
self
.
assertNotIn
(
self
.
assertNotIn
(
...
...
lms/djangoapps/certificates/views/webview.py
View file @
c1162864
...
@@ -87,12 +87,14 @@ def _update_certificate_context(context, course, user, user_certificate):
...
@@ -87,12 +87,14 @@ def _update_certificate_context(context, course, user, user_certificate):
user_fullname
=
user
.
profile
.
name
user_fullname
=
user
.
profile
.
name
platform_name
=
microsite
.
get_value
(
"platform_name"
,
settings
.
PLATFORM_NAME
)
platform_name
=
microsite
.
get_value
(
"platform_name"
,
settings
.
PLATFORM_NAME
)
certificate_type
=
context
.
get
(
'certificate_type'
)
certificate_type
=
context
.
get
(
'certificate_type'
)
partner_name
=
course
.
org
partner_short_name
=
course
.
org
partner_long_name
=
None
organizations
=
organization_api
.
get_course_organizations
(
course_id
=
course
.
id
)
organizations
=
organization_api
.
get_course_organizations
(
course_id
=
course
.
id
)
if
organizations
:
if
organizations
:
#TODO Need to add support for multiple organizations, Currently we are interested in the first one.
#TODO Need to add support for multiple organizations, Currently we are interested in the first one.
organization
=
organizations
[
0
]
organization
=
organizations
[
0
]
partner_name
=
organization
.
get
(
'name'
,
course
.
org
)
partner_long_name
=
organization
.
get
(
'name'
,
None
)
partner_short_name
=
organization
.
get
(
'short_name'
,
course
.
org
)
context
[
'organization_logo'
]
=
organization
.
get
(
'logo'
,
None
)
context
[
'organization_logo'
]
=
organization
.
get
(
'logo'
,
None
)
context
[
'username'
]
=
user
.
username
context
[
'username'
]
=
user
.
username
...
@@ -100,7 +102,7 @@ def _update_certificate_context(context, course, user, user_certificate):
...
@@ -100,7 +102,7 @@ def _update_certificate_context(context, course, user, user_certificate):
context
[
'accomplishment_user_id'
]
=
user
.
id
context
[
'accomplishment_user_id'
]
=
user
.
id
context
[
'accomplishment_copy_name'
]
=
user_fullname
context
[
'accomplishment_copy_name'
]
=
user_fullname
context
[
'accomplishment_copy_username'
]
=
user
.
username
context
[
'accomplishment_copy_username'
]
=
user
.
username
context
[
'accomplishment_copy_course_org'
]
=
partner_name
context
[
'accomplishment_copy_course_org'
]
=
partner_
short_
name
context
[
'accomplishment_copy_course_name'
]
=
course
.
display_name
context
[
'accomplishment_copy_course_name'
]
=
course
.
display_name
context
[
'course_image_url'
]
=
course_image_url
(
course
)
context
[
'course_image_url'
]
=
course_image_url
(
course
)
context
[
'share_settings'
]
=
settings
.
FEATURES
.
get
(
'SOCIAL_SHARING_SETTINGS'
,
{})
context
[
'share_settings'
]
=
settings
.
FEATURES
.
get
(
'SOCIAL_SHARING_SETTINGS'
,
{})
...
@@ -126,11 +128,20 @@ def _update_certificate_context(context, course, user, user_certificate):
...
@@ -126,11 +128,20 @@ def _update_certificate_context(context, course, user, user_certificate):
year
=
user_certificate
.
modified_date
.
year
year
=
user_certificate
.
modified_date
.
year
)
)
context
[
'accomplishment_copy_course_description'
]
=
_
(
'a course of study offered by {partner_name}, '
if
partner_long_name
:
'through {platform_name}.'
)
.
format
(
context
[
'accomplishment_copy_course_description'
]
=
_
(
'a course of study offered by {partner_short_name}, an '
partner_name
=
partner_name
,
'online learning initiative of {partner_long_name} '
platform_name
=
platform_name
'through {platform_name}.'
)
.
format
(
)
partner_short_name
=
partner_short_name
,
partner_long_name
=
partner_long_name
,
platform_name
=
platform_name
)
else
:
context
[
'accomplishment_copy_course_description'
]
=
_
(
'a course of study offered by {partner_short_name}, '
'through {platform_name}.'
)
.
format
(
partner_short_name
=
partner_short_name
,
platform_name
=
platform_name
)
# Translators: Accomplishments describe the awards/certifications obtained by students on this platform
# Translators: Accomplishments describe the awards/certifications obtained by students on this platform
context
[
'accomplishment_copy_about'
]
=
_
(
'About {platform_name} Accomplishments'
)
.
format
(
context
[
'accomplishment_copy_about'
]
=
_
(
'About {platform_name} Accomplishments'
)
.
format
(
...
@@ -201,16 +212,16 @@ def _update_certificate_context(context, course, user, user_certificate):
...
@@ -201,16 +212,16 @@ def _update_certificate_context(context, course, user, user_certificate):
# Translators: This text represents the verification of the certificate
# Translators: This text represents the verification of the certificate
context
[
'document_meta_description'
]
=
_
(
'This is a valid {platform_name} certificate for {user_name}, '
context
[
'document_meta_description'
]
=
_
(
'This is a valid {platform_name} certificate for {user_name}, '
'who participated in {partner_name} {course_number}'
)
.
format
(
'who participated in {partner_
short_
name} {course_number}'
)
.
format
(
platform_name
=
platform_name
,
platform_name
=
platform_name
,
user_name
=
user_fullname
,
user_name
=
user_fullname
,
partner_
name
=
partner
_name
,
partner_
short_name
=
partner_short
_name
,
course_number
=
course
.
number
course_number
=
course
.
number
)
)
# Translators: This text is bound to the HTML 'title' element of the page and appears in the browser title bar
# Translators: This text is bound to the HTML 'title' element of the page and appears in the browser title bar
context
[
'document_title'
]
=
_
(
"{partner_name} {course_number} Certificate | {platform_name}"
)
.
format
(
context
[
'document_title'
]
=
_
(
"{partner_
short_
name} {course_number} Certificate | {platform_name}"
)
.
format
(
partner_
name
=
partner
_name
,
partner_
short_name
=
partner_short
_name
,
course_number
=
course
.
number
,
course_number
=
course
.
number
,
platform_name
=
platform_name
platform_name
=
platform_name
)
)
...
...
requirements/edx/github.txt
View file @
c1162864
...
@@ -55,7 +55,7 @@ git+https://github.com/edx/edx-lint.git@b109a40c61277c52dcb396bf15e33755f5dbf5fa
...
@@ -55,7 +55,7 @@ git+https://github.com/edx/edx-lint.git@b109a40c61277c52dcb396bf15e33755f5dbf5fa
-e git+https://github.com/edx/edx-reverification-block.git@30fcf2fea305ed6649adcee9c831afaefba635c5#egg=edx-reverification-block
-e git+https://github.com/edx/edx-reverification-block.git@30fcf2fea305ed6649adcee9c831afaefba635c5#egg=edx-reverification-block
git+https://github.com/edx/ecommerce-api-client.git@1.1.0#egg=ecommerce-api-client==1.1.0
git+https://github.com/edx/ecommerce-api-client.git@1.1.0#egg=ecommerce-api-client==1.1.0
-e git+https://github.com/edx/edx-user-state-client.git@30c0ad4b9f57f8d48d6943eb585ec8a9205f4469#egg=edx-user-state-client
-e git+https://github.com/edx/edx-user-state-client.git@30c0ad4b9f57f8d48d6943eb585ec8a9205f4469#egg=edx-user-state-client
-e git+https://github.com/edx/edx-organizations.git@release-2015-08-
25
#egg=edx-organizations
-e git+https://github.com/edx/edx-organizations.git@release-2015-08-
31
#egg=edx-organizations
git+https://github.com/edx/edx-proctoring.git@0.7.2#egg=edx-proctoring==0.7.2
git+https://github.com/edx/edx-proctoring.git@0.7.2#egg=edx-proctoring==0.7.2
...
...
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