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
55786a7c
Commit
55786a7c
authored
Aug 22, 2012
by
Rocky Duan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed autosubscribe
parent
838171c8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
6 deletions
+5
-6
lms/lib/comment_client/comment.py
+5
-0
lms/static/coffee/src/backbone_discussion/content.coffee
+0
-1
lms/static/coffee/src/backbone_discussion/discussion.coffee
+0
-4
lms/static/coffee/src/backbone_discussion/discussion_module.coffee
+0
-1
No files found.
lms/lib/comment_client/comment.py
View file @
55786a7c
from
utils
import
*
from
thread
import
Thread
import
models
import
settings
...
...
@@ -23,6 +24,10 @@ class Comment(models.Model):
base_url
=
"{prefix}/comments"
.
format
(
prefix
=
settings
.
PREFIX
)
type
=
'comment'
@property
def
thread
(
self
):
return
Thread
(
id
=
self
.
thread_id
,
type
=
'thread'
)
@classmethod
def
url_for_comments
(
cls
,
params
=
{}):
if
params
.
get
(
'thread_id'
):
...
...
lms/static/coffee/src/backbone_discussion/content.coffee
View file @
55786a7c
...
...
@@ -87,7 +87,6 @@ class @ContentView extends Backbone.View
@
$
(
".discussion-follow-thread"
).
removeClass
(
"discussion-unfollow-thread"
).
html
(
"Follow"
)
ability
:
(
ability
)
->
console
.
log
"triggered"
for
action
,
elemSelector
of
@
model
.
actions
if
not
ability
[
action
]
@
$
(
elemSelector
).
parent
().
remove
()
...
...
lms/static/coffee/src/backbone_discussion/discussion.coffee
View file @
55786a7c
...
...
@@ -37,10 +37,8 @@ class @DiscussionView extends Backbone.View
@
newPost
()
reload
:
(
$elem
,
url
)
->
console
.
log
"here"
if
not
url
then
return
DiscussionUtil
.
get
$elem
,
url
,
{},
(
response
,
textStatus
)
=>
console
.
log
response
$parent
=
@
$el
.
parent
()
@
$el
.
replaceWith
(
response
.
html
)
$discussion
=
$parent
.
find
(
"section.discussion"
)
...
...
@@ -49,7 +47,6 @@ class @DiscussionView extends Backbone.View
DiscussionUtil
.
bulkUpdateContentInfo
(
window
.
$
$annotated_content_info
)
loadSimilarPost
:
(
event
)
->
console
.
log
"loading"
$title
=
@
$
(
".new-post-title"
)
$wrapper
=
@
$
(
".new-post-similar-posts-wrapper"
)
$similarPosts
=
@
$
(
".new-post-similar-posts"
)
...
...
@@ -63,7 +60,6 @@ class @DiscussionView extends Backbone.View
url
=
DiscussionUtil
.
urlFor
'search_similar_threads'
,
@
model
.
id
data
=
{
text
:
@
$
(
".new-post-title"
).
val
()
}
DiscussionUtil
.
get
$elem
,
url
,
data
,
(
response
,
textStatus
)
=>
console
.
log
response
$similarPosts
.
empty
()
if
$
.
type
(
response
)
==
"array"
and
response
.
length
$wrapper
.
show
()
...
...
lms/static/coffee/src/backbone_discussion/discussion_module.coffee
View file @
55786a7c
...
...
@@ -2,7 +2,6 @@ class @DiscussionModuleView extends Backbone.View
events
:
"click .discussion-show"
:
"toggleDiscussion"
toggleDiscussion
:
(
event
)
->
console
.
log
"toggle"
if
@
showed
@
$
(
"section.discussion"
).
hide
()
$
(
event
.
target
).
html
(
"Show Discussion"
)
...
...
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