akhaliq HF staff commited on
Commit
ff07661
·
verified ·
1 Parent(s): d0290b6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -49
app.py CHANGED
@@ -358,13 +358,6 @@ def change_sort_method_ui(method: str, time_frame: str = "all time") -> str:
358
  return paper_manager.get_current_page_papers()
359
 
360
 
361
- def refresh_papers_ui() -> str:
362
- """
363
- Refreshes the paper list.
364
- """
365
- return paper_manager.refresh()
366
-
367
-
368
  # --- CSS Styling ---
369
 
370
  css = """
@@ -432,15 +425,6 @@ table {
432
  text-decoration: none;
433
  }
434
 
435
- #refresh-button {
436
- background: none;
437
- border: none;
438
- color: black;
439
- font-weight: bold;
440
- font-size: 14pt;
441
- cursor: pointer;
442
- }
443
-
444
  .no-papers {
445
  text-align: center;
446
  color: #828282;
@@ -501,10 +485,6 @@ table {
501
  color: #b0b0b0;
502
  }
503
 
504
- #refresh-button {
505
- color: #e0e0e0;
506
- }
507
-
508
  .no-papers {
509
  color: #b0b0b0;
510
  }
@@ -526,22 +506,9 @@ with demo:
526
 
527
  Once your paper is submitted, it will automatically appear in this demo.
528
  """)
529
- # Header with Refresh Button
530
  with gr.Row():
531
- gr.HTML("""
532
- <table border="0" cellpadding="0" cellspacing="0" class="header-table">
533
- <tr>
534
- <td>
535
- <span class="pagetop">
536
- <b class="hnname"><a href="#">Daily Papers</a></b>
537
- </span>
538
- </td>
539
- <td align="right">
540
- <button id="refresh-button">Refresh</button>
541
- </td>
542
- </tr>
543
- </table>
544
- """)
545
  # Sort Options and Time Frame (conditionally visible)
546
  with gr.Row():
547
  sort_radio = gr.Radio(
@@ -563,7 +530,7 @@ with demo:
563
  with gr.Row():
564
  prev_button = gr.Button("Prev")
565
  next_button = gr.Button("Next")
566
-
567
  # Load papers on app start
568
  demo.load(
569
  fn=lambda: paper_manager.get_current_page_papers(),
@@ -574,19 +541,6 @@ with demo:
574
  prev_button.click(paper_manager.prev_page, outputs=[paper_list])
575
  next_button.click(paper_manager.next_page, outputs=[paper_list])
576
 
577
- # Refresh functionality
578
- refresh_button = gr.Button("Refresh", visible=False, elem_id="refresh-hidden")
579
- refresh_button.click(update_paper_manager, outputs=[paper_list])
580
-
581
- # Bind the visible Refresh button to the hidden one using JavaScript
582
- gr.HTML("""
583
- <script>
584
- document.getElementById('refresh-button').addEventListener('click', function() {
585
- document.getElementById('refresh-hidden').click();
586
- });
587
- </script>
588
- """)
589
-
590
  # Sort option change: Toggle visibility of time_frame_dropdown based on sort method
591
  def toggle_time_frame_visibility(sort_method):
592
  if sort_method.lower() == "top":
 
358
  return paper_manager.get_current_page_papers()
359
 
360
 
 
 
 
 
 
 
 
361
  # --- CSS Styling ---
362
 
363
  css = """
 
425
  text-decoration: none;
426
  }
427
 
 
 
 
 
 
 
 
 
 
428
  .no-papers {
429
  text-align: center;
430
  color: #828282;
 
485
  color: #b0b0b0;
486
  }
487
 
 
 
 
 
488
  .no-papers {
489
  color: #b0b0b0;
490
  }
 
506
 
507
  Once your paper is submitted, it will automatically appear in this demo.
508
  """)
509
+ # Header without Refresh Button
510
  with gr.Row():
511
+ gr.Markdown("<b>Daily Papers</b>")
 
 
 
 
 
 
 
 
 
 
 
 
 
512
  # Sort Options and Time Frame (conditionally visible)
513
  with gr.Row():
514
  sort_radio = gr.Radio(
 
530
  with gr.Row():
531
  prev_button = gr.Button("Prev")
532
  next_button = gr.Button("Next")
533
+
534
  # Load papers on app start
535
  demo.load(
536
  fn=lambda: paper_manager.get_current_page_papers(),
 
541
  prev_button.click(paper_manager.prev_page, outputs=[paper_list])
542
  next_button.click(paper_manager.next_page, outputs=[paper_list])
543
 
 
 
 
 
 
 
 
 
 
 
 
 
 
544
  # Sort option change: Toggle visibility of time_frame_dropdown based on sort method
545
  def toggle_time_frame_visibility(sort_method):
546
  if sort_method.lower() == "top":