diff --git a/pgml-dashboard/src/components/accordian/mod.rs b/pgml-dashboard/src/components/accordian/mod.rs index 4c17cb1a9..30580acc2 100644 --- a/pgml-dashboard/src/components/accordian/mod.rs +++ b/pgml-dashboard/src/components/accordian/mod.rs @@ -11,6 +11,7 @@ pub struct Accordian { html_contents: Vec, html_titles: Vec, selected: usize, + small_titles: bool, } impl Accordian { @@ -19,6 +20,7 @@ impl Accordian { html_contents: Vec::new(), html_titles: Vec::new(), selected: 0, + small_titles: false, } } @@ -31,6 +33,11 @@ impl Accordian { self.html_titles = html_titles.into_iter().map(|s| s.to_string()).collect(); self } + + pub fn small_titles(mut self, small_titles: bool) -> Self { + self.small_titles = small_titles; + self + } } component!(Accordian); diff --git a/pgml-dashboard/src/components/accordian/template.html b/pgml-dashboard/src/components/accordian/template.html index 5a4259f30..2f22e98dd 100644 --- a/pgml-dashboard/src/components/accordian/template.html +++ b/pgml-dashboard/src/components/accordian/template.html @@ -5,7 +5,11 @@
+ <% if small_titles {%> +
<%- html_titles[i] %>
+ <% } else { %>

<%- html_titles[i] %>

+ <% } %> add remove