Create tool_request_page.py
Browse files- tool_request_page.py +27 -0
tool_request_page.py
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
|
| 3 |
+
def tool_request_page():
|
| 4 |
+
st.title("Tool Request Form")
|
| 5 |
+
|
| 6 |
+
# Input fields
|
| 7 |
+
name = st.text_input("Your Name", placeholder="Enter your name")
|
| 8 |
+
tool = st.text_input("Tool Name", placeholder="Enter the tool you need")
|
| 9 |
+
|
| 10 |
+
# Send button
|
| 11 |
+
if st.button("Send"):
|
| 12 |
+
if name and tool:
|
| 13 |
+
send_request(name, tool)
|
| 14 |
+
else:
|
| 15 |
+
st.error("Please fill in both your name and the tool name.")
|
| 16 |
+
|
| 17 |
+
# Function to simulate sending an email
|
| 18 |
+
def send_request(name, tool):
|
| 19 |
+
# Here you can add your request sending logic
|
| 20 |
+
st.write(f"Name: {name}")
|
| 21 |
+
st.write(f"Tool: {tool}")
|
| 22 |
+
st.success("Your request has been sent successfully!")
|
| 23 |
+
|
| 24 |
+
# Store the name and tool in session state
|
| 25 |
+
st.session_state['name'] = name
|
| 26 |
+
st.session_state['tool'] = tool
|
| 27 |
+
st.session_state['page'] = 'mail'
|