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
a90af0c4
Commit
a90af0c4
authored
Aug 21, 2012
by
Rocky Duan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
render permalink in backend
parent
654075e0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
3 deletions
+10
-3
lms/djangoapps/django_comment_client/helpers.py
+7
-0
lms/lib/comment_client/comment.py
+1
-1
lms/static/coffee/src/backbone_discussion/content.coffee
+1
-1
lms/templates/discussion/mustache/_content.mustache
+1
-1
No files found.
lms/djangoapps/django_comment_client/helpers.py
View file @
a90af0c4
...
...
@@ -2,6 +2,7 @@ from django.core.urlresolvers import reverse
from
django.conf
import
settings
from
mitxmako.shortcuts
import
render_to_string
from
mustache_helpers
import
mustache_helpers
from
django.core.urlresolvers
import
reverse
from
functools
import
partial
from
utils
import
*
...
...
@@ -40,6 +41,12 @@ def render_content(content, additional_context={}):
'displayed_body'
:
content
.
get
(
'highlighted_body'
)
or
content
.
get
(
'body'
,
''
),
'raw_tags'
:
','
.
join
(
content
.
get
(
'tags'
,
[])),
}
if
content
[
'type'
]
==
'thread'
:
content_info
[
'permalink'
]
=
reverse
(
'django_comment_client.forum.views.single_thread'
,
args
=
[
content
[
'course_id'
],
content
[
'commentable_id'
],
content
[
'id'
]])
else
:
content_info
[
'permalink'
]
=
reverse
(
'django_comment_client.forum.views.single_thread'
,
args
=
[
content
[
'course_id'
],
content
[
'commentable_id'
],
content
[
'thread_id'
]])
+
'#'
+
content
[
'id'
]
context
=
{
'content'
:
merge_dict
(
content
,
content_info
),
content
[
'type'
]:
True
,
...
...
lms/lib/comment_client/comment.py
View file @
a90af0c4
...
...
@@ -10,7 +10,7 @@ class Comment(models.Model):
'endorsed'
,
'parent_id'
,
'thread_id'
,
'username'
,
'votes'
,
'user_id'
,
'closed'
,
'created_at'
,
'updated_at'
,
'depth'
,
'at_position_list'
,
'type'
,
'at_position_list'
,
'type'
,
'commentable_id'
,
]
updatable_fields
=
[
...
...
lms/static/coffee/src/backbone_discussion/content.coffee
View file @
a90af0c4
...
...
@@ -344,7 +344,7 @@ class @ContentView extends Backbone.View
@
initLocal
()
@
initTimeago
()
@
initBody
()
@
initPermalink
()
#
@initPermalink()
@
initCommentViews
()
class
@
Thread
extends
@
Content
...
...
lms/templates/discussion/mustache/_content.mustache
View file @
a90af0c4
...
...
@@ -55,7 +55,7 @@
{{#
thread
}}
<li><div
class=
"follow-wrapper"
><a
class=
"discussion-link discussion-follow-thread"
href=
"javascript:void(0)"
>
Follow
</a></div></li>
{{/
thread
}}
<li><a
class=
"discussion-link discussion-permanent-link"
href=
"
javascript:void(0)
"
>
Permanent Link
</a></li>
<li><a
class=
"discussion-link discussion-permanent-link"
href=
"
{{
content
.
permalink
}}
"
>
Permanent Link
</a></li>
</ul>
</div>
</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