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
8f005a5a
Commit
8f005a5a
authored
Feb 01, 2013
by
Arthur Barrett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved discussion html into its own method, should probably be in a template.
parent
48bb447f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
common/lib/xmodule/xmodule/annotatable_module.py
+11
-6
No files found.
common/lib/xmodule/xmodule/annotatable_module.py
View file @
8f005a5a
...
...
@@ -59,9 +59,9 @@ class AnnotatableModule(XModule):
if
container
is
None
:
return
parent
return
container
def
_
attach_discussion
(
self
,
span
,
index
,
xmltre
e
):
"""
Attaches a discussion thread to the annotation span.
"""
def
_
get_discussion_html
(
self
,
discussion_id
,
discussion_titl
e
):
"""
Returns html to display the discussion thread
"""
tpl
=
u'<div class="annotatable-discussion" data-discussion-id="{0}">'
tpl
+=
'<div class="annotatable-icon"> </div>'
...
...
@@ -69,17 +69,22 @@ class AnnotatableModule(XModule):
tpl
+=
'<span class="annotatable-discussion-thread">{1}</span>'
tpl
+=
'<a class="annotatable-show-discussion" href="javascript:void(0);">Show Discussion</a>'
tpl
+=
'</div>'
return
tpl
.
format
(
discussion_id
,
discussion_title
)
def
_attach_discussion
(
self
,
span
,
index
,
xmltree
):
""" Attaches a discussion thread to the annotation span. """
span_id
=
'span-{0}'
.
format
(
index
)
# How should we anchor spans?
span
.
set
(
'data-span-id'
,
span_id
)
discussion_id
=
'discussion-{0}'
.
format
(
index
)
# How do we get a real discussion ID?
discussion_title
=
'Thread Title {0}'
.
format
(
index
)
# How do we get the discussion Title?
discussion_html
=
tpl
.
format
(
discussion_id
,
discussion_title
)
discussion
=
etree
.
fromstring
(
discussion_html
)
discussion_html
=
self
.
_get_discussion_html
(
discussion_id
,
discussion_title
)
discussion
_xmltree
=
etree
.
fromstring
(
discussion_html
)
span_container
=
self
.
_get_span_container
(
span
)
span_container
.
append
(
discussion
)
span_container
.
append
(
discussion
_xmltree
)
self
.
discussion_for
[
span_id
]
=
discussion_id
...
...
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