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
a7550912
Commit
a7550912
authored
Apr 04, 2017
by
attiyaishaque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TNL-6284 Empty subcategory will not render in inline discussion modules.
parent
f00059f2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
2 deletions
+24
-2
lms/djangoapps/django_comment_client/tests/test_utils.py
+16
-0
lms/djangoapps/django_comment_client/utils.py
+1
-1
lms/templates/discussion/_discussion_inline.html
+5
-1
lms/templates/discussion/_filter_dropdown.html
+2
-0
No files found.
lms/djangoapps/django_comment_client/tests/test_utils.py
View file @
a7550912
...
...
@@ -178,6 +178,22 @@ class CoursewareContextTestCase(ModuleStoreTestCase):
assertThreadCorrect
(
threads
[
0
],
self
.
discussion1
,
"Chapter / Discussion 1"
)
assertThreadCorrect
(
threads
[
1
],
self
.
discussion2
,
"Subsection / Discussion 2"
)
def
test_empty_discussion_subcategory_title
(
self
):
"""
Test that for empty subcategory inline discussion modules,
the divider " / " is not rendered on a post or inline discussion topic label.
"""
discussion
=
ItemFactory
.
create
(
parent_location
=
self
.
course
.
location
,
category
=
"discussion"
,
discussion_id
=
"discussion"
,
discussion_category
=
"Chapter"
,
discussion_target
=
""
# discussion-subcategory
)
thread
=
{
"commentable_id"
:
discussion
.
discussion_id
}
utils
.
add_courseware_context
([
thread
],
self
.
course
,
self
.
user
)
self
.
assertNotIn
(
'/'
,
thread
.
get
(
"courseware_title"
))
@ddt.data
((
ModuleStoreEnum
.
Type
.
mongo
,
2
),
(
ModuleStoreEnum
.
Type
.
split
,
1
))
@ddt.unpack
def
test_get_accessible_discussion_xblocks
(
self
,
modulestore_type
,
expected_discussion_xblocks
):
...
...
lms/djangoapps/django_comment_client/utils.py
View file @
a7550912
...
...
@@ -147,7 +147,7 @@ def get_discussion_id_map_entry(xblock):
xblock
.
discussion_id
,
{
"location"
:
xblock
.
location
,
"title"
:
xblock
.
discussion_category
.
split
(
"/"
)[
-
1
]
.
strip
()
+
" / "
+
xblock
.
discussion_target
"title"
:
xblock
.
discussion_category
.
split
(
"/"
)[
-
1
]
.
strip
()
+
(
" / "
+
xblock
.
discussion_target
if
xblock
.
discussion_target
else
""
)
}
)
...
...
lms/templates/discussion/_discussion_inline.html
View file @
a7550912
...
...
@@ -15,7 +15,11 @@ from openedx.core.djangolib.js_utils import js_escaped_string
data-read-only=
"${'false' if can_create_thread else 'true'}"
>
<div
class=
"discussion-module-header"
>
<h3
class=
"hd hd-3 discussion-module-title"
>
${_(display_name)}
</h3>
<div
class=
"inline-discussion-topic"
><span
class=
"inline-discussion-topic-title"
>
${_("Topic:")}
</span>
${discussion_category} / ${discussion_target}
</div>
<div
class=
"inline-discussion-topic"
><span
class=
"inline-discussion-topic-title"
>
${_("Topic:")}
</span>
${discussion_category}
% if discussion_target:
/ ${discussion_target}
%endif
</div>
</div>
<button
class=
"discussion-show btn"
data-discussion-id=
"${discussion_id}"
>
<span
class=
"button-text"
>
${_("Show Discussion")}
</span>
...
...
lms/templates/discussion/_filter_dropdown.html
View file @
a7550912
...
...
@@ -23,7 +23,9 @@ from openedx.core.djangolib.markup import HTML
data-cohorted=
"${str(entries[entry]['is_cohorted']).lower()}"
role=
"option"
>
% if entry:
<span
class=
"forum-nav-browse-title"
>
${entry}
</span>
%endif
</li>
</
%
def>
...
...
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