Commit 3d61c629 by David Baumgold

Stubbed out textbooks index page

parent cc4e01b4
......@@ -44,7 +44,7 @@ __all__ = ['course_index', 'create_new_course', 'course_info',
'course_config_advanced_page',
'course_settings_updates',
'course_grader_updates',
'course_advanced_updates']
'course_advanced_updates', 'textbook_index']
@login_required
......@@ -411,3 +411,18 @@ def course_advanced_updates(request, org, course, name):
return HttpResponseBadRequest("Incorrect setting format. " + str(e), content_type="text/plain")
return HttpResponse(response_json, mimetype="application/json")
@login_required
@ensure_csrf_cookie
def textbook_index(request, org, course, name):
"""
Display an editable textbook overview.
org, course, name: Attributes of the Location for the item to edit
"""
location = get_location_and_verify_access(request, org, course, name)
course = modulestore().get_item(location, depth=3)
return render_to_response('textbooks.html', {
'context_course': course,
})
......@@ -349,6 +349,7 @@ body.course.outline .nav-course-courseware-outline,
body.course.updates .nav-course-courseware-updates,
body.course.pages .nav-course-courseware-pages,
body.course.uploads .nav-course-courseware-uploads,
body.course.textbooks .nav-course-courseware-textbooks,
// course settings
body.course.schedule .nav-course-settings .title,
......
<%inherit file="base.html" />
<%block name="title">Textbooks</%block>
<%block name="bodyclass">is-signedin course textbooks</%block>
<%block name="content">
<div class="wrapper-mast wrapper">
<header class="mast has-actions has-subtitle">
<h1 class="page-header">
<small class="subtitle">Course Content</small>
<span class="sr">&gt; </span>Textbooks
</h1>
</header>
</div>
<div class="main-wrapper">
<div class="inner-wrapper">
I'm a stub!
</div>
</div>
</%block>
......@@ -37,6 +37,9 @@
<li class="nav-item nav-course-courseware-uploads">
<a href="${reverse('asset_index', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name))}">Files &amp; Uploads</a>
</li>
<li class="nav-item nav-course-courseware-textbooks">
<a href="${reverse('textbook_index', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name))}">Textbooks</a>
</li>
</ul>
</div>
</div>
......
......@@ -81,6 +81,8 @@ urlpatterns = ('', # nopep8
'contentstore.views.asset_index', name='asset_index'),
url(r'^(?P<org>[^/]+)/(?P<course>[^/]+)/assets/(?P<name>[^/]+)/remove$',
'contentstore.views.assets.remove_asset', name='remove_asset'),
url(r'^(?P<org>[^/]+)/(?P<course>[^/]+)/textbooks/(?P<name>[^/]+)$',
'contentstore.views.textbook_index', name='textbook_index'),
# this is a generic method to return the data/metadata associated with a xmodule
url(r'^module_info/(?P<module_location>.*)$',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment