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
476f4fa7
Commit
476f4fa7
authored
Aug 30, 2012
by
Matthew Mongeau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix liking.
parent
1acb6185
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
lms/static/coffee/src/discussion/views/discussion_thread_view.coffee
+6
-6
lms/templates/discussion/single_thread.html
+1
-1
No files found.
lms/static/coffee/src/discussion/views/discussion_thread_view.coffee
View file @
476f4fa7
class
@
DiscussionThreadView
extends
Backbone
.
View
class
@
DiscussionThreadView
extends
Backbone
.
View
events
:
events
:
"click .discussion-vote
-up
"
:
"toggleVote"
"click .discussion-vote"
:
"toggleVote"
"click .dogear"
:
"toggleFollowing"
"click .dogear"
:
"toggleFollowing"
"click .discussion-submit-post"
:
"submitComment"
"click .discussion-submit-post"
:
"submitComment"
template
:
_
.
template
(
$
(
"#thread-template"
).
html
())
template
:
_
.
template
(
$
(
"#thread-template"
).
html
())
...
@@ -10,7 +10,7 @@ class @DiscussionThreadView extends Backbone.View
...
@@ -10,7 +10,7 @@ class @DiscussionThreadView extends Backbone.View
@
$el
.
html
(
@
template
(
@
model
.
toJSON
()))
@
$el
.
html
(
@
template
(
@
model
.
toJSON
()))
updateModelDetails
:
=>
updateModelDetails
:
=>
@
$
(
".votes-count-number"
).
html
(
@
model
.
get
(
"votes"
)[
"up_count"
])
@
$
(
".
discussion-vote .
votes-count-number"
).
html
(
@
model
.
get
(
"votes"
)[
"up_count"
])
render
:
->
render
:
->
if
window
.
user
.
following
(
@
model
)
if
window
.
user
.
following
(
@
model
)
...
@@ -44,8 +44,8 @@ class @DiscussionThreadView extends Backbone.View
...
@@ -44,8 +44,8 @@ class @DiscussionThreadView extends Backbone.View
@
model
.
trigger
"comment:add"
@
model
.
trigger
"comment:add"
toggleVote
:
->
toggleVote
:
->
@
$
(
".
vote-btn
"
).
toggleClass
(
"is-cast"
)
@
$
(
".
discussion-vote
"
).
toggleClass
(
"is-cast"
)
if
@
$
(
".
vote-btn
"
).
hasClass
(
"is-cast"
)
if
@
$
(
".
discussion-vote
"
).
hasClass
(
"is-cast"
)
@
vote
()
@
vote
()
else
else
@
unvote
()
@
unvote
()
...
@@ -68,7 +68,7 @@ class @DiscussionThreadView extends Backbone.View
...
@@ -68,7 +68,7 @@ class @DiscussionThreadView extends Backbone.View
vote
:
->
vote
:
->
url
=
@
model
.
urlFor
(
"upvote"
)
url
=
@
model
.
urlFor
(
"upvote"
)
@
$
(
".
votes-count-number"
).
html
(
parseInt
(
@
$
(
"
.votes-count-number"
).
html
())
+
1
)
@
$
(
".
discussion-vote .votes-count-number"
).
html
(
parseInt
(
@
$
(
".discussion-vote
.votes-count-number"
).
html
())
+
1
)
DiscussionUtil
.
safeAjax
DiscussionUtil
.
safeAjax
$elem
:
@
$
(
".discussion-vote"
)
$elem
:
@
$
(
".discussion-vote"
)
url
:
url
url
:
url
...
@@ -79,7 +79,7 @@ class @DiscussionThreadView extends Backbone.View
...
@@ -79,7 +79,7 @@ class @DiscussionThreadView extends Backbone.View
unvote
:
->
unvote
:
->
url
=
@
model
.
urlFor
(
"unvote"
)
url
=
@
model
.
urlFor
(
"unvote"
)
@
$
(
".
votes-count-number"
).
html
(
parseInt
(
@
$
(
"
.votes-count-number"
).
html
())
-
1
)
@
$
(
".
discussion-vote .votes-count-number"
).
html
(
parseInt
(
@
$
(
".discussion-vote
.votes-count-number"
).
html
())
-
1
)
DiscussionUtil
.
safeAjax
DiscussionUtil
.
safeAjax
$elem
:
@
$
(
".discussion-vote"
)
$elem
:
@
$
(
".discussion-vote"
)
url
:
url
url
:
url
...
...
lms/templates/discussion/single_thread.html
View file @
476f4fa7
...
@@ -147,7 +147,7 @@
...
@@ -147,7 +147,7 @@
<script
type=
"text/template"
id=
"thread-response-template"
>
<script
type=
"text/template"
id=
"thread-response-template"
>
<
header
>
<
header
>
<
a
href
=
"#"
class
=
"vote-btn"
data
-
tooltip
=
"vote"
><
span
class
=
"plus-icon"
><
/span><span class="votes-count-number">${"<%= votes
[
'up_count'
]
%>"}</
span
><
/a
>
<
a
href
=
"#"
class
=
"vote-btn"
data
-
tooltip
=
"vote"
><
span
class
=
"plus-icon"
><
/span><span class="votes-count-number">${"<%= votes
[
'up_count'
]
%>"}</
span
><
/a
>
<
a
href
=
"#"
class
=
"posted-by"
>
$
{
"<%= username %>"
}
<
/a
>
<
a
href
=
"#"
class
=
"posted-by"
>
$
{
"<%= username %>"
}
<
/a
>
<
p
class
=
"posted-details"
title
=
"${'<%= created_at %>'}"
>
Sometime
<
/p
>
<
p
class
=
"posted-details"
title
=
"${'<%= created_at %>'}"
>
Sometime
<
/p
>
<
/header
>
<
/header
>
...
...
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