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
d6bece9b
Commit
d6bece9b
authored
Aug 29, 2012
by
Matthew Mongeau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move user to window. Mark followed threads in list view.
parent
4735ce0a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
7 deletions
+7
-7
lms/static/coffee/src/discussion/discussion_router.coffee
+1
-2
lms/static/coffee/src/discussion/views/discussion_thread_view.coffee
+2
-3
lms/static/coffee/src/discussion/views/thread_list_item_view.coffee
+2
-0
lms/templates/discussion/single_thread.html
+2
-2
No files found.
lms/static/coffee/src/discussion/discussion_router.coffee
View file @
d6bece9b
...
@@ -4,7 +4,6 @@ class @DiscussionRouter extends Backbone.Router
...
@@ -4,7 +4,6 @@ class @DiscussionRouter extends Backbone.Router
":forum_name/threads/:thread_id"
:
"showThread"
":forum_name/threads/:thread_id"
:
"showThread"
initialize
:
(
options
)
->
initialize
:
(
options
)
->
@
user
=
options
[
'user'
]
@
discussion
=
options
[
'discussion'
]
@
discussion
=
options
[
'discussion'
]
@
nav
=
new
DiscussionThreadListView
(
collection
:
@
discussion
,
el
:
$
(
".post-list"
))
@
nav
=
new
DiscussionThreadListView
(
collection
:
@
discussion
,
el
:
$
(
".post-list"
))
@
nav
.
on
"thread:selected"
,
@
navigateToThread
@
nav
.
on
"thread:selected"
,
@
navigateToThread
...
@@ -16,7 +15,7 @@ class @DiscussionRouter extends Backbone.Router
...
@@ -16,7 +15,7 @@ class @DiscussionRouter extends Backbone.Router
showThread
:
(
forum_name
,
thread_id
)
->
showThread
:
(
forum_name
,
thread_id
)
->
@
nav
.
setActiveThread
(
thread_id
)
@
nav
.
setActiveThread
(
thread_id
)
thread
=
@
discussion
.
get
(
thread_id
)
thread
=
@
discussion
.
get
(
thread_id
)
view
=
new
DiscussionThreadView
(
el
:
$
(
".discussion-column"
),
model
:
thread
,
user
:
@
user
)
view
=
new
DiscussionThreadView
(
el
:
$
(
".discussion-column"
),
model
:
thread
)
view
.
render
()
view
.
render
()
navigateToThread
:
(
thread_id
)
=>
navigateToThread
:
(
thread_id
)
=>
...
...
lms/static/coffee/src/discussion/views/discussion_thread_view.coffee
View file @
d6bece9b
...
@@ -5,7 +5,6 @@ class @DiscussionThreadView extends Backbone.View
...
@@ -5,7 +5,6 @@ class @DiscussionThreadView extends Backbone.View
template
:
_
.
template
(
$
(
"#thread-template"
).
html
())
template
:
_
.
template
(
$
(
"#thread-template"
).
html
())
initialize
:
(
options
)
->
initialize
:
(
options
)
->
@
user
=
options
[
'user'
]
@
model
.
bind
"change"
,
@
updateModelDetails
@
model
.
bind
"change"
,
@
updateModelDetails
@
$el
.
html
(
@
template
(
@
model
.
toJSON
()))
@
$el
.
html
(
@
template
(
@
model
.
toJSON
()))
...
@@ -13,10 +12,10 @@ class @DiscussionThreadView extends Backbone.View
...
@@ -13,10 +12,10 @@ class @DiscussionThreadView extends Backbone.View
@
$
(
".votes-count-number"
).
html
(
@
model
.
get
(
"votes"
)[
"up_count"
])
@
$
(
".votes-count-number"
).
html
(
@
model
.
get
(
"votes"
)[
"up_count"
])
render
:
->
render
:
->
if
@
user
.
following
(
@
model
)
if
window
.
user
.
following
(
@
model
)
@
$
(
".dogear"
).
addClass
(
"is-followed"
)
@
$
(
".dogear"
).
addClass
(
"is-followed"
)
if
@
user
.
voted
(
@
model
)
if
window
.
user
.
voted
(
@
model
)
@
$
(
".vote-btn"
).
addClass
(
"is-cast"
)
@
$
(
".vote-btn"
).
addClass
(
"is-cast"
)
@
$
(
"span.timeago"
).
timeago
()
@
$
(
"span.timeago"
).
timeago
()
@
renderResponses
()
@
renderResponses
()
...
...
lms/static/coffee/src/discussion/views/thread_list_item_view.coffee
View file @
d6bece9b
...
@@ -7,6 +7,8 @@ class @ThreadListItemView extends Backbone.View
...
@@ -7,6 +7,8 @@ class @ThreadListItemView extends Backbone.View
@
model
.
on
"change"
,
@
render
@
model
.
on
"change"
,
@
render
render
:
=>
render
:
=>
@
$el
.
html
(
@
template
(
@
model
.
toJSON
()))
@
$el
.
html
(
@
template
(
@
model
.
toJSON
()))
if
window
.
user
.
following
(
@
model
)
@
$
(
"a"
).
addClass
(
"followed"
)
@
@
threadSelected
:
->
threadSelected
:
->
@
trigger
(
"thread:selected"
,
@
model
.
id
)
@
trigger
(
"thread:selected"
,
@
model
.
id
)
...
...
lms/templates/discussion/single_thread.html
View file @
d6bece9b
...
@@ -143,10 +143,10 @@
...
@@ -143,10 +143,10 @@
$$contents
=
{}
$$contents
=
{}
$$discussions
=
{}
$$discussions
=
{}
$
(
document
).
ready
(
function
()
{
$
(
document
).
ready
(
function
()
{
var
user
=
new
DiscussionUser
(
JSON
.
parse
(
"${user_info | escapejs}"
));
window
.
user
=
new
DiscussionUser
(
JSON
.
parse
(
"${user_info | escapejs}"
));
var
discussion
=
new
Discussion
(
JSON
.
parse
(
"${threads | escapejs}"
));
var
discussion
=
new
Discussion
(
JSON
.
parse
(
"${threads | escapejs}"
));
var
app
=
new
DiscussionRouter
({
user
:
user
,
discussion
:
discussion
})
var
app
=
new
DiscussionRouter
({
discussion
:
discussion
})
Backbone
.
history
.
start
({
pushState
:
true
,
root
:
"/courses/${course_id}/discussion/forum/"
})
Backbone
.
history
.
start
({
pushState
:
true
,
root
:
"/courses/${course_id}/discussion/forum/"
})
});
});
</script>
</script>
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