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
20926e83
Commit
20926e83
authored
Aug 05, 2012
by
Rocky Duan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed ajax retrieved search bar in forum view
parent
cacd58ca
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
23 deletions
+19
-23
lms/djangoapps/django_comment_client/forum/views.py
+13
-11
lms/static/coffee/src/discussion/discussion.coffee
+2
-8
lms/templates/discussion/_forum.html
+1
-1
lms/templates/discussion/_inline.html
+1
-1
lms/templates/discussion/_paginator.html
+1
-1
lms/templates/discussion/_sort.html
+1
-1
No files found.
lms/djangoapps/django_comment_client/forum/views.py
View file @
20926e83
...
@@ -43,12 +43,10 @@ def render_discussion(request, course_id, threads, discussion_id=None, \
...
@@ -43,12 +43,10 @@ def render_discussion(request, course_id, threads, discussion_id=None, \
'forum'
:
'discussion/_forum.html'
,
'forum'
:
'discussion/_forum.html'
,
}[
discussion_type
]
}[
discussion_type
]
"""
base_url = {
base_url
=
{
'inline'
:
(
lambda
:
reverse
(
'django_comment_client.forum.views.inline_discussion'
,
args
=
[
course_id
,
discussion_id
])),
'inline'
:
(
lambda
:
reverse
(
'django_comment_client.forum.views.inline_discussion'
,
args
=
[
course_id
,
discussion_id
])),
'forum'
:
(
lambda
:
reverse
(
'django_comment_client.forum.views.forum_form_discussion'
,
args
=
[
course_id
,
discussion_id
])),
'forum'
:
(
lambda
:
reverse
(
'django_comment_client.forum.views.forum_form_discussion'
,
args
=
[
course_id
,
discussion_id
])),
}[discussion_type]()"""
}[
discussion_type
]()
base_url
=
reverse
(
'django_comment_client.forum.views.inline_discussion'
,
args
=
[
course_id
,
discussion_id
])
annotated_content_info
=
{
thread
[
'id'
]:
get_annotated_content_info
(
thread
,
request
.
user
.
id
)
for
thread
in
threads
}
annotated_content_info
=
{
thread
[
'id'
]:
get_annotated_content_info
(
thread
,
request
.
user
.
id
)
for
thread
in
threads
}
...
@@ -116,13 +114,17 @@ def forum_form_discussion(request, course_id, discussion_id):
...
@@ -116,13 +114,17 @@ def forum_form_discussion(request, course_id, discussion_id):
threads
,
query_params
=
get_threads
(
request
,
course_id
,
discussion_id
)
threads
,
query_params
=
get_threads
(
request
,
course_id
,
discussion_id
)
content
=
render_forum_discussion
(
request
,
course_id
,
threads
,
discussion_id
=
discussion_id
,
\
content
=
render_forum_discussion
(
request
,
course_id
,
threads
,
discussion_id
=
discussion_id
,
\
query_params
=
query_params
)
query_params
=
query_params
)
context
=
{
'csrf'
:
csrf
(
request
)[
'csrf_token'
],
if
request
.
is_ajax
():
'course'
:
course
,
return
utils
.
HtmlResponse
(
content
)
'content'
:
content
,
else
:
'accordion'
:
render_accordion
(
request
,
course
,
discussion_id
),
context
=
{
}
'csrf'
:
csrf
(
request
)[
'csrf_token'
],
return
render_to_response
(
'discussion/index.html'
,
context
)
'course'
:
course
,
'content'
:
content
,
'accordion'
:
render_accordion
(
request
,
course
,
discussion_id
),
}
return
render_to_response
(
'discussion/index.html'
,
context
)
def
get_annotated_content_info
(
content
,
user_id
):
def
get_annotated_content_info
(
content
,
user_id
):
...
...
lms/static/coffee/src/discussion/discussion.coffee
View file @
20926e83
...
@@ -122,13 +122,7 @@ initializeFollowDiscussion = (discussion) ->
...
@@ -122,13 +122,7 @@ initializeFollowDiscussion = (discussion) ->
Discussion
.
bindLocalEvents
$local
,
Discussion
.
bindLocalEvents
$local
,
"submit .search-wrapper-forum>.discussion-search-form"
:
(
event
)
->
"submit .search-wrapper>.discussion-search-form"
:
(
event
)
->
event
.
preventDefault
()
text
=
$local
(
".search-input"
).
val
()
isSearchWithinBoard
=
$local
(
".discussion-search-within-board"
).
is
(
":checked"
)
handleSearch
(
text
,
isSearchWithinBoard
)
"submit .search-wrapper-inline>.discussion-search-form"
:
(
event
)
->
event
.
preventDefault
()
event
.
preventDefault
()
handleAjaxSearch
(
this
)
handleAjaxSearch
(
this
)
...
@@ -138,7 +132,7 @@ initializeFollowDiscussion = (discussion) ->
...
@@ -138,7 +132,7 @@ initializeFollowDiscussion = (discussion) ->
"click .discussion-search-link"
:
->
"click .discussion-search-link"
:
->
handleAjaxSearch
(
this
)
handleAjaxSearch
(
this
)
"click .discussion-
inline-
sort-link"
:
->
"click .discussion-sort-link"
:
->
handleAjaxSort
(
this
)
handleAjaxSort
(
this
)
$discussion
.
children
(
".discussion-paginator"
).
find
(
".discussion-inline-page-link"
).
click
->
$discussion
.
children
(
".discussion-paginator"
).
find
(
".discussion-inline-page-link"
).
click
->
...
...
lms/templates/discussion/_forum.html
View file @
20926e83
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<div
class=
"discussion-title-wrapper"
>
<div
class=
"discussion-title-wrapper"
>
<a
class=
"discussion-title"
href=
"javascript:void(0)"
>
Discussion
</a>
<a
class=
"discussion-title"
href=
"javascript:void(0)"
>
Discussion
</a>
</div>
</div>
<div
class=
"search-wrapper
-forum
"
>
<div
class=
"search-wrapper"
>
<
%
include
file=
"_search_bar.html"
/>
<
%
include
file=
"_search_bar.html"
/>
</div>
</div>
<div
class=
"search-within"
>
<div
class=
"search-within"
>
...
...
lms/templates/discussion/_inline.html
View file @
20926e83
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<section
class=
"discussion inline-discussion"
_id=
"${discussion_id}"
>
<section
class=
"discussion inline-discussion"
_id=
"${discussion_id}"
>
<div
class=
"discussion-non-content"
>
<div
class=
"discussion-non-content"
>
<div
class=
"search-wrapper-inline"
>
<div
class=
"search-wrapper-inline
search-wrapper
"
>
<
%
include
file=
"_search_bar.html"
/>
<
%
include
file=
"_search_bar.html"
/>
</div>
</div>
<div
class=
"discussion-new-post control-button"
href=
"javascript:void(0)"
>
New Post
</div>
<div
class=
"discussion-new-post control-button"
href=
"javascript:void(0)"
>
New Post
</div>
...
...
lms/templates/discussion/_paginator.html
View file @
20926e83
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
%
>
%
>
<
%
def
name=
"link_to_page(_page, text)"
>
<
%
def
name=
"link_to_page(_page, text)"
>
<a
class=
"discussion-page-link
discussion-inline-page-link
"
href=
"javascript:void(0)"
page-url=
"${url_for_page(_page)}"
>
${text}
</a>
<a
class=
"discussion-page-link"
href=
"javascript:void(0)"
page-url=
"${url_for_page(_page)}"
>
${text}
</a>
</
%
def>
</
%
def>
<
%
def
name=
"div_page(_page)"
>
<
%
def
name=
"div_page(_page)"
>
...
...
lms/templates/discussion/_sort.html
View file @
20926e83
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
def
url_for_sort
(
key
,
order
)
:
def
url_for_sort
(
key
,
order
)
:
return
base_url
+
'?'
+
urlencode
(
merge
(
query_params
,
{'
page
'
:
1
,
'
sort_key
'
:
key
,
'
sort_order
'
:
order
}))
return
base_url
+
'?'
+
urlencode
(
merge
(
query_params
,
{'
page
'
:
1
,
'
sort_key
'
:
key
,
'
sort_order
'
:
order
}))
%
>
%
>
<a
class=
"discussion-sort-link
discussion-inline-sort-link
${cls}"
href=
"javascript:void(0)"
sort-url=
"${url_for_sort(key, order)}"
>
${title}
</a>
<a
class=
"discussion-sort-link ${cls}"
href=
"javascript:void(0)"
sort-url=
"${url_for_sort(key, order)}"
>
${title}
</a>
</
%
def>
</
%
def>
<div
class=
"discussion-sort"
>
<div
class=
"discussion-sort"
>
...
...
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