def static_page(pctx, page_path): from course.content import get_staticpage_desc, get_processed_page_chunks try: page_desc = get_staticpage_desc(pctx.repo, pctx.course, pctx.course_commit_sha, "staticpages/"+page_path+".yml") except ObjectDoesNotExist: raise http.Http404() chunks = get_processed_page_chunks( pctx.course, pctx.repo, pctx.course_commit_sha, page_desc, pctx.role, get_now_or_fake_time(pctx.request), facilities=pctx.request.relate_facilities) return render_course_page(pctx, "course/static-page.html", { "chunks": chunks, "show_enroll_button": False, })
def static_page(pctx, page_path): # type: (CoursePageContext, Text) -> http.HttpResponse from course.content import get_staticpage_desc, get_processed_page_chunks try: page_desc = get_staticpage_desc(pctx.repo, pctx.course, pctx.course_commit_sha, "staticpages/"+page_path+".yml") except ObjectDoesNotExist: raise http.Http404() chunks = get_processed_page_chunks( pctx.course, pctx.repo, pctx.course_commit_sha, page_desc, pctx.role_identifiers(), get_now_or_fake_time(pctx.request), facilities=pctx.request.relate_facilities) return render_course_page(pctx, "course/static-page.html", { "chunks": chunks, "show_enroll_button": False, })