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
f4b06b2e
Commit
f4b06b2e
authored
May 10, 2013
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Beginnings of is-set work.
parent
fd52980a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
30 additions
and
4 deletions
+30
-4
cms/static/client_templates/metadata_editor.html
+2
-2
cms/static/client_templates/metadata_string_entry.html
+1
-2
cms/static/js/views/metadata_editor_view.js
+2
-0
cms/static/js/views/metadata_number_view.js
+15
-0
cms/static/js/views/metadata_option_view.js
+5
-0
cms/static/js/views/metadata_string_view.js
+4
-0
cms/templates/base.html
+1
-0
No files found.
cms/static/client_templates/metadata_editor.html
View file @
f4b06b2e
<ul
class=
"list-input settings-list"
>
<
%
_
.
each
(
metadata_entries
,
function
(
entry
)
{
%
>
<li
class=
"field comp-setting-entry"
>
<div
class=
'metadata_entry'
/>
<li
class=
"field comp-setting-entry metadata_entry"
>
</li>
<
%
})
%
>
</ul>
\ No newline at end of file
cms/static/client_templates/metadata_string_entry.html
View file @
f4b06b2e
...
...
@@ -5,4 +5,4 @@
<i
class=
"ss-icon ss-symbolicons-block undo"
>
↩
</i>
</button>
</div>
<span
class=
"tip setting-help"
><
%=
model
.
get
('
help
')
%
></span>
\ No newline at end of file
<span
class=
"tip setting-help"
><
%=
model
.
get
('
help
')
%
></span>
cms/static/js/views/metadata_editor_view.js
View file @
f4b06b2e
...
...
@@ -24,6 +24,8 @@ CMS.Views.Metadata.Editor = Backbone.View.extend({
model
:
new
CMS
.
Models
.
Metadata
(
item
)
};
if
(
item
.
options
.
length
>
0
)
{
// Right now, all our option types only hold strings. Should really support
// any type though.
self
.
views
[
key
]
=
new
CMS
.
Views
.
Metadata
.
Option
(
data
);
}
else
{
...
...
cms/static/js/views/metadata_number_view.js
0 → 100644
View file @
f4b06b2e
if
(
!
CMS
.
Views
[
'Metadata'
])
CMS
.
Views
.
Metadata
=
{};
CMS
.
Views
.
Metadata
.
Number
=
CMS
.
Views
.
Metadata
.
String
.
extend
({
getValue
:
function
()
{
var
stringVal
=
this
.
$el
.
find
(
'#'
+
this
.
uniqueId
).
val
();
if
(
this
.
isInteger
)
{
return
parseInt
(
stringVal
)
}
else
{
return
parseFloat
(
stringVal
)
}
}
});
\ No newline at end of file
cms/static/js/views/metadata_option_view.js
View file @
f4b06b2e
...
...
@@ -18,6 +18,11 @@ CMS.Views.Metadata.Option = Backbone.View.extend({
$
(
'#'
+
self
.
uniqueId
+
" option"
).
filter
(
function
()
{
return
$
(
this
).
text
()
===
self
.
model
.
get
(
'value'
);
}).
prop
(
'selected'
,
true
);
if
(
self
.
model
.
get
(
'explicitly_set'
))
{
self
.
$el
.
addClass
(
'is-set'
);
self
.
$el
.
find
(
'#'
+
self
.
uniqueId
+
" .setting-clear"
).
addClass
(
'active'
);
}
}
);
},
...
...
cms/static/js/views/metadata_string_view.js
View file @
f4b06b2e
...
...
@@ -15,6 +15,10 @@ CMS.Views.Metadata.String = Backbone.View.extend({
function
(
raw_template
)
{
self
.
template
=
_
.
template
(
raw_template
);
self
.
$el
.
append
(
self
.
template
({
model
:
self
.
model
,
uniqueId
:
self
.
uniqueId
}));
if
(
self
.
model
.
get
(
'explicitly_set'
))
{
self
.
$el
.
addClass
(
'is-set'
);
self
.
$el
.
find
(
'#'
+
self
.
uniqueId
+
" .setting-clear"
).
addClass
(
'active'
);
}
}
);
},
...
...
cms/templates/base.html
View file @
f4b06b2e
...
...
@@ -53,6 +53,7 @@
<!--TODO: not the right place-->
<script
type=
"text/javascript"
src=
"${static.url('js/models/metadata_model.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/views/metadata_string_view.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/views/metadata_number_view.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/views/metadata_option_view.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/models/metadata_editor.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/views/metadata_editor_view.js')}"
></script>
...
...
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