rearrange history buttons / added more descirptive labels

This commit is contained in:
murraydr 2023-10-18 13:07:48 -04:00
parent c58374ae1c
commit 2eb5f799b4

View File

@ -8,8 +8,8 @@ def subHisWin(subRequestsArchiveFilename,defaultFont):
history = pd.read_csv(subRequestsArchiveFilename,dtype=str) history = pd.read_csv(subRequestsArchiveFilename,dtype=str)
layout=[[sg.Text("Name of TA:")], layout=[[sg.Text("TA Search Box: Type a substring of the name of a TA",key="-LABEL-")],
[sg.Input()],[sg.Button("Find History"),sg.Button("Close Window"),sg.Button("Weekly Kudos"),sg.Button("Hall of Fame")], [sg.Input()],[sg.Button("Find History"),sg.Button("Weekly Kudos"),sg.Button("Hall of Fame"),sg.Button("Close Window")],
[sg.Button("+APP"),sg.Button("-APP"),sg.Button("+ACC"),sg.Button("-ACC"),sg.Button("+REJ"),sg.Button("-REJ"),sg.Button("+CAN"),sg.Button("-CAN"),sg.Button("+FUL"),sg.Button("-FUL")] [sg.Button("+APP"),sg.Button("-APP"),sg.Button("+ACC"),sg.Button("-ACC"),sg.Button("+REJ"),sg.Button("-REJ"),sg.Button("+CAN"),sg.Button("-CAN"),sg.Button("+FUL"),sg.Button("-FUL")]
,[sg.Text("",key="OUTPUT",expand_x=True,expand_y=True,size=(200, 20))]] ,[sg.Text("",key="OUTPUT",expand_x=True,expand_y=True,size=(200, 20))]]
@ -35,6 +35,7 @@ def subHisWin(subRequestsArchiveFilename,defaultFont):
event = "Find History" event = "Find History"
if event=="Find History": if event=="Find History":
window["-LABEL-"].update(value='TA Search Box: Type a substring of the name of a TA')
name = values[0] name = values[0]
netIDs=HF.nameToID(name,getAllMatches=True) netIDs=HF.nameToID(name,getAllMatches=True)
if not hasattr(netIDs,'__len__') or len(netIDs)==0: if not hasattr(netIDs,'__len__') or len(netIDs)==0:
@ -95,7 +96,8 @@ def subHisWin(subRequestsArchiveFilename,defaultFont):
pd.set_option('max_colwidth', 30) pd.set_option('max_colwidth', 30)
#Display instructions while the inputStr is not a valid input for the Hall of Fame #Display instructions while the inputStr is not a valid input for the Hall of Fame
output='To customize which categories to add (App,Acc,Rej,Can,Ful):\nuse 0,1,2,3,4 or any combination thereof in the text box then click "Hall of Fame" again\n(e.g. "12" yields Accepted plus Rejected)\n' window["-LABEL-"].update(value='Hall of Fame: To customize which categories to add (App,Acc,Rej,Can,Ful):\nuse 0,1,2,3,4 or any combination thereof in the text box then click "Hall of Fame" again\n(e.g. "12" yields Accepted plus Rejected)')
output=''
inputStr=values[0] inputStr=values[0]
if inputStr=="" or not inputStr.isnumeric(): if inputStr=="" or not inputStr.isnumeric():
inputStr="" inputStr=""
@ -120,6 +122,7 @@ def subHisWin(subRequestsArchiveFilename,defaultFont):
pastDate=timeStr-timedelta(hours=4+24*7,minutes=0) pastDate=timeStr-timedelta(hours=4+24*7,minutes=0)
currDate=currDate.strftime('%m')+"/"+currDate.strftime('%d') currDate=currDate.strftime('%m')+"/"+currDate.strftime('%d')
pastDate=pastDate.strftime('%m')+"/"+pastDate.strftime('%d') pastDate=pastDate.strftime('%m')+"/"+pastDate.strftime('%d')
window["-LABEL-"].update(value='Kudos: Displaying most fulfilled sub requests between '+pastDate+' and '+currDate)
output=f'Name : Hours subbed\n' output=f'Name : Hours subbed\n'