def add_entry(): que = request.args blog_id = int(que['blog_id']) name = blogs.getBlog(blog_id) user = blogs.getAuthor(blog_id) entries.addEntry(blog_id, "") entries_list = blogs.getEntries(blog_id) return render_template("blog.html", blog_id=blog_id, blog_title=name, author=user, entry_list=entries_list)
def edit_mode(): que = request.args entry_id = int(que['entry_id']) blog_id = int(que['blog_id']) name = blogs.getBlog(blog_id) user = blogs.getAuthor(blog_id) text = entries.viewEntry(entry_id) return render_template("edit.html", blog_id=blog_id, entry_id=entry_id, entry_text=text, blog_title=name, author=user)
def edit_entry(): que = request.args entry_id = int(que['entry_id']) blog_id = int(que['blog_id']) name = blogs.getBlog(blog_id) user = blogs.getAuthor(blog_id) text = que['content'] entries.editEntry(entry_id, text) return render_template("entry.html", blog_id=blog_id, entry_id=entry_id, entry_text=text, blog_title=name, author=user)
def display_blog(): que = request.args blog_id = int(que['blog_id']) name = blogs.getBlog(blog_id) user = blogs.getAuthor(blog_id) entries = blogs.getEntries(blog_id) if user == session['username']: return render_template("blog.html", blog_id=blog_id, blog_title=name, author=user, entry_list=entries) else: return render_template("blogview.html", blog_id=blog_id, blog_title=name, author=user, entry_list=entries)
def display_entry(): que = request.args entry_id = int(que['entry_id']) blog_id = int(que['blog_id']) name = blogs.getBlog(blog_id) user = blogs.getAuthor(blog_id) text = entries.viewEntry(entry_id) if user == session['username']: return render_template("entry.html", entry_id=entry_id, blog_id=blog_id, entry_text=text, blog_title=name, author=user) else: return render_template("entryview.html", entry_id=entry_id, blog_id=blog_id, entry_text=text, blog_title=name, author=user)