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
af3d2713
Commit
af3d2713
authored
Oct 14, 2014
by
Waqas Khalid
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5540 from mlkwaqas/waqas/tnl188-endorsement-username-link-broken
Endorsement username shouldn't be broken
parents
7e52ba87
f023b62b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletions
+5
-1
common/static/coffee/spec/discussion/view/thread_response_show_view_spec.coffee
+4
-0
common/static/coffee/src/discussion/views/discussion_content_view.coffee
+1
-1
No files found.
common/static/coffee/spec/discussion/view/thread_response_show_view_spec.coffee
View file @
af3d2713
...
@@ -45,6 +45,7 @@ describe "ThreadResponseShowView", ->
...
@@ -45,6 +45,7 @@ describe "ThreadResponseShowView", ->
it
"renders endorsement correctly for a marked answer in a question thread"
,
->
it
"renders endorsement correctly for a marked answer in a question thread"
,
->
endorsement
=
{
endorsement
=
{
"username"
:
"test_endorser"
,
"username"
:
"test_endorser"
,
"user_id"
:
"test_id"
,
"time"
:
new
Date
().
toISOString
()
"time"
:
new
Date
().
toISOString
()
}
}
@
thread
.
set
(
"thread_type"
,
"question"
)
@
thread
.
set
(
"thread_type"
,
"question"
)
...
@@ -56,6 +57,7 @@ describe "ThreadResponseShowView", ->
...
@@ -56,6 +57,7 @@ describe "ThreadResponseShowView", ->
expect
(
@
view
.
$
(
".posted-details"
).
text
().
replace
(
/\s+/g
,
" "
)).
toMatch
(
expect
(
@
view
.
$
(
".posted-details"
).
text
().
replace
(
/\s+/g
,
" "
)).
toMatch
(
"marked as answer less than a minute ago by "
+
endorsement
.
username
"marked as answer less than a minute ago by "
+
endorsement
.
username
)
)
expect
(
@
view
.
$
(
".posted-details > a"
).
attr
(
'href'
)).
toEqual
(
"/courses/edX/999/test/discussion/forum/users/test_id"
)
it
"renders anonymous endorsement correctly for a marked answer in a question thread"
,
->
it
"renders anonymous endorsement correctly for a marked answer in a question thread"
,
->
endorsement
=
{
endorsement
=
{
...
@@ -74,6 +76,7 @@ describe "ThreadResponseShowView", ->
...
@@ -74,6 +76,7 @@ describe "ThreadResponseShowView", ->
it
"renders endorsement correctly for an endorsed response in a discussion thread"
,
->
it
"renders endorsement correctly for an endorsed response in a discussion thread"
,
->
endorsement
=
{
endorsement
=
{
"username"
:
"test_endorser"
,
"username"
:
"test_endorser"
,
"user_id"
:
"test_id"
,
"time"
:
new
Date
().
toISOString
()
"time"
:
new
Date
().
toISOString
()
}
}
@
thread
.
set
(
"thread_type"
,
"discussion"
)
@
thread
.
set
(
"thread_type"
,
"discussion"
)
...
@@ -85,6 +88,7 @@ describe "ThreadResponseShowView", ->
...
@@ -85,6 +88,7 @@ describe "ThreadResponseShowView", ->
expect
(
@
view
.
$
(
".posted-details"
).
text
().
replace
(
/\s+/g
,
" "
)).
toMatch
(
expect
(
@
view
.
$
(
".posted-details"
).
text
().
replace
(
/\s+/g
,
" "
)).
toMatch
(
"endorsed less than a minute ago by "
+
endorsement
.
username
"endorsed less than a minute ago by "
+
endorsement
.
username
)
)
expect
(
@
view
.
$
(
".posted-details > a"
).
attr
(
'href'
)).
toEqual
(
"/courses/edX/999/test/discussion/forum/users/test_id"
)
it
"renders anonymous endorsement correctly for an endorsed response in a discussion thread"
,
->
it
"renders anonymous endorsement correctly for an endorsed response in a discussion thread"
,
->
endorsement
=
{
endorsement
=
{
...
...
common/static/coffee/src/discussion/views/discussion_content_view.coffee
View file @
af3d2713
...
@@ -194,7 +194,7 @@ if Backbone?
...
@@ -194,7 +194,7 @@ if Backbone?
url
=
@
model
.
urlFor
(
"endorse"
)
url
=
@
model
.
urlFor
(
"endorse"
)
updates
=
updates
=
endorsed
:
is_endorsing
endorsed
:
is_endorsing
endorsement
:
if
is_endorsing
then
{
username
:
DiscussionUtil
.
getUser
().
get
(
"username"
),
time
:
new
Date
().
toISOString
()}
else
null
endorsement
:
if
is_endorsing
then
{
username
:
DiscussionUtil
.
getUser
().
get
(
"username"
),
user_id
:
DiscussionUtil
.
getUser
().
id
,
time
:
new
Date
().
toISOString
()}
else
null
if
@
model
.
get
(
'thread'
).
get
(
'thread_type'
)
==
'question'
if
@
model
.
get
(
'thread'
).
get
(
'thread_type'
)
==
'question'
if
is_endorsing
if
is_endorsing
msg
=
gettext
(
"We had some trouble marking this response as an answer. Please try again."
)
msg
=
gettext
(
"We had some trouble marking this response as an answer. Please try again."
)
...
...
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