Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions assets/accordion.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* When the item is OPEN (not .collapsed), remove the header's bottom line */
.accordion-item.no-border-bottom > .accordion-header > .accordion-button:not(.collapsed) {
box-shadow: none !important; /* this is the “line” you see */
border-bottom: none !important; /* harmless extra */
}

/* If the above doesn't catch due to markup differences, this broader one will: */
.accordion-item.no-border-bottom .accordion-button:not(.collapsed) {
box-shadow: none !important;
border-bottom: none !important;
}
110 changes: 86 additions & 24 deletions laue_portal/components/navbar.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,91 @@
# import dash_bootstrap_components as dbc

# navbar = dbc.NavbarSimple(
# children=[
# dbc.NavItem(dbc.NavLink("Scans", href="/", active="exact")),
# dbc.NavItem(dbc.NavLink("Mask Reconstructions", href="/reconstructions", active="exact")),
# dbc.NavItem(dbc.NavLink("Wire Reconstructions", href="/wire-reconstructions", active="exact")),
# dbc.NavItem(dbc.NavLink("Peak Indexings", href="/peakindexings", active="exact")),
# dbc.NavItem(dbc.NavLink("Run Monitor", href="/run-monitor", active="exact")),
# dbc.DropdownMenu(
# id="manual-entry-dropdown",
# children=[
# dbc.DropdownMenuItem("New Scan", href="/create-scan"),
# dbc.DropdownMenuItem("New CA Reconstruction", href="/create-reconstruction"),
# dbc.DropdownMenuItem("New Wire Reconstruction", href="/create-wire-reconstruction"),
# dbc.DropdownMenuItem("New Peak Indexing", href="/create-peakindexing"),
# ],
# nav=True,
# in_navbar=True,
# label="Manual Entry",
# ),
# ],
# brand="3DMN Portal",
# brand_href="/",
# color="primary",
# className="navbar-lg",
# dark=True,
# style={"max-height": "50px"},
# )




import dash_bootstrap_components as dbc
from dash import html, Input, Output, State, callback

navbar = dbc.NavbarSimple(
children=[
dbc.NavItem(dbc.NavLink("Scans", href="/", active="exact")),
dbc.NavItem(dbc.NavLink("Mask Reconstructions", href="/reconstructions", active="exact")),
dbc.NavItem(dbc.NavLink("Wire Reconstructions", href="/wire-reconstructions", active="exact")),
dbc.NavItem(dbc.NavLink("Peak Indexings", href="/peakindexings", active="exact")),
dbc.NavItem(dbc.NavLink("Run Monitor", href="/run-monitor", active="exact")),
dbc.DropdownMenu(
id="manual-entry-dropdown",
children=[
dbc.DropdownMenuItem("New Scan", href="/create-scan"),
dbc.DropdownMenuItem("New CA Reconstruction", href="/create-reconstruction"),
dbc.DropdownMenuItem("New Wire Reconstruction", href="/create-wire-reconstruction"),
dbc.DropdownMenuItem("New Peak Indexing", href="/create-peakindexing"),
],
nav=True,
in_navbar=True,
label="Manual Entry",
),
],
brand="3DMN Portal",
brand_href="/",
navbar = dbc.Navbar(
dbc.Container(
[
dbc.NavbarBrand("3DMN Portal", href="/"),
dbc.NavbarToggler(id="nav-toggler"),
dbc.Collapse(
dbc.Nav(
[
dbc.NavItem(dbc.NavLink("Scans", href="/", active="exact")),
dbc.NavItem(dbc.NavLink("Mask Reconstructions", href="/reconstructions", active="exact")),
dbc.NavItem(dbc.NavLink("Wire Reconstructions", href="/wire-reconstructions", active="exact")),
dbc.NavItem(dbc.NavLink("Indexations", href="/peakindexings", active="exact")),
dbc.NavItem(dbc.NavLink("Run Monitor", href="/run-monitor", active="exact")),
dbc.DropdownMenu(
label="Menu",
nav=True, in_navbar=True, align_end=True,
children=[
dbc.DropdownMenuItem("New Scan", href="/create-scan"),
dbc.DropdownMenuItem("New CA Reconstruction", href="/create-reconstruction"),
dbc.DropdownMenuItem("New Wire Reconstruction", href="/create-wire-reconstruction"),
dbc.DropdownMenuItem("New LaueGo Indexation", href="/create-peakindexing"),
dbc.DropdownMenuItem(divider=True),
# dbc.DropdownMenuItem("Update Current DB", id="update-db"),
# dbc.DropdownMenuItem("Save as New DB", id="save-new-db"),
#dbc.DropdownMenuItem(divider=True),
dbc.DropdownMenuItem("Activate Admin Mode", id="activate-admin"),
],
),
],
navbar=True, className="ms-auto",
),
id="nav-collapse",
is_open=False,
navbar=True,
),
],
fluid=True,
),
className="py-3",
#brand="3DMN Portal",
#brand_href="/",
color="primary",
className="navbar-lg",
dark=True,
style={"max-height": "50px"},
#className="navbar-lg",
#style={"max-height": "70px"},
)

@callback(
Output("nav-collapse", "is_open"),
Input("nav-toggler", "n_clicks"),
State("nav-collapse", "is_open"),
prevent_initial_call=True,
)
def toggle_nav(n, is_open):
return not is_open
Loading