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
e58af446
Commit
e58af446
authored
Aug 29, 2012
by
Ibrahim Awwal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Annotate comment content wrappers with classes for the roles of the author.
parent
08b233f6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletions
+6
-1
lms/djangoapps/django_comment_client/utils.py
+5
-0
lms/templates/discussion/mustache/_content.mustache
+1
-1
No files found.
lms/djangoapps/django_comment_client/utils.py
View file @
e58af446
...
...
@@ -8,7 +8,9 @@ from django.utils import simplejson
from
django.db
import
connection
from
django.conf
import
settings
from
django.core.urlresolvers
import
reverse
from
django.contrib.auth.models
import
User
from
django_comment_client.permissions
import
check_permissions_by_view
from
django_comment_client.models
import
Role
from
mitxmako
import
middleware
import
logging
...
...
@@ -212,11 +214,14 @@ def permalink(content):
args
=
[
content
[
'course_id'
],
content
[
'commentable_id'
],
content
[
'thread_id'
]])
+
'#'
+
content
[
'id'
]
def
extend_content
(
content
):
user
=
User
.
objects
.
get
(
pk
=
content
[
'user_id'
])
roles
=
dict
([(
'name'
,
role
.
name
.
lower
())
for
role
in
user
.
roles
.
filter
(
course_id
=
content
[
'course_id'
])])
content_info
=
{
'displayed_title'
:
content
.
get
(
'highlighted_title'
)
or
content
.
get
(
'title'
,
''
),
'displayed_body'
:
content
.
get
(
'highlighted_body'
)
or
content
.
get
(
'body'
,
''
),
'raw_tags'
:
','
.
join
(
content
.
get
(
'tags'
,
[])),
'permalink'
:
permalink
(
content
),
'roles'
:
roles
,
}
return
merge_dict
(
content
,
content_info
)
...
...
lms/templates/discussion/mustache/_content.mustache
View file @
e58af446
<div
class=
"discussion-content local"
>
<div
class=
"discussion-content-wrapper"
>
<div
class=
"discussion-content-wrapper
{{#
content
.
roles
}}
role-
{{
name
}}{{/
content
.
roles
}}
"
>
<div
class=
"discussion-votes"
>
<a
class=
"discussion-vote discussion-vote-up"
href=
"javascript:void(0)"
value=
"up"
>
▲
</a>
<div
class=
"discussion-votes-point"
>
{{
content
.
votes
.
point
}}
</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