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
a25d6b08
Commit
a25d6b08
authored
Nov 27, 2012
by
Tom Giannattasio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrapped up data syncing and date format issues
parent
335c6949
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
8 deletions
+23
-8
cms/static/js/models/course_info.js
+1
-1
cms/static/js/views/course_info_edit.js
+12
-3
cms/static/sass/_course-info.scss
+10
-3
cms/templates/course_info.html
+0
-1
No files found.
cms/static/js/models/course_info.js
View file @
a25d6b08
...
...
@@ -15,7 +15,7 @@ CMS.Models.CourseInfo = Backbone.Model.extend({
// course update -- biggest kludge here is the lack of a real id to map updates to originals
CMS
.
Models
.
CourseUpdate
=
Backbone
.
Model
.
extend
({
defaults
:
{
"date"
:
$
.
datepicker
.
formatDate
(
'MM d'
,
new
Date
()),
"date"
:
$
.
datepicker
.
formatDate
(
'MM d
, yy
'
,
new
Date
()),
"content"
:
""
}
});
...
...
cms/static/js/views/course_info_edit.js
View file @
a25d6b08
...
...
@@ -67,10 +67,11 @@ CMS.Views.ClassInfoUpdateView = Backbone.View.extend({
var
updateEle
=
this
.
$el
.
find
(
"#course-update-list"
);
$
(
updateEle
).
prepend
(
$newForm
);
$newForm
.
addClass
(
'editing'
);
this
.
$currentPost
=
$newForm
.
closest
(
'li'
);
$modalCover
.
show
();
$modalCover
.
bind
(
'click'
,
function
()
{
self
.
closeEditor
(
self
);
self
.
closeEditor
(
self
,
true
);
});
$
(
'.date'
).
datepicker
(
'destroy'
);
...
...
@@ -89,7 +90,7 @@ CMS.Views.ClassInfoUpdateView = Backbone.View.extend({
// change editor contents back to model values and hide the editor
$
(
this
.
editor
(
event
)).
hide
();
var
targetModel
=
this
.
eventModel
(
event
);
this
.
closeEditor
(
this
);
this
.
closeEditor
(
this
,
!
targetModel
.
id
);
},
onEdit
:
function
(
event
)
{
...
...
@@ -116,13 +117,21 @@ CMS.Views.ClassInfoUpdateView = Backbone.View.extend({
});
},
closeEditor
:
function
(
self
)
{
closeEditor
:
function
(
self
,
removePost
)
{
var
targetModel
=
self
.
collection
.
getByCid
(
self
.
$currentPost
.
attr
(
'name'
));
if
(
removePost
)
{
self
.
$currentPost
.
remove
();
}
// close the modal and insert the appropriate data
self
.
$currentPost
.
removeClass
(
'editing'
);
self
.
$currentPost
.
find
(
'.date-display'
).
html
(
targetModel
.
get
(
'date'
));
self
.
$currentPost
.
find
(
'.date'
).
val
(
targetModel
.
get
(
'date'
));
self
.
$currentPost
.
find
(
'.update-contents'
).
html
(
targetModel
.
get
(
'content'
));
self
.
$currentPost
.
find
(
'.new-update-content'
).
val
(
targetModel
.
get
(
'content'
));
self
.
$currentPost
.
find
(
'form'
).
hide
();
$modalCover
.
unbind
(
'click'
);
$modalCover
.
hide
();
},
...
...
cms/static/sass/_course-info.scss
View file @
a25d6b08
.course-updates
{
padding
:
30px
40px
;
li
{
.update-list
>
li
{
padding
:
34px
0
42px
;
border-top
:
1px
solid
#cbd1db
;
border-top
:
1px
solid
#cbd1db
;
&
.editing
{
position
:
relative
;
...
...
@@ -19,6 +19,12 @@
}
}
h1
{
float
:
none
;
font-size
:
24px
;
font-weight
:
300
;
}
h2
{
margin-bottom
:
18px
;
font-size
:
14px
;
...
...
@@ -50,13 +56,14 @@
@include
blue-button
;
display
:
block
;
text-align
:
center
;
padding
:
1
2
px
0
;
padding
:
1
8
px
0
;
margin-bottom
:
28px
;
}
.new-update-form
{
@include
edit-box
;
margin-bottom
:
24px
;
padding
:
30px
;
border
:
none
;
textarea
{
...
...
cms/templates/course_info.html
View file @
a25d6b08
...
...
@@ -39,7 +39,6 @@
<h1>
Course Info
</h1>
<div
class=
"main-column"
>
<article
class=
"course-updates window"
id=
"course-update-view"
>
<h2>
Updates
</h2>
<a
href=
"#"
class=
"new-update-button"
>
New Update
</a>
<ol
class=
"update-list"
id=
"course-update-list"
></ol>
<!-- probably replace w/ a vertical where each element of the vertical is a separate update w/ a date and html field -->
...
...
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