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
ac71da15
Commit
ac71da15
authored
Oct 11, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make header tabs work
parent
ff25d132
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
64 additions
and
16 deletions
+64
-16
cms/djangoapps/contentstore/views.py
+26
-1
cms/static/sass/_header.scss
+25
-5
cms/templates/base.html
+1
-2
cms/templates/manage_users.html
+0
-1
cms/templates/overview.html
+1
-1
cms/templates/widgets/header.html
+11
-6
No files found.
cms/djangoapps/contentstore/views.py
View file @
ac71da15
...
@@ -157,6 +157,8 @@ def course_index(request, org, course, name):
...
@@ -157,6 +157,8 @@ def course_index(request, org, course, name):
sections
=
course
.
get_children
()
sections
=
course
.
get_children
()
return
render_to_response
(
'overview.html'
,
{
return
render_to_response
(
'overview.html'
,
{
'active_tab'
:
'courseware'
,
'context_course'
:
course
,
'sections'
:
sections
,
'sections'
:
sections
,
'parent_location'
:
course
.
location
,
'parent_location'
:
course
.
location
,
'new_section_template'
:
Location
(
'i4x'
,
'edx'
,
'templates'
,
'chapter'
,
'Empty'
),
'new_section_template'
:
Location
(
'i4x'
,
'edx'
,
'templates'
,
'chapter'
,
'Empty'
),
...
@@ -198,6 +200,7 @@ def edit_subsection(request, location):
...
@@ -198,6 +200,7 @@ def edit_subsection(request, location):
return
render_to_response
(
'edit_subsection.html'
,
return
render_to_response
(
'edit_subsection.html'
,
{
'subsection'
:
item
,
{
'subsection'
:
item
,
'context_course'
:
course
,
'create_new_unit_template'
:
Location
(
'i4x'
,
'edx'
,
'templates'
,
'vertical'
,
'Empty'
),
'create_new_unit_template'
:
Location
(
'i4x'
,
'edx'
,
'templates'
,
'vertical'
,
'Empty'
),
'lms_link'
:
lms_link
,
'lms_link'
:
lms_link
,
'parent_item'
:
parent
,
'parent_item'
:
parent
,
...
@@ -256,6 +259,7 @@ def edit_unit(request, location):
...
@@ -256,6 +259,7 @@ def edit_unit(request, location):
published_date
=
None
published_date
=
None
return
render_to_response
(
'unit.html'
,
{
return
render_to_response
(
'unit.html'
,
{
'context_course'
:
course
,
'unit'
:
item
,
'unit'
:
item
,
'unit_location'
:
location
,
'unit_location'
:
location
,
'components'
:
components
,
'components'
:
components
,
...
@@ -679,7 +683,11 @@ def manage_users(request, location):
...
@@ -679,7 +683,11 @@ def manage_users(request, location):
if
not
has_access
(
request
.
user
,
location
,
role
=
INSTRUCTOR_ROLE_NAME
):
if
not
has_access
(
request
.
user
,
location
,
role
=
INSTRUCTOR_ROLE_NAME
):
raise
PermissionDenied
()
raise
PermissionDenied
()
course_module
=
modulestore
()
.
get_item
(
location
)
return
render_to_response
(
'manage_users.html'
,
{
return
render_to_response
(
'manage_users.html'
,
{
'active_tab'
:
'users'
,
'context_course'
:
course_module
,
'staff'
:
get_users_in_course_group_by_role
(
location
,
STAFF_ROLE_NAME
),
'staff'
:
get_users_in_course_group_by_role
(
location
,
STAFF_ROLE_NAME
),
'add_user_postback_url'
:
reverse
(
'add_user'
,
args
=
[
location
])
.
rstrip
(
'/'
),
'add_user_postback_url'
:
reverse
(
'add_user'
,
args
=
[
location
])
.
rstrip
(
'/'
),
'remove_user_postback_url'
:
reverse
(
'remove_user'
,
args
=
[
location
])
.
rstrip
(
'/'
)
'remove_user_postback_url'
:
reverse
(
'remove_user'
,
args
=
[
location
])
.
rstrip
(
'/'
)
...
@@ -755,7 +763,19 @@ def landing(request, org, course, coursename):
...
@@ -755,7 +763,19 @@ def landing(request, org, course, coursename):
def
static_pages
(
request
,
org
,
course
,
coursename
):
def
static_pages
(
request
,
org
,
course
,
coursename
):
return
render_to_response
(
'static-pages.html'
,
{})
location
=
[
'i4x'
,
org
,
course
,
'course'
,
coursename
]
# check that logged in user has permissions to this item
if
not
has_access
(
request
.
user
,
location
):
raise
PermissionDenied
()
course
=
modulestore
()
.
get_item
(
location
)
return
render_to_response
(
'static-pages.html'
,
{
'active_tab'
:
'pages'
,
'context_course'
:
course
,
})
def
edit_static
(
request
,
org
,
course
,
coursename
):
def
edit_static
(
request
,
org
,
course
,
coursename
):
...
@@ -784,11 +804,14 @@ def asset_index(request, org, course, name):
...
@@ -784,11 +804,14 @@ def asset_index(request, org, course, name):
if
not
has_access
(
request
.
user
,
location
):
if
not
has_access
(
request
.
user
,
location
):
raise
PermissionDenied
()
raise
PermissionDenied
()
upload_asset_callback_url
=
reverse
(
'upload_asset'
,
kwargs
=
{
upload_asset_callback_url
=
reverse
(
'upload_asset'
,
kwargs
=
{
'org'
:
org
,
'org'
:
org
,
'course'
:
course
,
'course'
:
course
,
'coursename'
:
name
'coursename'
:
name
})
})
course_module
=
modulestore
()
.
get_item
(
location
)
course_reference
=
StaticContent
.
compute_location
(
org
,
course
,
name
)
course_reference
=
StaticContent
.
compute_location
(
org
,
course
,
name
)
assets
=
contentstore
()
.
get_all_content_for_course
(
course_reference
)
assets
=
contentstore
()
.
get_all_content_for_course
(
course_reference
)
...
@@ -811,6 +834,8 @@ def asset_index(request, org, course, name):
...
@@ -811,6 +834,8 @@ def asset_index(request, org, course, name):
asset_display
.
append
(
display_info
)
asset_display
.
append
(
display_info
)
return
render_to_response
(
'asset_index.html'
,
{
return
render_to_response
(
'asset_index.html'
,
{
'active_tab'
:
'assets'
,
'context_course'
:
course_module
,
'assets'
:
asset_display
,
'assets'
:
asset_display
,
'upload_asset_callback_url'
:
upload_asset_callback_url
'upload_asset_callback_url'
:
upload_asset_callback_url
})
})
...
...
cms/static/sass/_header.scss
View file @
ac71da15
...
@@ -4,6 +4,11 @@ body.no-header {
...
@@ -4,6 +4,11 @@ body.no-header {
}
}
}
}
@mixin
active
{
@include
linear-gradient
(
top
,
rgba
(
0
,
0
,
0
,
0
.6
)
,
rgba
(
0
,
0
,
0
,
0
.3
));
@include
box-shadow
(
0
2px
8px
rgba
(
0
,
0
,
0
,
.7
)
inset
);
}
.primary-header
{
.primary-header
{
width
:
100%
;
width
:
100%
;
height
:
36px
;
height
:
36px
;
...
@@ -13,6 +18,26 @@ body.no-header {
...
@@ -13,6 +18,26 @@ body.no-header {
color
:
#fff
;
color
:
#fff
;
@include
box-shadow
(
0
1px
1px
rgba
(
0
,
0
,
0
,
0
.2
)
,
0
-1px
0px
rgba
(
255
,
255
,
255
,
0
.05
)
inset
);
@include
box-shadow
(
0
1px
1px
rgba
(
0
,
0
,
0
,
0
.2
)
,
0
-1px
0px
rgba
(
255
,
255
,
255
,
0
.05
)
inset
);
&
.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-import
#import-tab
{
@include
active
;
}
.left
{
.left
{
width
:
700px
;
width
:
700px
;
}
}
...
@@ -48,9 +73,5 @@ body.no-header {
...
@@ -48,9 +73,5 @@ body.no-header {
background
:
rgba
(
255
,
255
,
255
,
.1
);
background
:
rgba
(
255
,
255
,
255
,
.1
);
}
}
&
.active
{
@include
linear-gradient
(
top
,
rgba
(
0
,
0
,
0
,
0
.6
)
,
rgba
(
0
,
0
,
0
,
0
.3
));
@include
box-shadow
(
0
2px
8px
rgba
(
0
,
0
,
0
,
.7
)
inset
);
}
}
}
}
}
\ No newline at end of file
cms/templates/base.html
View file @
ac71da15
...
@@ -18,8 +18,7 @@
...
@@ -18,8 +18,7 @@
</head>
</head>
<body
class=
"<%block name='bodyclass'></%block>"
>
<body
class=
"<%block name='bodyclass'></%block>"
>
<
%
include
file=
"widgets/header.html"
args=
"active_tab=active_tab"
/>
<
%
include
file=
"widgets/header.html"
/>
<
%
include
file=
"courseware_vendor_js.html"
/>
<
%
include
file=
"courseware_vendor_js.html"
/>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/json2.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/json2.js')}"
></script>
...
...
cms/templates/manage_users.html
View file @
ac71da15
<
%
inherit
file=
"base.html"
/>
<
%
inherit
file=
"base.html"
/>
<
%
block
name=
"title"
>
Course Staff Manager
</
%
block>
<
%
block
name=
"title"
>
Course Staff Manager
</
%
block>
<
%
block
name=
"bodyclass"
>
users
</
%
block>
<
%
block
name=
"bodyclass"
>
users
</
%
block>
<
%
include
file=
"widgets/header.html"
/>
<
%
block
name=
"content"
>
<
%
block
name=
"content"
>
<div
class=
"main-wrapper"
>
<div
class=
"main-wrapper"
>
...
...
cms/templates/overview.html
View file @
ac71da15
...
@@ -83,7 +83,7 @@
...
@@ -83,7 +83,7 @@
<a
href=
"#"
class=
"drag-handle wip"
></a>
<a
href=
"#"
class=
"drag-handle wip"
></a>
</div>
</div>
</div>
</div>
${units.enum_units(subsection)}
${units.enum_units(subsection)}
</li>
</li>
% endfor
% endfor
</ol>
</ol>
...
...
cms/templates/widgets/header.html
View file @
ac71da15
<
%!
from
django
.
core
.
urlresolvers
import
reverse
%
>
<
%!
from
django
.
core
.
urlresolvers
import
reverse
%
>
<header
class=
"primary-header"
>
<
%
active_tab_class =
'active-tab-'
+
active_tab
if
active_tab
else
''
%
>
<header
class=
"primary-header ${active_tab_class}"
>
<nav
class=
"inner-wrapper"
>
<nav
class=
"inner-wrapper"
>
<div
class=
"left"
>
<div
class=
"left"
>
<a
href=
"/"
><span
class=
"home-icon"
></span></a>
<a
href=
"/"
><span
class=
"home-icon"
></span></a>
<a
href=
"#"
class=
"class-name wip-box"
>
6.002x Circuits and Electronics
</a>
% if context_course:
<
%
ctx_loc =
context_course.location
%
>
<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>
<ul
class=
"class-nav"
>
<ul
class=
"class-nav"
>
<li><a
href=
"#"
class=
"active"
>
Courseware
</a></li>
<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=
"#"
class=
"wip-box"
>
Pages
</a></li>
<li><a
href=
"${reverse('static_pages', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, coursename=ctx_loc.name))}"
id=
'pages-tab'
>
Pages
</a></li>
<li><a
href=
"#"
class=
"wip-box"
>
Assets
</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=
"#"
class=
"wip-box"
>
Users
</a></li>
<li><a
href=
"${reverse('manage_users', kwargs=dict(location=ctx_loc))}"
id=
'users-tab'
>
Users
</a></li>
<li><a
href=
"${reverse('course_index', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name))}"
id=
'import-tab'
class=
"wip-box"
>
Import
</a></li>
</ul>
</ul>
% endif
</div>
</div>
<div
class=
"right"
>
<div
class=
"right"
>
<span
class=
"username"
>
${ user.username }
</span>
<span
class=
"username"
>
${ user.username }
</span>
...
...
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