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
2685a3b6
Commit
2685a3b6
authored
Aug 07, 2012
by
Rocky Duan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trending tags
parent
fddee7de
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
lms/djangoapps/django_comment_client/forum/views.py
+6
-0
lms/lib/comment_client.py
+8
-0
lms/templates/discussion/_trending_tags.html
+2
-2
No files found.
lms/djangoapps/django_comment_client/forum/views.py
View file @
2685a3b6
...
@@ -128,6 +128,11 @@ def forum_form_discussion(request, course_id, discussion_id):
...
@@ -128,6 +128,11 @@ def forum_form_discussion(request, course_id, discussion_id):
'commentable_id'
:
discussion_id
},
'commentable_id'
:
discussion_id
},
)
)
trending_tags
=
comment_client
.
search_trending_tags
(
course_id
,
query_params
=
{
'commentable_id'
:
discussion_id
},
)
if
request
.
is_ajax
():
if
request
.
is_ajax
():
return
utils
.
HtmlResponse
(
content
)
return
utils
.
HtmlResponse
(
content
)
else
:
else
:
...
@@ -137,6 +142,7 @@ def forum_form_discussion(request, course_id, discussion_id):
...
@@ -137,6 +142,7 @@ def forum_form_discussion(request, course_id, discussion_id):
'content'
:
content
,
'content'
:
content
,
'accordion'
:
render_accordion
(
request
,
course
,
discussion_id
),
'accordion'
:
render_accordion
(
request
,
course
,
discussion_id
),
'recent_active_threads'
:
recent_active_threads
,
'recent_active_threads'
:
recent_active_threads
,
'trending_tags'
:
trending_tags
,
}
}
return
render_to_response
(
'discussion/index.html'
,
context
)
return
render_to_response
(
'discussion/index.html'
,
context
)
...
...
lms/lib/comment_client.py
View file @
2685a3b6
...
@@ -39,6 +39,11 @@ def search_recent_active_threads(course_id, recursive=False, query_params={}, *a
...
@@ -39,6 +39,11 @@ def search_recent_active_threads(course_id, recursive=False, query_params={}, *a
attributes
=
dict
(
default_params
.
items
()
+
query_params
.
items
())
attributes
=
dict
(
default_params
.
items
()
+
query_params
.
items
())
return
_perform_request
(
'get'
,
_url_for_search_recent_active_threads
(),
attributes
,
*
args
,
**
kwargs
)
return
_perform_request
(
'get'
,
_url_for_search_recent_active_threads
(),
attributes
,
*
args
,
**
kwargs
)
def
search_trending_tags
(
course_id
,
query_params
=
{},
*
args
,
**
kwargs
):
default_params
=
{
'course_id'
:
course_id
}
attributes
=
dict
(
default_params
.
items
()
+
query_params
.
items
())
return
_perform_request
(
'get'
,
_url_for_search_trending_tags
(),
attributes
,
*
args
,
**
kwargs
)
def
create_user
(
attributes
,
*
args
,
**
kwargs
):
def
create_user
(
attributes
,
*
args
,
**
kwargs
):
return
_perform_request
(
'post'
,
_url_for_users
(),
attributes
,
*
args
,
**
kwargs
)
return
_perform_request
(
'post'
,
_url_for_users
(),
attributes
,
*
args
,
**
kwargs
)
...
@@ -175,6 +180,9 @@ def _url_for_search_similar_threads():
...
@@ -175,6 +180,9 @@ def _url_for_search_similar_threads():
def
_url_for_search_recent_active_threads
():
def
_url_for_search_recent_active_threads
():
return
"{prefix}/search/threads/recent_active"
.
format
(
prefix
=
PREFIX
)
return
"{prefix}/search/threads/recent_active"
.
format
(
prefix
=
PREFIX
)
def
_url_for_search_trending_tags
():
return
"{prefix}/search/tags/trending"
.
format
(
prefix
=
PREFIX
)
def
_url_for_threads_tags
():
def
_url_for_threads_tags
():
return
"{prefix}/threads/tags"
.
format
(
prefix
=
PREFIX
)
return
"{prefix}/threads/tags"
.
format
(
prefix
=
PREFIX
)
...
...
lms/templates/discussion/_trending_tags.html
View file @
2685a3b6
Trending tags:
Trending tags:
<div
class=
"trending-tags"
>
<div
class=
"trending-tags"
>
% for tag
in ['artificial-intelligence', 'java-sucks', '2012']
:
% for tag
, count in trending_tags
:
<div
class=
"trending-tag"
>
<div
class=
"trending-tag"
>
<a
class=
"trending-tag-link"
href=
"javascript:void(0)"
>
${tag}
</a>
<a
class=
"trending-tag-link"
href=
"javascript:void(0)"
>
${tag}
</a>
×
×
<span
class=
"trending-tag-count"
>
100
</span>
<span
class=
"trending-tag-count"
>
${count}
</span>
</div>
</div>
% endfor
% endfor
</div>
</div>
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