VyLala commited on
Commit
63a88a4
·
verified ·
1 Parent(s): bd93d29

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -14
app.py CHANGED
@@ -284,7 +284,7 @@ with gr.Blocks() as interface:
284
 
285
  gr.Markdown(" ") # A simple blank markdown can create space
286
 
287
- with gr.Group(visible=True, elem_id="nps-overlay") as nps_modal:
288
  #with gr.Column(elem_id="nps-box"):
289
  # with gr.Group(elem_id="nps-container"):
290
  # gr.Markdown("### How likely are you to recommend this tool to a colleague or peer?")
@@ -303,9 +303,13 @@ with gr.Blocks() as interface:
303
  # gr.Markdown("Extremely likely")
304
 
305
  # nps_submit = gr.Button("Submit", elem_id="nps-submit-button")
 
 
 
306
  with gr.Group(elem_id="nps-container"):
307
  gr.Markdown("### How likely are you to recommend this tool to a colleague or peer?")
308
-
 
309
  nps_radio = gr.Radio(
310
  choices=[str(i) for i in range(11)],
311
  label="Select score:",
@@ -313,20 +317,21 @@ with gr.Blocks() as interface:
313
  container=False,
314
  elem_id="nps-radio-container"
315
  )
316
-
317
- # This Row contains three elements to force the alignment
318
  with gr.Row():
319
- # 1. Left Label
320
- gr.Markdown("Not likely", scale=1)
321
-
322
- # 2. Invisible spacer that expands
323
- gr.Markdown("", scale=8)
324
-
325
- # 3. Right Label, aligned to the right
326
- gr.Markdown("Extremely likely", scale=1, text_align="right")
327
-
328
  nps_submit = gr.Button("Submit", elem_id="nps-submit-button")
329
- nps_output = gr.Textbox(label="", interactive=False, visible=True)
 
330
  gr.Markdown(" ") # A simple blank markdown can create space
331
 
332
  progress_box = gr.Textbox(label="Live Processing Log", lines=20, interactive=False)
 
284
 
285
  gr.Markdown(" ") # A simple blank markdown can create space
286
 
287
+ #with gr.Group(visible=True, elem_id="nps-overlay") as nps_modal:
288
  #with gr.Column(elem_id="nps-box"):
289
  # with gr.Group(elem_id="nps-container"):
290
  # gr.Markdown("### How likely are you to recommend this tool to a colleague or peer?")
 
303
  # gr.Markdown("Extremely likely")
304
 
305
  # nps_submit = gr.Button("Submit", elem_id="nps-submit-button")
306
+ # nps_output = gr.Textbox(label="", interactive=False, visible=True)
307
+
308
+ with gr.Group(visible=True, elem_id="nps-overlay") as nps_modal:
309
  with gr.Group(elem_id="nps-container"):
310
  gr.Markdown("### How likely are you to recommend this tool to a colleague or peer?")
311
+
312
+ # Score options (0-10)
313
  nps_radio = gr.Radio(
314
  choices=[str(i) for i in range(11)],
315
  label="Select score:",
 
317
  container=False,
318
  elem_id="nps-radio-container"
319
  )
320
+
321
+ # Row with labels on each side
322
  with gr.Row():
323
+ with gr.Column(scale=1, min_width=0):
324
+ gr.Markdown("Not likely", elem_classes="nps-label-left")
325
+
326
+ with gr.Column(scale=8, min_width=0):
327
+ gr.Markdown("") # spacer (optional)
328
+
329
+ with gr.Column(scale=1, min_width=0):
330
+ gr.Markdown("Extremely likely", elem_classes="nps-label-right")
331
+
332
  nps_submit = gr.Button("Submit", elem_id="nps-submit-button")
333
+ nps_output = gr.Textbox(label="", interactive=False, visible=True)
334
+
335
  gr.Markdown(" ") # A simple blank markdown can create space
336
 
337
  progress_box = gr.Textbox(label="Live Processing Log", lines=20, interactive=False)