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
abfa6d9a
Commit
abfa6d9a
authored
Sep 23, 2015
by
Saleem Latif
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Line breaks in signatory title issue fixed
parent
d8d49f75
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
4 deletions
+33
-4
cms/templates/js/signatory-details.underscore
+1
-1
common/test/acceptance/pages/studio/settings_certificates.py
+6
-0
common/test/acceptance/tests/studio/test_studio_settings_certificates.py
+24
-2
lms/templates/certificates/_accomplishment-rendering.html
+2
-1
No files found.
cms/templates/js/signatory-details.underscore
View file @
abfa6d9a
...
...
@@ -15,7 +15,7 @@
</div>
<div>
<span class="signatory-title-label"><b><%= gettext("Title") %>:</b> </span>
<span class="signatory-title-value"><%= title %></span>
<span class="signatory-title-value"><%= title
.replace(new RegExp('\r?\n','g'), '<br />')
%></span>
</div>
<div>
<span class="signatory-organization-label"><b><%= gettext("Organization") %>:</b> </span>
...
...
common/test/acceptance/pages/studio/settings_certificates.py
View file @
abfa6d9a
...
...
@@ -51,6 +51,12 @@ class CertificatesPage(CoursePage):
return
True
def
get_first_signatory_title
(
self
):
"""
Return signatory title for the first signatory in certificate.
"""
return
self
.
q
(
css
=
'.signatory-title-value'
)
.
first
.
html
[
0
]
################
# Properties
################
...
...
common/test/acceptance/tests/studio/test_studio_settings_certificates.py
View file @
abfa6d9a
"""
Acceptance tests for Studio's Setting pages
"""
from
unittest
import
skip
import
re
from
.base_studio_test
import
StudioCourseTest
from
...pages.studio.settings_certificates
import
CertificatesPage
from
flaky
import
flaky
class
CertificatesTest
(
StudioCourseTest
):
...
...
@@ -196,3 +195,26 @@ class CertificatesTest(StudioCourseTest):
certificate
.
course_title
=
"Title Override"
certificate
.
click_cancel_edit_certificate
()
self
.
assertEqual
(
len
(
self
.
certificates_page
.
certificates
),
0
)
def
test_line_breaks_in_signatory_title
(
self
):
"""
Scenario: Ensure that line breaks are properly reflected in certificate
Given I have a certificate with signatories
When I add signatory title with new line character
Then I see line break in certificate title
"""
self
.
certificates_page
.
visit
()
certificate
=
self
.
create_and_verify_certificate
(
"Course Title Override"
,
0
,
[
self
.
make_signatory_data
(
'Signatory title with new line character
\n
'
)]
)
certificate
.
wait_for_certificate_delete_button
()
# Make sure certificate is created
self
.
assertEqual
(
len
(
self
.
certificates_page
.
certificates
),
1
)
signatory_title
=
self
.
certificates_page
.
get_first_signatory_title
()
self
.
assertNotEqual
([],
re
.
findall
(
r'<br\s*/?>'
,
signatory_title
))
lms/templates/certificates/_accomplishment-rendering.html
View file @
abfa6d9a
<
%!
from
django
.
utils
.
translation
import
ugettext
as
_
%
>
<
%!
from
django
.
template
.
defaultfilters
import
linebreaks
%
>
<
%
namespace
name=
'static'
file=
'../static_content.html'
/>
<
%
course_mode_class =
course_mode
if
course_mode
else
''
...
...
@@ -50,7 +51,7 @@ course_mode_class = course_mode if course_mode else ''
<h4
class=
"signatory-name hd-5"
>
${signatory['name']}
</h4>
<p
class=
"signatory-credentials copy copy-micro"
>
<span
class=
"role"
>
${signatory['title']}
</span>
<span
class=
"role"
>
${signatory['title']
|linebreaks
}
</span>
<span
class=
"organization"
>
${signatory['organization']}
</span>
</p>
</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