From 62769971802384dfbe182a2e5e72e8af28cd3afa Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 29 Jul 2013 13:26:31 -0400 Subject: [PATCH] update checkbox with get settings --- .../static/coffee/src/discussion/utils.coffee | 3 --- .../views/discussion_thread_list_view.coffee | 19 +++++++--------- .../django_comment_client/base/urls.py | 1 - .../django_comment_client/base/views.py | 17 -------------- lms/lib/comment_client/user.py | 9 -------- .../discussion/_underscore_templates.html | 22 +------------------ 6 files changed, 9 insertions(+), 62 deletions(-) diff --git a/common/static/coffee/src/discussion/utils.coffee b/common/static/coffee/src/discussion/utils.coffee index c5a77242ec..b7b7cb2550 100644 --- a/common/static/coffee/src/discussion/utils.coffee +++ b/common/static/coffee/src/discussion/utils.coffee @@ -80,9 +80,6 @@ class @DiscussionUtil permanent_link_thread : "/courses/#{$$course_id}/discussion/forum/#{param}/threads/#{param1}" permanent_link_comment : "/courses/#{$$course_id}/discussion/forum/#{param}/threads/#{param1}##{param2}" user_profile : "/courses/#{$$course_id}/discussion/forum/users/#{param}" - - user_stats : "/courses/#{$$course_id}/discussion/panel/stats" - followed_threads : "/courses/#{$$course_id}/discussion/forum/users/#{param}/followed" threads : "/courses/#{$$course_id}/discussion/forum" }[name] diff --git a/common/static/coffee/src/discussion/views/discussion_thread_list_view.coffee b/common/static/coffee/src/discussion/views/discussion_thread_list_view.coffee index 958cb14175..e71b564556 100644 --- a/common/static/coffee/src/discussion/views/discussion_thread_list_view.coffee +++ b/common/static/coffee/src/discussion/views/discussion_thread_list_view.coffee @@ -197,7 +197,7 @@ if Backbone? @template = _.template($("#discussion-home").html()) $(".discussion-column").html(@template) $(".post-list a").removeClass("active") - @retrieveUserStats() + $(".email-notification").bind "click", @updateEmailNotifications thread_id = null toggleTopicDrop: (event) => @@ -321,16 +321,7 @@ if Backbone? if callback? callback() - retrieveUserStats: () -> - url = DiscussionUtil.urlFor("user_stats") - DiscussionUtil.safeAjax - url: url - type: "GET" - success: (response, textStatus) => - alert('success') - error: (response) => - alert('error') - + retrieveDiscussions: (discussion_ids) -> @discussionIds = discussion_ids.join(',') @mode = 'commentables' @@ -437,3 +428,9 @@ if Backbone? retrieveFollowed: (event)=> @mode = 'followed' @retrieveFirstPage(event) + + updateEmailNotifications: () => + if $('input.email-notification').attr('checked') + alert('checked') + else + alert('unchecked') \ No newline at end of file diff --git a/lms/djangoapps/django_comment_client/base/urls.py b/lms/djangoapps/django_comment_client/base/urls.py index ab62ba64db..5b653e1c68 100644 --- a/lms/djangoapps/django_comment_client/base/urls.py +++ b/lms/djangoapps/django_comment_client/base/urls.py @@ -3,7 +3,6 @@ from django.conf.urls.defaults import url, patterns urlpatterns = patterns('django_comment_client.base.views', # nopep8 url(r'upload$', 'upload', name='upload'), url(r'users/(?P\w+)/update_moderator_status$', 'update_moderator_status', name='update_moderator_status'), - url(r'panel/stats', 'user_stats', name='user_stats'), url(r'threads/tags/autocomplete$', 'tags_autocomplete', name='tags_autocomplete'), url(r'threads/(?P[\w\-]+)/update$', 'update_thread', name='update_thread'), url(r'threads/(?P[\w\-]+)/reply$', 'create_comment', name='create_comment'), diff --git a/lms/djangoapps/django_comment_client/base/views.py b/lms/djangoapps/django_comment_client/base/views.py index f9ef3307dd..b2e3ea3e08 100644 --- a/lms/djangoapps/django_comment_client/base/views.py +++ b/lms/djangoapps/django_comment_client/base/views.py @@ -649,20 +649,3 @@ def upload(request, course_id): # ajax upload file to a question or answer 'file_url': file_url, } }) - -@login_required -def user_stats(request, course_id): - try: - profiled_user = cc.User(id=request.user.id, course_id=course_id) - print "\n\n\n*******************\n\n\n" - print profiled_user.course_id - query_params = {} - - user_stats_results = profiled_user.stats(query_params) - - return utils.JsonResponse({ - 'stats': user_stats_results - }) - - except (cc.utils.CommentClientError, cc.utils.CommentClientUnknownError, User.DoesNotExist): - raise Http404 diff --git a/lms/lib/comment_client/user.py b/lms/lib/comment_client/user.py index 275558fd48..e686b9a052 100644 --- a/lms/lib/comment_client/user.py +++ b/lms/lib/comment_client/user.py @@ -75,15 +75,6 @@ class User(models.Model): response = perform_request('get', url, params) return response.get('collection', []), response.get('page', 1), response.get('num_pages', 1) - def stats(self, query_params={}): - if not self.course_id: - raise CommentClientError("Must provide course_id when retrieving stats for the user") - url = _url_for_user_stats(self.id,self.course_id) - params = {'course_id': self.course_id} - params = merge_dict(params, query_params) - response = perform_request('get', url, params) - return response.get('collection', []), response.get('page', 1), response.get('num_pages', 1) - def _retrieve(self, *args, **kwargs): url = self.url(action='get', params=self.attributes) retrieve_params = self.default_retrieve_params diff --git a/lms/templates/discussion/_underscore_templates.html b/lms/templates/discussion/_underscore_templates.html index 907cb14508..a6b03dccfb 100644 --- a/lms/templates/discussion/_underscore_templates.html +++ b/lms/templates/discussion/_underscore_templates.html @@ -177,26 +177,6 @@ DISCUSSION HOME:

${course.display_name_with_default}

-
-
- PROFILE, PARTICIPATION - Your profile Name -
-
-
- 5 - POSTS -
-
- 12 - COMMENTS -
-
- 9 - FOLLOWING -
-
-
HOW TO USE EDX DISCUSSIONS @@ -233,7 +213,7 @@
Receive updates - + If enabled, you will receive an email digest once a day notifying you about new, unread activity from posts you are following.