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
8a58582e
Commit
8a58582e
authored
Sep 06, 2012
by
Ibrahim Awwal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add newly posted threads to the inline thread list.
parent
b7e88a83
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
16 deletions
+22
-16
lms/static/coffee/src/discussion/discussion_module_view.coffee
+16
-11
lms/templates/discussion/mustache/_inline_discussion.mustache
+6
-5
No files found.
lms/static/coffee/src/discussion/discussion_module.coffee
→
lms/static/coffee/src/discussion/discussion_module
_view
.coffee
View file @
8a58582e
...
@@ -15,7 +15,6 @@ if Backbone?
...
@@ -15,7 +15,6 @@ if Backbone?
@
newPostForm
.
slideUp
(
300
)
@
newPostForm
.
slideUp
(
300
)
toggleDiscussion
:
(
event
)
->
toggleDiscussion
:
(
event
)
->
console
.
log
"doing stuff yo"
if
@
showed
if
@
showed
@
$
(
"section.discussion"
).
hide
()
@
$
(
"section.discussion"
).
hide
()
$
(
event
.
target
).
html
(
"Show Discussion"
)
$
(
event
.
target
).
html
(
"Show Discussion"
)
...
@@ -38,22 +37,28 @@ if Backbone?
...
@@ -38,22 +37,28 @@ if Backbone?
success
:
(
response
,
textStatus
,
jqXHR
)
=>
@
createDiscussion
(
event
,
response
,
textStatus
)
success
:
(
response
,
textStatus
,
jqXHR
)
=>
@
createDiscussion
(
event
,
response
,
textStatus
)
createDiscussion
:
(
event
,
response
,
textStatus
)
=>
createDiscussion
:
(
event
,
response
,
textStatus
)
=>
console
.
log
"HI"
console
.
log
response
window
.
user
=
new
DiscussionUser
(
response
.
user_info
)
window
.
user
=
new
DiscussionUser
(
response
.
user_info
)
Content
.
loadContentInfos
(
response
.
annotated_content_info
)
Content
.
loadContentInfos
(
response
.
annotated_content_info
)
console
.
log
"infod"
$
(
event
.
target
).
html
(
"Hide Discussion"
)
$
(
event
.
target
).
html
(
"Hide Discussion"
)
discussion
=
new
Discussion
()
@
discussion
=
new
Discussion
()
discussion
.
reset
(
response
.
discussion_data
,
{
silent
:
false
})
@
discussion
.
reset
(
response
.
discussion_data
,
{
silent
:
false
})
$discussion
=
$
(
Mustache
.
render
$
(
"script#_inline_discussion"
).
html
(),
{
'threads'
:
response
.
discussion_data
})
$discussion
=
$
(
Mustache
.
render
$
(
"script#_inline_discussion"
).
html
(),
{
'threads'
:
response
.
discussion_data
})
$
(
".discussion-module"
).
append
(
$discussion
)
$
(
".discussion-module"
).
append
(
$discussion
)
@
newPostForm
=
$
(
'.new-post-article'
)
@
newPostForm
=
$
(
'.new-post-article'
)
discussion
.
each
(
thread
)
->
@
threadviews
=
@
discussion
.
map
(
thread
)
->
element
=
$
(
"article#thread_
#{
thread
.
id
}
"
)
new
DiscussionThreadInlineView
el
:
@
$
(
"article#thread_
#{
thread
.
id
}
"
),
model
:
thread
dtv
=
new
DiscussionThreadInlineView
el
:
element
,
model
:
thread
_
.
each
@
threadviews
,
(
dtv
)
->
dtv
.
render
()
dtv
.
render
()
DiscussionUtil
.
bulkUpdateContentInfo
(
window
.
$
$annotated_content_info
)
DiscussionUtil
.
bulkUpdateContentInfo
(
window
.
$
$annotated_content_info
)
@
newPostView
=
new
NewPostInlineView
el
:
$
(
'.new-post-article'
),
collection
:
discussion
@
newPostView
=
new
NewPostInlineView
el
:
@
$
(
'.new-post-article'
),
collection
:
@
discussion
@
discussion
.
on
"add"
,
@
addThread
@
retrieved
=
true
@
retrieved
=
true
@
showed
=
true
@
showed
=
true
addThread
:
(
thread
,
collection
,
options
)
=>
# TODO: When doing pagination, this will need to repaginate
article
=
$
(
"<article class='discussion-thread' id='thread_
#{
thread
.
id
}
'></article>"
)
@
$
(
'section.discussion > .threads'
).
prepend
(
article
)
threadView
=
new
DiscussionThreadInlineView
el
:
article
,
model
:
thread
threadView
.
render
()
@
threadviews
.
unshift
threadView
lms/templates/discussion/mustache/_inline_discussion.mustache
View file @
8a58582e
...
@@ -29,9 +29,10 @@
...
@@ -29,9 +29,10 @@
</div>
</div>
</article>
</article>
<section
class=
"threads"
>
{{#
threads
}}
{{#
threads
}}
<article
class=
"discussion-thread"
id=
"thread_
{{
id
}}
"
>
<article
class=
"discussion-thread"
id=
"thread_
{{
id
}}
"
>
</article>
</article>
{{/
threads
}}
{{/
threads
}}
</section>
</section>
</section>
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