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
01ede40b
Commit
01ede40b
authored
May 02, 2013
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switching branches
parent
6ee2ab86
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
13 deletions
+24
-13
cms/djangoapps/contentstore/views.py
+1
-0
cms/static/coffee/src/views/module_edit.coffee
+2
-0
cms/static/js/base.js
+7
-7
cms/templates/base.html
+1
-1
cms/templates/widgets/metadata-edit.html
+12
-2
cms/templates/widgets/source-edit.html
+1
-1
common/lib/xmodule/xmodule/templates/problem/empty.yaml
+0
-2
No files found.
cms/djangoapps/contentstore/views.py
View file @
01ede40b
...
...
@@ -682,6 +682,7 @@ def save_item(request):
del
existing_item
.
_model_data
[
metadata_key
]
del
posted_metadata
[
metadata_key
]
else
:
# TODO, in here check if value is the same before setting.
existing_item
.
_model_data
[
metadata_key
]
=
value
# commit to datastore
...
...
cms/static/coffee/src/views/module_edit.coffee
View file @
01ede40b
...
...
@@ -35,6 +35,8 @@ class CMS.Views.ModuleEdit extends Backbone.View
return
_metadata
getMetadata
:
->
cloneTemplate
:
(
parent
,
template
)
->
$
.
post
(
"/clone_item"
,
{
parent_location
:
parent
...
...
cms/static/js/base.js
View file @
01ede40b
...
...
@@ -845,15 +845,15 @@ function saveSetSectionScheduleDate(e) {
data
:
JSON
.
stringify
({
'id'
:
id
,
'metadata'
:
{
'start'
:
start
}})
}).
success
(
function
()
{
var
$thisSection
=
$
(
'.courseware-section[data-id="'
+
id
+
'"]'
);
var
format
=
gettext
(
'<strong>Will Release:</strong> %(date)s at $(time)s UTC'
);
var
format
=
gettext
(
'<strong>Will Release:</strong> %(date)s at $(time)s UTC'
);
var
willReleaseAt
=
interpolate
(
format
,
[
input_date
,
input_time
],
true
);
$thisSection
.
find
(
'.section-published-date'
).
html
(
'<span class="published-status">'
+
willReleaseAt
+
'</span>'
+
'<a href="#" class="edit-button" '
+
'" data-date="'
+
input_date
+
'" data-time="'
+
input_time
+
'" data-id="'
+
id
+
'">'
+
gettext
(
'Edit'
)
+
'</a>'
);
'<span class="published-status">'
+
willReleaseAt
+
'</span>'
+
'<a href="#" class="edit-button" '
+
'" data-date="'
+
input_date
+
'" data-time="'
+
input_time
+
'" data-id="'
+
id
+
'">'
+
gettext
(
'Edit'
)
+
'</a>'
);
$thisSection
.
find
(
'.section-published-date'
).
animate
({
'background-color'
:
'rgb(182,37,104)'
},
300
).
animate
({
...
...
cms/templates/base.html
View file @
01ede40b
...
...
@@ -30,7 +30,7 @@
<body
class=
"<%block name='bodyclass'></%block> hide-wip"
>
<
%
include
file=
"courseware_vendor_js.html"
/>
<script
type=
"text/javascript"
src=
"jsi18n/"
></script>
<script
type=
"text/javascript"
src=
"
/
jsi18n/"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/json2.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/underscore-min.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/backbone-min.js')}"
></script>
...
...
cms/templates/widgets/metadata-edit.html
View file @
01ede40b
<
%
import
hashlib
from
xmodule
.
fields
import
StringyInteger
,
StringyFloat
hlskey =
hashlib.md5(module.location.url()).hexdigest()
%
>
<section
class=
"metadata_edit"
>
...
...
@@ -12,8 +13,17 @@
% endif
% else:
<label>
${field_value['field'].display_name}:
</label>
<input
type=
'text'
data-metadata-name=
'${field_value["field"].display_name}'
value=
'${field_value["field"].to_json(field_value["value"])}'
size=
'60'
/>
% if False:
<input
type=
'text'
data-metadata-name=
'${field_value["field"].display_name}'
##
This
is
a
hack
to
keep
current
behavior
for
weight
and
attempts
(
empty
will
parse
OK
as
unset
).
##
This
hack
will
go
away
with
our
custom
editors
.
%
if
field_value
["
value
"]
==
None
and
(
isinstance
(
field_value
["
field
"],
StringyFloat
)
or
isinstance
(
field_value
["
field
"],
StringyInteger
))
:
value =
''
%
else:
value=
'${field_value["field"].to_json(field_value["value"])}'
%
endif
size=
'60'
/>
## Change to True to see all the information being passed through.
% if True:
<label>
Help: ${field_value['field'].help}
</label>
<label>
Type: ${type(field_value['field']).__name__}
</label>
<label>
Inherited: ${field_value['is_inherited']}
</label>
...
...
cms/templates/widgets/source-edit.html
View file @
01ede40b
...
...
@@ -12,7 +12,7 @@
<form
id=
"hls-form"
enctype=
"multipart/form-data"
>
<section
class=
"source-edit"
>
<textarea
name=
""
data-metadata-name=
"source_code"
class=
"source-edit-box hls-data"
rows=
"8"
cols=
"40"
>
${editable_metadata_fields['source_code']|h}
</textarea>
<textarea
name=
""
data-metadata-name=
"source_code"
class=
"source-edit-box hls-data"
rows=
"8"
cols=
"40"
>
${editable_metadata_fields['source_code']
['value']
|h}
</textarea>
</section>
<div
class=
"submit"
>
<button
type=
"reset"
class=
"hls-compile"
>
Save
&
Compile to edX XML
</button>
...
...
common/lib/xmodule/xmodule/templates/problem/empty.yaml
View file @
01ede40b
---
metadata
:
display_name
:
Blank Common Problem
rerandomize
:
never
showanswer
:
always
markdown
:
"
"
weight
:
"
"
empty
:
True
attempts
:
"
"
data
:
|
...
...
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