Example #1
0
def admin_new_article(db, id=""):
	prepare_admin(request)
	id, author, title, content, contype = \
			("", users.get_login(request), "", "", contype_markdown)
	blog = blogs.Blog(**locals())
	if id:
		blog = blogs.get_article(db, id, status=status_draft)
	return template("admin_newedit_page", blog=blog)
Example #2
0
def admin_edit_article(db, id):
	prepare_admin(request)
	blog = blogs.get_article(db, id)
	return template("admin_newedit_page", blog=blog)
Example #3
0
def show_article(id, db):
	blog = blogs.get_article(db, id)
	if blog:
		return template("article_page", blog=blog)
	return HTTPError(404, "Page not found")