def cc_codesearch(): form = CodeSearchForm(request.form) if not form.validate(): return render_template("colorcode/listwdelete.html", form = form, error = "Invalid code") return render_template("colorcode/listwdelete.html", items = Cc_ptype.codesearch_cc(form.incl.data, form.search.data), form = CodeSearchForm())
def item_codesearch(): form = CodeSearchForm(request.form) if not form.validate(): return render_template("items/listpersonal.html", form=form, error="Invalid code") return render_template("items/listpersonal.html", items=Item.codesearch(str(current_user.id), form.incl.data, form.search.data), form=CodeSearchForm())
def items_date_added(): return render_template("items/listpersonal.html", items=Item.date_added(Item, str(current_user.id)), form=CodeSearchForm())
def items_favorite(): return render_template("items/listpersonal.html", items=Item.find_favorite(Item, str(current_user.id)), form=CodeSearchForm())
def items_myindex(): return render_template("items/listpersonal.html", items=Item.personal_index(Item, str(current_user.id)), form=CodeSearchForm())
def most_popular_cc(): return render_template("colorcode/listwdelete.html", items = Colorcode.most_popular_cc(), form = CodeSearchForm())
def ptype_only(): if current_user.is_authenticated: if "ADMIN" in current_user.roles(): return render_template("colorcode/listwdelete.html", items = Ptype.ptype_iterable(), form = CodeSearchForm()) return render_template("colorcode/listccptype.html", items = Ptype.ptype_iterable(), form = CodeSearchForm())
def cc_only(): if current_user.is_authenticated: if "ADMIN" in current_user.roles(): print("------IS ADMIN!") return render_template("colorcode/listwdelete.html", items = Colorcode.cc_iterable(), form = CodeSearchForm()) return render_template("colorcode/listccptype.html", items = Colorcode.cc_iterable(), form = CodeSearchForm())
def cc_ptype_index(): return render_template("colorcode/list.html", items = Cc_ptype.list_products(), form = CodeSearchForm())