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
a9927727
Commit
a9927727
authored
Nov 07, 2012
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add new files
parent
9cc1af50
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
113 additions
and
0 deletions
+113
-0
cms/static/coffee/src/views/tabs.coffee
+54
-0
cms/templates/edit-tabs.html
+41
-0
common/lib/xmodule/xmodule/templates/about/empty.yaml
+6
-0
common/lib/xmodule/xmodule/templates/courseinfo/empty.yaml
+6
-0
common/lib/xmodule/xmodule/templates/statictab/empty.yaml
+6
-0
No files found.
cms/static/coffee/src/views/tabs.coffee
0 → 100644
View file @
a9927727
class
CMS
.
Views
.
TabsEdit
extends
Backbone
.
View
events
:
'click .new-tab'
:
'addNewTab'
initialize
:
=>
@
$
(
'.component'
).
each
((
idx
,
element
)
=>
new
CMS
.
Views
.
ModuleEdit
(
el
:
element
,
onDelete
:
@
deleteTab
,
model
:
new
CMS
.
Models
.
Module
(
id
:
$
(
element
).
data
(
'id'
),
)
)
)
@
$
(
'.components'
).
sortable
(
handle
:
'.drag-handle'
update
:
(
event
,
ui
)
=>
alert
'got it!'
helper
:
'clone'
opacity
:
'0.5'
placeholder
:
'component-placeholder'
forcePlaceholderSize
:
true
axis
:
'y'
items
:
'> .component'
)
addNewTab
:
(
event
)
=>
event
.
preventDefault
()
editor
=
new
CMS
.
Views
.
ModuleEdit
(
onDelete
:
@
deleteTab
model
:
new
CMS
.
Models
.
Module
()
)
$
(
'.new-component-item'
).
before
(
editor
.
$el
)
editor
.
cloneTemplate
(
@
model
.
get
(
'id'
),
'i4x://edx/templates/static_tab/Empty'
)
deleteTab
:
(
event
)
=>
if
not
confirm
'Are you sure you want to delete this component? This action cannot be undone.'
return
$component
=
$
(
event
.
currentTarget
).
parents
(
'.component'
)
$
.
post
(
'/delete_item'
,
{
id
:
$component
.
data
(
'id'
)
},
=>
$component
.
remove
()
)
cms/templates/edit-tabs.html
0 → 100644
View file @
a9927727
<
%
inherit
file=
"base.html"
/>
<
%!
from
django
.
core
.
urlresolvers
import
reverse
%
>
<
%
block
name=
"title"
>
Tabs
</
%
block>
<
%
block
name=
"bodyclass"
>
static-pages
</
%
block>
<
%
block
name=
"jsextra"
>
<script
type=
'text/javascript'
>
new
CMS
.
Views
.
TabsEdit
({
el
:
$
(
'.main-wrapper'
),
model
:
new
CMS
.
Models
.
Module
({
id
:
'${context_course.location}'
})
});
</script>
</
%
block>
<
%
block
name=
"content"
>
<div
class=
"main-wrapper"
>
<div
class=
"inner-wrapper"
>
<h1>
Static Tabs
</h1>
<div
class=
"main-column"
>
<article
class=
"unit-body window"
>
<div
class=
"tab-list"
>
<ol
class=
'components'
>
% for id in components:
<li
class=
"component"
data-id=
"${id}"
/>
% endfor
<li
class=
"new-component-item"
>
<a
href=
"#"
class=
"new-component-button new-tab"
>
<span
class=
"plus-icon"
></span>
New Tab
</a>
</li>
</ol>
</div>
</article>
</div>
</div>
</div>
</
%
block>
\ No newline at end of file
common/lib/xmodule/xmodule/templates/about/empty.yaml
0 → 100644
View file @
a9927727
---
metadata
:
display_name
:
Empty
data
:
"
This
is
where
you
can
add
additional
information
about
your
course."
children
:
[]
\ No newline at end of file
common/lib/xmodule/xmodule/templates/courseinfo/empty.yaml
0 → 100644
View file @
a9927727
---
metadata
:
display_name
:
Empty
data
:
"
This
is
where
you
can
add
additional
information
about
your
course."
children
:
[]
\ No newline at end of file
common/lib/xmodule/xmodule/templates/statictab/empty.yaml
0 → 100644
View file @
a9927727
---
metadata
:
display_name
:
Empty
data
:
"
This
is
where
you
can
add
additional
pages
to
your
courseware.
Click
the
'edit'
button
to
begin
editing."
children
:
[]
\ No newline at end of file
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