2021-03-18 22:20:59 +00:00
|
|
|
def navbarItems(activePage):
|
|
|
|
pages = ["Students", "Assistants", "Experiments", "Appointments", "Groups", "Users"]
|
|
|
|
items = ""
|
|
|
|
for page in pages:
|
|
|
|
active = ""
|
|
|
|
lowerPage = page.lower().replace(" ", "_")
|
|
|
|
if lowerPage == activePage:
|
|
|
|
active = " active"
|
2021-03-19 12:41:52 +00:00
|
|
|
items += '<a class="nav-link' + active + '" href="' + lowerPage + '">' + page + '</a>'
|
2021-03-18 22:20:59 +00:00
|
|
|
return items
|
2021-03-19 12:41:52 +00:00
|
|
|
|
2021-03-19 15:30:02 +00:00
|
|
|
def makeTable(headerAndDataList, rows):
|
|
|
|
def td(cell):
|
|
|
|
return "<td>" + str(cell) + "</td>"
|
2021-03-19 12:41:52 +00:00
|
|
|
|
2021-03-19 15:30:02 +00:00
|
|
|
def th(cell):
|
|
|
|
return '<th data-sortable="true">' + str(cell) + '</th>'
|
|
|
|
|
|
|
|
|
|
|
|
table = '<thead><tr>'
|
|
|
|
for i in headerAndDataList:
|
|
|
|
table += th(i[0])
|
|
|
|
table += '</tr></thead>\n<tbody>\n'
|
|
|
|
|
|
|
|
for row in rows:
|
|
|
|
table += '<tr>'
|
|
|
|
|
|
|
|
for i in headerAndDataList:
|
|
|
|
table += td(eval(i[1]))
|
|
|
|
|
|
|
|
table += '</tr>\n'
|
|
|
|
|
|
|
|
table += '</tbody>'
|
|
|
|
return table
|