def adminHomepage(): pageData = { "Name": Backend.getName(current_user.id), "Items": Backend.getItems(), "Sections": list(Backend.getSections()) } managers = Backend.getManagers() sep = [] for manager in managers: sectNames = "" for sect in manager["Sections"]: sectNames += Backend.getSectName(sect) + ", " manager["SectionNames"] = sectNames[:-2] sep.append(manager) pageData["Managers"] = sep return render_template("adminHomepage.html", pageData=pageData)
def managerSectionPage(): sID = request.form.get("sID") pageData = { "ID": sID, "Name": Backend.getSectName(sID), "AllItems": Backend.getItems() } items = [] for item in Backend.getSectItems(sID): item["Name"] = Backend.getItemName(item["ID"]) items.append(item) pageData["Items"] = items managerIDs = Backend.getSectManagers(sID) managerNames = [] for mID in managerIDs: managerNames.append(Backend.getManagerName(mID)) pageData["ManagerNames"] = managerNames return render_template("managerSectionPage.html", pageData=pageData)