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
54156b7a
Commit
54156b7a
authored
Mar 14, 2013
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Saving work.
parent
bf71f099
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
91 additions
and
59 deletions
+91
-59
cms/djangoapps/contentstore/checklist_model.py
+0
-0
cms/djangoapps/contentstore/views.py
+43
-57
cms/static/js/views/checklists_view.js
+19
-0
cms/templates/checklists.html
+0
-0
cms/templates/widgets/header.html
+1
-1
cms/urls.py
+2
-1
common/lib/xmodule/xmodule/templates/course/empty.yaml
+26
-0
No files found.
cms/djangoapps/contentstore/checklist_model.py
0 → 100644
View file @
54156b7a
cms/djangoapps/contentstore/views.py
View file @
54156b7a
...
...
@@ -113,9 +113,6 @@ def howitworks(request):
else
:
return
render_to_response
(
'howitworks.html'
,
{})
def
ux_checklists
(
request
):
return
render_to_response
(
'ux-checklists.html'
,
{})
# ==== Views for any logged-in user ==================================
...
...
@@ -179,11 +176,7 @@ def course_index(request, org, course, name):
org, course, name: Attributes of the Location for the item to edit
"""
location
=
[
'i4x'
,
org
,
course
,
'course'
,
name
]
# check that logged in user has permissions to this item
if
not
has_access
(
request
.
user
,
location
):
raise
PermissionDenied
()
location
=
get_location_and_verify_access
(
request
,
org
,
course
,
name
)
lms_link
=
get_lms_link_for_item
(
location
)
...
...
@@ -1071,11 +1064,7 @@ def course_info(request, org, course, name, provided_id=None):
org, course, name: Attributes of the Location for the item to edit
"""
location
=
[
'i4x'
,
org
,
course
,
'course'
,
name
]
# check that logged in user has permissions to this item
if
not
has_access
(
request
.
user
,
location
):
raise
PermissionDenied
()
location
=
get_location_and_verify_access
(
request
,
org
,
course
,
name
)
course_module
=
modulestore
()
.
get_item
(
location
)
...
...
@@ -1170,11 +1159,7 @@ def get_course_settings(request, org, course, name):
org, course, name: Attributes of the Location for the item to edit
"""
location
=
[
'i4x'
,
org
,
course
,
'course'
,
name
]
# check that logged in user has permissions to this item
if
not
has_access
(
request
.
user
,
location
):
raise
PermissionDenied
()
location
=
get_location_and_verify_access
(
request
,
org
,
course
,
name
)
course_module
=
modulestore
()
.
get_item
(
location
)
...
...
@@ -1197,11 +1182,7 @@ def course_config_graders_page(request, org, course, name):
org, course, name: Attributes of the Location for the item to edit
"""
location
=
[
'i4x'
,
org
,
course
,
'course'
,
name
]
# check that logged in user has permissions to this item
if
not
has_access
(
request
.
user
,
location
):
raise
PermissionDenied
()
location
=
get_location_and_verify_access
(
request
,
org
,
course
,
name
)
course_module
=
modulestore
()
.
get_item
(
location
)
course_details
=
CourseGradingModel
.
fetch
(
location
)
...
...
@@ -1221,11 +1202,7 @@ def course_config_advanced_page(request, org, course, name):
org, course, name: Attributes of the Location for the item to edit
"""
location
=
[
'i4x'
,
org
,
course
,
'course'
,
name
]
# check that logged in user has permissions to this item
if
not
has_access
(
request
.
user
,
location
):
raise
PermissionDenied
()
location
=
get_location_and_verify_access
(
request
,
org
,
course
,
name
)
course_module
=
modulestore
()
.
get_item
(
location
)
...
...
@@ -1280,11 +1257,7 @@ def course_grader_updates(request, org, course, name, grader_index=None):
org, course: Attributes of the Location for the item to edit
"""
location
=
[
'i4x'
,
org
,
course
,
'course'
,
name
]
# check that logged in user has permissions to this item
if
not
has_access
(
request
.
user
,
location
):
raise
PermissionDenied
()
location
=
get_location_and_verify_access
(
request
,
org
,
course
,
name
)
if
request
.
method
==
'POST'
and
'HTTP_X_HTTP_METHOD_OVERRIDE'
in
request
.
META
:
real_method
=
request
.
META
[
'HTTP_X_HTTP_METHOD_OVERRIDE'
]
...
...
@@ -1314,11 +1287,7 @@ def course_advanced_updates(request, org, course, name):
org, course: Attributes of the Location for the item to edit
"""
location
=
[
'i4x'
,
org
,
course
,
'course'
,
name
]
# check that logged in user has permissions to this item
if
not
has_access
(
request
.
user
,
location
):
raise
PermissionDenied
()
location
=
get_location_and_verify_access
(
request
,
org
,
course
,
name
)
# NB: we're setting Backbone.emulateHTTP to true on the client so everything comes as a post!!!
if
request
.
method
==
'POST'
and
'HTTP_X_HTTP_METHOD_OVERRIDE'
in
request
.
META
:
...
...
@@ -1335,6 +1304,27 @@ def course_advanced_updates(request, org, course, name):
return
HttpResponse
(
json
.
dumps
(
CourseMetadata
.
update_from_json
(
location
,
json
.
loads
(
request
.
body
))),
mimetype
=
"application/json"
)
#@ensure_csrf_cookie what is this cookie?
@login_required
def
get_checklists
(
request
,
org
,
course
,
name
):
location
=
get_location_and_verify_access
(
request
,
org
,
course
,
name
)
modulestore
=
get_modulestore
(
location
)
course_module
=
modulestore
.
get_item
(
location
)
new_course_template
=
Location
(
'i4x'
,
'edx'
,
'templates'
,
'course'
,
'Empty'
)
template_module
=
modulestore
.
get_item
(
new_course_template
)
# If course was created before checklists were introduced, copy them over from the template.
key
=
"checklists"
if
not
key
in
course_module
.
metadata
:
course_module
.
metadata
[
key
]
=
template_module
.
metadata
[
key
]
modulestore
.
update_metadata
(
location
,
course_module
.
metadata
)
return
render_to_response
(
'checklists.html'
,
{
'checklists'
:
course_module
.
metadata
[
key
]})
@login_required
@ensure_csrf_cookie
def
asset_index
(
request
,
org
,
course
,
name
):
...
...
@@ -1343,12 +1333,7 @@ def asset_index(request, org, course, name):
org, course, name: Attributes of the Location for the item to edit
"""
location
=
[
'i4x'
,
org
,
course
,
'course'
,
name
]
# check that logged in user has permissions to this item
if
not
has_access
(
request
.
user
,
location
):
raise
PermissionDenied
()
location
=
get_location_and_verify_access
(
request
,
org
,
course
,
name
)
upload_asset_callback_url
=
reverse
(
'upload_asset'
,
kwargs
=
{
'org'
:
org
,
...
...
@@ -1473,11 +1458,7 @@ def initialize_course_tabs(course):
@login_required
def
import_course
(
request
,
org
,
course
,
name
):
location
=
[
'i4x'
,
org
,
course
,
'course'
,
name
]
# check that logged in user has permissions to this item
if
not
has_access
(
request
.
user
,
location
):
raise
PermissionDenied
()
location
=
get_location_and_verify_access
(
request
,
org
,
course
,
name
)
if
request
.
method
==
'POST'
:
filename
=
request
.
FILES
[
'course-data'
]
.
name
...
...
@@ -1550,10 +1531,7 @@ def import_course(request, org, course, name):
@ensure_csrf_cookie
@login_required
def
generate_export_course
(
request
,
org
,
course
,
name
):
location
=
[
'i4x'
,
org
,
course
,
'course'
,
name
]
# check that logged in user has permissions to this item
if
not
has_access
(
request
.
user
,
location
):
raise
PermissionDenied
()
location
=
get_location_and_verify_access
(
request
,
org
,
course
,
name
)
loc
=
Location
(
location
)
export_file
=
NamedTemporaryFile
(
prefix
=
name
+
'.'
,
suffix
=
".tar.gz"
)
...
...
@@ -1586,11 +1564,9 @@ def generate_export_course(request, org, course, name):
@login_required
def
export_course
(
request
,
org
,
course
,
name
):
location
=
[
'i4x'
,
org
,
course
,
'course'
,
name
]
location
=
get_location_and_verify_access
(
request
,
org
,
course
,
name
)
course_module
=
modulestore
()
.
get_item
(
location
)
# check that logged in user has permissions to this item
if
not
has_access
(
request
.
user
,
location
):
raise
PermissionDenied
()
return
render_to_response
(
'export.html'
,
{
'context_course'
:
course_module
,
...
...
@@ -1605,3 +1581,12 @@ def event(request):
console logs don't get distracted :-)
'''
return
HttpResponse
(
True
)
def
get_location_and_verify_access
(
request
,
org
,
course
,
name
):
location
=
[
'i4x'
,
org
,
course
,
'course'
,
name
]
# check that logged in user has permissions to this item
if
not
has_access
(
request
.
user
,
location
):
raise
PermissionDenied
()
return
location
\ No newline at end of file
cms/static/js/views/checklists_view.js
0 → 100644
View file @
54156b7a
CMS
.
Views
.
Checklists
=
Backbone
.
View
.
extend
({
// takes CMS.Models.CourseInfo as model
tagName
:
'div'
,
render
:
function
()
{
// instantiate the ClassInfoUpdateView and delegate the proper dom to it
new
CMS
.
Views
.
ClassInfoUpdateView
({
el
:
$
(
'body.updates'
),
collection
:
this
.
model
.
get
(
'updates'
)
});
new
CMS
.
Views
.
ClassInfoHandoutsView
({
el
:
this
.
$
(
'#course-handouts-view'
),
model
:
this
.
model
.
get
(
'handouts'
)
});
return
this
;
}
});
\ No newline at end of file
cms/templates/checklists.html
View file @
54156b7a
This diff is collapsed.
Click to expand it.
cms/templates/widgets/header.html
View file @
54156b7a
...
...
@@ -58,7 +58,7 @@
<ul>
<li
class=
"nav-item nav-course-tools-import"
><a
href=
"${reverse('import_course', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name))}"
>
Import
</a></li>
<li
class=
"nav-item nav-course-tools-export"
><a
href=
"${reverse('export_course', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name))}"
>
Export
</a></li>
<li
class=
"nav-item nav-course-tools-checklists"
><a
href=
"${reverse('checklists')}"
>
Tasks
&
Checklists
</a></li>
<li
class=
"nav-item nav-course-tools-checklists"
><a
href=
"${reverse('checklists'
, kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name)
)}"
>
Tasks
&
Checklists
</a></li>
</ul>
</div>
</div>
...
...
cms/urls.py
View file @
54156b7a
...
...
@@ -83,7 +83,8 @@ urlpatterns = ('',
# User creation and updating views
urlpatterns
+=
(
url
(
r'^ux-checklists$'
,
'contentstore.views.ux_checklists'
,
name
=
'checklists'
),
url
(
r'^(?P<org>[^/]+)/(?P<course>[^/]+)/checklists/(?P<name>[^/]+)$'
,
'contentstore.views.get_checklists'
,
name
=
'checklists'
),
# url(r'^ux-checklists$', 'contentstore.views.ux_checklists', name='checklists'),
url
(
r'^howitworks$'
,
'contentstore.views.howitworks'
,
name
=
'howitworks'
),
url
(
r'^signup$'
,
'contentstore.views.signup'
,
name
=
'signup'
),
...
...
common/lib/xmodule/xmodule/templates/course/empty.yaml
View file @
54156b7a
...
...
@@ -2,5 +2,31 @@
metadata
:
display_name
:
Empty
start
:
2020-10-10T10:00
checklists
:
[
{
"
short_description"
:
"
Getting
Started
With
Studio"
,
"
items"
:
[{
"
short_description"
:
"
Add
Course
Team
Members"
,
"
long_description"
:
"
Grant
your
collaborators
permission
to
edit
your
course
so
you
can
work
together."
,
"
is_checked"
:
false
,
"
action_url"
:
"
/manage_users/"
,
"
action_text"
:
"
Edit
Course
Team"
},
{
"
short_description"
:
"
Drink
Whiskey"
,
"
long_description"
:
"
Team-building
activity."
,
"
is_checked"
:
false
,
"
action_url"
:
"
/drink_alcohol"
,
"
action_text"
:
"
Drink"
}],
"
completed"
:
false
},
{
"
short_description"
:
"
Launching
Your
Course"
,
"
items"
:
[{
"
short_description"
:
"
Add
Content"
,
"
long_description"
:
"
Create
videos
and
problems."
,
"
is_checked"
:
false
,
"
action_url"
:
"
"
,
"
action_text"
:
"
"
},
{
"
short_description"
:
"
View
Course
as
a
Student"
,
"
long_description"
:
"
Create
a
student
account
and
view
your
course."
,
"
is_checked"
:
false
,
"
action_url"
:
"
"
,
"
action_text"
:
"
"
}],
"
completed"
:
false
}
]
data
:
{
'
textbooks'
:
[
],
'
wiki_slug'
:
null
}
children
:
[]
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