danemery-ai2 commited on
Commit
c2f4381
·
unverified ·
1 Parent(s): 3916685

Revert "Move floating feedback button to document body" (#33)

Browse files
Files changed (2) hide show
  1. app.py +1 -12
  2. ui_components.py +6 -0
app.py CHANGED
@@ -104,17 +104,6 @@ redirect_script = """
104
  </script>
105
  """
106
 
107
- sticky_feedback_button_script = """
108
- <script>
109
- const btn = document.createElement('a');
110
- btn.id = 'floating-feedback-button';
111
- btn.href = 'https://docs.google.com/forms/d/e/1FAIpQLSfJdVkD62aPYh8XehN2FrSeHUWt488Ejc-QdtuZn5NZ3eNoxA/viewform';
112
- btn.target = '_blank';
113
- btn.rel = 'noopener noreferrer';
114
- btn.textContent = 'Have feedback?';
115
- document.body.appendChild(btn);
116
- </script>
117
- """
118
  # --- This is the final CSS ---
119
  final_css = css + f"""
120
  /* --- Find the "Home" button and replace its text with an icon --- */
@@ -147,7 +136,7 @@ final_css = css + f"""
147
  }}
148
  """
149
  # --- Gradio App Definition ---
150
- demo = gr.Blocks(theme=theme, css=final_css, head=scroll_script + redirect_script + sticky_feedback_button_script)
151
  with demo.route("Home", "/home"):
152
  build_main_page()
153
 
 
104
  </script>
105
  """
106
 
 
 
 
 
 
 
 
 
 
 
 
107
  # --- This is the final CSS ---
108
  final_css = css + f"""
109
  /* --- Find the "Home" button and replace its text with an icon --- */
 
136
  }}
137
  """
138
  # --- Gradio App Definition ---
139
+ demo = gr.Blocks(theme=theme, css=final_css, head=scroll_script + redirect_script)
140
  with demo.route("Home", "/home"):
141
  build_main_page()
142
 
ui_components.py CHANGED
@@ -334,6 +334,12 @@ def create_leaderboard_display(
334
  )
335
  gr.HTML(SCATTER_DISCLAIMER, elem_id="scatter-disclaimer")
336
 
 
 
 
 
 
 
337
  # Put table and key into an accordion
338
  with gr.Accordion("Show / Hide Table View", open=True, elem_id="leaderboard-accordion"):
339
  gr.HTML(value=legend_markdown, elem_id="legend-markdown")
 
334
  )
335
  gr.HTML(SCATTER_DISCLAIMER, elem_id="scatter-disclaimer")
336
 
337
+ # Floating feedback button
338
+ floating_feedback_button_html = """
339
+ <a id="floating-feedback-button" href="https://docs.google.com/forms/d/e/1FAIpQLSfJdVkD62aPYh8XehN2FrSeHUWt488Ejc-QdtuZn5NZ3eNoxA/viewform">Have feedback?</a>
340
+ """
341
+ gr.HTML(floating_feedback_button_html)
342
+
343
  # Put table and key into an accordion
344
  with gr.Accordion("Show / Hide Table View", open=True, elem_id="leaderboard-accordion"):
345
  gr.HTML(value=legend_markdown, elem_id="legend-markdown")