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
5df5cf98
Commit
5df5cf98
authored
Aug 08, 2012
by
Mike Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix Close Thread showing for students and empty bracket in search bar
parent
ca2a2d2f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
7 deletions
+10
-7
lms/djangoapps/django_comment_client/forum/views.py
+3
-1
lms/djangoapps/django_comment_client/permissions.py
+3
-4
lms/static/coffee/src/discussion/content.coffee
+2
-0
lms/templates/discussion/_search_bar.html
+1
-1
lms/templates/discussion/_thread.html
+1
-1
No files found.
lms/djangoapps/django_comment_client/forum/views.py
View file @
5df5cf98
...
@@ -149,12 +149,14 @@ def forum_form_discussion(request, course_id, discussion_id):
...
@@ -149,12 +149,14 @@ def forum_form_discussion(request, course_id, discussion_id):
def
get_annotated_content_info
(
course_id
,
content
,
user
,
is_thread
):
def
get_annotated_content_info
(
course_id
,
content
,
user
,
is_thread
):
return
{
permissions
=
{
'editable'
:
check_permissions_by_view
(
user
,
course_id
,
content
,
"update_thread"
if
is_thread
else
"update_comment"
),
'editable'
:
check_permissions_by_view
(
user
,
course_id
,
content
,
"update_thread"
if
is_thread
else
"update_comment"
),
'can_reply'
:
check_permissions_by_view
(
user
,
course_id
,
content
,
"create_comment"
if
is_thread
else
"create_sub_comment"
),
'can_reply'
:
check_permissions_by_view
(
user
,
course_id
,
content
,
"create_comment"
if
is_thread
else
"create_sub_comment"
),
'can_endorse'
:
check_permissions_by_view
(
user
,
course_id
,
content
,
"endorse_comment"
)
if
not
is_thread
else
False
,
'can_endorse'
:
check_permissions_by_view
(
user
,
course_id
,
content
,
"endorse_comment"
)
if
not
is_thread
else
False
,
'can_delete'
:
check_permissions_by_view
(
user
,
course_id
,
content
,
"delete_thread"
if
is_thread
else
"delete_comment"
),
'can_delete'
:
check_permissions_by_view
(
user
,
course_id
,
content
,
"delete_thread"
if
is_thread
else
"delete_comment"
),
'can_openclose'
:
check_permissions_by_view
(
user
,
course_id
,
content
,
"openclose_thread"
)
if
is_thread
else
False
,
}
}
return
permissions
def
get_annotated_content_infos
(
course_id
,
thread
,
user
,
is_thread
=
True
):
def
get_annotated_content_infos
(
course_id
,
thread
,
user
,
is_thread
=
True
):
infos
=
{}
infos
=
{}
...
...
lms/djangoapps/django_comment_client/permissions.py
View file @
5df5cf98
...
@@ -67,11 +67,10 @@ def check_conditions_permissions(user, permissions, course_id, **kwargs):
...
@@ -67,11 +67,10 @@ def check_conditions_permissions(user, permissions, course_id, **kwargs):
VIEW_PERMISSIONS
=
{
VIEW_PERMISSIONS
=
{
'update_thread'
:
[
'edit_content'
,
[
'update_thread'
,
'is_open'
,
'author'
]],
'update_thread'
:
[
'edit_content'
,
[
'update_thread'
,
'is_open'
,
'is_author'
]],
# 'create_comment' : [["create_comment", "is_open"]],
'create_comment'
:
[[
"create_comment"
,
"is_open"
]],
'create_comment'
:
[
"create_comment"
],
'delete_thread'
:
[
'delete_thread'
],
'delete_thread'
:
[
'delete_thread'
],
'update_comment'
:
[
'edit_content'
,
[
'update_comment'
,
'is_open'
,
'author'
]],
'update_comment'
:
[
'edit_content'
,
[
'update_comment'
,
'is_open'
,
'
is_
author'
]],
'endorse_comment'
:
[
'endorse_comment'
],
'endorse_comment'
:
[
'endorse_comment'
],
'openclose_thread'
:
[
'openclose_thread'
],
'openclose_thread'
:
[
'openclose_thread'
],
'create_sub_comment'
:
[[
'create_sub_comment'
,
'is_open'
]],
'create_sub_comment'
:
[[
'create_sub_comment'
,
'is_open'
]],
...
...
lms/static/coffee/src/discussion/content.coffee
View file @
5df5cf98
...
@@ -372,3 +372,5 @@ initializeFollowThread = (thread) ->
...
@@ -372,3 +372,5 @@ initializeFollowThread = (thread) ->
$local
(
".discussion-endorse-control"
).
remove
()
$local
(
".discussion-endorse-control"
).
remove
()
if
not
Discussion
.
getContentInfo
id
,
'can_delete'
if
not
Discussion
.
getContentInfo
id
,
'can_delete'
$local
(
".discussion-delete"
).
remove
()
$local
(
".discussion-delete"
).
remove
()
if
not
Discussion
.
getContentInfo
id
,
'can_openclose'
$local
(
".discussion-openclose"
).
remove
()
lms/templates/discussion/_search_bar.html
View file @
5df5cf98
...
@@ -12,7 +12,7 @@ def base_url_for_search():
...
@@ -12,7 +12,7 @@ def base_url_for_search():
% if query_params.get('tags', None):
% if query_params.get('tags', None):
<input
class=
"search-input"
type=
"text"
value=
"[${tags}]${text}"
id=
"keywords"
autocomplete=
"off"
/>
<input
class=
"search-input"
type=
"text"
value=
"[${tags}]${text}"
id=
"keywords"
autocomplete=
"off"
/>
% else:
% else:
<input
class=
"search-input"
type=
"text"
value=
"
[${tags}]
${text}"
id=
"keywords"
autocomplete=
"off"
/>
<input
class=
"search-input"
type=
"text"
value=
"${text}"
id=
"keywords"
autocomplete=
"off"
/>
% endif
% endif
<div
class=
"discussion-link discussion-search-link"
href=
"javascript:void(0)"
>
Search posts
</div>
<div
class=
"discussion-link discussion-search-link"
href=
"javascript:void(0)"
>
Search posts
</div>
</form>
</form>
lms/templates/discussion/_thread.html
View file @
5df5cf98
...
@@ -98,7 +98,7 @@
...
@@ -98,7 +98,7 @@
<label
class=
"discussion-link"
for=
"discussion-endorse-${content['id']}"
>
Endorsed
</label>
<label
class=
"discussion-link"
for=
"discussion-endorse-${content['id']}"
>
Endorsed
</label>
</span>
</span>
% if type == "thread"
and request.user.is_staff
:
% if type == "thread":
% if content['closed']:
% if content['closed']:
<a
class=
"discussion-openclose"
id=
"discussion-openclose-${content['id']}"
href=
"javascript:void(0);"
>
Re-open thread
</a>
<a
class=
"discussion-openclose"
id=
"discussion-openclose-${content['id']}"
href=
"javascript:void(0);"
>
Re-open thread
</a>
% else:
% else:
...
...
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