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
6a19f4e0
Commit
6a19f4e0
authored
Dec 04, 2012
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes to underscore template
parent
a0104f65
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
3 deletions
+43
-3
lms/static/coffee/src/discussion/content.coffee
+1
-0
lms/static/coffee/src/discussion/views/discussion_content_view.coffee
+6
-0
lms/static/coffee/src/discussion/views/discussion_thread_show_view.coffee
+0
-1
lms/static/coffee/src/discussion/views/thread_response_show_view.coffee
+35
-0
lms/templates/discussion/_underscore_templates.html
+1
-2
No files found.
lms/static/coffee/src/discussion/content.coffee
View file @
6a19f4e0
...
...
@@ -165,6 +165,7 @@ if Backbone?
'update'
:
->
DiscussionUtil
.
urlFor
(
'update_comment'
,
@
id
)
'delete'
:
->
DiscussionUtil
.
urlFor
(
'delete_comment'
,
@
id
)
getCommentsCount
:
->
count
=
0
@
get
(
'comments'
).
each
(
comment
)
->
...
...
lms/static/coffee/src/discussion/views/discussion_content_view.coffee
View file @
6a19f4e0
if
Backbone
?
class
@
DiscussionContentView
extends
Backbone
.
View
events
:
"click .discussion-flag-abuse"
:
"toggleFlagAbuse"
attrRenderer
:
endorsed
:
(
endorsed
)
->
if
endorsed
...
...
@@ -94,6 +99,7 @@ if Backbone?
setWmdContent
:
(
cls_identifier
,
text
)
=>
DiscussionUtil
.
setWmdContent
@
$el
,
$
.
proxy
(
@
$
,
@
),
cls_identifier
,
text
initialize
:
->
@
initLocal
()
...
...
lms/static/coffee/src/discussion/views/discussion_thread_show_view.coffee
View file @
6a19f4e0
...
...
@@ -74,7 +74,6 @@ if Backbone?
@
unFlagAbuse
()
else
@
flagAbuse
()
@
renderFlagged
()
toggleFollowing
:
(
event
)
->
...
...
lms/static/coffee/src/discussion/views/thread_response_show_view.coffee
View file @
6a19f4e0
...
...
@@ -5,6 +5,7 @@ if Backbone?
"click .action-endorse"
:
"toggleEndorse"
"click .action-delete"
:
"delete"
"click .action-edit"
:
"edit"
"click .discussion-flag-abuse"
:
"toggleFlagAbuse"
$
:
(
selector
)
->
@
$el
.
find
(
selector
)
...
...
@@ -70,6 +71,40 @@ if Backbone?
success
:
(
response
,
textStatus
)
=>
if
textStatus
==
'success'
@
model
.
set
(
response
)
toggleFlagAbuse
:
(
event
)
->
event
.
preventDefault
()
if
window
.
user
.
id
in
@
model
.
get
(
"abuse_flaggers"
)
@
unFlagAbuse
()
else
@
flagAbuse
()
flagAbuse
:
->
url
=
@
model
.
urlFor
(
"flagAbuse"
)
DiscussionUtil
.
safeAjax
$elem
:
@
$
(
".discussion-flag-abuse"
)
url
:
url
type
:
"POST"
success
:
(
response
,
textStatus
)
=>
if
textStatus
==
'success'
###
note, we have to clone the array in order to trigger a change event
###
temp_array
=
_
.
clone
(
@
model
.
get
(
'abuse_flaggers'
));
temp_array
.
push
(
window
.
user
.
id
)
@
model
.
set
(
'abuse_flaggers'
,
temp_array
)
unFlagAbuse
:
->
url
=
@
model
.
urlFor
(
"unFlagAbuse"
)
DiscussionUtil
.
safeAjax
$elem
:
@
$
(
".discussion-flag-abuse"
)
url
:
url
type
:
"POST"
success
:
(
response
,
textStatus
)
=>
if
textStatus
==
'success'
temp_array
=
_
.
clone
(
@
model
.
get
(
'abuse_flaggers'
));
temp_array
.
pop
(
window
.
user
.
id
)
@
model
.
set
(
'abuse_flaggers'
,
temp_array
)
edit
:
(
event
)
->
@
trigger
"response:edit"
,
event
...
...
lms/templates/discussion/_underscore_templates.html
View file @
6a19f4e0
...
...
@@ -137,8 +137,7 @@
<script
type=
"text/template"
id=
"response-comment-show-template"
>
<
div
id
=
"comment_${'<%- id %>'}"
>
<
div
class
=
"response-body"
>
$
{
'<%- body %>'
}
<
/div
>
<
div
class
=
"discussion-flag-abuse notflagged"
data
-
role
=
"thread-flag"
data
-
tooltip
=
"flag"
>
<
i
class
=
"icon"
><
/i>Report Misuse</
div
>
<
p
class
=
"posted-details"
>&
ndash
;
posted
<
span
class
=
"timeago"
title
=
"${'<%- created_at %>'}"
>
$
{
'<%- created_at %>'
}
<
/span> b
y
$
{
"<% if (obj.username) { %>"
}
<
a
href
=
"${'<%- user_url %>'}"
class
=
"profile-link"
>
$
{
'<%- username %>'
}
<
/a
>
...
...
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