Update app.py
Browse files
app.py
CHANGED
@@ -1,54 +1,31 @@
|
|
1 |
import streamlit as st
|
|
|
|
|
2 |
|
3 |
# Function to simulate sending an email
|
4 |
-
def
|
5 |
-
# Here you can add your
|
6 |
-
|
7 |
st.write(f"Tool: {tool}")
|
8 |
-
st.write(f"Email: {email}")
|
9 |
st.success("Your request has been sent successfully!")
|
10 |
|
11 |
-
# Store the
|
|
|
12 |
st.session_state['tool'] = tool
|
13 |
-
st.session_state['email'] = email
|
14 |
st.session_state['page'] = 'mail'
|
15 |
|
16 |
-
# Function for the tool request form page
|
17 |
-
def tool_request_page():
|
18 |
-
st.title("Tool Request Form")
|
19 |
-
|
20 |
-
# Input fields
|
21 |
-
tool = st.text_input("Tool Name", placeholder="Enter the tool you need")
|
22 |
-
email = st.text_input("Your Email", placeholder="Enter your email address")
|
23 |
-
|
24 |
-
# Send button
|
25 |
-
if st.button("Send"):
|
26 |
-
if tool and email:
|
27 |
-
send_email(tool, email)
|
28 |
-
else:
|
29 |
-
st.error("Please fill in both the tool name and your email address.")
|
30 |
-
|
31 |
-
# Function for the email confirmation page
|
32 |
-
def mail_page():
|
33 |
-
st.title("Email Sent Successfully")
|
34 |
-
st.write("Thank you for your tool request! Your email has been sent.")
|
35 |
-
st.write("Here are the details of your request:")
|
36 |
-
|
37 |
-
# Retrieve the tool and email from session state
|
38 |
-
tool = st.session_state.get('tool')
|
39 |
-
email = st.session_state.get('email')
|
40 |
-
|
41 |
-
if tool and email:
|
42 |
-
st.write(f"**Tool:** {tool}")
|
43 |
-
st.write(f"**Email:** {email}")
|
44 |
-
else:
|
45 |
-
st.write("No request details found.")
|
46 |
-
|
47 |
# Main function to handle page navigation
|
48 |
def main():
|
49 |
if 'page' not in st.session_state:
|
50 |
st.session_state['page'] = 'tool_request'
|
51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
if st.session_state['page'] == 'tool_request':
|
53 |
tool_request_page()
|
54 |
elif st.session_state['page'] == 'mail':
|
|
|
1 |
import streamlit as st
|
2 |
+
from tool_request_page import tool_request_page
|
3 |
+
from mail_page import mail_page
|
4 |
|
5 |
# Function to simulate sending an email
|
6 |
+
def send_request(name, tool):
|
7 |
+
# Here you can add your request sending logic
|
8 |
+
st.write(f"Name: {name}")
|
9 |
st.write(f"Tool: {tool}")
|
|
|
10 |
st.success("Your request has been sent successfully!")
|
11 |
|
12 |
+
# Store the name and tool in session state
|
13 |
+
st.session_state['name'] = name
|
14 |
st.session_state['tool'] = tool
|
|
|
15 |
st.session_state['page'] = 'mail'
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
# Main function to handle page navigation
|
18 |
def main():
|
19 |
if 'page' not in st.session_state:
|
20 |
st.session_state['page'] = 'tool_request'
|
21 |
|
22 |
+
# Navigation link in the upper left corner
|
23 |
+
st.sidebar.title("Navigation")
|
24 |
+
if st.sidebar.button("Tool Request"):
|
25 |
+
st.session_state['page'] = 'tool_request'
|
26 |
+
if st.sidebar.button("Request Confirmation"):
|
27 |
+
st.session_state['page'] = 'mail'
|
28 |
+
|
29 |
if st.session_state['page'] == 'tool_request':
|
30 |
tool_request_page()
|
31 |
elif st.session_state['page'] == 'mail':
|