Spaces:
Paused
Paused
Update app.py
Browse files50 unmodified lines51525354555657585960616263641 unmodified line666768697071723 unmodified lines7677787980818274 unmodified lines15715815916016116216316431 unmodified lines19619719819920020120220320420520650 unmodified lines"""name = str(name).strip()tag = str(tag).strip()description = str(description).strip()if name == "":return "⚠️ Please enter a team name."if tag == "":return "⚠️ Please include an anonymous tag."if not description:return "⚠️ Please include a description."# Get the submissions worksheetworksheet = get_worksheet(0)1 unmodified line# If sheet is empty, add header rowif not data:worksheet.append_row(["Name", "Tag", "Description", "Timestamp"])data = worksheet.get_all_values()# Collect submitted names from row 2 onward (assuming row 1 is the header)3 unmodified lines# Record current timestamp and append the new submissiontimestamp = datetime.now().strftime('%Y-%m-%d %H:%M:%S')worksheet.append_row([name, tag, description, timestamp])return f"✅ Team name '{name}' with tag '{tag}' submitted successfully at {timestamp}!"74 unmodified linesnames_list = []if len(data > 1):for row in data[1:]:name, description = row[0], row[2]display_text = f"{name}: {description}"names_list.append(display_text)# names_list = [row[0] for row in data[1:]] if len(data) > 1 else []31 unmodified lineswith gr.Row():name_input = gr.Textbox(label="Team Name", placeholder="Enter a team name idea")tag_input = gr.Textbox(label="Anonymous Tag", placeholder="e.g., your initials")description_input = gr.Textbox(label="Name Description", placeholder="e.g., acronym")submit_btn = gr.Button("Submit")submit_msg = gr.Markdown() # Feedback messagesubmit_btn.click(fn=add_name, inputs=[name_input, description_input, tag_input], outputs=submit_msg)with gr.Tab("Vote for Name"):gr.Markdown("**Vote for Your Top 3 Choices** (each user can vote for up to 3 names in total)")50 unmodified lines51525354555657585960616263641 unmodified line666768697071723 unmodified lines7677787980818274 unmodified lines15715815916016116216316431 unmodified lines19619719819920020120220320420520650 unmodified lines"""name = str(name).strip()tag = str(tag).strip()# description = str(description).strip()if name == "":return "⚠️ Please enter a team name."if tag == "":return "⚠️ Please include an anonymous tag."# if not description:# return "⚠️ Please include a description."# Get the submissions worksheetworksheet = get_worksheet(0)1 unmodified line# If sheet is empty, add header rowif not data:worksheet.append_row(["Name", "Tag", "Timestamp"])data = worksheet.get_all_values()# Collect submitted names from row 2 onward (assuming row 1 is the header)3 unmodified lines# Record current timestamp and append the new submissiontimestamp = datetime.now().strftime('%Y-%m-%d %H:%M:%S')worksheet.append_row([name, tag, timestamp])return f"✅ Team name '{name}' with tag '{tag}' submitted successfully at {timestamp}!"74 unmodified linesnames_list = []if len(data > 1):for row in data[1:]:name = row[0]display_text = f"{name}"names_list.append(display_text)# names_list = [row[0] for row in data[1:]] if len(data) > 1 else []31 unmodified lineswith gr.Row():name_input = gr.Textbox(label="Team Name", placeholder="Enter a team name idea")tag_input = gr.Textbox(label="Anonymous Tag", placeholder="e.g., your initials")# description_input = gr.Textbox(label="Name Description", placeholder="e.g., acronym")submit_btn = gr.Button("Submit")submit_msg = gr.Markdown() # Feedback messagesubmit_btn.click(fn=add_name, inputs=[name_input, tag_input], outputs=submit_msg)with gr.Tab("Vote for Name"):gr.Markdown("**Vote for Your Top 3 Choices** (each user can vote for up to 3 names in total)")
app.py+9-9