def edit_recipe(id): if "uuid" not in session: return redirect("/") return render_template( "editrecipe.html", logged_in_user = User.get_by_id({"id": session['uuid']}), recipe = Recipe.get_one({"id" : id}) )
def dashboard(): if "uuid" not in session: return redirect("/") return render_template( "dashboard.html", logged_in_user = User.get_by_id({"id": session['uuid']}), all_recipes = Recipe.get_all() )
def show_edit(userid): data = {'id': userid} return render_template('edit.html', user=User.get_by_id(data))
def show_one(userid): data = {'id': userid} return render_template("show_one.html", user=User.get_by_id(data))
def edit_user_page(id_num): data = {"id": id_num} return render_template("edit_user.html", user=User.get_by_id(data))
def show_single_user_page(id_num): data = {"id": id_num} return render_template("show_single_user.html", user=User.get_by_id(data))
def edit(id): data = {"id": int(id)} return render_template('index_edit.html', user=User.get_by_id(data))
def new_recipe(): if "uuid" not in session: return redirect("/") #some wireframes expect you to dispaly the name of the logged in user on this page,then you would pass in # the logged in user, other wireframes don't require it at all, just there to create a form so no need) return render_template("newrecipe.html", new_recipe = User.get_by_id({"id": session['uuid']}))
def show_user_page(id): data = {'id': int(id)} return render_template('index_show.html', user=User.get_by_id(data))
def display_users(): if "uuid" not in session: flash("Must log in") return redirect('/') return render_template("users.html", all_users = User.get_all(), user = User.get_by_id({"id": session['uuid']}))
def register_success(user_id): if 'user_id' not in session: return "You are not logged in <br><a href = '/'>" + "Click Here to Login</a>" data = {"user_id": user_id} return render_template('welcome.html', user=User.get_by_id(data))
def edit_user(id): data = {"id": id} return render_template("edit.html", user=User.get_by_id(data))
def read(id): data = {"id": id} return render_template("user.html", user=User.get_by_id(data))