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
fca5ab9a
Commit
fca5ab9a
authored
Aug 06, 2012
by
Mike Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added delete link
parent
7e8b1992
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
0 deletions
+27
-0
lms/djangoapps/django_comment_client/forum/views.py
+1
-0
lms/static/coffee/src/discussion/content.coffee
+23
-0
lms/templates/discussion/_thread.html
+3
-0
No files found.
lms/djangoapps/django_comment_client/forum/views.py
View file @
fca5ab9a
...
...
@@ -133,6 +133,7 @@ def get_annotated_content_info(content, user, is_thread):
'editable'
:
check_permissions_by_view
(
user
,
content
,
"update_thread"
if
is_thread
else
"update_comment"
),
'can_reply'
:
check_permissions_by_view
(
user
,
content
,
"create_comment"
if
is_thread
else
"create_sub_comment"
),
'can_endorse'
:
check_permissions_by_view
(
user
,
content
,
"endorse_comment"
)
if
not
is_thread
else
False
,
'can_delete'
:
check_permissions_by_view
(
user
,
content
,
"delete_thread"
if
is_thread
else
"delete_comment"
),
}
def
get_annotated_content_infos
(
thread
,
user
):
...
...
lms/static/coffee/src/discussion/content.coffee
View file @
fca5ab9a
...
...
@@ -223,6 +223,24 @@ initializeFollowThread = (thread) ->
error
:
(
response
,
textStatus
,
e
)
->
console
.
log
e
handleDelete
=
(
elem
)
->
if
$content
.
hasClass
(
"thread"
)
url
=
Discussion
.
urlFor
(
'delete_thread'
,
id
)
else
url
=
Discussion
.
urlFor
(
'delete_comment'
,
id
)
Discussion
.
safeAjax
$elem
:
$
(
elem
)
url
:
url
type
:
"POST"
dataType
:
"json"
data
:
{}
success
:
(
response
,
textStatus
)
=>
if
textStatus
==
"success"
$
(
content
).
remove
()
error
:
(
response
,
textStatus
,
e
)
->
console
.
log
e
handleHideSingleThread
=
(
elem
)
->
$threadTitle
=
$local
(
".thread-title"
)
$showComments
=
$local
(
".discussion-show-comments"
)
...
...
@@ -308,6 +326,9 @@ initializeFollowThread = (thread) ->
else
handleEditComment
(
this
)
"click .discussion-delete"
:
->
handleDelete
(
this
)
initializeContent
:
(
content
)
->
$content
=
$
(
content
)
initializeVote
$content
...
...
@@ -326,3 +347,5 @@ initializeFollowThread = (thread) ->
$local
(
".discussion-reply"
).
remove
()
if
not
Discussion
.
getContentInfo
id
,
'can_endorse'
$local
(
".discussion-endorse-control"
).
remove
()
if
not
Discussion
.
getContentInfo
id
,
'can_delete'
$local
(
".discussion-delete"
).
remove
()
lms/templates/discussion/_thread.html
View file @
fca5ab9a
...
...
@@ -95,6 +95,9 @@
<a
class=
"discussion-openclose"
id=
"discussion-openclose-${content['id']}"
href=
"javascript:void(0);"
>
Close thread
</a>
% endif
% endif
${render_link("discussion-link discussion-delete", "Delete")}
</div>
</
%
def>
...
...
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