File tree Expand file tree Collapse file tree 5 files changed +46
-6
lines changed Expand file tree Collapse file tree 5 files changed +46
-6
lines changed Original file line number Diff line number Diff line change 20
20
width : 100% ;
21
21
}
22
22
23
+ & .expandable {
24
+ .dropdown-menu {
25
+ width : auto ;
26
+ min-width : 100% ;
27
+ }
28
+ }
29
+
23
30
.dropdown-item {
24
31
overflow : hidden ;
25
32
text-overflow : ellipsis ;
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ pub struct Dropdown {
33
33
34
34
/// Where the dropdown menu should appear
35
35
menu_position : String ,
36
+ expandable : bool ,
36
37
}
37
38
38
39
impl Dropdown {
@@ -91,6 +92,11 @@ impl Dropdown {
91
92
self . offset_collapsed = offset. to_owned ( ) ;
92
93
self
93
94
}
95
+
96
+ pub fn expandable ( mut self ) -> Self {
97
+ self . expandable = true ;
98
+ self
99
+ }
94
100
}
95
101
96
102
component ! ( Dropdown ) ;
Original file line number Diff line number Diff line change 2
2
< % use crate::components::dropdown::DropdownValue; %>
3
3
4
4
<!-- Dropdown component -->
5
- < div class ="dropdown ">
5
+ < div class ="dropdown <% if expandable { %>expandable<% } %> ">
6
6
< % if let DropdownValue::Icon(icon) = value { %>
7
7
< a
8
- class ="horizontal-hide topnav-controlls dropdown-toggle expanded "
8
+ class ="topnav-controlls dropdown-toggle "
9
9
role ="button "
10
10
data-bs-toggle ="dropdown "
11
11
data-bs-offset ="<%= offset %> "
15
15
</ a >
16
16
< % } else if let DropdownValue::Text(text) = value { %>
17
17
< button
18
- class ="horizontal-hide btn btn-dropdown dropdown-toggle expanded <% if collapsable { %> leftnav-collapse-affect <% } %> "
18
+ class ="horizontal-hide btn btn-dropdown dropdown-toggle <% if collapsable { %> leftnav-collapse-affect <% } %> "
19
19
role ="button "
20
20
data-bs-toggle ="dropdown "
21
21
data-bs-offset ="<%= offset %> "
Original file line number Diff line number Diff line change 59
59
60
60
< % if !account_management_nav.links.is_empty() { %>
61
61
< li class ="d-none d-lg-flex nav-item align-items-center ">
62
- < %+ Dropdown::new(account_management_nav.links.clone())
63
- .icon(ProfileIcon::new().into()) %>
62
+ < %+
63
+ Dropdown::new(account_management_nav.links.clone())
64
+ .icon(ProfileIcon::new().into())
65
+ .expandable()
66
+ %>
64
67
</ li >
65
68
< li class ="nav-item d-flex d-lg-none align-items-center ">
66
69
< a class ="nav-link p-lg-0 " data-bs-toggle ="collapse " data-bs-target =".horizontal-collapse "> Account Management</ a >
Original file line number Diff line number Diff line change @@ -59,7 +59,31 @@ impl Default for Cluster {
59
59
. active( true ) ,
60
60
] ,
61
61
} ,
62
- account_management_nav : StaticNav :: default ( ) ,
62
+ account_management_nav : StaticNav {
63
+ links : vec ! [
64
+ StaticNavLink :: new( "Notebooks" . to_string( ) , "/dashboard" . to_string( ) ) ,
65
+ StaticNavLink :: new(
66
+ "Projects" . to_string( ) ,
67
+ "/dashboard?tab=Projects" . to_string( ) ,
68
+ ) ,
69
+ StaticNavLink :: new(
70
+ "Models" . to_string( ) ,
71
+ "/dashboard?tab=Models" . to_string( ) ,
72
+ ) ,
73
+ StaticNavLink :: new(
74
+ "Snapshots" . to_string( ) ,
75
+ "/dashboard?tab=Snapshots" . to_string( ) ,
76
+ ) ,
77
+ StaticNavLink :: new(
78
+ "Upload data" . to_string( ) ,
79
+ "/dashboard?tab=Upload_Data" . to_string( ) ,
80
+ ) ,
81
+ StaticNavLink :: new(
82
+ "PostgresML.org" . to_string( ) ,
83
+ "https://postgresml.org" . to_string( ) ,
84
+ ) ,
85
+ ] ,
86
+ } ,
63
87
upper_left_nav : StaticNav {
64
88
links : vec ! [
65
89
StaticNavLink :: new(
You can’t perform that action at this time.
0 commit comments