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
b7da6b2f
Commit
b7da6b2f
authored
Oct 23, 2014
by
E. Kolpakov
Committed by
Zia Fazal
Apr 08, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved discussion XBlock to edx-platform
(cherry picked from commit a7c0a2a)
parent
0e82b607
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
27 additions
and
23 deletions
+27
-23
cms/djangoapps/contentstore/views/helpers.py
+0
-4
common/djangoapps/edxmako/startup.py
+0
-3
common/lib/xmodule/xmodule/x_module.py
+17
-8
common/static/coffee/src/discussion/discussion_module_view.coffee
+2
-1
common/static/coffee/src/discussion/views/discussion_thread_view.coffee
+3
-2
common/templates/discussion/user_profile.html
+5
-3
lms/templates/main.html
+0
-1
lms/templates/main_django.html
+0
-1
No files found.
cms/djangoapps/contentstore/views/helpers.py
View file @
b7da6b2f
...
...
@@ -19,10 +19,6 @@ from contentstore.utils import reverse_course_url, reverse_library_url, reverse_
__all__
=
[
'edge'
,
'event'
,
'landing'
]
# Add Discussion templates
add_lookup
(
'lms.main'
,
'templates'
,
package
=
'discussion_app'
)
# points to the temporary course landing page with log in and sign up
def
landing
(
request
,
org
,
course
,
coursename
):
return
render_to_response
(
'temp-course-landing.html'
,
{})
...
...
common/djangoapps/edxmako/startup.py
View file @
b7da6b2f
...
...
@@ -17,6 +17,3 @@ def run():
clear_lookups
(
namespace
)
for
directory
in
directories
:
add_lookup
(
namespace
,
directory
)
# Add Discussion templates
add_lookup
(
'main'
,
'templates'
,
package
=
'discussion_app'
)
common/lib/xmodule/xmodule/x_module.py
View file @
b7da6b2f
...
...
@@ -1267,19 +1267,21 @@ class DescriptorSystem(MetricsMixin, ConfigurableFragmentWrapper, Runtime): # p
return
result
def
handler_url
(
self
,
block
,
handler_name
,
suffix
=
''
,
query
=
''
,
thirdparty
=
False
):
# Currently, Modulestore is responsible for instantiating DescriptorSystems
# This means that LMS/CMS don't have a way to define a subclass of DescriptorSystem
# that implements the correct handler url. So, for now, instead, we will reference a
# global function that the application can override.
return
descriptor_global_handler_url
(
block
,
handler_name
,
suffix
,
query
,
thirdparty
)
if
block
.
xmodule_runtime
is
not
None
:
return
block
.
xmodule_runtime
.
handler_url
(
block
,
handler_name
,
suffix
,
query
,
thirdparty
)
else
:
# Currently, Modulestore is responsible for instantiating DescriptorSystems
# This means that LMS/CMS don't have a way to define a subclass of DescriptorSystem
# that implements the correct handler url. So, for now, instead, we will reference a
# global function that the application can override.
return
descriptor_global_handler_url
(
block
,
handler_name
,
suffix
,
query
,
thirdparty
)
def
local_resource_url
(
self
,
block
,
uri
):
"""
See :meth:`xblock.runtime.Runtime:local_resource_url` for documentation.
"""
xmodule_runtime
=
getattr
(
block
,
'xmodule_runtime'
,
None
)
if
xmodule_runtime
is
not
None
:
return
xmodule_runtime
.
local_resource_url
(
block
,
uri
)
if
block
.
xmodule_runtime
is
not
None
:
return
block
.
xmodule_runtime
.
local_resource_url
(
block
,
uri
)
else
:
# Currently, Modulestore is responsible for instantiating DescriptorSystems
# This means that LMS/CMS don't have a way to define a subclass of DescriptorSystem
...
...
@@ -1303,6 +1305,13 @@ class DescriptorSystem(MetricsMixin, ConfigurableFragmentWrapper, Runtime): # p
"""
raise
NotImplementedError
(
"edX Platform doesn't currently implement XBlock resource urls"
)
def
publish
(
self
,
block
,
event_type
,
event
):
"""
See :meth:`xblock.runtime.Runtime:publish` for documentation.
"""
if
block
.
xmodule_runtime
is
not
None
:
return
block
.
xmodule_runtime
.
publish
(
block
,
event_type
,
event
)
def
add_block_as_child_node
(
self
,
block
,
node
):
child
=
etree
.
SubElement
(
node
,
"unknown"
)
child
.
set
(
'url_name'
,
block
.
url_name
)
...
...
common/static/coffee/src/discussion/discussion_module_view.coffee
View file @
b7da6b2f
...
...
@@ -98,7 +98,8 @@ if Backbone?
else
@
$el
.
append
(
$discussion
)
@
newPostForm
=
this
.
$el
.
find
(
'.new-post-article'
)
@
newPostForm
=
$
(
'.new-post-article'
)
async
=
@
options
.
async_thread_views
@
threadviews
=
@
discussion
.
map
(
thread
)
=>
view
=
new
DiscussionThreadView
(
el
:
@
$
(
"article#thread_
#{
thread
.
id
}
"
),
...
...
common/static/coffee/src/discussion/views/discussion_thread_view.coffee
View file @
b7da6b2f
...
...
@@ -22,6 +22,8 @@ if Backbone?
if
@
mode
not
in
[
"tab"
,
"inline"
]
throw
new
Error
(
"invalid mode: "
+
@
mode
)
@
async_thread_views
=
if
options
.
async_thread_views
?
then
options
.
async_thread_views
else
false
# Quick fix to have an actual model when we're receiving new models from
# the server.
@
model
.
collection
.
on
"reset"
,
(
collection
)
=>
...
...
@@ -227,7 +229,7 @@ if Backbone?
renderResponseToList
:
(
response
,
listSelector
,
options
)
=>
response
.
set
(
'thread'
,
@
model
)
view
=
new
ThreadResponseView
(
$
.
extend
({
model
:
response
},
options
))
view
=
new
ThreadResponseView
(
$
.
extend
({
model
:
response
,
async
:
@
async_thread_views
},
options
))
view
.
on
"comment:add"
,
@
addComment
view
.
on
"comment:endorse"
,
@
endorseThread
view
.
render
()
...
...
@@ -261,7 +263,6 @@ if Backbone?
comment
=
new
Comment
(
body
:
body
,
created_at
:
(
new
Date
()).
toISOString
(),
username
:
window
.
user
.
get
(
"username"
),
votes
:
{
up_count
:
0
},
abuse_flaggers
:
[],
endorsed
:
false
,
user_id
:
window
.
user
.
get
(
"id"
))
comment
.
set
(
'thread'
,
@
model
.
get
(
'thread'
))
@
renderResponseToList
(
comment
,
".js-response-list"
)
@
renderAttrs
()
@
model
.
addComment
()
@
renderAddResponseButton
()
...
...
common/templates/discussion/user_profile.html
View file @
b7da6b2f
...
...
@@ -9,10 +9,12 @@
<
%
block
name=
"headextra"
>
<
%
static:css
group=
'style-course-vendor'
/>
<
%
static:css
group=
'style-course'
/>
<
%
include
file=
"_js_head_dependencies.html"
/>
</
%
block>
<
%
block
name=
"js_extra"
>
<
%
include
file=
"
/discussion/
_js_body_dependencies.html"
/>
<
%
include
file=
"_js_body_dependencies.html"
/>
<
%
static:js
group=
'discussion'
/>
<script
language=
"javascript"
>
$
(
function
()
{
...
...
@@ -31,7 +33,7 @@
<nav>
<article
class=
"sidebar-module discussion-sidebar"
>
<
%
include
file=
"
/discussion/
_user_profile.html"
/>
<
%
include
file=
"_user_profile.html"
/>
</article>
</nav>
...
...
@@ -41,4 +43,4 @@
</div>
</section>
<
%
include
file=
"
/discussion/
_underscore_templates.html"
/>
<
%
include
file=
"_underscore_templates.html"
/>
lms/templates/main.html
View file @
b7da6b2f
...
...
@@ -66,7 +66,6 @@
<
%
static:css
group=
'style-app'
/>
<
%
static:css
group=
'style-app-extend1'
/>
<
%
static:css
group=
'style-app-extend2'
/>
<
%
static:css
group=
'style-discussion-app'
/>
% if disable_courseware_js:
<
%
static:js
group=
'base_vendor'
/>
...
...
lms/templates/main_django.html
View file @
b7da6b2f
...
...
@@ -13,7 +13,6 @@
{% compressed_css 'style-app-extend2' %}
{% compressed_css 'style-course-vendor' %}
{% compressed_css 'style-course' %}
{% compressed_css 'style-discussion-app' %}
{% block main_vendor_js %}
{% compressed_js 'main_vendor' %}
...
...
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