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
9b54abe3
Commit
9b54abe3
authored
Jan 22, 2014
by
jsa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add "Add A Response" button to thread views in discussion tab / inline
JIRA: FOR-373
parent
a6b97b40
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
90 additions
and
14 deletions
+90
-14
common/static/coffee/src/discussion/content.coffee
+3
-0
common/static/coffee/src/discussion/views/discussion_thread_view.coffee
+15
-0
common/static/coffee/src/discussion/views/discussion_thread_view_inline.coffee
+3
-0
lms/static/sass/_discussion.scss
+48
-6
lms/templates/discussion/_underscore_templates.html
+6
-1
lms/templates/discussion/mustache/_inline_thread.mustache
+7
-3
lms/templates/discussion/mustache/_inline_thread_cohorted.mustache
+8
-4
No files found.
common/static/coffee/src/discussion/content.coffee
View file @
9b54abe3
...
@@ -159,6 +159,9 @@ if Backbone?
...
@@ -159,6 +159,9 @@ if Backbone?
created_at_time
:
->
created_at_time
:
->
new
Date
(
@
get
(
"created_at"
)).
getTime
()
new
Date
(
@
get
(
"created_at"
)).
getTime
()
hasResponses
:
->
@
get
(
'comments_count'
)
>
0
class
@
Comment
extends
@
Content
class
@
Comment
extends
@
Content
urlMappers
:
urlMappers
:
'reply'
:
->
DiscussionUtil
.
urlFor
(
'create_sub_comment'
,
@
id
)
'reply'
:
->
DiscussionUtil
.
urlFor
(
'create_sub_comment'
,
@
id
)
...
...
common/static/coffee/src/discussion/views/discussion_thread_view.coffee
View file @
9b54abe3
...
@@ -3,6 +3,7 @@ if Backbone?
...
@@ -3,6 +3,7 @@ if Backbone?
events
:
events
:
"click .discussion-submit-post"
:
"submitComment"
"click .discussion-submit-post"
:
"submitComment"
"click .add-response-btn"
:
"scrollToAddResponse"
$
:
(
selector
)
->
$
:
(
selector
)
->
@
$el
.
find
(
selector
)
@
$el
.
find
(
selector
)
...
@@ -25,6 +26,7 @@ if Backbone?
...
@@ -25,6 +26,7 @@ if Backbone?
@
$
(
"span.timeago"
).
timeago
()
@
$
(
"span.timeago"
).
timeago
()
@
makeWmdEditor
"reply-body"
@
makeWmdEditor
"reply-body"
@
renderAddResponseButton
()
@
renderResponses
()
@
renderResponses
()
@
@
...
@@ -55,6 +57,18 @@ if Backbone?
...
@@ -55,6 +57,18 @@ if Backbone?
@
$el
.
find
(
".responses"
).
append
(
view
.
el
)
@
$el
.
find
(
".responses"
).
append
(
view
.
el
)
view
.
afterInsert
()
view
.
afterInsert
()
renderAddResponseButton
:
->
if
@
model
.
hasResponses
()
@
$el
.
find
(
'div.add-response'
).
show
()
else
@
$el
.
find
(
'div.add-response'
).
hide
()
scrollToAddResponse
:
(
event
)
->
event
.
preventDefault
()
form
=
$
(
event
.
target
).
parents
(
'article.discussion-article'
).
find
(
'form.discussion-reply-new'
)
$
(
'html, body'
).
scrollTop
(
form
.
offset
().
top
)
form
.
find
(
'.wmd-panel textarea'
).
focus
()
addComment
:
=>
addComment
:
=>
@
model
.
comment
()
@
model
.
comment
()
...
@@ -72,6 +86,7 @@ if Backbone?
...
@@ -72,6 +86,7 @@ if Backbone?
comment
.
set
(
'thread'
,
@
model
.
get
(
'thread'
))
comment
.
set
(
'thread'
,
@
model
.
get
(
'thread'
))
@
renderResponse
(
comment
)
@
renderResponse
(
comment
)
@
model
.
addComment
()
@
model
.
addComment
()
@
renderAddResponseButton
()
DiscussionUtil
.
safeAjax
DiscussionUtil
.
safeAjax
$elem
:
$
(
event
.
target
)
$elem
:
$
(
event
.
target
)
...
...
common/static/coffee/src/discussion/views/discussion_thread_view_inline.coffee
View file @
9b54abe3
...
@@ -5,6 +5,7 @@ if Backbone?
...
@@ -5,6 +5,7 @@ if Backbone?
"click .discussion-submit-post"
:
"submitComment"
"click .discussion-submit-post"
:
"submitComment"
"click .expand-post"
:
"expandPost"
"click .expand-post"
:
"expandPost"
"click .collapse-post"
:
"collapsePost"
"click .collapse-post"
:
"collapsePost"
"click .add-response-btn"
:
"scrollToAddResponse"
initialize
:
->
initialize
:
->
super
()
super
()
...
@@ -36,6 +37,7 @@ if Backbone?
...
@@ -36,6 +37,7 @@ if Backbone?
@
$el
.
find
(
'.post-extended-content'
).
hide
()
@
$el
.
find
(
'.post-extended-content'
).
hide
()
if
@
expanded
if
@
expanded
@
makeWmdEditor
"reply-body"
@
makeWmdEditor
"reply-body"
@
renderAddResponseButton
()
@
renderResponses
()
@
renderResponses
()
@
@
createShowView
:
()
->
createShowView
:
()
->
...
@@ -106,6 +108,7 @@ if Backbone?
...
@@ -106,6 +108,7 @@ if Backbone?
@
makeWmdEditor
"reply-body"
@
makeWmdEditor
"reply-body"
@
renderAttrs
()
@
renderAttrs
()
if
@
$el
.
find
(
'.loading'
).
length
if
@
$el
.
find
(
'.loading'
).
length
@
renderAddResponseButton
()
@
renderResponses
()
@
renderResponses
()
collapsePost
:
(
event
)
->
collapsePost
:
(
event
)
->
...
...
lms/static/sass/_discussion.scss
View file @
9b54abe3
...
@@ -1186,6 +1186,8 @@ body.discussion {
...
@@ -1186,6 +1186,8 @@ body.discussion {
.blank-slate
{
.blank-slate
{
padding
:
40px
40px
10px
;
section
{
section
{
border-bottom
:
1px
solid
#ccc
;
border-bottom
:
1px
solid
#ccc
;
}
}
...
@@ -1336,7 +1338,6 @@ body.discussion {
...
@@ -1336,7 +1338,6 @@ body.discussion {
.discussion-article
{
.discussion-article
{
position
:
relative
;
position
:
relative
;
padding
:
$baseline
*
2
;
min-height
:
468px
;
min-height
:
468px
;
a
{
a
{
...
@@ -1397,7 +1398,7 @@ body.discussion {
...
@@ -1397,7 +1398,7 @@ body.discussion {
}
}
.discussion-post
{
.discussion-post
{
padding
:
$baseline
/
2
$baseline
;
padding
:
$baseline
*
2
$baseline
*
2
$baseline
/
2
$baseline
*
2
;
>
header
.vote-btn
{
>
header
.vote-btn
{
position
:
relative
;
position
:
relative
;
...
@@ -1443,7 +1444,7 @@ body.discussion {
...
@@ -1443,7 +1444,7 @@ body.discussion {
.responses
{
.responses
{
list-style
:
none
;
list-style
:
none
;
margin-top
:
$baseline
;
margin-top
:
$baseline
;
padding
:
0
;
padding
:
0
px
$baseline
*
2
;
>
li
{
>
li
{
position
:
relative
;
position
:
relative
;
...
@@ -1511,6 +1512,27 @@ body.discussion {
...
@@ -1511,6 +1512,27 @@ body.discussion {
}
}
}
}
div
.add-response
{
margin-top
:
$baseline
;
padding
:
0px
30px
;
button
.add-response-btn
{
@include
white-button
;
position
:
relative
;
padding
:
0px
30px
;
border
:
1px
solid
#b2b2b2
;
box-shadow
:
0
1px
3px
rgba
(
0
,
0
,
0
,
.15
);
font-size
:
13px
;
text-align
:
left
;
@include
animation
(
fadeIn
.3s
);
width
:
100%
;
span
.add-response-btn-text
{
padding-left
:
4px
;
}
}
}
.vote-btn
{
.vote-btn
{
position
:
relative
;
position
:
relative
;
z-index
:
100
;
z-index
:
100
;
...
@@ -1783,7 +1805,7 @@ body.discussion {
...
@@ -1783,7 +1805,7 @@ body.discussion {
.discussion-reply-new
{
.discussion-reply-new
{
padding
:
$baseline
;
padding
:
0px
30px
$baseline
;
@include
clearfix
;
@include
clearfix
;
@include
transition
(
opacity
.2s
linear
0s
);
@include
transition
(
opacity
.2s
linear
0s
);
...
@@ -1856,11 +1878,31 @@ body.discussion {
...
@@ -1856,11 +1878,31 @@ body.discussion {
margin-top
:
$baseline
*
2
;
margin-top
:
$baseline
*
2
;
>
li
{
>
li
{
margin
:
0
$baseline
$baseline
!
important
;
padding
:
26px
30px
$baseline
!
important
;
padding
:
26px
30px
$baseline
!
important
;
}
}
}
}
div
.add-response.post-extended-content
{
margin-top
:
$baseline
;
margin-bottom
:
20px
;
button
.add-response-btn
{
@include
white-button
;
position
:
relative
;
border
:
1px
solid
#b2b2b2
;
box-shadow
:
0
1px
3px
rgba
(
0
,
0
,
0
,
.15
);
font-size
:
13px
;
text-align
:
left
;
@include
animation
(
fadeIn
.3s
);
width
:
100%
;
padding-left
:
30px
;
span
.add-response-btn-text
{
padding-left
:
4px
;
}
}
}
.loading-animation
{
.loading-animation
{
background-image
:
url(../images/spinner-on-grey.gif)
;
background-image
:
url(../images/spinner-on-grey.gif)
;
}
}
...
@@ -1938,7 +1980,7 @@ body.discussion {
...
@@ -1938,7 +1980,7 @@ body.discussion {
@include
transition
(
all
.2s
linear
0s
);
@include
transition
(
all
.2s
linear
0s
);
.discussion-post
{
.discussion-post
{
padding
:
12px
$baseline
0
$baseline
;
padding
:
12px
30px
0px
;
@include
clearfix
;
@include
clearfix
;
.inline-comment-count
{
.inline-comment-count
{
...
...
lms/templates/discussion/_underscore_templates.html
View file @
9b54abe3
...
@@ -5,7 +5,12 @@
...
@@ -5,7 +5,12 @@
<script
type=
"text/template"
id=
"thread-template"
>
<script
type=
"text/template"
id=
"thread-template"
>
<
article
class
=
"discussion-article"
data
-
id
=
"${'<%- id %>'}"
>
<
article
class
=
"discussion-article"
data
-
id
=
"${'<%- id %>'}"
>
<
div
class
=
"thread-content-wrapper"
><
/div
>
<
div
class
=
"thread-content-wrapper"
><
/div
>
<
div
class
=
"add-response"
>
<
button
class
=
"button add-response-btn"
>
<
i
class
=
"icon icon-reply"
><
/i
>
<
span
class
=
"add-response-btn-text"
>
$
{
_
(
'Add A Response'
)}
<
/span
>
<
/button
>
<
/div
>
<
ol
class
=
"responses"
>
<
ol
class
=
"responses"
>
<
li
class
=
"loading"
><
div
class
=
"loading-animation"
><
span
class
=
"sr"
>
$
{
_
(
'Loading content'
)}
<
/span></
div
><
/li
>
<
li
class
=
"loading"
><
div
class
=
"loading-animation"
><
span
class
=
"sr"
>
$
{
_
(
'Loading content'
)}
<
/span></
div
><
/li
>
<
/ol
>
<
/ol
>
...
...
lms/templates/discussion/mustache/_inline_thread.mustache
View file @
9b54abe3
...
@@ -2,7 +2,12 @@
...
@@ -2,7 +2,12 @@
<article
class=
"discussion-article"
data-id=
"
{{
id
}}
"
>
<article
class=
"discussion-article"
data-id=
"
{{
id
}}
"
>
<div
class=
"thread-content-wrapper"
></div>
<div
class=
"thread-content-wrapper"
></div>
<div
class=
"add-response post-extended-content"
>
<button
class=
"button add-response-btn"
>
<i
class=
"icon icon-reply"
></i>
<span
class=
"add-response-btn-text"
>
${_('Add A Response')}
</span>
</button>
</div>
<ol
class=
"responses post-extended-content"
>
<ol
class=
"responses post-extended-content"
>
<li
class=
"loading"
><div
class=
"loading-animation"
><span
class=
"sr"
>
${_("Loading content")}
</span></div></li>
<li
class=
"loading"
><div
class=
"loading-animation"
><span
class=
"sr"
>
${_("Loading content")}
</span></div></li>
</ol>
</ol>
...
@@ -20,4 +25,4 @@
...
@@ -20,4 +25,4 @@
<a
href=
"javascript:void(0)"
class=
"collapse-post"
>
${_("Hide discussion")}
</a>
<a
href=
"javascript:void(0)"
class=
"collapse-post"
>
${_("Hide discussion")}
</a>
</div>
</div>
</article>
</article>
\ No newline at end of file
lms/templates/discussion/mustache/_inline_thread_cohorted.mustache
View file @
9b54abe3
...
@@ -4,9 +4,14 @@
...
@@ -4,9 +4,14 @@
<div
class=
"group-visibility-label"
>
{{
group_string
}}
</div>
<div
class=
"group-visibility-label"
>
{{
group_string
}}
</div>
<div
class=
"thread-content-wrapper"
></div>
<div
class=
"thread-content-wrapper"
></div>
<div
class=
"add-response post-extended-content"
>
<button
class=
"button add-response-btn"
>
<i
class=
"icon icon-reply"
></i>
<span
class=
"add-response-btn-text"
>
${_('Add A Response')}
</span>
</button>
</div>
<ol
class=
"responses post-extended-content"
>
<ol
class=
"responses post-extended-content"
>
<li
class=
"loading"
><div
class=
"loading-animation"
><span
class=
"sr"
>
${_("Loading content")}
)
</span></div></li>
<li
class=
"loading"
><div
class=
"loading-animation"
><span
class=
"sr"
>
${_("Loading content")}
</span></div></li>
</ol>
</ol>
<form
class=
"local discussion-reply-new post-extended-content"
data-id=
"
{{
id
}}
"
>
<form
class=
"local discussion-reply-new post-extended-content"
data-id=
"
{{
id
}}
"
>
<h4>
${_("Post a response:")}
</h4>
<h4>
${_("Post a response:")}
</h4>
...
@@ -22,4 +27,4 @@
...
@@ -22,4 +27,4 @@
<a
href=
"javascript:void(0)"
class=
"collapse-post"
>
${_("Hide discussion")}
</a>
<a
href=
"javascript:void(0)"
class=
"collapse-post"
>
${_("Hide discussion")}
</a>
</div>
</div>
</article>
</article>
\ No newline at end of file
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