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
83ad9508
Commit
83ad9508
authored
Feb 01, 2013
by
Brian Talbot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
studio - revised course nav: plumbed in current html and scss progress into header
parent
d0d02963
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
486 additions
and
144 deletions
+486
-144
cms/static/js/base.js
+15
-0
cms/static/sass/_base.scss
+13
-1
cms/static/sass/_header.scss
+344
-104
cms/static/sass/_variables.scss
+6
-0
cms/templates/base.html
+2
-2
cms/templates/widgets/header.html
+90
-35
common/static/sass/_mixins.scss
+16
-2
No files found.
cms/static/js/base.js
View file @
83ad9508
...
...
@@ -39,6 +39,21 @@ $(document).ready(function() {
$
(
'.unit .item-actions .delete-button'
).
bind
(
'click'
,
deleteUnit
);
$
(
'.new-unit-item'
).
bind
(
'click'
,
createNewUnit
);
// nav-related
$
(
'body'
).
addClass
(
'js'
);
$
(
'.nav-dropdown .nav-item .title'
).
click
(
function
(
e
){
$subnav
=
$
(
this
).
parent
().
find
(
'.nav-sub'
);
$title
=
$
(
this
).
parent
().
find
(
'.title'
);
e
.
preventDefault
();
$
(
'.nav-dropdown .nav-item .title'
).
removeClass
(
'is-selected'
);
$
(
'.nav-dropdown .nav-item .nav-sub'
).
removeClass
(
'is-shown'
);
$title
.
toggleClass
(
'is-selected'
);
$subnav
.
toggleClass
(
'is-shown'
);
});
// toggling overview section details
$
(
function
(){
if
(
$
(
'.courseware-section'
).
length
>
0
)
{
...
...
cms/static/sass/_base.scss
View file @
83ad9508
...
...
@@ -6,7 +6,7 @@
body
{
min-width
:
980px
;
background
:
rgb
(
240
,
241
,
245
)
;
background
:
$m-gray-l
;
font-size
:
16px
;
line-height
:
1
.6
;
color
:
$baseFontColor
;
...
...
@@ -42,6 +42,12 @@ h1 {
margin-bottom
:
30px
;
}
.wrapper
{
@include
clearfix
();
@include
box-sizing
(
border-box
);
width
:
100%
;
}
.main-wrapper
{
position
:
relative
;
margin
:
0
40px
;
...
...
@@ -417,4 +423,9 @@ body.show-wip {
font-size
:
20px
;
color
:
rgba
(
0
,
0
,
0
,
0
.85
);
}
}
// basic utility
.sr
{
@include
text-sr
();
}
\ No newline at end of file
cms/static/sass/_header.scss
View file @
83ad9508
body
.no-header
{
.primary-header
{
display
:
none
;
}
// header
.wrapper-header
{
margin
:
0
0
(
$baseline
*
1
.5
)
0
;
padding
:
$baseline
;
border-bottom
:
1px
solid
tint
(
$m-gray
,
50%
);
@include
box-shadow
(
0
1px
5px
0
rgba
(
0
,
0
,
0
,
0
.1
));
background
:
$white
;
height
:
76px
;
position
:
relative
;
width
:
100%
;
z-index
:
10
;
a
{
color
:
$baseFontColor
;
display
:
block
;
&
:hover
,
&
:active
{
color
:
$blue
;
}
}
}
.header
{
@include
clearfix
();
max-width
:
1280px
;
margin
:
0
auto
;
color
:
$lightGrey
;
}
.branding
,
.info-course
,
.nav-course
,
.nav-account
{
display
:
inline-block
;
vertical-align
:
top
;
}
.branding
,
.info-course
,
.nav-course
{
margin
:
0
(
$baseline
*
0
.75
)
0
0
;
}
.branding
{
position
:
relative
;
padding-right
:
15px
;
a
{
@include
text-hide
();
display
:
block
;
width
:
164px
;
height
:
32px
;
background
:
transparent
url('../img/logo-edx-studio.png')
0
0
no-repeat
;
}
&
:before
{
@extend
.faded-vertical-divider
;
content
:
""
;
display
:
block
;
height
:
50px
;
position
:
absolute
;
right
:
1px
;
top
:
-8px
;
width
:
1px
;
}
&
:after
{
@extend
.faded-vertical-divider-light
;
content
:
""
;
display
:
block
;
height
:
50px
;
position
:
absolute
;
right
:
0px
;
top
:
-12px
;
width
:
1px
;
}
}
.info-course
{
position
:
relative
;
max-width
:
500px
;
min-width
:
200px
;
width
:
23%
;
padding-right
:
15px
;
font-size
:
14px
;
&
:before
{
@extend
.faded-vertical-divider
;
content
:
""
;
display
:
block
;
height
:
50px
;
position
:
absolute
;
right
:
1px
;
top
:
-8px
;
width
:
1px
;
}
&
:after
{
@extend
.faded-vertical-divider-light
;
content
:
""
;
display
:
block
;
height
:
50px
;
position
:
absolute
;
right
:
0px
;
top
:
-12px
;
width
:
1px
;
}
.course-number
,
.course-title
{
display
:
block
;
}
.course-number
{
font-size
:
12px
;
}
.course-title
{
width
:
100%
;
overflow
:
hidden
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
font-size
:
16px
;
font-weight
:
600
;
}
}
@mixin
active
{
@include
linear-gradient
(
top
,
rgba
(
255
,
255
,
255
,
.4
)
,
rgba
(
255
,
255
,
255
,
0
));
background-color
:
rgba
(
255
,
255
,
255
,
.3
);
@include
box-shadow
(
0
-1px
0
rgba
(
0
,
0
,
0
,
.2
)
inset
,
0
1px
0
#fff
inset
);
text-shadow
:
0
1px
0
rgba
(
255
,
255
,
255
,
0
.5
);
.nav-course
{
width
:
275px
;
margin-top
:
-
(
$baseline
/
4
);
font-size
:
14px
;
ol
{
@include
clearfix
();
}
.nav-item
{
display
:
inline-block
;
vertical-align
:
bottom
;
margin
:
0
(
$baseline
/
2
)
0
0
;
&
:last-child
{
margin-right
:
0
;
}
.title
{
display
:
block
;
padding
:
5px
;
text-transform
:
uppercase
;
&
:hover
,
&
:active
{
color
:
$blue
;
}
.label-prefix
{
display
:
block
;
font-size
:
11px
;
}
.ss-icon
{
}
&
.is-selected
{
color
:
$blue
;
}
}
// current state
&
.is-current
{
.title
{
color
:
$blue
;
}
}
// specific nav items
&
.nav-course-courseware
{
}
&
.nav-course-settings
{
}
&
.nav-course-tools
{
}
}
}
.primary-header
{
width
:
100%
;
margin-bottom
:
30px
;
&
.active-tab-courseware
#courseware-tab
{
@include
active
;
}
&
.active-tab-assets
#assets-tab
{
@include
active
;
}
&
.active-tab-pages
#pages-tab
{
@include
active
;
}
&
.active-tab-users
#users-tab
{
@include
active
;
}
&
.active-tab-settings
#settings-tab
{
@include
active
;
}
&
.active-tab-import
#import-tab
{
@include
active
;
}
&
.active-tab-export
#export-tab
{
@include
active
;
}
.drop-icon
{
margin-left
:
5px
;
font-size
:
11px
;
}
.settings-icon
{
font-size
:
18px
;
line-height
:
18px
;
}
.class-nav-bar
{
clear
:
both
;
@include
linear-gradient
(
top
,
rgba
(
255
,
255
,
255
,
.4
)
,
rgba
(
255
,
255
,
255
,
0
));
background-color
:
$lightBluishGrey
;
@include
box-shadow
(
0
1px
0
rgba
(
255
,
255
,
255
,
0
.2
)
inset
,
0
-1px
0
rgba
(
0
,
0
,
0
,
0
.2
)
inset
);
}
.class-nav
{
@include
clearfix
;
a
{
float
:
left
;
display
:
inline-block
;
padding
:
15px
25px
17px
;
font-size
:
15px
;
color
:
#3c3c3c
;
text-shadow
:
0
1px
0
rgba
(
255
,
255
,
255
,
0
.3
);
&
:hover
{
@include
linear-gradient
(
top
,
rgba
(
255
,
255
,
255
,
.2
)
,
rgba
(
255
,
255
,
255
,
0
));
}
}
li
{
float
:
left
;
}
}
.class
{
@include
clearfix
;
height
:
100%
;
font-size
:
12px
;
color
:
rgb
(
163
,
171
,
184
);
@include
linear-gradient
(
top
,
rgba
(
255
,
255
,
255
,
0
)
,
rgba
(
255
,
255
,
255
,
.1
));
background-color
:
rgb
(
47
,
53
,
63
);
a
{
display
:
inline-block
;
height
:
20px
;
padding
:
5px
10px
6px
;
color
:
rgb
(
163
,
171
,
184
);
}
.home
{
position
:
relative
;
top
:
1px
;
}
.log-out
{
position
:
relative
;
top
:
3px
;
}
}
.nav-account
{
float
:
right
;
max-width
:
300px
;
min-width
:
175px
;
width
:
20%
;
margin-top
:
10px
;
font-size
:
14px
;
text-align
:
right
;
.nav-account-username
{
.ss-icon
{
display
:
inline-block
;
vertical-align
:
middle
;
margin-right
:
3px
;
font-size
:
12px
;
}
.account-username
{
display
:
inline-block
;
width
:
80%
;
overflow
:
hidden
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
}
}
}
// dropdown UI
.nav-dropdown
{
.nav-item
{
position
:
relative
;
}
.nav-sub
{
@include
border-radius
(
2px
);
position
:
absolute
;
top
:
30px
;
width
:
125px
;
border
:
1px
solid
tint
(
$m-gray
,
50%
);
padding
:
(
$baseline
/
4
)
(
$baseline
/
2
);
@include
box-shadow
(
0
1px
5px
0
rgba
(
0
,
0
,
0
,
0
.1
));
background
:
$white
;
li
{
margin
:
0
0
(
$baseline
/
4
)
0
;
border-bottom
:
1px
solid
tint
(
$m-gray
,
75%
);
padding
:
0
0
(
$baseline
/
4
)
0
;
font-size
:
13px
;
&
:last-child
{
margin-bottom
:
0
;
border-bottom
:
none
;
padding-bottom
:
0
;
}
a
{
display
:
block
;
}
}
// arrows
&
:after
,
&
:before
{
}
&
:after
{
}
&
:before
{
}
}
// vendor
.arrow_box
{
position
:
relative
;
background
:
#fff
;
border
:
1px
solid
#a1a1a1
;
}
.arrow_box
:after
,
.arrow_box
:before
{
bottom
:
100%
;
border
:
solid
transparent
;
content
:
" "
;
height
:
0
;
width
:
0
;
position
:
absolute
;
pointer-events
:
none
;
}
.arrow_box
:after
{
border-color
:
rgba
(
255
,
255
,
255
,
0
);
border-bottom-color
:
#fff
;
border-width
:
10px
;
left
:
50%
;
margin-left
:
-10px
;
}
.arrow_box
:before
{
border-color
:
rgba
(
161
,
161
,
161
,
0
);
border-bottom-color
:
#a1a1a1
;
border-width
:
11px
;
left
:
50%
;
margin-left
:
-11px
;
}
// specific navs
&
.nav-account
{
.nav-sub
{
right
:
0
;
text-align
:
left
;
}
}
&
.nav-course
{
.nav-sub
{
left
:
-5px
;
}
.nav-course-courseware
{
.nav-sub
{
top
:
50px
;
}
}
.nav-course-settings
{
.nav-sub
{
top
:
50px
;
}
}
.nav-course-tools
{
.nav-sub
{
}
}
}
}
// js enabled
.js
{
.nav-dropdown
{
.nav-item
.title
{
cursor
:
pointer
;
}
}
.nav-sub
{
@include
transition
(
opacity
1
.0s
ease-in-out
0s
);
opacity
:
0
;
pointer-events
:
none
;
&
.is-shown
{
opacity
:
1
.0
;
pointer-events
:
auto
;
}
}
}
\ No newline at end of file
cms/static/sass/_variables.scss
View file @
83ad9508
$baseline
:
20px
;
$gw-column
:
80px
;
$gw-gutter
:
20px
;
...
...
@@ -35,3 +37,7 @@ $disabledGreen: rgb(124, 206, 153);
$darkGreen
:
rgb
(
52
,
133
,
76
);
$lightBluishGrey
:
rgb
(
197
,
207
,
223
);
$lightBluishGrey2
:
rgb
(
213
,
220
,
228
);
// new colors - progress for re-org
$m-gray-l
:
rgb
(
247
,
247
,
247
);
$m-gray
:
rgb
(
67
,
67
,
67
);
cms/templates/base.html
View file @
83ad9508
...
...
@@ -9,8 +9,8 @@
<
%
static:css
group=
'base-style'
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"${static.url('js/vendor/markitup/skins/simple/style.css')}"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"${static.url('js/vendor/markitup/sets/wiki/style.css')}"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"${static.url('css/vendor/symbolset.ss-standard.css')}"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"${static.url('css/vendor/symbolset.ss-symbolicons-block.css')}"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"${static.url('css/vendor/symbolset.ss-standard.css')}"
/>
<title><
%
block
name=
"title"
></
%
block></title>
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1"
>
...
...
@@ -29,8 +29,8 @@
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/backbone-min.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/markitup/jquery.markitup.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/markitup/sets/wiki/set.js')}"
></script>
<script
src=
"${static.url('js/vendor/symbolset.ss-symbolicons.js')}"
></script>
<script
src=
"${static.url('js/vendor/symbolset.ss-standard.js')}"
></script>
<script
src=
"${static.url('js/vendor/symbolset.ss-symbolicons.js')}"
></script>
<
%
static:js
group=
'main'
/>
<
%
static:js
group=
'module-js'
/>
...
...
cms/templates/widgets/header.html
View file @
83ad9508
<
%!
from
django
.
core
.
urlresolvers
import
reverse
%
>
<
%
active_tab_class =
'active-tab-'
+
active_tab
if
active_tab
else
''
%
>
<header
class=
"primary-header ${active_tab_class}"
>
<div
class=
"class"
>
<div
class=
"inner-wrapper"
>
<div
class=
"left"
>
% if context_course:
<
%
ctx_loc =
context_course.location
%
>
<a
href=
"/"
class=
"home"
><span
class=
"small-home-icon"
></span></a>
›
<a
href=
"${reverse('course_index', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name))}"
class=
"class-name"
>
${context_course.display_name}
</a>
›
% endif
</div>
<div
class=
"right"
>
<span
class=
"username"
>
${ user.username }
</span>
% if user.is_authenticated():
<a
href=
"${reverse('logout')}"
class=
"log-out"
><span
class=
"log-out-icon"
></span></a>
% else:
<a
href=
"${reverse('login')}"
>
Log in
</a>
% endif
</div>
</div>
</div>
<nav
class=
"class-nav-bar"
>
<div
class=
"wrapper-header wrapper"
>
<header
class=
"primary"
role=
"banner"
>
<h1
class=
"branding"
><a
href=
"#"
>
edX Studio
</a></h1>
% if context_course:
<
%
ctx_loc =
context_course.location
%
>
<ul
class=
"class-nav inner-wrapper"
>
<li><a
href=
"${reverse('course_index', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name))}"
id=
'courseware-tab'
>
Courseware
</a></li>
<li><a
href=
"${reverse('course_info', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name))}"
id=
'courseinfo-tab'
>
Course Info
</a></li>
<li><a
href=
"${reverse('edit_tabs', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, coursename=ctx_loc.name))}"
id=
'pages-tab'
>
Pages
</a></li>
<li><a
href=
"${reverse('manage_users', kwargs=dict(location=ctx_loc))}"
id=
'users-tab'
>
Users
</a></li>
<li><a
href=
"${reverse('asset_index', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name))}"
id=
'assets-tab'
>
Assets
</a></li>
<li><a
href=
"${reverse('course_settings', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name))}"
id=
'settings-tab'
>
Settings
</a></li>
<li><a
href=
"${reverse('import_course', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name))}"
id=
'import-tab'
>
Import
</a></li>
<li><a
href=
"${reverse('export_course', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name))}"
id=
'export-tab'
>
Export
</a></li>
</ul>
<div
class=
"info-course"
>
<h2
class=
"sr"
>
Current Course:
</h2>
<a
href=
"${reverse('course_index', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name))}"
>
<span
class=
"course-number"
>
PH207x:
</span>
<span
class=
"course-title"
>
${context_course.display_name}
</span>
</a>
</div>
<nav
class=
"nav-course primary nav-dropdown"
role=
"navigation"
>
<h2
class=
"sr"
>
PH207x's Navigation:
</h2>
<ol>
<li
class=
"nav-item nav-course-courseware"
>
<h3
class=
"title"
><span
class=
"label-prefix"
>
Course
</span>
Content
<i
class=
"ss-icon ss-symbolicons-block icon-expand"
>
▾
</i></h3>
<div
class=
"nav-sub"
>
<ul>
<li><a
href=
"${reverse('course_index', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name))}"
>
Outline
</a></li>
<li><a
href=
"${reverse('course_info', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name))}"
>
Updates
</a></li>
<li><a
href=
"${reverse('edit_tabs', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, coursename=ctx_loc.name))}"
>
Pages/Tabs
</a></li>
<li><a
href=
"${reverse('asset_index', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name))}"
>
Files
&
Uploads
</a></li>
</ul>
</div>
</li>
<li
class=
"nav-item nav-course-settings"
>
<h3
class=
"title"
><span
class=
"label-prefix"
>
Course
</span>
Settings
<i
class=
"ss-icon ss-symbolicons-block icon-expand"
>
▾
</i></h3>
<div
class=
"nav-sub"
>
<ul>
<li><a
href=
"${reverse('asset_index', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name))}"
>
Schedule
&
Details
</a></li>
<li><a
href=
"${reverse('asset_index', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name))}"
>
Grading
</a></li>
<li><a
href=
"${reverse('manage_users', kwargs=dict(location=ctx_loc))}"
>
Course Team
</a></li>
<li><a
href=
"${reverse('asset_index', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name))}"
>
Advanced Settings
</a></li>
</ul>
</div>
</li>
<li
class=
"nav-item nav-course-tools"
>
<h3
class=
"title"
>
Tools
<i
class=
"ss-icon ss-symbolicons-block icon-expand"
>
▾
</i></h3>
<div
class=
"nav-sub"
>
<ul>
<li><a
href=
"${reverse('import_course', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name))}"
>
Import
</a></li>
<li><a
href=
"${reverse('export_course', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name))}"
>
Export
</a></li>
</ul>
</div>
</li>
</ol>
</nav>
% endif
% if user.is_authenticated():
<nav
class=
"nav-account is-logged-in nav-dropdown"
>
<h2
class=
"sr"
>
Currently logged in as:
</h2>
<ol>
<li
class=
"nav-item nav-account-username"
>
<a
href=
"#"
class=
"title"
>
<span
class=
"account-username"
>
<i
class=
"ss-icon ss-symbolicons-standard"
>
👤
</i>
${ user.username }
</span>
<i
class=
"ss-icon ss-symbolicons-block icon-expand"
>
▾
</i>
</a>
<div
class=
"nav-sub"
>
<ul>
<li><a
href=
"#"
>
Help
</a></li>
<li><a
class=
"action action-logout"
href=
"${reverse('logout')}"
>
Logout
</a></li>
</ul>
</div>
</li>
</ol>
</nav>
% else:
<nav
class=
"nav-account nav-dropdown"
>
<h2
class=
"sr"
>
You're not currently logged in
</h2>
<ol>
<li>
<a
class=
"action action-login"
href=
"${reverse('login')}"
>
Logout
</a>
</li>
</ol>
</nav>
% endif
</
nav
>
</
header
>
</
header
>
</
div
>
\ No newline at end of file
common/static/sass/_mixins.scss
View file @
83ad9508
...
...
@@ -7,12 +7,25 @@
@return
$body-line-height
*
$amount
;
}
@mixin
hide-text
()
{
// image-replacement hidden text
@mixin
text-hide
()
{
text-indent
:
-100%
;
white-space
:
nowrap
;
overflow
:
hidden
;
}
// hidden elems - screenreaders
@mixin
text-sr
()
{
border
:
0
;
clip
:
rect
(
0
0
0
0
);
height
:
1px
;
margin
:
-1px
;
overflow
:
hidden
;
padding
:
0
;
position
:
absolute
;
width
:
1px
;
}
@mixin
vertically-and-horizontally-centered
(
$height
,
$width
)
{
left
:
50%
;
margin-left
:
-
$width
/
2
;
...
...
@@ -21,4 +34,4 @@
min-width
:
$width
;
position
:
absolute
;
top
:
150px
;
}
}
\ 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