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
fecacf8e
Commit
fecacf8e
authored
Jun 11, 2014
by
Anton Stupak
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4039 from edx/anton/context-aware-video-index
Video Editor: Add table of contents.
parents
04c94265
d9d11a21
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
2 deletions
+36
-2
CHANGELOG.rst
+2
-0
cms/djangoapps/contentstore/features/video_editor.feature
+15
-0
cms/djangoapps/contentstore/features/video_editor.py
+13
-1
common/lib/xmodule/xmodule/video_module/video_module.py
+6
-1
No files found.
CHANGELOG.rst
View file @
fecacf8e
...
@@ -5,6 +5,8 @@ These are notable changes in edx-platform. This is a rolling list of changes,
...
@@ -5,6 +5,8 @@ These are notable changes in edx-platform. This is a rolling list of changes,
in roughly chronological order, most recent first. Add your entries at or near
in roughly chronological order, most recent first. Add your entries at or near
the top. Include a label indicating the component affected.
the top. Include a label indicating the component affected.
Blades: Add context-aware video index. BLD-933
Blades: Fix bug with incorrect link format and redirection. BLD-1049
Blades: Fix bug with incorrect link format and redirection. BLD-1049
Blades: Fix bug with incorrect RelativeTime value after XML serialization. BLD-1060
Blades: Fix bug with incorrect RelativeTime value after XML serialization. BLD-1060
...
...
cms/djangoapps/contentstore/features/video_editor.feature
View file @
fecacf8e
...
@@ -224,3 +224,18 @@ Feature: CMS Video Component Editor
...
@@ -224,3 +224,18 @@ Feature: CMS Video Component Editor
And
I click button
"Add"
And
I click button
"Add"
Then
I cannot choose
"zh"
language code
Then
I cannot choose
"zh"
language code
# 18
Scenario
:
User can see table of content at the first position
Given
I have created a Video component
And
I edit the component
And
I open tab
"Advanced"
And I upload transcript files
:
|
lang_code
|
filename
|
|
uk
|
uk_transcripts.srt
|
|
table
|
chinese_transcripts.srt
|
And
I save changes
Then
when I view the video it does show the captions
And
I see
"好 各位同学"
text in the captions
And
video language menu has
"table, uk"
translations
And
I see video language with code
"table"
at position
"0"
cms/djangoapps/contentstore/features/video_editor.py
View file @
fecacf8e
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
import
requests
import
requests
from
lettuce
import
world
,
step
from
lettuce
import
world
,
step
from
nose.tools
import
assert_true
,
assert_equal
,
assert_in
,
assert_not_equal
# pylint: disable=E0611
from
nose.tools
import
assert_true
,
assert_equal
,
assert_in
,
assert_not_equal
# pylint: disable=E0611
from
terrain.steps
import
reload_the_page
from
terrain.steps
import
reload_the_page
from
django.conf
import
settings
from
django.conf
import
settings
from
common
import
upload_file
,
attach_file
from
common
import
upload_file
,
attach_file
...
@@ -18,6 +18,10 @@ LANGUAGES = {
...
@@ -18,6 +18,10 @@ LANGUAGES = {
for
lang
,
display
in
settings
.
ALL_LANGUAGES
for
lang
,
display
in
settings
.
ALL_LANGUAGES
}
}
LANGUAGES
.
update
({
'table'
:
'Table of Contents'
})
TRANSLATION_BUTTONS
=
{
TRANSLATION_BUTTONS
=
{
'add'
:
'.metadata-video-translations .create-action'
,
'add'
:
'.metadata-video-translations .create-action'
,
'upload'
:
'.metadata-video-translations .upload-action'
,
'upload'
:
'.metadata-video-translations .upload-action'
,
...
@@ -306,3 +310,11 @@ def i_see_correct_langs(_step, langs):
...
@@ -306,3 +310,11 @@ def i_see_correct_langs(_step, langs):
for
lang_code
,
label
in
translations
.
items
():
for
lang_code
,
label
in
translations
.
items
():
assert_true
(
any
([
i
.
text
==
label
for
i
in
items
]))
assert_true
(
any
([
i
.
text
==
label
for
i
in
items
]))
assert_true
(
any
([
i
[
'data-lang-code'
]
==
lang_code
for
i
in
items
]))
assert_true
(
any
([
i
[
'data-lang-code'
]
==
lang_code
for
i
in
items
]))
@step
(
'video language with code "([^"]*)" at position "(
\
d+)"$'
)
def
i_see_lang_at_position
(
_step
,
code
,
position
):
menu_name
=
'language'
open_menu
(
menu_name
)
item
=
world
.
css_find
(
VIDEO_MENUS
[
menu_name
]
+
' li'
)[
int
(
position
)]
assert_equal
(
item
[
'data-lang-code'
],
code
)
common/lib/xmodule/xmodule/video_module/video_module.py
View file @
fecacf8e
...
@@ -129,7 +129,11 @@ class VideoModule(VideoFields, VideoStudentViewHandlers, XModule):
...
@@ -129,7 +129,11 @@ class VideoModule(VideoFields, VideoStudentViewHandlers, XModule):
languages
[
'en'
]
=
'English'
languages
[
'en'
]
=
'English'
# OrderedDict for easy testing of rendered context in tests
# OrderedDict for easy testing of rendered context in tests
sorted_languages
=
OrderedDict
(
sorted
(
languages
.
items
(),
key
=
itemgetter
(
1
)))
sorted_languages
=
sorted
(
languages
.
items
(),
key
=
itemgetter
(
1
))
if
'table'
in
self
.
transcripts
:
sorted_languages
.
insert
(
0
,
(
'table'
,
'Table of Contents'
))
sorted_languages
=
OrderedDict
(
sorted_languages
)
return
self
.
system
.
render_template
(
'video.html'
,
{
return
self
.
system
.
render_template
(
'video.html'
,
{
'ajax_url'
:
self
.
system
.
ajax_url
+
'/save_user_state'
,
'ajax_url'
:
self
.
system
.
ajax_url
+
'/save_user_state'
,
...
@@ -254,6 +258,7 @@ class VideoDescriptor(VideoFields, VideoStudioViewHandlers, TabsEditingDescripto
...
@@ -254,6 +258,7 @@ class VideoDescriptor(VideoFields, VideoStudioViewHandlers, TabsEditingDescripto
languages
=
[{
'label'
:
label
,
'code'
:
lang
}
for
lang
,
label
in
settings
.
ALL_LANGUAGES
if
lang
!=
u'en'
]
languages
=
[{
'label'
:
label
,
'code'
:
lang
}
for
lang
,
label
in
settings
.
ALL_LANGUAGES
if
lang
!=
u'en'
]
languages
.
sort
(
key
=
lambda
l
:
l
[
'label'
])
languages
.
sort
(
key
=
lambda
l
:
l
[
'label'
])
languages
.
insert
(
0
,
{
'label'
:
'Table of Contents'
,
'code'
:
'table'
})
editable_fields
[
'transcripts'
][
'languages'
]
=
languages
editable_fields
[
'transcripts'
][
'languages'
]
=
languages
editable_fields
[
'transcripts'
][
'type'
]
=
'VideoTranslations'
editable_fields
[
'transcripts'
][
'type'
]
=
'VideoTranslations'
editable_fields
[
'transcripts'
][
'urlRoot'
]
=
self
.
runtime
.
handler_url
(
self
,
'studio_transcript'
,
'translation'
)
.
rstrip
(
'/?'
)
editable_fields
[
'transcripts'
][
'urlRoot'
]
=
self
.
runtime
.
handler_url
(
self
,
'studio_transcript'
,
'translation'
)
.
rstrip
(
'/?'
)
...
...
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