From f6ec6beeb240966c5fb9a8a912499b2abb8a8b09 Mon Sep 17 00:00:00 2001 From: Dan <39170265+chillenberger@users.noreply.github.com> Date: Wed, 22 May 2024 16:03:05 -0600 Subject: [PATCH] accordion add ability to have small titles --- pgml-dashboard/src/components/accordian/mod.rs | 7 +++++++ pgml-dashboard/src/components/accordian/template.html | 4 ++++ 2 files changed, 11 insertions(+) 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