File size: 4,584 Bytes
e1bd894
 
7f99f70
 
e1bd894
7f99f70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e1bd894
 
 
 
7f99f70
e1bd894
7f99f70
e1bd894
 
 
 
7f99f70
 
e1bd894
 
7f99f70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e1bd894
7f99f70
 
e1bd894
 
7f99f70
 
 
e1bd894
 
7f99f70
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import gradio as gr

def guest_signup(name, phone, otp_phone, email, otp_email, profile_pic, family_pic, password):
    return f"Guest {name} signed up successfully!"

def guest_login(name, password):
    return f"Guest {name} logged in successfully!"

def groom_signup(name, email, otp_email, phone, otp_phone, e_card, password):
    return f"Groom {name} signed up successfully!"

def groom_login(name, password, two_factor):
    return f"Groom {name} logged in successfully!"

def photographer_signup(name, email, otp_email, phone, otp_phone, password):
    return f"Photographer {name} signed up successfully!"

def photographer_login(email, password, two_factor):
    return f"Photographer {email} logged in successfully!"

def guest_dashboard():
    return "Guest Dashboard: View and manage your photos."

def groom_dashboard():
    return "Groom Dashboard: Manage public gallery and approve requests."

def photographer_dashboard():
    return "Photographer Dashboard: Upload and manage photos."

with gr.Blocks() as app:
    gr.Markdown("# Wedding Media Management System")
    
    with gr.Tab("Guest Signup"):
        name = gr.Textbox(label="Name")
        phone = gr.Textbox(label="Phone Number")
        otp_phone = gr.Textbox(label="OTP Verification (Phone)")
        email = gr.Textbox(label="Email")
        otp_email = gr.Textbox(label="OTP Verification (Email)")
        profile_pic = gr.File(label="Upload Profile Picture")
        family_pic = gr.File(label="Upload Family Picture (Optional)")
        password = gr.Textbox(label="Password", type="password")
        submit = gr.Button("Submit")
        output = gr.Textbox()
        submit.click(guest_signup, inputs=[name, phone, otp_phone, email, otp_email, profile_pic, family_pic, password], outputs=output)
    
    with gr.Tab("Guest Login"):
        name = gr.Textbox(label="Name")
        password = gr.Textbox(label="Password", type="password")
        login_btn = gr.Button("Login")
        output = gr.Textbox()
        login_btn.click(guest_login, inputs=[name, password], outputs=output)
    
    with gr.Tab("Groom Signup"):
        name = gr.Textbox(label="Name")
        email = gr.Textbox(label="Email")
        otp_email = gr.Textbox(label="OTP Verification (Email)")
        phone = gr.Textbox(label="Phone Number")
        otp_phone = gr.Textbox(label="OTP Verification (Phone)")
        e_card = gr.File(label="Upload E-Card")
        password = gr.Textbox(label="Password", type="password")
        submit = gr.Button("Submit")
        output = gr.Textbox()
        submit.click(groom_signup, inputs=[name, email, otp_email, phone, otp_phone, e_card, password], outputs=output)
    
    with gr.Tab("Groom Login"):
        name = gr.Textbox(label="Name")
        password = gr.Textbox(label="Password", type="password")
        two_factor = gr.Textbox(label="Two-step authenticator")
        login_btn = gr.Button("Login")
        output = gr.Textbox()
        login_btn.click(groom_login, inputs=[name, password, two_factor], outputs=output)
    
    with gr.Tab("Photographer Signup"):
        name = gr.Textbox(label="Name")
        email = gr.Textbox(label="Email")
        otp_email = gr.Textbox(label="OTP Verification (Email)")
        phone = gr.Textbox(label="Phone Number")
        otp_phone = gr.Textbox(label="OTP Verification (Phone)")
        password = gr.Textbox(label="Password", type="password")
        submit = gr.Button("Submit")
        output = gr.Textbox()
        submit.click(photographer_signup, inputs=[name, email, otp_email, phone, otp_phone, password], outputs=output)
    
    with gr.Tab("Photographer Login"):
        email = gr.Textbox(label="Email")
        password = gr.Textbox(label="Password", type="password")
        two_factor = gr.Textbox(label="Two-step authenticator")
        login_btn = gr.Button("Login")
        output = gr.Textbox()
        login_btn.click(photographer_login, inputs=[email, password, two_factor], outputs=output)
    
    with gr.Tab("Guest Dashboard"):
        dashboard_btn = gr.Button("View Guest Dashboard")
        output = gr.Textbox()
        dashboard_btn.click(guest_dashboard, outputs=output)
    
    with gr.Tab("Groom Dashboard"):
        dashboard_btn = gr.Button("View Groom Dashboard")
        output = gr.Textbox()
        dashboard_btn.click(groom_dashboard, outputs=output)
    
    with gr.Tab("Photographer Dashboard"):
        dashboard_btn = gr.Button("View Photographer Dashboard")
        output = gr.Textbox()
        dashboard_btn.click(photographer_dashboard, outputs=output)
    
app.launch()