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
fdf647c0
Commit
fdf647c0
authored
Jun 22, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split problem metadata out from problem editing contents when rendering
parent
3eadcd29
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
66 additions
and
71 deletions
+66
-71
cms/djangoapps/contentstore/views.py
+1
-2
cms/static/sass/_problem.scss
+39
-39
cms/templates/unit.html
+18
-2
cms/templates/widgets/html-edit.html
+2
-25
common/lib/xmodule/js/module/html.coffee
+6
-3
No files found.
cms/djangoapps/contentstore/views.py
View file @
fdf647c0
from
mitxmako.shortcuts
import
render_to_response
from
keystore.django
import
keystore
from
django.contrib.auth.decorators
import
login_required
from
django.http
import
HttpResponse
def
index
(
request
):
...
...
@@ -20,4 +18,5 @@ def edit_item(request):
return
render_to_response
(
'unit.html'
,
{
'contents'
:
item
.
get_html
(),
'type'
:
item
.
type
,
'name'
:
item
.
name
,
})
cms/static/sass/_problem.scss
View file @
fdf647c0
section
.problem-new
,
section
.problem-edit
,
section
.html-edit
{
section
#unit-wrapper
{
>
header
{
border-bottom
:
2px
solid
#333
;
@include
clearfix
();
...
...
@@ -17,54 +15,56 @@ section.html-edit {
float
:
right
;
}
}
>
section
{
padding
:
20px
;
textarea
{
@include
box-sizing
(
border-box
);
display
:
block
;
width
:
100%
;
a
.save-update
{
@extend
.button
;
@include
inline-block
();
margin-top
:
20px
;
}
}
}
section
.problem-new
,
section
.problem-edit
,
section
.html-edit
{
textarea
{
@include
box-sizing
(
border-box
);
display
:
block
;
width
:
100%
;
}
div
.preview
{
background
:
#eee
;
@include
box-sizing
(
border-box
);
min-height
:
40px
;
padding
:
10px
;
width
:
100%
;
margin-top
:
10px
;
h1
{
font-size
:
24px
;
margin-bottom
:
1em
;
}
div
.preview
{
background
:
#eee
;
@include
box-sizing
(
border-box
);
min-height
:
40px
;
padding
:
10px
;
width
:
100%
;
margin-top
:
10px
;
h2
{
font-size
:
20
px
;
margin-bottom
:
1em
;
}
h1
{
font-size
:
24
px
;
margin-bottom
:
1em
;
}
h3
{
font-size
:
18
;
margin-bottom
:
1em
;
}
h2
{
font-size
:
20px
;
margin-bottom
:
1em
;
}
ul
{
padding-left
:
20px
;
margin-bottom
:
1em
;
}
h3
{
font-size
:
18
;
margin-bottom
:
1em
;
}
p
{
margin-bottom
:
1em
;
}
ul
{
padding-left
:
20px
;
margin-bottom
:
1em
;
}
a
.save-update
{
@extend
.button
;
@include
inline-block
();
margin-top
:
20px
;
p
{
margin-bottom
:
1em
;
}
}
}
...
...
cms/templates/unit.html
View file @
fdf647c0
<div
id=
"unit-wrapper"
class=
"${type}"
>
<section
id=
"unit-wrapper"
class=
"${type}"
>
<header>
<h1
class=
"editable"
>
${name}
</h1>
<p>
Unit type: ${type}
</p>
<!-- <div class="actions"> -->
<!-- <a href="#" class="cancel">Cancel</a> -->
<!-- <a href="#" class="save-update">Save & Update</a> -->
<!-- </div> -->
</header>
<section>
${contents}
</div>
</section>
<section>
<div
class=
"actions"
>
<a
href=
""
class=
"save-update"
>
Save
&
Update
</a>
<a
href=
"#"
class=
"cancel"
>
Cancel
</a>
</div>
</section>
</section>
cms/templates/widgets/html-edit.html
View file @
fdf647c0
<
%
namespace
name=
'static'
file=
'../static_content.html'
/>
<section
class=
"html-edit"
>
<header>
<h1
class=
"editable"
>
${module.name}
</h1>
<p>
Unit type: HTML
</p>
<!-- <div class="actions"> -->
<!-- <a href="#" class="cancel">Cancel</a> -->
<!-- <a href="#" class="save-update">Save & Update</a> -->
<!-- </div> -->
</header>
<section>
<header>
</header>
<section>
<textarea
name=
""
id=
"edit-box"
rows=
"8"
cols=
"40"
>
${module.definition['data']['text']}
</textarea>
<div
id=
"edit-preview"
class=
"preview"
>
${module.definition['data']['text']}
</div>
</section>
<div
class=
"actions"
>
<a
href=
""
class=
"save-update"
>
Save
&
Update
</a>
<a
href=
"#"
class=
"cancel"
>
Cancel
</a>
</div>
</section>
<textarea
name=
""
class=
"edit-box"
rows=
"8"
cols=
"40"
>
${module.definition['data']['text']}
</textarea>
<div
class=
"preview"
>
${module.definition['data']['text']}
</div>
</section>
common/lib/xmodule/js/module/html.coffee
View file @
fdf647c0
class
@
HTML
constructor
:
(
id
)
->
$
(
'#'
+
id
+
" #edit-box"
).
on
(
'input'
,
->
$
(
'#'
+
id
+
' #edit-preview'
).
empty
().
append
(
$
(
this
).
val
())
constructor
:
(
@
id
)
->
id
=
@
id
$
(
"#
#{
id
}
.edit-box"
).
on
(
'input'
,
->
$
(
"#
#{
id
}
.preview"
).
empty
().
append
(
$
(
this
).
val
())
)
save
:
->
$
(
"#
#{
@
id
}
.edit-box"
).
val
()
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