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
470e4027
Commit
470e4027
authored
Mar 15, 2013
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
patch for backward compatibility
parent
7eb4970f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
3 deletions
+22
-3
lms/djangoapps/django_comment_client/base/views.py
+3
-0
lms/djangoapps/django_comment_client/forum/views.py
+10
-0
lms/templates/discussion/_underscore_templates.html
+9
-3
No files found.
lms/djangoapps/django_comment_client/base/views.py
View file @
470e4027
...
...
@@ -116,6 +116,9 @@ def create_thread(request, course_id, commentable_id):
thread
.
save
()
#patch for backward compatibility with comments service
thread
[
'pinned'
]
=
False
if
post
.
get
(
'auto_subscribe'
,
'false'
)
.
lower
()
==
'true'
:
user
=
cc
.
User
.
from_django_user
(
request
.
user
)
user
.
follow
(
thread
)
...
...
lms/djangoapps/django_comment_client/forum/views.py
View file @
470e4027
...
...
@@ -98,6 +98,9 @@ def get_threads(request, course_id, discussion_id=None, per_page=THREADS_PER_PAG
else
:
thread
[
'group_name'
]
=
""
thread
[
'group_string'
]
=
"This post visible to everyone."
#temporary patch for backward compatibility to comments service
thread
[
'pinning'
]
=
False
query_params
[
'page'
]
=
page
query_params
[
'num_pages'
]
=
num_pages
...
...
@@ -245,6 +248,10 @@ def single_thread(request, course_id, discussion_id, thread_id):
try
:
thread
=
cc
.
Thread
.
find
(
thread_id
)
.
retrieve
(
recursive
=
True
,
user_id
=
request
.
user
.
id
)
#temporary patch for backward compatibility with comments service
thread
[
"pinned"
]
=
False
except
(
cc
.
utils
.
CommentClientError
,
cc
.
utils
.
CommentClientUnknownError
)
as
err
:
log
.
error
(
"Error loading single thread."
)
raise
Http404
...
...
@@ -285,6 +292,9 @@ def single_thread(request, course_id, discussion_id, thread_id):
if
thread
.
get
(
'group_id'
)
and
not
thread
.
get
(
'group_name'
):
thread
[
'group_name'
]
=
get_cohort_by_id
(
course_id
,
thread
.
get
(
'group_id'
))
.
name
#temporary patch for backward compatibility with comments service
thread
[
"pinned"
]
=
False
threads
=
[
utils
.
safe_content
(
thread
)
for
thread
in
threads
]
#recent_active_threads = cc.search_recent_active_threads(
...
...
lms/templates/discussion/_underscore_templates.html
View file @
470e4027
...
...
@@ -45,11 +45,17 @@
<
/header
>
<
div
class
=
"post-body"
>
$
{
'<%- body %>'
}
<
/div
>
%
if
course
and
has_permission
(
user
,
'openclose_thread'
,
course
.
id
):
<!--
temporary
patch
for
backward
compatibility
with
comments
service
-->
%
if
course
and
has_permission
(
user
,
'openclose_thread'
,
course
.
id
)
and
False
:
<
div
class
=
"admin-pin discussion-pin notpinned"
data
-
role
=
"thread-pin"
data
-
tooltip
=
"pin this thread"
>
<
i
class
=
"icon"
><
/i><span class="pin-label">Pin Thread</
span
><
/div>
%
else
:
<!--
secondary
patch
for
backward
compatibility
with
comments
service
-->
%
elif
False
:
$
{
"<% if (pinned) { %>"
}
<
div
class
=
"discussion-pin notpinned"
data
-
role
=
"thread-pin"
data
-
tooltip
=
"pin this thread"
>
<
i
class
=
"icon"
><
/i><span class="pin-label">Pin Thread</
span
><
/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