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
a78dad77
Commit
a78dad77
authored
Jan 31, 2014
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass component display name to Mako template
STUD-1241
parent
830ad942
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
1 deletions
+23
-1
cms/djangoapps/contentstore/features/component.feature
+7
-0
cms/djangoapps/contentstore/features/component.py
+13
-0
cms/djangoapps/contentstore/views/item.py
+2
-1
cms/templates/component.html
+1
-0
No files found.
cms/djangoapps/contentstore/features/component.feature
View file @
a78dad77
...
...
@@ -112,3 +112,10 @@ Feature: CMS.Component Adding
Then
I see a Problem component with display name
"Blank Common Problem"
in position
"0"
And
I see a Problem component with display name
"Duplicate of 'Blank Common Problem'"
in position
"1"
And
I see a Problem component with display name
"Multiple Choice"
in position
"2"
Scenario
:
I
can set the display name of a component
Given
I am in Studio editing a new unit
When
I add a
"Text"
"HTML"
component
Then
I see the display name is
"Text"
When
I change the display name to
"I'm the Cuddliest!"
Then
I see the display name is
"I'm the Cuddliest!"
cms/djangoapps/contentstore/features/component.py
View file @
a78dad77
...
...
@@ -154,3 +154,16 @@ def see_component_in_position(step, display_name, index):
return
world
.
css_text
(
component_css
,
int
(
index
))
.
startswith
(
display_name
.
upper
())
world
.
wait_for
(
find_problem
,
timeout_msg
=
'Did not find the duplicated problem'
)
@step
(
u'I see the display name is "([^"]*)"'
)
def
check_component_display_name
(
step
,
display_name
):
label
=
world
.
css_text
(
".component-header"
)
assert
display_name
==
label
@step
(
u'I change the display name to "([^"]*)"'
)
def
change_display_name
(
step
,
display_name
):
world
.
edit_component_and_select_settings
()
world
.
css_fill
(
"ul.settings-list li:first-child input"
,
display_name
)
world
.
save_component
(
step
)
cms/djangoapps/contentstore/views/item.py
View file @
a78dad77
...
...
@@ -113,7 +113,8 @@ def xblock_handler(request, tag=None, package_id=None, branch=None, version_guid
return
render_to_response
(
'component.html'
,
{
'preview'
:
get_preview_html
(
request
,
component
),
'editor'
:
content
'editor'
:
content
,
'display_name'
:
component
.
display_name
,
})
elif
request
.
method
==
'DELETE'
:
delete_children
=
str_to_bool
(
request
.
REQUEST
.
get
(
'recurse'
,
'False'
))
...
...
cms/templates/component.html
View file @
a78dad77
...
...
@@ -28,6 +28,7 @@
</div>
<div
class=
"wrapper wrapper-component-action-header"
>
<div
class=
"component-header"
>
${display_name}
</div>
<ul
class=
"component-actions"
>
<li
class=
"action-item action-edit"
>
...
...
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