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
fc2b6f03
Commit
fc2b6f03
authored
Dec 18, 2012
by
Don Mitchell
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/cale/cms-master' of github.com:MITx/mitx into bug/dhm/dec12
parents
0192a04b
a34b42b8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
cms/djangoapps/contentstore/views.py
+13
-6
cms/templates/widgets/header.html
+1
-0
No files found.
cms/djangoapps/contentstore/views.py
View file @
fc2b6f03
...
...
@@ -902,6 +902,10 @@ def edit_tabs(request, org, course, coursename):
static_tabs
=
modulestore
(
'direct'
)
.
get_items
(
static_tabs_loc
)
# see tabs have been uninitialized (e.g. supporing courses created before tab support in studio)
if
course_item
.
tabs
is
None
or
len
(
course_item
.
tabs
)
==
0
:
initialize_course_tabs
(
course_item
)
components
=
[
static_tab
.
location
.
url
()
for
static_tab
...
...
@@ -1199,22 +1203,25 @@ def create_new_course(request):
# set a default start date to now
new_course
.
metadata
[
'start'
]
=
stringify_time
(
time
.
gmtime
())
initialize_course_tabs
(
new_course
)
create_all_course_groups
(
request
.
user
,
new_course
.
location
)
return
HttpResponse
(
json
.
dumps
({
'id'
:
new_course
.
location
.
url
()}))
def
initialize_course_tabs
(
course
):
# set up the default tabs
# I've added this because when we add static tabs, the LMS either expects a None for the tabs list or
# at least a list populated with the minimal times
# @TODO: I don't like the fact that the presentation tier is away of these data related constraints, let's find a better
# place for this. Also rather than using a simple list of dictionaries a nice class model would be helpful here
new_
course
.
tabs
=
[{
"type"
:
"courseware"
},
course
.
tabs
=
[{
"type"
:
"courseware"
},
{
"type"
:
"course_info"
,
"name"
:
"Course Info"
},
{
"type"
:
"discussion"
,
"name"
:
"Discussion"
},
{
"type"
:
"wiki"
,
"name"
:
"Wiki"
},
{
"type"
:
"progress"
,
"name"
:
"Progress"
}]
modulestore
(
'direct'
)
.
update_metadata
(
new_course
.
location
.
url
(),
new_course
.
own_metadata
)
create_all_course_groups
(
request
.
user
,
new_course
.
location
)
return
HttpResponse
(
json
.
dumps
({
'id'
:
new_course
.
location
.
url
()}))
modulestore
(
'direct'
)
.
update_metadata
(
course
.
location
.
url
(),
course
.
own_metadata
)
@ensure_csrf_cookie
@login_required
...
...
cms/templates/widgets/header.html
View file @
fc2b6f03
...
...
@@ -29,6 +29,7 @@
<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.org))}"
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>
...
...
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