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
7e8b1992
Commit
7e8b1992
authored
Aug 06, 2012
by
Mike Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show endorsed checkmark based on permissions
parent
af656fcf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
+10
-5
lms/djangoapps/django_comment_client/forum/views.py
+1
-0
lms/static/coffee/src/discussion/content.coffee
+2
-0
lms/templates/discussion/_thread.html
+7
-5
No files found.
lms/djangoapps/django_comment_client/forum/views.py
View file @
7e8b1992
...
...
@@ -132,6 +132,7 @@ def get_annotated_content_info(content, user, is_thread):
return
{
'editable'
:
check_permissions_by_view
(
user
,
content
,
"update_thread"
if
is_thread
else
"update_comment"
),
'can_reply'
:
check_permissions_by_view
(
user
,
content
,
"create_comment"
if
is_thread
else
"create_sub_comment"
),
'can_endorse'
:
check_permissions_by_view
(
user
,
content
,
"endorse_comment"
)
if
not
is_thread
else
False
,
}
def
get_annotated_content_infos
(
thread
,
user
):
...
...
lms/static/coffee/src/discussion/content.coffee
View file @
7e8b1992
...
...
@@ -324,3 +324,5 @@ initializeFollowThread = (thread) ->
$local
(
".discussion-edit"
).
remove
()
if
not
Discussion
.
getContentInfo
id
,
'can_reply'
$local
(
".discussion-reply"
).
remove
()
if
not
Discussion
.
getContentInfo
id
,
'can_endorse'
$local
(
".discussion-endorse-control"
).
remove
()
lms/templates/discussion/_thread.html
View file @
7e8b1992
...
...
@@ -78,14 +78,16 @@
${render_info(content)}
${render_link("discussion-link discussion-reply discussion-reply-" + type, "Reply")}
${render_link("discussion-link discussion-edit", "Edit")}
% if type == "comment" and request.user.is_staff:
% if content['endorsed']:
<input
type=
"checkbox"
checked=
"checked"
class=
"discussion-link discussion-endorse"
id=
"discussion-endorse-${content['id']}"
>
<span
class=
"discussion-endorse-control"
>
% if content.get('endorsed', False):
<input
type=
"checkbox"
checked=
"checked"
class=
"discussion-link discussion-endorse"
id=
"discussion-endorse-${content['id']}"
/>
% else:
<input
type=
"checkbox"
class=
"discussion-link discussion-endorse"
id=
"discussion-endorse-${content['id']}"
>
<input
type=
"checkbox"
class=
"discussion-link discussion-endorse"
id=
"discussion-endorse-${content['id']}"
/
>
% endif
<label
class=
"discussion-link"
for=
"discussion-endorse-${content['id']}"
>
Endorsed
</label>
% endif
</span>
% if type == "thread" and request.user.is_staff:
% if content['closed']:
<a
class=
"discussion-openclose"
id=
"discussion-openclose-${content['id']}"
href=
"javascript:void(0);"
>
Re-open thread
</a>
...
...
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