From 6ec92871138a795dfdcf7610c8b20f03010a5931 Mon Sep 17 00:00:00 2001 From: Manuel Cillero Date: Sat, 25 Nov 2023 11:38:51 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20Remove=20template=20usage=20in?= =?UTF-8?q?=20base=20components?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pagetop/src/base/component/form/date.rs | 11 ----------- pagetop/src/base/component/form/form_main.rs | 11 ----------- pagetop/src/base/component/form/input.rs | 11 ----------- pagetop/src/base/component/wrapper.rs | 11 ----------- 4 files changed, 44 deletions(-) diff --git a/pagetop/src/base/component/form/date.rs b/pagetop/src/base/component/form/date.rs index 16f369ad..b70ebff7 100644 --- a/pagetop/src/base/component/form/date.rs +++ b/pagetop/src/base/component/form/date.rs @@ -17,7 +17,6 @@ pub struct Date { readonly : OptionString, required : OptionString, help_text : OptionString, - template : String, } impl ComponentTrait for Date { @@ -157,12 +156,6 @@ impl Date { self } - #[fn_with] - pub fn alter_template(&mut self, template: &str) -> &mut Self { - self.template = template.to_owned(); - self - } - // Date GETTERS. pub fn name(&self) -> &OptionString { @@ -204,8 +197,4 @@ impl Date { pub fn help_text(&self) -> &OptionString { &self.help_text } - - pub fn template(&self) -> &str { - self.template.as_str() - } } diff --git a/pagetop/src/base/component/form/form_main.rs b/pagetop/src/base/component/form/form_main.rs index 79ee9e5c..2ff2a406 100644 --- a/pagetop/src/base/component/form/form_main.rs +++ b/pagetop/src/base/component/form/form_main.rs @@ -19,7 +19,6 @@ pub struct Form { charset : OptionString, method : FormMethod, stuff : AnyComponents, - template : String, } impl ComponentTrait for Form { @@ -111,12 +110,6 @@ impl Form { self } - #[fn_with] - pub fn alter_template(&mut self, template: &str) -> &mut Self { - self.template = template.to_owned(); - self - } - // Form GETTERS. pub fn action(&self) -> &OptionString { @@ -134,8 +127,4 @@ impl Form { pub fn elements(&self) -> &AnyComponents { &self.stuff } - - pub fn template(&self) -> &str { - self.template.as_str() - } } diff --git a/pagetop/src/base/component/form/input.rs b/pagetop/src/base/component/form/input.rs index 287a9155..8c9529f9 100644 --- a/pagetop/src/base/component/form/input.rs +++ b/pagetop/src/base/component/form/input.rs @@ -32,7 +32,6 @@ pub struct Input { readonly : OptionString, required : OptionString, help_text : OptionTranslated, - template : String, } impl ComponentTrait for Input { @@ -258,12 +257,6 @@ impl Input { self } - #[fn_with] - pub fn alter_template(&mut self, template: &str) -> &mut Self { - self.template = template.to_owned(); - self - } - // Input GETTERS. pub fn input_type(&self) -> &InputType { @@ -321,8 +314,4 @@ impl Input { pub fn help_text(&self) -> &OptionTranslated { &self.help_text } - - pub fn template(&self) -> &str { - self.template.as_str() - } } diff --git a/pagetop/src/base/component/wrapper.rs b/pagetop/src/base/component/wrapper.rs index 641123aa..2bb337c7 100644 --- a/pagetop/src/base/component/wrapper.rs +++ b/pagetop/src/base/component/wrapper.rs @@ -21,7 +21,6 @@ pub struct Wrapper { inner_classes: OptionClasses, wrapper_type : WrapperType, stuff : AnyComponents, - template : String, } impl ComponentTrait for Wrapper { @@ -153,12 +152,6 @@ impl Wrapper { self } - #[fn_with] - pub fn alter_template(&mut self, template: &str) -> &mut Self { - self.template = template.to_owned(); - self - } - // Wrapper GETTERS. pub fn inner_classes(&self) -> &OptionClasses { @@ -172,8 +165,4 @@ impl Wrapper { pub fn components(&self) -> &AnyComponents { &self.stuff } - - pub fn template(&self) -> &str { - self.template.as_str() - } }