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
229f1122
Commit
229f1122
authored
Dec 28, 2016
by
alisan617
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hide add a response button if 0 other responses
parent
9e5139dc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
12 deletions
+22
-12
common/static/common/js/discussion/views/discussion_thread_view.js
+8
-2
common/static/common/templates/discussion/thread-show.underscore
+1
-1
common/static/common/templates/discussion/thread.underscore
+7
-5
lms/static/sass/discussion/views/_response.scss
+2
-1
lms/static/sass/discussion/views/_thread.scss
+4
-3
No files found.
common/static/common/js/discussion/views/discussion_thread_view.js
View file @
229f1122
...
@@ -280,6 +280,9 @@
...
@@ -280,6 +280,9 @@
responseCountFormat
=
ngettext
(
responseCountFormat
=
ngettext
(
'{numResponses} other response'
,
'{numResponses} other responses'
,
responseTotal
'{numResponses} other response'
,
'{numResponses} other responses'
,
responseTotal
);
);
if
(
responseTotal
===
0
)
{
this
.
$el
.
find
(
'.response-count'
).
hide
();
}
}
else
{
}
else
{
responseCountFormat
=
ngettext
(
responseCountFormat
=
ngettext
(
'{numResponses} response'
,
'{numResponses} responses'
,
responseTotal
'{numResponses} response'
,
'{numResponses} responses'
,
responseTotal
...
@@ -288,6 +291,7 @@
...
@@ -288,6 +291,7 @@
this
.
$el
.
find
(
'.response-count'
).
text
(
this
.
$el
.
find
(
'.response-count'
).
text
(
edx
.
StringUtils
.
interpolate
(
responseCountFormat
,
{
numResponses
:
responseTotal
},
true
)
edx
.
StringUtils
.
interpolate
(
responseCountFormat
,
{
numResponses
:
responseTotal
},
true
)
);
);
responsePagination
=
this
.
$el
.
find
(
'.response-pagination'
);
responsePagination
=
this
.
$el
.
find
(
'.response-pagination'
);
responsePagination
.
empty
();
responsePagination
.
empty
();
if
(
responseTotal
>
0
)
{
if
(
responseTotal
>
0
)
{
...
@@ -327,6 +331,8 @@
...
@@ -327,6 +331,8 @@
});
});
return
responsePagination
.
append
(
$loadMoreButton
);
return
responsePagination
.
append
(
$loadMoreButton
);
}
}
}
else
{
this
.
$el
.
find
(
'.add-response'
).
hide
();
}
}
};
};
...
@@ -345,9 +351,9 @@
...
@@ -345,9 +351,9 @@
DiscussionThreadView
.
prototype
.
renderAddResponseButton
=
function
()
{
DiscussionThreadView
.
prototype
.
renderAddResponseButton
=
function
()
{
if
(
this
.
model
.
hasResponses
()
&&
this
.
model
.
can
(
'can_reply'
)
&&
!
this
.
model
.
get
(
'closed'
))
{
if
(
this
.
model
.
hasResponses
()
&&
this
.
model
.
can
(
'can_reply'
)
&&
!
this
.
model
.
get
(
'closed'
))
{
return
this
.
$el
.
find
(
'
div
.add-response'
).
show
();
return
this
.
$el
.
find
(
'.add-response'
).
show
();
}
else
{
}
else
{
return
this
.
$el
.
find
(
'
div
.add-response'
).
hide
();
return
this
.
$el
.
find
(
'.add-response'
).
hide
();
}
}
};
};
...
...
common/static/common/templates/discussion/thread-show.underscore
View file @
229f1122
<div class="discussion-post">
<div class="discussion-post">
<header class="post-header">
<header class="post-header">
<% if (!readOnly) { %>
<% if (!readOnly) { %>
<div class="post-header-actions
post-extended-content
">
<div class="post-header-actions">
<%=
<%=
_.template(
_.template(
$('#forum-actions').html())(
$('#forum-actions').html())(
...
...
common/static/common/templates/discussion/thread.underscore
View file @
229f1122
...
@@ -7,16 +7,18 @@
...
@@ -7,16 +7,18 @@
</div>
</div>
</div>
</div>
<div class="post-extended-content thread-responses-wrapper">
<div class="post-extended-content thread-responses-wrapper">
<% if (!readOnly) { %>
<div class="response-btn-count-wrapper">
<% if (!readOnly) { %>
<div class="add-response">
<div class="add-response">
<button class="btn btn-small add-response-btn">
<button class="btn btn-small add-response-btn">
<%- gettext("Add a Response") %>
<%- gettext("Add a Response") %>
</button>
</button>
</div>
</div>
<% } %>
<% } %>
<div class="response-count"/>
<div class="response-count"></div>
<ol class="responses js-response-list"/>
</div>
<div class="response-pagination"/>
<ol class="responses js-response-list"></ol>
<div class="response-pagination"></div>
<div class="post-status-closed bottom-post-status" style="display: none">
<div class="post-status-closed bottom-post-status" style="display: none">
<%- gettext("This thread is closed.") %>
<%- gettext("This thread is closed.") %>
</div>
</div>
...
...
lms/static/sass/discussion/views/_response.scss
View file @
229f1122
...
@@ -182,13 +182,14 @@
...
@@ -182,13 +182,14 @@
.response-count
{
.response-count
{
@include
float
(
right
);
@include
float
(
right
);
@include
margin-right
(
$baseline
/
2
);
color
:
$forum-color-response-count
;
color
:
$forum-color-response-count
;
font-size
:
$forum-base-font-size
;
font-size
:
$forum-base-font-size
;
}
}
.response-pagination
{
.response-pagination
{
visibility
:
visible
;
visibility
:
visible
;
padding
:
0
(
$baseline
/
2
)
;
margin
:
(
$baseline
/
2
)
0
;
&
:empty
{
&
:empty
{
visibility
:
hidden
;
visibility
:
hidden
;
...
...
lms/static/sass/discussion/views/_thread.scss
View file @
229f1122
...
@@ -45,7 +45,8 @@
...
@@ -45,7 +45,8 @@
font-weight
:
600
;
font-weight
:
600
;
}
}
.thread-responses-wrapper
{
.thread-responses-wrapper
,
.post-extended-content
{
padding
:
0
(
$baseline
/
2
);
padding
:
0
(
$baseline
/
2
);
}
}
...
@@ -96,8 +97,8 @@
...
@@ -96,8 +97,8 @@
// +thread - wrapper styling
// +thread - wrapper styling
.thread-wrapper
{
.thread-wrapper
{
.
thread-main
-wrapper
{
.
response-btn-count
-wrapper
{
padding-bottom
:
$baseline
;
margin
:
$baseline
0
;
}
}
}
}
...
...
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