updates but getting status and setting status not working
This commit is contained in:
@@ -82,6 +82,8 @@ class @DiscussionUtil
|
||||
user_profile : "/courses/#{$$course_id}/discussion/forum/users/#{param}"
|
||||
followed_threads : "/courses/#{$$course_id}/discussion/forum/users/#{param}/followed"
|
||||
threads : "/courses/#{$$course_id}/discussion/forum"
|
||||
"enable_notifications" : "/notification_prefs/enable/"
|
||||
"disable_notifications" : "/notification_prefs/disable/"
|
||||
}[name]
|
||||
|
||||
@safeAjax: (params) ->
|
||||
|
||||
@@ -197,7 +197,12 @@ if Backbone?
|
||||
@template = _.template($("#discussion-home").html())
|
||||
$(".discussion-column").html(@template)
|
||||
$(".post-list a").removeClass("active")
|
||||
$(".email-notification").bind "click", @updateEmailNotifications
|
||||
$("input.email-setting").bind "click", @updateEmailNotifications
|
||||
url=DiscussionUtil.urlFor("get_notifications_state",window.user.get("id"))
|
||||
DiscussionUtil.safeAjax
|
||||
url: url
|
||||
type: "POST"
|
||||
dataType: 'json'
|
||||
thread_id = null
|
||||
|
||||
toggleTopicDrop: (event) =>
|
||||
@@ -432,20 +437,23 @@ if Backbone?
|
||||
updateEmailNotifications: () =>
|
||||
if $('input.email-notification').attr('checked')
|
||||
DiscussionUtil.safeAjax
|
||||
url: '/notification_prefs/enable/'
|
||||
url: DiscussionUtil.urlFor("enable_notifications")
|
||||
type: "POST"
|
||||
dataType: 'json'
|
||||
data:
|
||||
username: window.user.get("username")
|
||||
user: window.user.get("id")
|
||||
error: () =>
|
||||
$('input.email-notification').removeAttr('checked')
|
||||
|
||||
|
||||
else
|
||||
DiscussionUtil.safeAjax
|
||||
url: '/notification_prefs/disable/'
|
||||
url: DiscussionUtil.urlFor("disable_notifications")
|
||||
type: "POST"
|
||||
dataType: 'json'
|
||||
data:
|
||||
username: window.user.get("username")
|
||||
user: window.user.get("id")
|
||||
error: () =>
|
||||
$('input.email-notification').attr('checked','checked')
|
||||
|
||||
|
||||
|
||||
@@ -131,7 +131,6 @@ def ajax_disable(request):
|
||||
|
||||
return HttpResponse(status=204)
|
||||
|
||||
|
||||
@require_GET
|
||||
def unsubscribe(request, token):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user