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
62769971
Commit
62769971
authored
Jul 29, 2013
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update checkbox with get settings
parent
d95693eb
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
61 deletions
+9
-61
common/static/coffee/src/discussion/utils.coffee
+0
-3
common/static/coffee/src/discussion/views/discussion_thread_list_view.coffee
+8
-10
lms/djangoapps/django_comment_client/base/urls.py
+0
-1
lms/djangoapps/django_comment_client/base/views.py
+0
-17
lms/lib/comment_client/user.py
+0
-9
lms/templates/discussion/_underscore_templates.html
+1
-21
No files found.
common/static/coffee/src/discussion/utils.coffee
View file @
62769971
...
...
@@ -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
]
...
...
common/static/coffee/src/discussion/views/discussion_thread_list_view.coffee
View file @
62769971
...
...
@@ -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,15 +321,6 @@ 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
(
','
)
...
...
@@ -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
lms/djangoapps/django_comment_client/base/urls.py
View file @
62769971
...
...
@@ -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<user_id>\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<thread_id>[\w\-]+)/update$'
,
'update_thread'
,
name
=
'update_thread'
),
url
(
r'threads/(?P<thread_id>[\w\-]+)/reply$'
,
'create_comment'
,
name
=
'create_comment'
),
...
...
lms/djangoapps/django_comment_client/base/views.py
View file @
62769971
...
...
@@ -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
lms/lib/comment_client/user.py
View file @
62769971
...
...
@@ -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
...
...
lms/templates/discussion/_underscore_templates.html
View file @
62769971
...
...
@@ -177,26 +177,6 @@
<
span
class
=
"label"
>
DISCUSSION
HOME
:
<
/span
>
<
h1
class
=
"home-title"
>
$
{
course
.
display_name_with_default
}
<
/h1
>
<
/section
>
<
section
class
=
"home-stats"
>
<
div
class
=
"label-area"
>
<
span
class
=
"label"
>
PROFILE
,
PARTICIPATION
<
/span
>
<
a
href
=
"#"
class
=
"profile-link"
>
Your
profile
Name
<
/a
>
<
/div
>
<
div
class
=
"stats-grouping"
>
<
div
class
=
"profile-stat profile-stat-posts"
>
<
span
class
=
"count count-posts"
>
5
<
/span
>
<
span
class
=
"profile-stat-label"
>
POSTS
<
/span
>
<
/div
>
<
div
class
=
"profile-stat profile-stat-comments"
>
<
span
class
=
"count count-comments"
>
12
<
/span
>
<
span
class
=
"profile-stat-label"
>
COMMENTS
<
/span
>
<
/div
>
<
div
class
=
"profile-stat profile-stat-following"
>
<
span
class
=
"count count-following"
>
9
<
/span
>
<
span
class
=
"profile-stat-label"
>
FOLLOWING
<
/span
>
<
/div
>
<
/div
>
<
/section
>
<
span
class
=
"label label-settings"
>
HOW
TO
USE
EDX
DISCUSSIONS
<
/span
>
<
table
class
=
"home-helpgrid"
>
<
tr
class
=
"helpgrid-row helpgrid-row-navigation"
>
...
...
@@ -233,7 +213,7 @@
<
td
class
=
"row-title"
>
Receive
updates
<
/td
>
<
td
class
=
"row-item-full"
colspan
=
"3"
>
<
i
class
=
"icon icon-envelope"
><
/i
>
<
span
class
=
"row-setting"
><
input
type
=
"checkbox"
name
=
"email-notification"
><
/input></
span
>
<
span
class
=
"row-setting"
><
input
type
=
"checkbox"
class
=
"email-notification"
name
=
"email-notification"
><
/input></
span
>
<
span
class
=
"row-description"
>
If
enabled
,
you
will
receive
an
email
digest
once
a
day
notifying
you
about
new
,
unread
activity
from
posts
you
are
following
.
<
/span
>
<
/td
>
<
/tr
>
...
...
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