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
240fcc1d
Commit
240fcc1d
authored
May 22, 2014
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix merge conflicts
parent
cd862b32
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
24 additions
and
349 deletions
+24
-349
cms/djangoapps/contentstore/tests/test_contentstore.py
+0
-11
cms/djangoapps/contentstore/views/component.py
+2
-8
cms/djangoapps/contentstore/views/item.py
+3
-23
cms/djangoapps/contentstore/views/preview.py
+0
-9
cms/djangoapps/contentstore/views/tests/test_container.py
+0
-144
cms/djangoapps/contentstore/views/tests/test_container_page.py
+2
-2
cms/static/js/spec/views/pages/container_spec.js
+1
-1
cms/static/js/spec/views/unit_spec.js
+0
-13
cms/static/js/spec_helpers/edit_helpers.js
+1
-1
cms/static/js/utils/module.js
+2
-8
cms/static/js/views/pages/container.js
+2
-2
cms/templates/container.html
+1
-5
cms/templates/studio_container_wrapper.html
+2
-2
cms/templates/studio_xblock_wrapper.html
+3
-9
cms/templates/unit.html
+5
-5
common/djangoapps/student/views.py
+0
-26
lms/templates/notes.html
+0
-13
lms/templates/textannotation.html
+0
-46
lms/templates/videoannotation.html
+0
-21
No files found.
cms/djangoapps/contentstore/tests/test_contentstore.py
View file @
240fcc1d
...
...
@@ -356,17 +356,6 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
"""
Tests the ajax callback to render an XModule
"""
<<<<<<<
HEAD
=======
resp
=
self
.
_test_preview
(
Location
(
'i4x'
,
'edX'
,
'toy'
,
'vertical'
,
'vertical_test'
,
None
),
'container_preview'
)
self
.
assertContains
(
resp
,
'/branch/draft/block/sample_video'
)
self
.
assertContains
(
resp
,
'/branch/draft/block/separate_file_video'
)
self
.
assertContains
(
resp
,
'/branch/draft/block/video_with_end_time'
)
self
.
assertContains
(
resp
,
'/branch/draft/block/T1_changemind_poll_foo_2'
)
def
_test_preview
(
self
,
location
,
view_name
):
""" Preview test case. """
>>>>>>>
edx
/
master
direct_store
=
modulestore
(
'direct'
)
_
,
course_items
=
import_from_xml
(
direct_store
,
'common/test/data/'
,
[
'toy'
])
usage_key
=
course_items
[
0
]
.
id
.
make_usage_key
(
'vertical'
,
'vertical_test'
)
...
...
cms/djangoapps/contentstore/views/component.py
View file @
240fcc1d
...
...
@@ -196,15 +196,9 @@ def unit_handler(request, usage_key_string):
return
render_to_response
(
'unit.html'
,
{
'context_course'
:
course
,
'unit'
:
item
,
<<<<<<<
HEAD
'unit_locator'
:
usage_key
,
'xblocks'
:
xblocks
,
'component_templates'
:
component_templates
,
=======
'unit_locator'
:
locator
,
'locators'
:
locators
,
'unit_usage_key'
:
usage_key
,
'child_usage_keys'
:
[
block
.
scope_ids
.
usage_id
for
block
in
xblocks
],
'component_templates'
:
json
.
dumps
(
component_templates
),
>>>>>>>
edx
/
master
'draft_preview_link'
:
preview_lms_link
,
'published_preview_link'
:
lms_link
,
'subsection'
:
containing_subsection
,
...
...
cms/djangoapps/contentstore/views/item.py
View file @
240fcc1d
...
...
@@ -20,13 +20,8 @@ from xblock.fields import Scope
from
xblock.fragment
import
Fragment
import
xmodule
<<<<<<<
HEAD
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
,
InvalidLocationError
=======
from
xmodule.modulestore.django
import
modulestore
,
loc_mapper
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
,
InvalidLocationError
,
DuplicateItemError
>>>>>>>
edx
/
master
from
xmodule.modulestore.inheritance
import
own_metadata
from
xmodule.video_module
import
manage_video_subtitles_save
...
...
@@ -182,25 +177,15 @@ def xblock_view_handler(request, usage_key_string, view_name):
accept_header
=
request
.
META
.
get
(
'HTTP_ACCEPT'
,
'application/json'
)
if
'application/json'
in
accept_header
:
<<<<<<<
HEAD
store
=
get_modulestore
(
usage_key
)
component
=
store
.
get_item
(
usage_key
)
is_read_only
=
_xblock_is_read_only
(
component
)
# wrap the generated fragment in the xmodule_editor div so that the javascript
# can bind to it correctly
component
.
runtime
.
wrappers
.
append
(
partial
(
wrap_xblock
,
'StudioRuntime'
,
usage_id_serializer
=
unicode
))
=======
store
=
get_modulestore
(
old_location
)
xblock
=
store
.
get_item
(
old_location
)
xblock
=
store
.
get_item
(
usage_key
)
is_read_only
=
_is_xblock_read_only
(
xblock
)
container_views
=
[
'container_preview'
,
'reorderable_container_child_preview'
]
unit_views
=
[
'student_view'
]
# wrap the generated fragment in the xmodule_editor div so that the javascript
# can bind to it correctly
xblock
.
runtime
.
wrappers
.
append
(
partial
(
wrap_xblock
,
'StudioRuntime'
))
>>>>>>>
edx
/
master
xblock
.
runtime
.
wrappers
.
append
(
partial
(
wrap_xblock
,
'StudioRuntime'
,
usage_id_serializer
=
unicode
))
if
view_name
==
'studio_view'
:
try
:
...
...
@@ -226,13 +211,8 @@ def xblock_view_handler(request, usage_key_string, view_name):
# which links to the new container page.
html
=
render_to_string
(
'container_xblock_component.html'
,
{
'xblock_context'
:
context
,
<<<<<<<
HEAD
'xblock'
:
component
,
'locator'
:
usage_key
,
=======
'xblock'
:
xblock
,
'locator'
:
locator
,
>>>>>>>
edx
/
master
'locator'
:
usage_key
,
})
return
JsonResponse
({
'html'
:
html
,
...
...
cms/djangoapps/contentstore/views/preview.py
View file @
240fcc1d
...
...
@@ -27,12 +27,7 @@ from util.sandboxing import can_execute_unsafe_code
import
static_replace
from
.session_kv_store
import
SessionKeyValueStore
<<<<<<<
HEAD
from
.helpers
import
render_from_lms
=======
from
.helpers
import
render_from_lms
,
xblock_has_own_studio_page
from
..utils
import
get_course_for_item
>>>>>>>
edx
/
master
from
contentstore.views.access
import
get_user_role
...
...
@@ -175,13 +170,9 @@ def _studio_wrap_xblock(xblock, view, frag, context, display_name_only=False):
"""
# Only add the Studio wrapper when on the container page. The unit page will remain as is for now.
if
context
.
get
(
'container_view'
,
None
)
and
view
==
'student_view'
:
<<<<<<<
HEAD
=======
root_xblock
=
context
.
get
(
'root_xblock'
)
is_root
=
root_xblock
and
xblock
.
location
==
root_xblock
.
location
locator
=
loc_mapper
()
.
translate_location
(
xblock
.
course_id
,
xblock
.
location
,
published
=
False
)
is_reorderable
=
_is_xblock_reorderable
(
xblock
,
context
)
>>>>>>>
edx
/
master
template_context
=
{
'xblock_context'
:
context
,
'xblock'
:
xblock
,
...
...
cms/djangoapps/contentstore/views/tests/test_container.py
deleted
100644 → 0
View file @
cd862b32
"""
Unit tests for the container view.
"""
import
json
from
contentstore.tests.utils
import
CourseTestCase
from
contentstore.utils
import
compute_publish_state
,
PublishState
from
contentstore.views.helpers
import
xblock_studio_url
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.tests.factories
import
ItemFactory
class
ContainerViewTestCase
(
CourseTestCase
):
"""
Unit tests for the container view.
"""
def
setUp
(
self
):
super
(
ContainerViewTestCase
,
self
)
.
setUp
()
self
.
chapter
=
ItemFactory
.
create
(
parent_location
=
self
.
course
.
location
,
category
=
'chapter'
,
display_name
=
"Week 1"
)
self
.
sequential
=
ItemFactory
.
create
(
parent_location
=
self
.
chapter
.
location
,
category
=
'sequential'
,
display_name
=
"Lesson 1"
)
self
.
vertical
=
ItemFactory
.
create
(
parent_location
=
self
.
sequential
.
location
,
category
=
'vertical'
,
display_name
=
'Unit'
)
self
.
child_vertical
=
ItemFactory
.
create
(
parent_location
=
self
.
vertical
.
location
,
category
=
'vertical'
,
display_name
=
'Child Vertical'
)
self
.
video
=
ItemFactory
.
create
(
parent_location
=
self
.
child_vertical
.
location
,
category
=
"video"
,
display_name
=
"My Video"
)
def
test_container_html
(
self
):
self
.
_test_html_content
(
self
.
child_vertical
,
expected_location_in_section_tag
=
self
.
child_vertical
.
location
,
expected_breadcrumbs
=
(
r'<a href="/unit/{unit_location}"\s*'
r'class="navigation-link navigation-parent">Unit</a>\s*'
r'<a href="#" class="navigation-link navigation-current">Child Vertical</a>'
)
.
format
(
unit_location
=
(
unicode
(
self
.
vertical
.
location
)
.
replace
(
"+"
,
"
\\
+"
)))
)
def
test_container_on_container_html
(
self
):
"""
Create the scenario of an xblock with children (non-vertical) on the container page.
This should create a container page that is a child of another container page.
"""
published_xblock_with_child
=
ItemFactory
.
create
(
parent_location
=
self
.
child_vertical
.
location
,
category
=
"wrapper"
,
display_name
=
"Wrapper"
)
ItemFactory
.
create
(
parent_location
=
published_xblock_with_child
.
location
,
category
=
"html"
,
display_name
=
"Child HTML"
)
expected_breadcrumbs
=
(
r'<a href="/unit/{unit_location}"\s*'
r'class="navigation-link navigation-parent">Unit</a>\s*'
r'<a href="/container/{child_vertical_location}"\s*'
r'class="navigation-link navigation-parent">Child Vertical</a>\s*'
r'<a href="#" class="navigation-link navigation-current">Wrapper</a>'
)
.
format
(
unit_location
=
unicode
(
self
.
vertical
.
location
)
.
replace
(
"+"
,
"
\\
+"
),
child_vertical_location
=
unicode
(
self
.
child_vertical
.
location
)
.
replace
(
"+"
,
"
\\
+"
),
)
self
.
_test_html_content
(
published_xblock_with_child
,
expected_location_in_section_tag
=
published_xblock_with_child
.
location
,
expected_breadcrumbs
=
expected_breadcrumbs
)
# Now make the unit and its children into a draft and validate the container again
modulestore
(
'draft'
)
.
convert_to_draft
(
self
.
vertical
.
location
)
modulestore
(
'draft'
)
.
convert_to_draft
(
self
.
child_vertical
.
location
)
draft_xblock_with_child
=
modulestore
(
'draft'
)
.
convert_to_draft
(
published_xblock_with_child
.
location
)
self
.
_test_html_content
(
draft_xblock_with_child
,
expected_location_in_section_tag
=
draft_xblock_with_child
.
location
,
expected_breadcrumbs
=
expected_breadcrumbs
)
def
_test_html_content
(
self
,
xblock
,
expected_location_in_section_tag
,
expected_breadcrumbs
):
"""
Get the HTML for a container page and verify the section tag is correct
and the breadcrumbs trail is correct.
"""
publish_state
=
compute_publish_state
(
xblock
)
url
=
xblock_studio_url
(
xblock
)
resp
=
self
.
client
.
get_html
(
url
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
html
=
resp
.
content
expected_section_tag
=
\
'<section class="wrapper-xblock level-page is-hidden" '
\
'data-locator="{child_location}" '
\
'data-course-key="{course_key}">'
.
format
(
child_location
=
unicode
(
expected_location_in_section_tag
),
course_key
=
unicode
(
expected_location_in_section_tag
.
course_key
)
)
self
.
assertIn
(
expected_section_tag
,
html
)
# Verify the navigation link at the top of the page is correct.
self
.
assertRegexpMatches
(
html
,
expected_breadcrumbs
)
# Verify the link that allows users to change publish status.
if
publish_state
==
PublishState
.
public
:
expected_message
=
'you need to edit unit <a href="/unit/{unit_location}">Unit</a> as a draft.'
else
:
expected_message
=
'your changes will be published with unit <a href="/unit/{unit_location}">Unit</a>.'
expected_unit_link
=
expected_message
.
format
(
unit_location
=
unicode
(
self
.
vertical
.
location
)
)
self
.
assertIn
(
expected_unit_link
,
html
)
def
test_container_preview_html
(
self
):
"""
Verify that an xblock returns the expected HTML for a container preview
"""
# First verify that the behavior is correct with a published container
self
.
_test_preview_html
(
self
.
vertical
)
self
.
_test_preview_html
(
self
.
child_vertical
)
# Now make the unit and its children into a draft and validate the preview again
draft_unit
=
modulestore
(
'draft'
)
.
convert_to_draft
(
self
.
vertical
.
location
)
draft_container
=
modulestore
(
'draft'
)
.
convert_to_draft
(
self
.
child_vertical
.
location
)
self
.
_test_preview_html
(
draft_unit
)
self
.
_test_preview_html
(
draft_container
)
def
_test_preview_html
(
self
,
xblock
):
"""
Verify that the specified xblock has the expected HTML elements for container preview
"""
publish_state
=
compute_publish_state
(
xblock
)
preview_url
=
'/xblock/{}/container_preview'
.
format
(
xblock
.
location
)
resp
=
self
.
client
.
get
(
preview_url
,
HTTP_ACCEPT
=
'application/json'
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
resp_content
=
json
.
loads
(
resp
.
content
)
html
=
resp_content
[
'html'
]
# Verify that there are no drag handles for public pages
drag_handle_html
=
'<span data-tooltip="Drag to reorder" class="drag-handle action"></span>'
if
publish_state
==
PublishState
.
public
:
self
.
assertNotIn
(
drag_handle_html
,
html
)
else
:
self
.
assertIn
(
drag_handle_html
,
html
)
cms/djangoapps/contentstore/views/tests/test_container_page.py
View file @
240fcc1d
...
...
@@ -36,7 +36,7 @@ class ContainerPageTestCase(StudioPageTestCase):
branch_name
=
branch_name
,
expected_section_tag
=
(
'<section class="wrapper-xblock level-page is-hidden studio-xblock-wrapper" '
'data-locator="{
branch_name}/Split_Test">'
.
format
(
branch_name
=
branch_name
)
'data-locator="{
0}" data-course-key="{0.course_key}">'
.
format
(
self
.
child_container
.
location
)
),
expected_breadcrumbs
=
(
r'<a href="/unit/{branch_name}/Unit"\s*'
...
...
@@ -66,7 +66,7 @@ class ContainerPageTestCase(StudioPageTestCase):
branch_name
=
branch_name
,
expected_section_tag
=
(
'<section class="wrapper-xblock level-page is-hidden studio-xblock-wrapper" '
'data-locator="{
branch_name}/Wrapper">'
.
format
(
branch_name
=
branch_name
)
'data-locator="{
0}" data-course-key="{0.course_key}">'
.
format
(
published_container
.
location
)
),
expected_breadcrumbs
=
(
r'<a href="/unit/{branch_name}/Unit"\s*'
...
...
cms/static/js/spec/views/pages/container_spec.js
View file @
240fcc1d
...
...
@@ -311,7 +311,7 @@ define(["jquery", "underscore", "js/spec_helpers/create_sinon", "js/spec_helpers
// verify content of request
request
=
lastRequest
();
expect
(
request
.
url
).
toEqual
(
"/xblock"
);
expect
(
request
.
url
).
toEqual
(
"/xblock
/
"
);
expect
(
request
.
method
).
toEqual
(
"POST"
);
expect
(
JSON
.
parse
(
request
.
requestBody
)).
toEqual
(
JSON
.
parse
(
...
...
cms/static/js/spec/views/unit_spec.js
View file @
240fcc1d
<<<<<<<
HEAD
define
([
"coffee/src/views/unit"
,
"js/models/module_info"
,
"js/spec_helpers/create_sinon"
,
"js/views/feedback_notification"
,
"jasmine-stealth"
],
function
(
UnitEditView
,
ModuleModel
,
create_sinon
,
NotificationView
)
{
var
verifyJSON
=
function
(
requests
,
json
)
{
var
request
=
requests
[
requests
.
length
-
1
];
expect
(
request
.
url
).
toEqual
(
"/xblock/"
);
expect
(
request
.
method
).
toEqual
(
"POST"
);
// There was a problem with order of returned parameters in strings.
// Changed to compare objects instead strings.
expect
(
JSON
.
parse
(
request
.
requestBody
)).
toEqual
(
JSON
.
parse
(
json
));
=======
define
([
"jquery"
,
"underscore"
,
"jasmine"
,
"coffee/src/views/unit"
,
"js/models/module_info"
,
"js/spec_helpers/create_sinon"
,
"js/spec_helpers/edit_helpers"
,
"jasmine-stealth"
],
function
(
$
,
_
,
jasmine
,
UnitEditView
,
ModuleModel
,
create_sinon
,
edit_helpers
)
{
...
...
@@ -21,7 +9,6 @@ define(["jquery", "underscore", "jasmine", "coffee/src/views/unit", "js/models/m
{
html
:
html
,
"resources"
:
[]
},
requestIndex
);
>>>>>>>
edx
/
master
};
initialize
=
function
(
test
)
{
...
...
cms/static/js/spec_helpers/edit_helpers.js
View file @
240fcc1d
...
...
@@ -94,7 +94,7 @@ define(["jquery", "underscore", "js/spec_helpers/create_sinon", "js/spec_helpers
verifyXBlockRequest
=
function
(
requests
,
expectedJson
)
{
var
request
=
requests
[
requests
.
length
-
1
],
actualJson
=
JSON
.
parse
(
request
.
requestBody
);
expect
(
request
.
url
).
toEqual
(
"/xblock"
);
expect
(
request
.
url
).
toEqual
(
"/xblock
/
"
);
expect
(
request
.
method
).
toEqual
(
"POST"
);
expect
(
actualJson
).
toEqual
(
expectedJson
);
};
...
...
cms/static/js/utils/module.js
View file @
240fcc1d
...
...
@@ -11,16 +11,11 @@ define(["underscore"], function (_) {
var
urlRoot
=
'/xblock'
;
var
getUpdateUrl
=
function
(
locator
)
{
<<<<<<<
HEAD
if
(
locator
===
undefined
)
{
return
urlRoot
+
"/"
;
=======
if
(
_
.
isUndefined
(
locator
))
{
return
urlRoot
;
>>>>>>>
edx
/
master
return
urlRoot
+
'/'
;
}
else
{
return
urlRoot
+
"/"
+
locator
;
return
urlRoot
+
'/'
+
locator
;
}
};
return
{
...
...
@@ -28,4 +23,3 @@ define(["underscore"], function (_) {
getUpdateUrl
:
getUpdateUrl
};
});
cms/static/js/views/pages/container.js
View file @
240fcc1d
...
...
@@ -116,7 +116,7 @@ define(["jquery", "underscore", "gettext", "js/views/feedback_notification",
requestData
=
_
.
extend
(
template
,
{
parent_locator
:
parentLocator
});
return
$
.
postJSON
(
this
.
getURLRoot
(),
requestData
,
return
$
.
postJSON
(
this
.
getURLRoot
()
+
'/'
,
requestData
,
_
.
bind
(
this
.
onNewXBlock
,
this
,
placeholderElement
,
scrollOffset
));
},
...
...
@@ -135,7 +135,7 @@ define(["jquery", "underscore", "gettext", "js/views/feedback_notification",
duplicate_source_locator
:
xblockElement
.
data
(
'locator'
),
parent_locator
:
parentElement
.
data
(
'locator'
)
};
return
$
.
postJSON
(
self
.
getURLRoot
(),
requestData
,
return
$
.
postJSON
(
self
.
getURLRoot
()
+
'/'
,
requestData
,
_
.
bind
(
self
.
onNewXBlock
,
self
,
placeholderElement
,
scrollOffset
));
});
},
...
...
cms/templates/container.html
View file @
240fcc1d
...
...
@@ -83,11 +83,7 @@ main_xblock_info = {
<section
class=
"content-area"
>
<article
class=
"content-primary window"
>
<
<<<<<<
HEAD
<
section
class=
"wrapper-xblock level-page is-hidden"
data-locator=
"${xblock_locator}"
data-course-key=
"${xblock_locator.course_key}"
>
=======
<section
class=
"wrapper-xblock level-page is-hidden studio-xblock-wrapper"
data-locator=
"${xblock_locator}"
>
>>>>>>> edx/master
<section
class=
"wrapper-xblock level-page is-hidden studio-xblock-wrapper"
data-locator=
"${xblock_locator}"
data-course-key=
"${xblock_locator.course_key}"
>
</section>
<div
class=
"no-container-content is-hidden"
>
<p>
${_("This page has no content yet.")}
</p>
...
...
cms/templates/studio_container_wrapper.html
View file @
240fcc1d
...
...
@@ -5,11 +5,11 @@ from contentstore.views.helpers import xblock_studio_url
<
%
namespace
name=
'static'
file=
'static_content.html'
/>
% if is_reorderable:
<li
class=
"studio-xblock-wrapper is-draggable"
data-locator=
"${
locator
}"
>
<li
class=
"studio-xblock-wrapper is-draggable"
data-locator=
"${
xblock.location
}"
>
% else:
<div
class=
"studio-xblock-wrapper"
>
% endif
<section
class=
"wrapper-xblock xblock-type-container level-element"
data-locator=
"${
locator
}"
>
<section
class=
"wrapper-xblock xblock-type-container level-element"
data-locator=
"${
xblock.location
}"
>
<header
class=
"xblock-header"
>
<div
class=
"header-details"
>
${xblock.display_name_with_default}
...
...
cms/templates/studio_xblock_wrapper.html
View file @
240fcc1d
<
%!
from
django
.
utils
.
translation
import
ugettext
as
_
%
>
<
<<<<<<
HEAD
%
if
xblock
.
location
!=
xblock_context
['
root_xblock
'].
location:
<%
section_class =
"level-nesting"
if
xblock
.
has_children
else
"
level-element
"
%
>
<section
class=
"wrapper-xblock ${section_class}"
data-locator=
"${xblock.location}"
data-display-name=
"${xblock.display_name_with_default | h}"
data-category=
"${xblock.category | h}"
data-course-key=
"${xblock.location.course_key}"
>
=======
% if not is_root:
% if is_reorderable:
<li
class=
"studio-xblock-wrapper is-draggable"
data-locator=
"${
locator
}"
>
<li
class=
"studio-xblock-wrapper is-draggable"
data-locator=
"${
xblock.location
}"
>
% else:
<div
class=
"studio-xblock-wrapper"
data-locator=
"${
locator
}"
>
<div
class=
"studio-xblock-wrapper"
data-locator=
"${
xblock.location
}"
>
% endif
<
%
section_class =
"level-nesting"
if
xblock
.
has_children
else
"
level-element
"
collapsible_class =
"is-collapsible"
if
xblock
.
has_children
else
""
%
>
<section
class=
"wrapper-xblock ${section_class} ${collapsible_class}"
>
>>>>>>> edx/master
<section
class=
"wrapper-xblock ${section_class} ${collapsible_class}"
data-course-key=
"${xblock.location.course_key}"
>
% endif
<header
class=
"xblock-header"
>
...
...
cms/templates/unit.html
View file @
240fcc1d
...
...
@@ -23,7 +23,7 @@ from django.utils.translation import ugettext as _
require
([
"domReady!"
,
"jquery"
,
"js/models/module_info"
,
"coffee/src/views/unit"
,
"js/collections/component_template"
,
"jquery.ui"
,
"xmodule"
,
"coffee/src/main"
,
"xblock/cms.runtime.v1"
],
function
(
doc
,
$
,
ModuleModel
,
UnitEditView
,
ComponentTemplates
)
{
window
.
unit_location_analytics
=
'${unit_
locator
}'
;
window
.
unit_location_analytics
=
'${unit_
usage_key
}'
;
var
templates
=
new
ComponentTemplates
(
$
{
component_templates
|
n
},
{
parse
:
true
});
...
...
@@ -31,7 +31,7 @@ require(["domReady!", "jquery", "js/models/module_info", "coffee/src/views/unit"
el
:
$
(
'.main-wrapper'
),
view
:
'unit'
,
model
:
new
ModuleModel
({
id
:
'${unit_
locator
}'
,
id
:
'${unit_
usage_key
}'
,
state
:
'${unit_state}'
}),
templates
:
templates
...
...
@@ -46,7 +46,7 @@ require(["domReady!", "jquery", "js/models/module_info", "coffee/src/views/unit"
</
%
block>
<
%
block
name=
"content"
>
<div
class=
"main-wrapper edit-state-${unit_state}"
data-locator=
"${unit_
locator}"
data-course-key=
"${unit_locator
.course_key}"
>
<div
class=
"main-wrapper edit-state-${unit_state}"
data-locator=
"${unit_
usage_key}"
data-course-key=
"${unit_usage_key
.course_key}"
>
<div
class=
"inner-wrapper"
>
<div
class=
"alert editing-draft-alert"
>
<p
class=
"alert-message"
><strong>
${_("You are editing a draft.")}
</strong>
...
...
@@ -60,8 +60,8 @@ require(["domReady!", "jquery", "js/models/module_info", "coffee/src/views/unit"
<article
class=
"unit-body window"
>
<p
class=
"unit-name-input"
><label
for=
"unit-display-name-input"
>
${_("Display Name:")}
</label><input
type=
"text"
value=
"${unit.display_name_with_default | h}"
id=
"unit-display-name-input"
class=
"unit-display-name-input"
/></p>
<ol
class=
"components"
>
% for
xblock in xblock
s:
<li
class=
"component"
data-locator=
"${
xblock.location}"
data-course-key=
"${xblock.location
.course_key}"
/>
% for
usage_key in child_usage_key
s:
<li
class=
"component"
data-locator=
"${
usage_key}"
data-course-key=
"${usage_key
.course_key}"
/>
% endfor
</ol>
<div
class=
"add-xblock-component new-component-item adding"
></div>
...
...
common/djangoapps/student/views.py
View file @
240fcc1d
...
...
@@ -1856,29 +1856,3 @@ def change_email_settings(request):
track
.
views
.
server_track
(
request
,
"change-email-settings"
,
{
"receive_emails"
:
"no"
,
"course"
:
course_id
},
page
=
'dashboard'
)
return
JsonResponse
({
"success"
:
True
})
<<<<<<<
HEAD
@login_required
def
token
(
request
):
'''
Return a token for the backend of annotations.
It uses the course id to retrieve a variable that contains the secret
token found in inheritance.py. It also contains information of when
the token was issued. This will be stored with the user along with
the id for identification purposes in the backend.
'''
course_id
=
SlashSeparatedCourseKey
.
from_deprecated_string
(
request
.
GET
.
get
(
"course_id"
))
course
=
course_from_id
(
course_id
)
dtnow
=
datetime
.
datetime
.
now
()
dtutcnow
=
datetime
.
datetime
.
utcnow
()
delta
=
dtnow
-
dtutcnow
newhour
,
newmin
=
divmod
((
delta
.
days
*
24
*
60
*
60
+
delta
.
seconds
+
30
)
//
60
,
60
)
newtime
=
"
%
s
%+02
d:
%02
d"
%
(
dtnow
.
isoformat
(),
newhour
,
newmin
)
secret
=
course
.
annotation_token_secret
custom_data
=
{
"issuedAt"
:
newtime
,
"consumerKey"
:
secret
,
"userId"
:
request
.
user
.
email
,
"ttl"
:
86400
}
newtoken
=
create_token
(
secret
,
custom_data
)
response
=
HttpResponse
(
newtoken
,
mimetype
=
"text/plain"
)
return
response
=======
>>>>>>>
edx
/
master
lms/templates/notes.html
View file @
240fcc1d
...
...
@@ -64,21 +64,12 @@
<section
id=
"catchDIV"
>
<div
class=
"annotationListContainer"
>
${_('You do not have any notes.')}
</div>
</section>
<
<<<<<<
HEAD
<script>
//Grab uri of the course
var
parts
=
window
.
location
.
href
.
split
(
"/"
),
uri
=
''
;
for
(
var
index
=
0
;
index
<=
6
;
index
+=
1
)
uri
+=
parts
[
index
]
+
"/"
;
//Get the unit url
=
======
<
script
>
//Grab uri of the course
var parts = window.location.href.split("/"),
uri = '';
for (var index = 0; index
<
=
6
;
index
+=
1
)
uri
+=
parts
[
index
]+"/";
//
Get
the
unit
url
>
>>>>>> edx/master
var
pagination
=
100
,
is_staff
=
false
,
options
=
{
...
...
@@ -177,11 +168,7 @@
},
},
auth
:
{
<<<<<<<
HEAD
tokenUrl:
location
.
protocol
+'//'+
location
.
host
+"/
token
?
course_id=
${course.id.to_deprecated_string()}"
=======
token
:
"${token}"
>
>>>>>> edx/master
},
store
:
{
// The endpoint of the store on your server.
...
...
lms/templates/textannotation.html
View file @
240fcc1d
...
...
@@ -35,34 +35,6 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)}
<
script
>
<<<<<<<
HEAD
function
onClickHideInstructions
(){
//Reset function if there is more than one event handler
$
(
this
).
off
();
$
(
this
).
on
(
'click'
,
onClickHideInstructions
);
var
hide
=
$
(
this
).
html
()
==
'Collapse Instructions'
?
true
:
false
,
cls
,
txt
,
slideMethod
;
txt
=
(
hide
?
'Expand'
:
'Collapse'
)
+
' Instructions'
;
cls
=
(
hide
?
[
'expanded'
,
'collapsed'
]
:
[
'collapsed'
,
'expanded'
]);
slideMethod
=
(
hide
?
'slideUp'
:
'slideDown'
);
$
(
this
).
text
(
txt
).
removeClass
(
cls
[
0
]).
addClass
(
cls
[
1
]);
$
(
this
).
parents
(
'.annotatable-section:first'
).
find
(
'.annotatable-instructions'
)[
slideMethod
]();
}
$
(
'.annotatable-toggle-instructions'
).
on
(
'click'
,
onClickHideInstructions
);
//Grab uri of the course
var
parts
=
window
.
location
.
href
.
split
(
"/"
),
uri
=
''
;
for
(
var
index
=
0
;
index
<=
9
;
index
+=
1
)
uri
+=
parts
[
index
]
+
"/"
;
//Get the unit url
//Change uri in cms
var
lms_location
=
$
(
'.sidebar .preview-button'
).
attr
(
'href'
);
if
(
typeof
lms_location
!=
'undefined'
){
uri
=
window
.
location
.
protocol
;
for
(
var
index
=
0
;
index
<=
9
;
index
+=
1
)
uri
+=
lms_location
.
split
(
"/"
)[
index
]
+
"/"
;
//Get the unit url
}
var
pagination
=
100
,
is_staff
=
!
(
'${user.is_staff}'
==
'False'
),
=======
function
onClickHideInstructions
(){
//Reset function if there is more than one event handler
$
(
this
).
off
();
...
...
@@ -91,7 +63,6 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)}
uri
+=
unit_id
;
var
pagination
=
100
,
is_staff
=
!
(
'${user.is_staff}'
==
'False'
),
>>>>>>>
edx
/
master
options
=
{
optionsAnnotator
:
{
permissions
:{
...
...
@@ -148,11 +119,7 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)}
},
},
auth
:
{
<<<<<<<
HEAD
tokenUrl
:
location
.
protocol
+
'//'
+
location
.
host
+
"/token?course_id=${course_key.to_deprecated_string()}"
=======
token
:
"${token}"
>>>>>>>
edx
/
master
},
store
:
{
// The endpoint of the store on your server.
...
...
@@ -198,20 +165,11 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)}
}
},
};
<<<<<<<
HEAD
var
imgURLRoot
=
"${settings.STATIC_URL}"
+
"js/vendor/ova/catch/img/"
;
tinyMCE
.
baseURL
=
"${settings.STATIC_URL}"
+
"js/vendor/ova"
;
//remove old instances
=======
var
imgURLRoot
=
"${settings.STATIC_URL}"
+
"js/vendor/ova/catch/img/"
;
tinymce
.
baseURL
=
"${settings.STATIC_URL}"
+
"js/vendor/tinymce/js/tinymce"
;
//remove old instances
>>>>>>>
edx
/
master
if
(
Annotator
.
_instances
.
length
!==
0
)
{
$
(
'#textHolder'
).
annotator
(
"destroy"
);
}
...
...
@@ -219,10 +177,6 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)}
//Load the plugin Video/Text Annotation
var
ova
=
new
OpenVideoAnnotation
.
Annotator
(
$
(
'#textHolder'
),
options
);
<<<<<<<
HEAD
=======
>>>>>>>
edx
/
master
//Catch
var
annotator
=
ova
.
annotator
,
catchOptions
=
{
...
...
lms/templates/videoannotation.html
View file @
240fcc1d
...
...
@@ -54,11 +54,7 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)}
$
(
'.annotatable-toggle-instructions'
).
on
(
'click'
,
onClickHideInstructions
);
//Grab uri of the course
<<<<<<<
HEAD
var
parts
=
window
.
location
.
href
.
split
(
"/"
),
=======
var
parts
=
window
.
location
.
href
.
split
(
"/"
),
>>>>>>>
edx
/
master
uri
=
''
;
for
(
var
index
=
0
;
index
<=
9
;
index
+=
1
)
uri
+=
parts
[
index
]
+
"/"
;
//Get the unit url
//Change uri in cms
...
...
@@ -67,12 +63,8 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)}
uri
=
window
.
location
.
protocol
;
for
(
var
index
=
0
;
index
<=
9
;
index
+=
1
)
uri
+=
lms_location
.
split
(
"/"
)[
index
]
+
"/"
;
//Get the unit url
}
<<<<<<<
HEAD
=======
var
unit_id
=
$
(
'#sequence-list'
).
find
(
'.active'
).
attr
(
"data-element"
);
uri
+=
unit_id
;
>>>>>>>
edx
/
master
var
pagination
=
100
,
is_staff
=
!
(
'${user.is_staff}'
==
'False'
),
options
=
{
...
...
@@ -131,11 +123,7 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)}
},
},
auth
:
{
<<<<<<<
HEAD
tokenUrl
:
location
.
protocol
+
'//'
+
location
.
host
+
"/token?course_id=${course_key.to_deprecated_string()}"
=======
token
:
"${token}"
>>>>>>>
edx
/
master
},
store
:
{
// The endpoint of the store on your server.
...
...
@@ -180,11 +168,7 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)}
};
var
imgURLRoot
=
"${settings.STATIC_URL}"
+
"js/vendor/ova/catch/img/"
;
<<<<<<<
HEAD
tinyMCE
.
baseURL
=
"${settings.STATIC_URL}"
+
"js/vendor/ova"
;
=======
tinymce
.
baseURL
=
"${settings.STATIC_URL}"
+
"js/vendor/tinymce/js/tinymce"
;
>>>>>>>
edx
/
master
//remove old instances
if
(
Annotator
.
_instances
.
length
!==
0
)
{
...
...
@@ -196,11 +180,6 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)}
ova
.
annotator
.
addPlugin
(
'Tags'
);
<<<<<<<
HEAD
=======
>>>>>>>
edx
/
master
//Catch
var
annotator
=
ova
.
annotator
,
catchOptions
=
{
...
...
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