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
bd5d5f14
Commit
bd5d5f14
authored
Oct 05, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make location view state update as the state changes on the unit page
parent
81b6d757
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
9 deletions
+41
-9
cms/static/coffee/src/views/unit.coffee
+12
-0
cms/static/sass/_cms_mixins.scss
+23
-3
cms/static/sass/_graphics.scss
+3
-4
cms/templates/widgets/units.html
+3
-2
No files found.
cms/static/coffee/src/views/unit.coffee
View file @
bd5d5f14
...
@@ -22,6 +22,11 @@ class CMS.Views.UnitEdit extends Backbone.View
...
@@ -22,6 +22,11 @@ class CMS.Views.UnitEdit extends Backbone.View
model
:
@
model
model
:
@
model
)
)
@
locationView
=
new
CMS
.
Views
.
UnitEdit
.
LocationState
(
el
:
@
$
(
'.section-item.editing a'
)
model
:
@
model
)
@
model
.
on
(
'change:state'
,
@
render
)
@
model
.
on
(
'change:state'
,
@
render
)
@
$newComponentItem
=
@
$
(
'.new-component-item'
)
@
$newComponentItem
=
@
$
(
'.new-component-item'
)
...
@@ -150,6 +155,13 @@ class CMS.Views.UnitEdit extends Backbone.View
...
@@ -150,6 +155,13 @@ class CMS.Views.UnitEdit extends Backbone.View
@
model
.
set
(
'state'
,
@
$
(
'#visibility'
).
val
())
@
model
.
set
(
'state'
,
@
$
(
'#visibility'
).
val
())
)
)
class
CMS
.
Views
.
UnitEdit
.
LocationState
extends
Backbone
.
View
initialize
:
=>
@
model
.
on
(
'change:state'
,
@
render
)
render
:
=>
@
$el
.
toggleClass
(
"
#{
@
model
.
previous
(
'state'
)
}
-item
#{
@
model
.
get
(
'state'
)
}
-item"
)
class
CMS
.
Views
.
UnitEdit
.
Visibility
extends
Backbone
.
View
class
CMS
.
Views
.
UnitEdit
.
Visibility
extends
Backbone
.
View
initialize
:
=>
initialize
:
=>
@
model
.
on
(
'change:state'
,
@
render
)
@
model
.
on
(
'change:state'
,
@
render
)
...
...
cms/static/sass/_cms_mixins.scss
View file @
bd5d5f14
...
@@ -173,13 +173,33 @@
...
@@ -173,13 +173,33 @@
background
:
#fffcf1
;
background
:
#fffcf1
;
}
}
.draft-item
,
.draft-item
:after
,
.hidden-item
,
.public-item
:after
,
.private-item
:after
{
margin-left
:
3px
;
font-size
:
9px
;
font-weight
:
600
;
text-transform
:
uppercase
;
}
.draft-item
:after
{
content
:
"- draft"
;
}
.public-item
:after
{
content
:
"- public"
;
}
.private-item
:after
{
content
:
"- private"
;
}
.public-item
,
.private-item
{
.private-item
{
color
:
#a4aab7
;
color
:
#a4aab7
;
}
}
.
has-new-
draft-item
{
.draft-item
{
color
:
#9f7d10
;
color
:
#9f7d10
;
}
}
}
}
...
...
cms/static/sass/_graphics.scss
View file @
bd5d5f14
...
@@ -117,9 +117,8 @@
...
@@ -117,9 +117,8 @@
}
}
.draft-tag
,
.draft-tag
,
.hidden-tag
,
.public-tag
,
.private-tag
,
.private-tag
{
.has-new-draft-tag
{
margin-left
:
3px
;
margin-left
:
3px
;
font-size
:
9px
;
font-size
:
9px
;
font-weight
:
600
;
font-weight
:
600
;
...
@@ -127,7 +126,7 @@
...
@@ -127,7 +126,7 @@
color
:
#a4aab7
;
color
:
#a4aab7
;
}
}
.
has-new-
draft-tag
{
.draft-tag
{
color
:
#9f7d10
;
color
:
#9f7d10
;
}
}
...
...
cms/templates/widgets/units.html
View file @
bd5d5f14
<
%!
from
django
.
core
.
urlresolvers
import
reverse
%
>
<
%!
from
django
.
core
.
urlresolvers
import
reverse
%
>
<
%!
from
contentstore
.
utils
import
compute_unit_state
%
>
<!--
<!--
This def will enumerate through a passed in subsection and list all of the units
This def will enumerate through a passed in subsection and list all of the units
...
@@ -8,16 +9,16 @@ This def will enumerate through a passed in subsection and list all of the units
...
@@ -8,16 +9,16 @@ This def will enumerate through a passed in subsection and list all of the units
% for unit in subsection.get_children():
% for unit in subsection.get_children():
<li
class=
"leaf unit"
data-id=
"${unit.location}"
>
<li
class=
"leaf unit"
data-id=
"${unit.location}"
>
<
%
<
%
unit_state =
compute_unit_state(unit)
if
unit
.
location =
=
selected:
if
unit
.
location =
=
selected:
selected_class =
'editing'
selected_class =
'editing'
else:
else:
selected_class =
''
selected_class =
''
%
>
%
>
<div
class=
"section-item ${selected_class}"
>
<div
class=
"section-item ${selected_class}"
>
<a
href=
"${reverse('edit_unit', args=[unit.location])}"
class=
"
private
-item"
>
<a
href=
"${reverse('edit_unit', args=[unit.location])}"
class=
"
${unit_state}
-item"
>
<span
class=
"${unit.category}-icon"
></span>
<span
class=
"${unit.category}-icon"
></span>
${unit.display_name}
${unit.display_name}
<span
class=
"private-tag wip"
>
- private
</span>
</a>
</a>
% if actions:
% if actions:
<div
class=
"item-actions"
>
<div
class=
"item-actions"
>
...
...
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