EasySci commited on
Commit
2f1fd87
·
1 Parent(s): 2c8b459

Update app2.py

Browse files
Files changed (1) hide show
  1. app2.py +16 -13
app2.py CHANGED
@@ -1,6 +1,3 @@
1
- import panel as pn
2
- from panel import Tabs
3
-
4
  pn.extension('katex')
5
 
6
  import pytz
@@ -15,18 +12,12 @@ from src.search import Search_Papers
15
  class MainBody(param.Parameterized):
16
  main_body = param.List(default=[pn.pane.LaTeX("Please select some tags!", styles={'font-size': '20pt'})])
17
 
18
-
19
-
20
-
21
  @param.depends("main_body")
22
  def update(self):
23
  return pn.Column(*self.main_body)
24
 
25
  main_body_instance = MainBody()
26
 
27
-
28
-
29
-
30
  paper_list = [] # Add this line to initialize paper_list as an empty list
31
 
32
  main_body = [pn.pane.LaTeX("Please select some tags!", styles={'font-size': '20pt'})]
@@ -54,7 +45,20 @@ def display_selected_value(event):
54
  select.param.watch(display_selected_value, 'value')
55
  select2.param.watch(display_selected_value, 'value')
56
 
57
- date_picker = pn.widgets.DatePicker(name='Date Picker',width_policy ="fit",max_width = 140)
 
 
 
 
 
 
 
 
 
 
 
 
 
58
 
59
  # Create a column layout for the buttons inside the toggleable sidebar
60
  buttons = pn.Column(
@@ -73,8 +77,6 @@ buttons = pn.Column(
73
  def toggle_settings(event):
74
  buttons[-1].visible = event.new
75
 
76
-
77
-
78
  button3.param.watch(toggle_settings, 'value')
79
 
80
  # List to store the entered options
@@ -152,13 +154,14 @@ filter_list = pn.widgets.MultiChoice(
152
  template = pn.template.FastListTemplate(
153
  title="EasySciRead",
154
  header=[pn.Row(header_buttons, width=750, sizing_mode='stretch_width'), pn.Row(filter_list, width=250), pn.Row(add_to_header_button, width=55)],
155
- main=main_body_instance.update
156
  sidebar=[buttons],
157
  accent_base_color="#88d8b0",
158
  header_background="#FFFFFF",
159
  header_color="#000000",
160
  text_align='center',
161
  sidebar_width=200,
 
162
  sizing_mode = 'stretch_both'
163
  )
164
 
 
 
 
 
1
  pn.extension('katex')
2
 
3
  import pytz
 
12
  class MainBody(param.Parameterized):
13
  main_body = param.List(default=[pn.pane.LaTeX("Please select some tags!", styles={'font-size': '20pt'})])
14
 
 
 
 
15
  @param.depends("main_body")
16
  def update(self):
17
  return pn.Column(*self.main_body)
18
 
19
  main_body_instance = MainBody()
20
 
 
 
 
21
  paper_list = [] # Add this line to initialize paper_list as an empty list
22
 
23
  main_body = [pn.pane.LaTeX("Please select some tags!", styles={'font-size': '20pt'})]
 
45
  select.param.watch(display_selected_value, 'value')
46
  select2.param.watch(display_selected_value, 'value')
47
 
48
+ custom_css = """
49
+ .datepicker-modal {
50
+ z-index: 10000 !important;
51
+ }
52
+ """
53
+
54
+ # Custom callback to set the z_index of the date picker widget when it opens
55
+ def set_date_picker_zindex(event):
56
+ date_picker = event.obj
57
+ date_picker.z_index = 9999 # Set a high z-index value to bring it to the front
58
+
59
+ # Create the Datepicker widget
60
+ date_picker = pn.widgets.DatePicker(name='Select Date', sizing_mode='stretch_width')
61
+ date_picker.param.watch(set_date_picker_zindex, 'value')
62
 
63
  # Create a column layout for the buttons inside the toggleable sidebar
64
  buttons = pn.Column(
 
77
  def toggle_settings(event):
78
  buttons[-1].visible = event.new
79
 
 
 
80
  button3.param.watch(toggle_settings, 'value')
81
 
82
  # List to store the entered options
 
154
  template = pn.template.FastListTemplate(
155
  title="EasySciRead",
156
  header=[pn.Row(header_buttons, width=750, sizing_mode='stretch_width'), pn.Row(filter_list, width=250), pn.Row(add_to_header_button, width=55)],
157
+ main= main_body_instance.update,
158
  sidebar=[buttons],
159
  accent_base_color="#88d8b0",
160
  header_background="#FFFFFF",
161
  header_color="#000000",
162
  text_align='center',
163
  sidebar_width=200,
164
+ css=custom_css,
165
  sizing_mode = 'stretch_both'
166
  )
167