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
c55e6460
Commit
c55e6460
authored
Jan 05, 2015
by
Waqas Khalid
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6440 from mlkwaqas/waqas/tnl1016-dual-vote-count-forum
Discussion thread response show dual vote count
parents
8d577563
e7be2f73
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
1 deletions
+57
-1
common/static/coffee/src/discussion/views/discussion_content_view.coffee
+2
-0
common/static/coffee/src/discussion/views/discussion_thread_view.coffee
+1
-1
common/test/acceptance/pages/lms/discussion.py
+4
-0
common/test/acceptance/tests/discussion/test_discussion.py
+50
-0
No files found.
common/static/coffee/src/discussion/views/discussion_content_view.coffee
View file @
c55e6460
...
...
@@ -138,6 +138,8 @@ if Backbone?
closed
:
(
closed
)
->
@
updateButtonState
(
".action-close"
,
closed
)
@
$
(
".post-label-closed"
).
toggleClass
(
"is-hidden"
,
not
closed
)
@
$
(
".action-vote"
).
toggle
(
not
closed
)
@
$
(
".display-vote"
).
toggle
(
closed
)
})
toggleSecondaryActions
:
(
event
)
=>
...
...
common/static/coffee/src/discussion/views/discussion_thread_view.coffee
View file @
c55e6460
...
...
@@ -79,7 +79,6 @@ if Backbone?
@
$
(
'.comment-form'
).
closest
(
'li'
).
toggle
(
not
closed
)
@
$
(
".action-vote"
).
toggle
(
not
closed
)
@
$
(
".display-vote"
).
toggle
(
closed
)
# @$(".display-vote").toggle(closed)
@
renderAddResponseButton
()
})
...
...
@@ -260,6 +259,7 @@ if Backbone?
comment
=
new
Comment
(
body
:
body
,
created_at
:
(
new
Date
()).
toISOString
(),
username
:
window
.
user
.
get
(
"username"
),
votes
:
{
up_count
:
0
},
abuse_flaggers
:
[],
endorsed
:
false
,
user_id
:
window
.
user
.
get
(
"id"
))
comment
.
set
(
'thread'
,
@
model
.
get
(
'thread'
))
@
renderResponseToList
(
comment
,
".js-response-list"
)
@
renderAttrs
()
@
model
.
addComment
()
@
renderAddResponseButton
()
...
...
common/test/acceptance/pages/lms/discussion.py
View file @
c55e6460
...
...
@@ -265,6 +265,10 @@ class DiscussionTabSingleThreadPage(CoursePage):
def
__getattr__
(
self
,
name
):
return
getattr
(
self
.
thread_page
,
name
)
def
close_open_thread
(
self
):
with
self
.
thread_page
.
_secondary_action_menu_open
(
".forum-thread-main-wrapper"
):
self
.
_find_within
(
".forum-thread-main-wrapper .action-close"
)
.
first
.
click
()
class
InlineDiscussionPage
(
PageObject
):
url
=
None
...
...
common/test/acceptance/tests/discussion/test_discussion.py
View file @
c55e6460
...
...
@@ -153,6 +153,56 @@ class DiscussionTabSingleThreadTest(UniqueCourseTest, DiscussionResponsePaginati
@attr
(
'shard_1'
)
class
DiscussionOpenClosedThreadTest
(
UniqueCourseTest
):
"""
Tests for checking the display of attributes on open and closed threads
"""
def
setUp
(
self
):
super
(
DiscussionOpenClosedThreadTest
,
self
)
.
setUp
()
# Create a course to register for
CourseFixture
(
**
self
.
course_info
)
.
install
()
self
.
thread_id
=
"test_thread_{}"
.
format
(
uuid4
()
.
hex
)
def
setup_user
(
self
,
roles
=
[]):
roles_str
=
','
.
join
(
roles
)
self
.
user_id
=
AutoAuthPage
(
self
.
browser
,
course_id
=
self
.
course_id
,
roles
=
roles_str
)
.
visit
()
.
get_user_id
()
def
setup_view
(
self
,
**
thread_kwargs
):
view
=
SingleThreadViewFixture
(
Thread
(
id
=
self
.
thread_id
,
**
thread_kwargs
)
)
view
.
addResponse
(
Response
(
id
=
"response1"
))
view
.
push
()
def
setup_openclosed_thread_page
(
self
,
closed
=
False
):
self
.
setup_user
(
roles
=
[
'Moderator'
])
if
closed
:
self
.
setup_view
(
closed
=
True
)
else
:
self
.
setup_view
()
page
=
DiscussionTabSingleThreadPage
(
self
.
browser
,
self
.
course_id
,
self
.
thread_id
)
page
.
visit
()
page
.
close_open_thread
()
return
page
def
test_originally_open_thread_vote_display
(
self
):
page
=
self
.
setup_openclosed_thread_page
()
self
.
assertFalse
(
page
.
_is_element_visible
(
'.forum-thread-main-wrapper .action-vote'
))
self
.
assertTrue
(
page
.
_is_element_visible
(
'.forum-thread-main-wrapper .display-vote'
))
self
.
assertFalse
(
page
.
_is_element_visible
(
'.response_response1 .action-vote'
))
self
.
assertTrue
(
page
.
_is_element_visible
(
'.response_response1 .display-vote'
))
def
test_originally_closed_thread_vote_display
(
self
):
page
=
self
.
setup_openclosed_thread_page
(
True
)
self
.
assertTrue
(
page
.
_is_element_visible
(
'.forum-thread-main-wrapper .action-vote'
))
self
.
assertFalse
(
page
.
_is_element_visible
(
'.forum-thread-main-wrapper .display-vote'
))
self
.
assertTrue
(
page
.
_is_element_visible
(
'.response_response1 .action-vote'
))
self
.
assertFalse
(
page
.
_is_element_visible
(
'.response_response1 .display-vote'
))
@attr
(
'shard_1'
)
class
DiscussionCommentDeletionTest
(
UniqueCourseTest
):
"""
Tests for deleting comments displayed beneath responses in the single thread view.
...
...
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