-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsidebar.py
More file actions
108 lines (104 loc) · 4.3 KB
/
sidebar.py
File metadata and controls
108 lines (104 loc) · 4.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import dash
import dash_bootstrap_components as dbc
from dash import dcc, html, Input, Output, callback
from src.utils.scan_lists import MEMB_LISTS
member_list_keys = list(MEMB_LISTS.keys())
def sidebar() -> html.Div:
return html.Div(
children=[
dbc.Row(
[
dbc.Col(
html.Img(
src="/assets/favicon.svg",
alt="Red Maine DSA logo of a moose holding a rose in its mouth under the text Maine DSA",
),
align="center",
),
dbc.Col(
[
dbc.Row(
[
dbc.Col(dbc.Label(className="fa fa-sun", html_for="color-mode-switch")),
dbc.Col(
dbc.Switch(
id="color-mode-switch",
value=True,
className="d-inline-block ms-1",
persistence=True,
)
),
dbc.Col(dbc.Label(className="fa fa-moon", html_for="color-mode-switch")),
],
className="g-0",
),
dbc.Row(
dbc.Col(
[
dbc.Button(
"Fetch New List",
id="fetch-list-button",
size="sm",
color="secondary",
className="mt-1 w-100",
),
html.Small(id="fetch-list-status", className="text-muted"),
dcc.Interval(id="fetch-list-poll", interval=1000, disabled=True),
]
),
),
],
width="auto",
align="center",
),
]
),
dbc.Row(
dbc.Col(
[
html.Div(
[
html.Hr(),
html.P("Membership Dashboard", className="lead"),
],
),
dcc.Dropdown(
options=member_list_keys,
value=member_list_keys[0],
id="list-selected",
persistence=True,
persistence_type="session",
),
html.Div(
[
html.P("Active List"),
],
),
dcc.Dropdown(
options=member_list_keys,
id="list-compare",
persistence=True,
persistence_type="session",
),
html.Div(
[
html.P("Compare To"),
],
),
dbc.Nav(
[
dbc.NavLink(
html.Div(page["name"], className="ms-2"),
href=page["path"],
active="exact",
)
for page in dash.page_registry.values()
],
vertical=True,
pills=True,
),
]
),
),
],
)