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
2d105265
Commit
2d105265
authored
Sep 11, 2012
by
Ibrahim Awwal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add @references for deeply nested (3+) comments.
parent
fc459f7e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
6 deletions
+17
-6
lms/static/coffee/src/discussion/views/response_comment_view.coffee
+6
-1
lms/static/coffee/src/discussion/views/thread_response_view.coffee
+4
-4
lms/templates/discussion/_underscore_templates.html
+7
-1
No files found.
lms/static/coffee/src/discussion/views/response_comment_view.coffee
View file @
2d105265
...
...
@@ -8,7 +8,12 @@ if Backbone?
@
$delegateElement
=
@
$local
render
:
->
@
$el
.
html
(
@
template
(
@
model
.
toJSON
()))
params
=
@
model
.
toJSON
()
params
[
'deep'
]
=
@
options
.
deep
if
@
options
.
deep
params
[
'parent_id'
]
=
@
options
.
parent
.
id
params
[
'parent_username'
]
=
@
options
.
parent
.
get
(
'username'
)
@
$el
.
html
(
@
template
(
params
))
@
initLocal
()
@
delegateEvents
()
@
renderAttrs
()
...
...
lms/static/coffee/src/discussion/views/thread_response_view.coffee
View file @
2d105265
...
...
@@ -27,15 +27,15 @@ if Backbone?
MathJax
.
Hub
.
Queue
[
"Typeset"
,
MathJax
.
Hub
,
element
[
0
]]
renderComments
:
->
@
model
.
get
(
"comments"
).
each
@
renderComment
@
model
.
get
(
"comments"
).
each
(
comment
)
=>
@
renderComment
(
comment
,
false
,
null
)
renderComment
:
(
comment
)
=>
renderComment
:
(
comment
,
deep
=
false
,
parent
=
null
)
=>
comment
.
set
(
'thread'
,
@
model
.
get
(
'thread'
))
view
=
new
ResponseCommentView
(
model
:
comment
)
view
=
new
ResponseCommentView
(
model
:
comment
,
deep
:
deep
,
parent
:
parent
)
view
.
render
()
@
$el
.
find
(
".comments li:last"
).
before
(
view
.
el
)
children
=
new
Comments
(
comment
.
get
(
'children'
))
children
.
each
@
renderC
omment
children
.
each
(
child
)
=>
@
renderComment
child
,
true
,
c
omment
toggleVote
:
(
event
)
->
...
...
lms/templates/discussion/_underscore_templates.html
View file @
2d105265
...
...
@@ -95,7 +95,13 @@
</script>
<script
type=
"text/template"
id=
"response-comment-template"
>
<
p
><
span
class
=
"response-body"
>
$
{
'<%- body %>'
}
<
/span><span class="posted-details">–posted <span class="timeago" title="${'<%- created_at %>'}">${'<%- created_at %>'}</
span
>
by
<
a
href
=
"${'<%- user_url %>'}"
>
$
{
'<%- username %>'
}
<
/a></
span
><
/p
>
<
p
id
=
"comment_${'<%- id %>'}"
>
$
{
'<% if (deep) {%>'
}
<
a
href
=
"#comment_${'<%- parent_id %>'}"
>
@
$
{
'<%- parent_username %>'
}
<
/a>
:
$
{
'<% }%>'
}
<
span
class
=
"response-body"
>
$
{
'<%- body %>'
}
<
/span
>
<
span
class
=
"posted-details"
>&
ndash
;
posted
<
span
class
=
"timeago"
title
=
"${'<%- created_at %>'}"
>
$
{
'<%- created_at %>'
}
<
/span> by <a href="${'<%- user_url %>'}">${'<%- username %>'}</
a
><
/span
>
<
/p
>
</script>
<script
type=
"text/template"
id=
"thread-list-item-template"
>
...
...
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