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
f1df9a10
Commit
f1df9a10
authored
Jul 11, 2014
by
Waqas Khalid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix anonymous posts appear are labeled with the logged in user's role
FOR-156
parent
9cf082e7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
common/static/coffee/spec/discussion/content_spec.coffee
+16
-0
common/static/coffee/src/discussion/content.coffee
+6
-2
No files found.
common/static/coffee/spec/discussion/content_spec.coffee
View file @
f1df9a10
...
...
@@ -2,6 +2,22 @@ describe 'All Content', ->
beforeEach
->
DiscussionSpecHelper
.
setUpGlobals
()
describe
'Staff and TA Content'
,
->
beforeEach
->
DiscussionUtil
.
loadRoles
({
"Moderator"
:
[
567
],
"Administrator"
:
[
567
],
"Community TA"
:
[
567
]})
it
'anonymous thread should not include login role label'
,
->
anon_content
=
new
Content
anon_content
.
initialize
expect
(
anon_content
.
get
'staff_authored'
).
toBe
false
expect
(
anon_content
.
get
'community_ta_authored'
).
toBe
false
it
'general thread should include login role label'
,
->
anon_content
=
new
Content
{
user_id
:
'567'
}
anon_content
.
initialize
expect
(
anon_content
.
get
'staff_authored'
).
toBe
true
expect
(
anon_content
.
get
'community_ta_authored'
).
toBe
true
describe
'Content'
,
->
beforeEach
->
@
content
=
new
Content
{
...
...
common/static/coffee/src/discussion/content.coffee
View file @
f1df9a10
...
...
@@ -54,8 +54,12 @@ if Backbone?
initialize
:
->
Content
.
addContent
@
id
,
@
userId
=
@
get
(
'user_id'
)
@
set
(
'staff_authored'
,
DiscussionUtil
.
isStaff
(
userId
))
@
set
(
'community_ta_authored'
,
DiscussionUtil
.
isTA
(
userId
))
if
userId
?
@
set
(
'staff_authored'
,
DiscussionUtil
.
isStaff
(
userId
))
@
set
(
'community_ta_authored'
,
DiscussionUtil
.
isTA
(
userId
))
else
@
set
(
'staff_authored'
,
false
)
@
set
(
'community_ta_authored'
,
false
)
if
Content
.
getInfo
(
@
id
)
@
updateInfo
(
Content
.
getInfo
(
@
id
))
@
set
'user_url'
,
DiscussionUtil
.
urlFor
(
'user_profile'
,
userId
)
...
...
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