measmonysuon commited on
Commit
653b75e
1 Parent(s): 612c29b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -14
app.py CHANGED
@@ -297,7 +297,7 @@ def create_gradio_interface():
297
  gr.HTML("""
298
  <h1>AI ImaGen DALL·E 4K</h1>
299
  <h3>Welcome! Please enter your UID and OTP to continue or Register with <a href="https://t.me/myexpsupportBot">@SupportBot</a> to get UID</h3>
300
- <p><a href="/static/privacy_policy.html" target="_blank">Privacy Policy</a></p>
301
  """)
302
 
303
  with gr.Row():
@@ -315,18 +315,6 @@ def create_gradio_interface():
315
 
316
  generate_button = gr.Button("Generate")
317
  result_output = gr.Image(label="Generated Image", type="pil")
318
-
319
- # Dropdown for selecting content
320
- content_dropdown = gr.Dropdown(choices=["Privacy Policy"], label="Select Document", value="Privacy Policy")
321
- content_display = gr.HTML()
322
-
323
- def display_content(selected_option):
324
- if selected_option == "Privacy Policy":
325
- return PRIVACY_POLICY_HTML
326
- return "<p>Content not found.</p>"
327
-
328
- content_dropdown.change(fn=display_content, inputs=content_dropdown, outputs=content_display)
329
-
330
 
331
  generate_button.click(
332
  fn=handle_generate_image,
@@ -345,7 +333,16 @@ def create_gradio_interface():
345
  inputs=[user_chat_id_input],
346
  outputs=[message_output]
347
  )
348
-
 
 
 
 
 
 
 
 
 
349
  gr.HTML("""
350
  <style>
351
  footer.svelte-1rjryqp {
 
297
  gr.HTML("""
298
  <h1>AI ImaGen DALL·E 4K</h1>
299
  <h3>Welcome! Please enter your UID and OTP to continue or Register with <a href="https://t.me/myexpsupportBot">@SupportBot</a> to get UID</h3>
300
+ <p>Read more about out Privacy Policy below</a></p>
301
  """)
302
 
303
  with gr.Row():
 
315
 
316
  generate_button = gr.Button("Generate")
317
  result_output = gr.Image(label="Generated Image", type="pil")
 
 
 
 
 
 
 
 
 
 
 
 
318
 
319
  generate_button.click(
320
  fn=handle_generate_image,
 
333
  inputs=[user_chat_id_input],
334
  outputs=[message_output]
335
  )
336
+
337
+ # Display Privacy Policy
338
+ with gr.Row():
339
+ gr.HTML("""
340
+ <button onclick="document.getElementById('privacy-policy').style.display='block'">View Privacy Policy</button>
341
+ <div id="privacy-policy" style="display:none;">
342
+ {}
343
+ </div>
344
+ """.format(PRIVACY_POLICY_HTML))
345
+
346
  gr.HTML("""
347
  <style>
348
  footer.svelte-1rjryqp {