Update app.py
Browse files
app.py
CHANGED
@@ -1,46 +1,107 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
def
|
4 |
-
return "
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
with gr.Tab("Guest Signup"):
|
13 |
name = gr.Textbox(label="Name")
|
14 |
phone = gr.Textbox(label="Phone Number")
|
15 |
-
otp_phone = gr.
|
16 |
email = gr.Textbox(label="Email")
|
17 |
-
otp_email = gr.
|
18 |
profile_pic = gr.File(label="Upload Profile Picture")
|
19 |
family_pic = gr.File(label="Upload Family Picture (Optional)")
|
20 |
password = gr.Textbox(label="Password", type="password")
|
21 |
submit = gr.Button("Submit")
|
|
|
|
|
22 |
|
23 |
with gr.Tab("Guest Login"):
|
24 |
-
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
login_btn = gr.Button("Login")
|
|
|
|
|
27 |
|
28 |
with gr.Tab("Guest Dashboard"):
|
29 |
-
gr.
|
30 |
-
|
31 |
-
|
32 |
-
download = gr.Button("Download Photos or Upload to Google Drive")
|
33 |
-
request_access = gr.Button("Request Access for Family Members")
|
34 |
-
logout = gr.Button("Logout")
|
35 |
|
36 |
with gr.Tab("Groom Dashboard"):
|
37 |
-
gr.
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
def guest_signup(name, phone, otp_phone, email, otp_email, profile_pic, family_pic, password):
|
4 |
+
return f"Guest {name} signed up successfully!"
|
5 |
|
6 |
+
def guest_login(name, password):
|
7 |
+
return f"Guest {name} logged in successfully!"
|
8 |
+
|
9 |
+
def groom_signup(name, email, otp_email, phone, otp_phone, e_card, password):
|
10 |
+
return f"Groom {name} signed up successfully!"
|
11 |
+
|
12 |
+
def groom_login(name, password, two_factor):
|
13 |
+
return f"Groom {name} logged in successfully!"
|
14 |
+
|
15 |
+
def photographer_signup(name, email, otp_email, phone, otp_phone, password):
|
16 |
+
return f"Photographer {name} signed up successfully!"
|
17 |
+
|
18 |
+
def photographer_login(email, password, two_factor):
|
19 |
+
return f"Photographer {email} logged in successfully!"
|
20 |
+
|
21 |
+
def guest_dashboard():
|
22 |
+
return "Guest Dashboard: View and manage your photos."
|
23 |
+
|
24 |
+
def groom_dashboard():
|
25 |
+
return "Groom Dashboard: Manage public gallery and approve requests."
|
26 |
+
|
27 |
+
def photographer_dashboard():
|
28 |
+
return "Photographer Dashboard: Upload and manage photos."
|
29 |
+
|
30 |
+
with gr.Blocks() as app:
|
31 |
+
gr.Markdown("# Wedding Media Management System")
|
32 |
|
33 |
with gr.Tab("Guest Signup"):
|
34 |
name = gr.Textbox(label="Name")
|
35 |
phone = gr.Textbox(label="Phone Number")
|
36 |
+
otp_phone = gr.Textbox(label="OTP Verification (Phone)")
|
37 |
email = gr.Textbox(label="Email")
|
38 |
+
otp_email = gr.Textbox(label="OTP Verification (Email)")
|
39 |
profile_pic = gr.File(label="Upload Profile Picture")
|
40 |
family_pic = gr.File(label="Upload Family Picture (Optional)")
|
41 |
password = gr.Textbox(label="Password", type="password")
|
42 |
submit = gr.Button("Submit")
|
43 |
+
output = gr.Textbox()
|
44 |
+
submit.click(guest_signup, inputs=[name, phone, otp_phone, email, otp_email, profile_pic, family_pic, password], outputs=output)
|
45 |
|
46 |
with gr.Tab("Guest Login"):
|
47 |
+
name = gr.Textbox(label="Name")
|
48 |
+
password = gr.Textbox(label="Password", type="password")
|
49 |
+
login_btn = gr.Button("Login")
|
50 |
+
output = gr.Textbox()
|
51 |
+
login_btn.click(guest_login, inputs=[name, password], outputs=output)
|
52 |
+
|
53 |
+
with gr.Tab("Groom Signup"):
|
54 |
+
name = gr.Textbox(label="Name")
|
55 |
+
email = gr.Textbox(label="Email")
|
56 |
+
otp_email = gr.Textbox(label="OTP Verification (Email)")
|
57 |
+
phone = gr.Textbox(label="Phone Number")
|
58 |
+
otp_phone = gr.Textbox(label="OTP Verification (Phone)")
|
59 |
+
e_card = gr.File(label="Upload E-Card")
|
60 |
+
password = gr.Textbox(label="Password", type="password")
|
61 |
+
submit = gr.Button("Submit")
|
62 |
+
output = gr.Textbox()
|
63 |
+
submit.click(groom_signup, inputs=[name, email, otp_email, phone, otp_phone, e_card, password], outputs=output)
|
64 |
+
|
65 |
+
with gr.Tab("Groom Login"):
|
66 |
+
name = gr.Textbox(label="Name")
|
67 |
+
password = gr.Textbox(label="Password", type="password")
|
68 |
+
two_factor = gr.Textbox(label="Two-step authenticator")
|
69 |
+
login_btn = gr.Button("Login")
|
70 |
+
output = gr.Textbox()
|
71 |
+
login_btn.click(groom_login, inputs=[name, password, two_factor], outputs=output)
|
72 |
+
|
73 |
+
with gr.Tab("Photographer Signup"):
|
74 |
+
name = gr.Textbox(label="Name")
|
75 |
+
email = gr.Textbox(label="Email")
|
76 |
+
otp_email = gr.Textbox(label="OTP Verification (Email)")
|
77 |
+
phone = gr.Textbox(label="Phone Number")
|
78 |
+
otp_phone = gr.Textbox(label="OTP Verification (Phone)")
|
79 |
+
password = gr.Textbox(label="Password", type="password")
|
80 |
+
submit = gr.Button("Submit")
|
81 |
+
output = gr.Textbox()
|
82 |
+
submit.click(photographer_signup, inputs=[name, email, otp_email, phone, otp_phone, password], outputs=output)
|
83 |
+
|
84 |
+
with gr.Tab("Photographer Login"):
|
85 |
+
email = gr.Textbox(label="Email")
|
86 |
+
password = gr.Textbox(label="Password", type="password")
|
87 |
+
two_factor = gr.Textbox(label="Two-step authenticator")
|
88 |
login_btn = gr.Button("Login")
|
89 |
+
output = gr.Textbox()
|
90 |
+
login_btn.click(photographer_login, inputs=[email, password, two_factor], outputs=output)
|
91 |
|
92 |
with gr.Tab("Guest Dashboard"):
|
93 |
+
dashboard_btn = gr.Button("View Guest Dashboard")
|
94 |
+
output = gr.Textbox()
|
95 |
+
dashboard_btn.click(guest_dashboard, outputs=output)
|
|
|
|
|
|
|
96 |
|
97 |
with gr.Tab("Groom Dashboard"):
|
98 |
+
dashboard_btn = gr.Button("View Groom Dashboard")
|
99 |
+
output = gr.Textbox()
|
100 |
+
dashboard_btn.click(groom_dashboard, outputs=output)
|
101 |
+
|
102 |
+
with gr.Tab("Photographer Dashboard"):
|
103 |
+
dashboard_btn = gr.Button("View Photographer Dashboard")
|
104 |
+
output = gr.Textbox()
|
105 |
+
dashboard_btn.click(photographer_dashboard, outputs=output)
|
106 |
+
|
107 |
+
app.launch()
|