Merge branch 'ccp0101/moderation' of github.com:dementrock/mitx into merge
Conflicts: lms/djangoapps/django_comment_client/forum/views.py lms/djangoapps/django_comment_client/permissions.py lms/static/coffee/src/discussion/content.coffee lms/static/coffee/src/discussion/utils.coffee lms/templates/discussion/_recent_active_posts.html lms/templates/discussion/_search_bar.html lms/templates/discussion/_thread.html lms/templates/discussion/_trending_tags.html lms/urls.py
This commit is contained in:
@@ -232,14 +232,12 @@ initializeFollowThread = (thread) ->
|
||||
handleDelete = (elem) ->
|
||||
if $content.hasClass("thread")
|
||||
url = Discussion.urlFor('delete_thread', id)
|
||||
confirmValue = confirm("Are you sure? This will delete the thread and all comments associated with it and cannot be recovered.")
|
||||
c = confirm "Are you sure to delete thread \"" + $content.find("a.thread-title").text() + "\"?"
|
||||
else
|
||||
url = Discussion.urlFor('delete_comment', id)
|
||||
confirmValue = confirm("Are you sure? This will delete the comment and all replies associated with it and cannot be recovered.")
|
||||
|
||||
if not confirmValue
|
||||
c = confirm "Are you sure to delete this comment? "
|
||||
if c != true
|
||||
return
|
||||
|
||||
Discussion.safeAjax
|
||||
$elem: $(elem)
|
||||
url: url
|
||||
@@ -375,6 +373,15 @@ initializeFollowThread = (thread) ->
|
||||
|
||||
MathJax.Hub.Queue ["Typeset", MathJax.Hub, $contentBody.attr("id")]
|
||||
id = $content.attr("_id")
|
||||
|
||||
discussion_id = $content.parents(".discussion").attr("_id")
|
||||
if $content.hasClass("thread")
|
||||
permalink = Discussion.urlFor("permanent_link_thread", discussion_id, id)
|
||||
else
|
||||
thread_id = $content.parents(".thread").attr("_id")
|
||||
permalink = Discussion.urlFor("permanent_link_comment", discussion_id, thread_id, id)
|
||||
$local(".discussion-permanent-link").attr "href", permalink
|
||||
|
||||
if not Discussion.getContentInfo id, 'editable'
|
||||
$local(".admin-edit").remove()
|
||||
if not Discussion.getContentInfo id, 'can_reply'
|
||||
@@ -383,3 +390,5 @@ initializeFollowThread = (thread) ->
|
||||
$local(".admin-endorse").remove()
|
||||
if not Discussion.getContentInfo id, 'can_delete'
|
||||
$local(".admin-delete").remove()
|
||||
if not Discussion.getContentInfo id, 'can_openclose'
|
||||
$local(".discussion-openclose").remove()
|
||||
|
||||
@@ -16,7 +16,7 @@ wmdEditors = {}
|
||||
.addClass(cls).html(txt)
|
||||
.click -> handler(this)
|
||||
|
||||
urlFor: (name, param, param1) ->
|
||||
urlFor: (name, param, param1, param2) ->
|
||||
{
|
||||
follow_discussion : "/courses/#{$$course_id}/discussion/#{param}/follow"
|
||||
unfollow_discussion : "/courses/#{$$course_id}/discussion/#{param}/unfollow"
|
||||
@@ -44,6 +44,9 @@ wmdEditors = {}
|
||||
retrieve_discussion : "/courses/#{$$course_id}/discussion/forum/#{param}/inline"
|
||||
retrieve_single_thread : "/courses/#{$$course_id}/discussion/forum/#{param}/threads/#{param1}"
|
||||
update_moderator_status : "/courses/#{$$course_id}/discussion/users/#{param}/update_moderator_status"
|
||||
openclose_thread : "/courses/#{$$course_id}/discussion/threads/#{param}/close"
|
||||
permanent_link_thread : "/courses/#{$$course_id}/discussion/forum/#{param}/threads/#{param1}"
|
||||
permanent_link_comment : "/courses/#{$$course_id}/discussion/forum/#{param}/threads/#{param1}##{param2}"
|
||||
}[name]
|
||||
|
||||
safeAjax: (params) ->
|
||||
|
||||
Reference in New Issue
Block a user