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
60cf22e4
Commit
60cf22e4
authored
Oct 17, 2012
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
work in progress: set start date
parent
b76556b9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
3 deletions
+53
-3
cms/static/js/base.js
+41
-0
cms/templates/overview.html
+12
-3
No files found.
cms/static/js/base.js
View file @
60cf22e4
...
...
@@ -77,6 +77,10 @@ $(document).ready(function() {
$
(
'.new-course-button'
).
bind
(
'click'
,
addNewCourse
);
// section name editing
$
(
'.section-name'
).
bind
(
'click'
,
editSectionName
);
$
(
'.edit-section-name-cancel'
).
bind
(
'click'
,
cancelEditSectionName
);
$
(
'.edit-section-name-save'
).
bind
(
'click'
,
saveEditSectionName
);
});
function
showImportSubmit
(
e
)
{
...
...
@@ -576,3 +580,40 @@ function cancelNewSubsection(e) {
e
.
preventDefault
();
$
(
this
).
parents
(
'li.branch'
).
remove
();
}
function
editSectionName
(
e
)
{
e
.
preventDefault
();
$
(
this
).
children
(
'div.section-name-edit'
).
show
();
$
(
this
).
children
(
'span.section-name-span'
).
hide
();
}
function
cancelEditSectionName
(
e
)
{
e
.
preventDefault
();
$
(
this
).
parent
().
hide
();
$
(
this
).
parent
().
siblings
(
'span.section-name-span'
).
show
();
e
.
stopPropagation
();
}
function
saveEditSectionName
(
e
)
{
e
.
preventDefault
();
id
=
$
(
this
).
closest
(
"section.courseware-section"
).
data
(
"id"
);
display_name
=
$
(
this
).
prev
(
'.edit-section-name'
).
val
();
var
$_this
=
$
(
this
);
// call into server to commit the new order
$
.
ajax
({
url
:
"/save_item"
,
type
:
"POST"
,
dataType
:
"json"
,
contentType
:
"application/json"
,
data
:
JSON
.
stringify
({
'id'
:
id
,
'metadata'
:
{
'display_name'
:
display_name
},
'data'
:
null
,
'children'
:
null
})
}).
success
(
function
()
{
alert
(
'Your changes have been saved.'
);
$_this
.
parent
().
siblings
(
'span.section-name-span'
).
html
(
display_name
);
$_this
.
parent
().
siblings
(
'span.section-name-span'
).
show
();
$_this
.
parent
().
hide
();
e
.
stopPropagation
();
});
}
cms/templates/overview.html
View file @
60cf22e4
...
...
@@ -52,9 +52,18 @@
<section
class=
"courseware-section branch"
data-id=
"${section.location}"
>
<header>
<a
href=
"#"
class=
"expand-collapse-icon collapse"
></a>
<div
class=
"item-details"
>
<h3>
${section.display_name}
</h3>
<h4><strong>
Unscheduled:
</strong>
<a
href=
"#"
>
click here to set
</a></h4>
<div
class=
"item-details"
data-id=
"${section.location}"
>
<h3
class=
"section-name"
>
<span
class=
"section-name-span"
>
${section.display_name}
</span>
<div
class=
"section-name-edit"
style=
"display:none"
>
<input
type=
"text"
value=
"${section.display_name}"
class=
"edit-section-name"
autocomplete=
"off"
/>
<a
href=
"#"
class=
"edit-section-name-save"
>
Save
</a><a
href=
"#"
class=
"edit-section-name-cancel"
>
Cancel
</a>
</div>
</h3>
<h4>
<strong>
Unscheduled:
</strong>
<a
href=
"#"
class=
"set-publish-date"
>
click here to set
</a>
</h4>
</div>
<div
class=
"item-actions"
>
<a
href=
"#"
class=
"delete-button delete-section-button"
><span
class=
"delete-icon"
></span></a>
...
...
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