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
2811822b
Commit
2811822b
authored
Sep 06, 2012
by
Ibrahim Awwal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Attach the discussion_id to posts made from the embedded discussion forum.
parent
00d21acd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
8 deletions
+9
-8
lms/static/coffee/src/discussion/discussion_module_view.coffee
+5
-5
lms/static/coffee/src/discussion/views/new_post_inline_vew.coffee
+1
-1
lms/templates/discussion/_discussion_module.html
+1
-1
lms/templates/discussion/mustache/_inline_discussion.mustache
+2
-1
No files found.
lms/static/coffee/src/discussion/discussion_module_view.coffee
View file @
2811822b
...
@@ -26,23 +26,23 @@ if Backbone?
...
@@ -26,23 +26,23 @@ if Backbone?
@
showed
=
true
@
showed
=
true
else
else
$elem
=
$
(
event
.
target
)
$elem
=
$
(
event
.
target
)
discussion
_id
=
$elem
.
attr
(
"discussion_
id"
)
discussion
Id
=
$elem
.
data
(
"discussion-
id"
)
url
=
DiscussionUtil
.
urlFor
'retrieve_discussion'
,
discussion
_i
d
url
=
DiscussionUtil
.
urlFor
'retrieve_discussion'
,
discussion
I
d
DiscussionUtil
.
safeAjax
DiscussionUtil
.
safeAjax
$elem
:
$elem
$elem
:
$elem
$loading
:
$elem
$loading
:
$elem
url
:
url
url
:
url
type
:
"GET"
type
:
"GET"
dataType
:
'json'
dataType
:
'json'
success
:
(
response
,
textStatus
,
jqXHR
)
=>
@
createDiscussion
(
event
,
response
,
textStatus
)
success
:
(
response
,
textStatus
,
jqXHR
)
=>
@
createDiscussion
(
event
,
response
,
textStatus
,
discussionId
)
createDiscussion
:
(
event
,
response
,
textStatus
)
=>
createDiscussion
:
(
event
,
response
,
textStatus
,
discussionId
)
=>
window
.
user
=
new
DiscussionUser
(
response
.
user_info
)
window
.
user
=
new
DiscussionUser
(
response
.
user_info
)
Content
.
loadContentInfos
(
response
.
annotated_content_info
)
Content
.
loadContentInfos
(
response
.
annotated_content_info
)
$
(
event
.
target
).
html
(
"Hide Discussion"
)
$
(
event
.
target
).
html
(
"Hide Discussion"
)
@
discussion
=
new
Discussion
()
@
discussion
=
new
Discussion
()
@
discussion
.
reset
(
response
.
discussion_data
,
{
silent
:
false
})
@
discussion
.
reset
(
response
.
discussion_data
,
{
silent
:
false
})
$discussion
=
$
(
Mustache
.
render
$
(
"script#_inline_discussion"
).
html
(),
{
'threads'
:
response
.
discussion_data
})
$discussion
=
$
(
Mustache
.
render
$
(
"script#_inline_discussion"
).
html
(),
{
'threads'
:
response
.
discussion_data
,
'discussionId'
:
discussionId
})
$
(
".discussion-module"
).
append
(
$discussion
)
$
(
".discussion-module"
).
append
(
$discussion
)
@
newPostForm
=
$
(
'.new-post-article'
)
@
newPostForm
=
$
(
'.new-post-article'
)
@
threadviews
=
@
discussion
.
map
(
thread
)
->
@
threadviews
=
@
discussion
.
map
(
thread
)
->
...
...
lms/static/coffee/src/discussion/views/new_post_inline_vew.coffee
View file @
2811822b
...
@@ -2,7 +2,7 @@ class @NewPostInlineView extends Backbone.View
...
@@ -2,7 +2,7 @@ class @NewPostInlineView extends Backbone.View
initialize
:
()
->
initialize
:
()
->
@
topicId
=
@
$
(
".topic"
).
first
().
data
(
"discussion
_
id"
)
@
topicId
=
@
$
(
".topic"
).
first
().
data
(
"discussion
-
id"
)
@
maxNameWidth
=
100
@
maxNameWidth
=
100
...
...
lms/templates/discussion/_discussion_module.html
View file @
2811822b
<
%
include
file=
"_underscore_templates.html"
/>
<
%
include
file=
"_underscore_templates.html"
/>
<div
class=
"discussion-module"
>
<div
class=
"discussion-module"
>
<a
class=
"discussion-show control-button"
href=
"javascript:void(0)"
d
iscussion_
id=
"${discussion_id | h}"
>
Show Discussion
</a>
<a
class=
"discussion-show control-button"
href=
"javascript:void(0)"
d
ata-discussion-
id=
"${discussion_id | h}"
>
Show Discussion
</a>
</div>
</div>
lms/templates/discussion/mustache/_inline_discussion.mustache
View file @
2811822b
<section
class=
"discussion"
>
<section
class=
"discussion"
data-discussion-id=
"
{{
discussionId
}}
"
>
<a
href=
"#"
class=
"new-post-btn"
><span
class=
"new-post-icon"
></span>
New Post
</a>
<a
href=
"#"
class=
"new-post-btn"
><span
class=
"new-post-icon"
></span>
New Post
</a>
<article
class=
"new-post-article"
>
<article
class=
"new-post-article"
>
<span
class=
"topic"
data-discussion-id=
"
{{
discussionId
}}
"
/>
<div
class=
"inner-wrapper"
>
<div
class=
"inner-wrapper"
>
<div
class=
"new-post-form-errors"
>
<div
class=
"new-post-form-errors"
>
</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