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
4f680ee0
Commit
4f680ee0
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
a7a24c44
87c8c6c2
Hide 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 @
4f680ee0
...
@@ -9,7 +9,9 @@ from django.utils import simplejson
...
@@ -9,7 +9,9 @@ from django.utils import simplejson
from
django.db
import
connection
from
django.db
import
connection
from
django.conf
import
settings
from
django.conf
import
settings
from
django.core.urlresolvers
import
reverse
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.permissions
import
check_permissions_by_view
from
django_comment_client.models
import
Role
from
mitxmako
import
middleware
from
mitxmako
import
middleware
import
logging
import
logging
...
@@ -226,11 +228,15 @@ def permalink(content):
...
@@ -226,11 +228,15 @@ def permalink(content):
args
=
[
content
[
'course_id'
],
content
[
'commentable_id'
],
content
[
'thread_id'
]])
+
'#'
+
content
[
'id'
]
args
=
[
content
[
'course_id'
],
content
[
'commentable_id'
],
content
[
'thread_id'
]])
+
'#'
+
content
[
'id'
]
def
extend_content
(
content
):
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
=
{
content_info
=
{
'displayed_title'
:
content
.
get
(
'highlighted_title'
)
or
content
.
get
(
'title'
,
''
),
'displayed_title'
:
content
.
get
(
'highlighted_title'
)
or
content
.
get
(
'title'
,
''
),
'displayed_body'
:
content
.
get
(
'highlighted_body'
)
or
content
.
get
(
'body'
,
''
),
'displayed_body'
:
content
.
get
(
'highlighted_body'
)
or
content
.
get
(
'body'
,
''
),
'raw_tags'
:
','
.
join
(
content
.
get
(
'tags'
,
[])),
'raw_tags'
:
','
.
join
(
content
.
get
(
'tags'
,
[])),
'permalink'
:
permalink
(
content
),
'permalink'
:
permalink
(
content
),
'roles'
:
roles
,
'updated'
:
content
[
'created_at'
]
!=
content
[
'updated_at'
],
}
}
return
merge_dict
(
content
,
content_info
)
return
merge_dict
(
content
,
content_info
)
...
...
lms/static/coffee/src/discussion/content.coffee
View file @
4f680ee0
...
@@ -374,6 +374,9 @@ if Backbone?
...
@@ -374,6 +374,9 @@ if Backbone?
MathJax
.
Hub
.
Queue
[
"Typeset"
,
MathJax
.
Hub
,
$contentBody
.
attr
(
"id"
)]
MathJax
.
Hub
.
Queue
[
"Typeset"
,
MathJax
.
Hub
,
$contentBody
.
attr
(
"id"
)]
initTimeago
:
->
initTimeago
:
->
@
$
(
"span.timeago"
).
each
(
index
,
element
)
->
elem
=
$
(
element
)
elem
.
html
(
"posted on
#{
$
.
timeago
.
parse
(
elem
.
html
()).
toLocaleString
()
}
"
)
@
$
(
"span.timeago"
).
timeago
()
@
$
(
"span.timeago"
).
timeago
()
renderPartial
:
->
renderPartial
:
->
...
...
lms/static/sass/_discussion.scss
View file @
4f680ee0
...
@@ -390,6 +390,14 @@ $tag-text-color: #5b614f;
...
@@ -390,6 +390,14 @@ $tag-text-color: #5b614f;
color
:
#dea03e
;
color
:
#dea03e
;
}
}
}
}
.author-moderator
:after
{
content
:
" (moderator)"
}
.author-administrator
:after
{
content
:
" (instructor)"
}
}
}
.discussion-content
{
.discussion-content
{
...
@@ -415,6 +423,13 @@ $tag-text-color: #5b614f;
...
@@ -415,6 +423,13 @@ $tag-text-color: #5b614f;
}
}
}
}
// Role based styles
.role-moderator
{
background-color
:
#eafcfc
;
}
.role-administrator
{
background-color
:
#eafcea
;
}
//COMMENT STYLES
//COMMENT STYLES
.comments
{
.comments
{
overflow
:
hidden
;
overflow
:
hidden
;
...
...
lms/templates/discussion/mustache/_content.mustache
View file @
4f680ee0
<div
class=
"discussion-content local"
>
<div
class=
"discussion-content local
{{#
content
.
roles
}}
role-
{{
name
}}{{/
content
.
roles
}}
"
>
<div
class=
"discussion-content-wrapper"
>
<div
class=
"discussion-content-wrapper"
>
<div
class=
"discussion-votes"
>
<div
class=
"discussion-votes"
>
<a
class=
"discussion-vote discussion-vote-up"
href=
"javascript:void(0)"
value=
"up"
>
▲
</a>
<a
class=
"discussion-vote discussion-vote-up"
href=
"javascript:void(0)"
value=
"up"
>
▲
</a>
...
@@ -34,12 +34,15 @@
...
@@ -34,12 +34,15 @@
</div>
</div>
<div
class=
"info"
>
<div
class=
"info"
>
<div
class=
"comment-time"
>
<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
}}
{{#
content
.
anonymous
}}
anonymous
anonymous
{{/
content
.
anonymous
}}
{{/
content
.
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
}}
{{/
content
.
anonymous
}}
</div>
</div>
<div
class=
"show-comments-wrapper"
>
<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