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
db0549be
Commit
db0549be
authored
Sep 07, 2012
by
David Ormsbee
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #594 from MITx/feature/ibrahim/discussion_distinguish_instructors
Feature/ibrahim/discussion distinguish instructors
parents
8312ddf0
b276d8b4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
3 deletions
+30
-3
lms/djangoapps/django_comment_client/utils.py
+6
-0
lms/static/coffee/src/discussion/content.coffee
+3
-0
lms/static/sass/_discussion.scss
+15
-0
lms/templates/discussion/mustache/_content.mustache
+6
-3
No files found.
lms/djangoapps/django_comment_client/utils.py
View file @
db0549be
...
...
@@ -9,7 +9,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
...
...
@@ -226,11 +228,15 @@ 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
,
'updated'
:
content
[
'created_at'
]
!=
content
[
'updated_at'
],
}
return
merge_dict
(
content
,
content_info
)
...
...
lms/static/coffee/src/discussion/content.coffee
View file @
db0549be
...
...
@@ -374,6 +374,9 @@ if Backbone?
MathJax
.
Hub
.
Queue
[
"Typeset"
,
MathJax
.
Hub
,
$contentBody
.
attr
(
"id"
)]
initTimeago
:
->
@
$
(
"span.timeago"
).
each
(
index
,
element
)
->
elem
=
$
(
element
)
elem
.
html
(
"posted on
#{
$
.
timeago
.
parse
(
elem
.
html
()).
toLocaleString
()
}
"
)
@
$
(
"span.timeago"
).
timeago
()
renderPartial
:
->
...
...
lms/static/sass/_discussion.scss
View file @
db0549be
...
...
@@ -390,6 +390,14 @@ $tag-text-color: #5b614f;
color
:
#dea03e
;
}
}
.author-moderator
:after
{
content
:
" (moderator)"
}
.author-administrator
:after
{
content
:
" (instructor)"
}
}
.discussion-content
{
...
...
@@ -415,6 +423,13 @@ $tag-text-color: #5b614f;
}
}
// Role based styles
.role-moderator
{
background-color
:
#eafcfc
;
}
.role-administrator
{
background-color
:
#eafcea
;
}
//COMMENT STYLES
.comments
{
overflow
:
hidden
;
...
...
lms/templates/discussion/mustache/_content.mustache
View file @
db0549be
<div
class=
"discussion-content local"
>
<div
class=
"discussion-content local
{{#
content
.
roles
}}
role-
{{
name
}}{{/
content
.
roles
}}
"
>
<div
class=
"discussion-content-wrapper"
>
<div
class=
"discussion-votes"
>
<a
class=
"discussion-vote discussion-vote-up"
href=
"javascript:void(0)"
value=
"up"
>
▲
</a>
...
...
@@ -34,12 +34,15 @@
</div>
<div
class=
"info"
>
<div
class=
"comment-time"
>
<span
class=
"timeago"
title=
"
{{
content
.
updated_at
}}
"
>
sometime
</span>
by
{{#
content
.
updated
}}
updated
{{/
content
.
updated
}}
<span
class=
"timeago"
title=
"
{{
content
.
updated_at
}}
"
>
{{
content
.
created_at
}}
</span>
by
{{#
content
.
anonymous
}}
anonymous
{{/
content
.
anonymous
}}
{{^
content
.
anonymous
}}
<a
href=
"
{{#
#
url_for_user
}}{{
content
.
user_id
}}{{/
url_for_user
}}
"
>
{{
content
.
username
}}
</a>
<a
href=
"
{{#
#
url_for_user
}}{{
content
.
user_id
}}{{/
url_for_user
}}
"
class=
"
{{#
content
.
roles
}}
author-
{{
name
}}
{{/
content
.
roles
}}
"
>
{{
content
.
username
}}
</a>
{{/
content
.
anonymous
}}
</div>
<div
class=
"show-comments-wrapper"
>
...
...
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