def static_tab(request, course_id, tab_slug): """ Display the courses tab with the given name. Assumes the course_id is in a valid format. """ course = get_course_with_access(request.user, course_id, 'load') tab = tabs.get_static_tab_by_slug(course, tab_slug) if tab is None: raise Http404 contents = tabs.get_static_tab_contents( request, course, tab ) if contents is None: raise Http404 staff_access = has_access(request.user, course, 'staff') return render_to_response('courseware/static_tab.html', {'course': course, 'tab': tab, 'tab_contents': contents, 'staff_access': staff_access, })
def static_tab(request, course_id, tab_slug): """ Display the courses tab with the given name. Assumes the course_id is in a valid format. """ course = get_course_with_access(request.user, course_id, 'load') tab = tabs.get_static_tab_by_slug(course, tab_slug) if tab is None: raise Http404 contents = tabs.get_static_tab_contents( request, course, tab ) if contents is None: raise Http404 staff_access = has_access(request.user, course, 'staff') return render_to_response('courseware/static_tab.html', {'course': course, 'tab': tab, 'tab_contents': contents, 'staff_access': staff_access, })
def static_tab(request, course_id, tab_slug): """ Display the courses tab with the given name. Assumes the course_id is in a valid format. """ course = get_course_with_access(request.user, course_id, "load") tab = tabs.get_static_tab_by_slug(course, tab_slug) if tab is None: raise Http404 contents = tabs.get_static_tab_contents(request, course, tab) if contents is None: raise Http404 staff_access = has_access(request.user, course, "staff") return render_to_response( "courseware/static_tab.html", {"course": course, "tab": tab, "tab_contents": contents, "staff_access": staff_access}, )