Skip to content

Commit 91b2f6d

Browse files
authored
Merge pull request #62 from Linked-Liszt/DS_NewIndexing
IndexingAndNaviBarDesign
2 parents 10773a2 + 92697c9 commit 91b2f6d

4 files changed

Lines changed: 612 additions & 145 deletions

File tree

assets/accordion.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* When the item is OPEN (not .collapsed), remove the header's bottom line */
2+
.accordion-item.no-border-bottom > .accordion-header > .accordion-button:not(.collapsed) {
3+
box-shadow: none !important; /* this is the “line” you see */
4+
border-bottom: none !important; /* harmless extra */
5+
}
6+
7+
/* If the above doesn't catch due to markup differences, this broader one will: */
8+
.accordion-item.no-border-bottom .accordion-button:not(.collapsed) {
9+
box-shadow: none !important;
10+
border-bottom: none !important;
11+
}

laue_portal/components/navbar.py

Lines changed: 86 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,91 @@
1+
# import dash_bootstrap_components as dbc
2+
3+
# navbar = dbc.NavbarSimple(
4+
# children=[
5+
# dbc.NavItem(dbc.NavLink("Scans", href="/", active="exact")),
6+
# dbc.NavItem(dbc.NavLink("Mask Reconstructions", href="/reconstructions", active="exact")),
7+
# dbc.NavItem(dbc.NavLink("Wire Reconstructions", href="/wire-reconstructions", active="exact")),
8+
# dbc.NavItem(dbc.NavLink("Peak Indexings", href="/peakindexings", active="exact")),
9+
# dbc.NavItem(dbc.NavLink("Run Monitor", href="/run-monitor", active="exact")),
10+
# dbc.DropdownMenu(
11+
# id="manual-entry-dropdown",
12+
# children=[
13+
# dbc.DropdownMenuItem("New Scan", href="/create-scan"),
14+
# dbc.DropdownMenuItem("New CA Reconstruction", href="/create-reconstruction"),
15+
# dbc.DropdownMenuItem("New Wire Reconstruction", href="/create-wire-reconstruction"),
16+
# dbc.DropdownMenuItem("New Peak Indexing", href="/create-peakindexing"),
17+
# ],
18+
# nav=True,
19+
# in_navbar=True,
20+
# label="Manual Entry",
21+
# ),
22+
# ],
23+
# brand="3DMN Portal",
24+
# brand_href="/",
25+
# color="primary",
26+
# className="navbar-lg",
27+
# dark=True,
28+
# style={"max-height": "50px"},
29+
# )
30+
31+
32+
33+
134
import dash_bootstrap_components as dbc
35+
from dash import html, Input, Output, State, callback
236

3-
navbar = dbc.NavbarSimple(
4-
children=[
5-
dbc.NavItem(dbc.NavLink("Scans", href="/", active="exact")),
6-
dbc.NavItem(dbc.NavLink("Mask Reconstructions", href="/reconstructions", active="exact")),
7-
dbc.NavItem(dbc.NavLink("Wire Reconstructions", href="/wire-reconstructions", active="exact")),
8-
dbc.NavItem(dbc.NavLink("Peak Indexings", href="/peakindexings", active="exact")),
9-
dbc.NavItem(dbc.NavLink("Run Monitor", href="/run-monitor", active="exact")),
10-
dbc.DropdownMenu(
11-
id="manual-entry-dropdown",
12-
children=[
13-
dbc.DropdownMenuItem("New Scan", href="/create-scan"),
14-
dbc.DropdownMenuItem("New CA Reconstruction", href="/create-reconstruction"),
15-
dbc.DropdownMenuItem("New Wire Reconstruction", href="/create-wire-reconstruction"),
16-
dbc.DropdownMenuItem("New Peak Indexing", href="/create-peakindexing"),
17-
],
18-
nav=True,
19-
in_navbar=True,
20-
label="Manual Entry",
21-
),
22-
],
23-
brand="3DMN Portal",
24-
brand_href="/",
37+
navbar = dbc.Navbar(
38+
dbc.Container(
39+
[
40+
dbc.NavbarBrand("3DMN Portal", href="/"),
41+
dbc.NavbarToggler(id="nav-toggler"),
42+
dbc.Collapse(
43+
dbc.Nav(
44+
[
45+
dbc.NavItem(dbc.NavLink("Scans", href="/", active="exact")),
46+
dbc.NavItem(dbc.NavLink("Mask Reconstructions", href="/reconstructions", active="exact")),
47+
dbc.NavItem(dbc.NavLink("Wire Reconstructions", href="/wire-reconstructions", active="exact")),
48+
dbc.NavItem(dbc.NavLink("Indexations", href="/peakindexings", active="exact")),
49+
dbc.NavItem(dbc.NavLink("Run Monitor", href="/run-monitor", active="exact")),
50+
dbc.DropdownMenu(
51+
label="Menu",
52+
nav=True, in_navbar=True, align_end=True,
53+
children=[
54+
dbc.DropdownMenuItem("New Scan", href="/create-scan"),
55+
dbc.DropdownMenuItem("New CA Reconstruction", href="/create-reconstruction"),
56+
dbc.DropdownMenuItem("New Wire Reconstruction", href="/create-wire-reconstruction"),
57+
dbc.DropdownMenuItem("New LaueGo Indexation", href="/create-peakindexing"),
58+
dbc.DropdownMenuItem(divider=True),
59+
# dbc.DropdownMenuItem("Update Current DB", id="update-db"),
60+
# dbc.DropdownMenuItem("Save as New DB", id="save-new-db"),
61+
#dbc.DropdownMenuItem(divider=True),
62+
dbc.DropdownMenuItem("Activate Admin Mode", id="activate-admin"),
63+
],
64+
),
65+
],
66+
navbar=True, className="ms-auto",
67+
),
68+
id="nav-collapse",
69+
is_open=False,
70+
navbar=True,
71+
),
72+
],
73+
fluid=True,
74+
),
75+
className="py-3",
76+
#brand="3DMN Portal",
77+
#brand_href="/",
2578
color="primary",
26-
className="navbar-lg",
2779
dark=True,
28-
style={"max-height": "50px"},
80+
#className="navbar-lg",
81+
#style={"max-height": "70px"},
82+
)
83+
84+
@callback(
85+
Output("nav-collapse", "is_open"),
86+
Input("nav-toggler", "n_clicks"),
87+
State("nav-collapse", "is_open"),
88+
prevent_initial_call=True,
2989
)
90+
def toggle_nav(n, is_open):
91+
return not is_open

0 commit comments

Comments
 (0)