👽️ Aplica cambio de API para Context
This commit is contained in:
parent
a1d51d6d0f
commit
9552ae0af5
17 changed files with 96 additions and 100 deletions
|
|
@ -41,18 +41,18 @@ impl ComponentTrait for Button {
|
|||
self.weight
|
||||
}
|
||||
|
||||
fn is_renderable(&self, rcx: &RenderContext) -> bool {
|
||||
(self.renderable.check)(rcx)
|
||||
fn is_renderable(&self, cx: &Context) -> bool {
|
||||
(self.renderable.check)(cx)
|
||||
}
|
||||
|
||||
fn prepare_component(&self, rcx: &mut RenderContext) -> PrepareMarkup {
|
||||
fn prepare_component(&self, cx: &mut Context) -> PrepareMarkup {
|
||||
let button_type = match self.button_type() {
|
||||
ButtonType::Button => "button",
|
||||
ButtonType::Submit => "submit",
|
||||
ButtonType::Reset => "reset",
|
||||
};
|
||||
let id = self.name().get().map(|name| concat_string!("edit-", name));
|
||||
let value = self.value().prepare(rcx);
|
||||
let value = self.value().prepare(cx);
|
||||
PrepareMarkup::With(html! {
|
||||
button
|
||||
type=(button_type)
|
||||
|
|
|
|||
|
|
@ -36,11 +36,11 @@ impl ComponentTrait for Date {
|
|||
self.weight
|
||||
}
|
||||
|
||||
fn is_renderable(&self, rcx: &RenderContext) -> bool {
|
||||
(self.renderable.check)(rcx)
|
||||
fn is_renderable(&self, cx: &Context) -> bool {
|
||||
(self.renderable.check)(cx)
|
||||
}
|
||||
|
||||
fn prepare_component(&self, _: &mut RenderContext) -> PrepareMarkup {
|
||||
fn prepare_component(&self, _: &mut Context) -> PrepareMarkup {
|
||||
let id = self.name().get().map(|name| concat_string!("edit-", name));
|
||||
PrepareMarkup::With(html! {
|
||||
div class=[self.classes().get()] {
|
||||
|
|
|
|||
|
|
@ -44,15 +44,15 @@ impl ComponentTrait for Form {
|
|||
self.weight
|
||||
}
|
||||
|
||||
fn is_renderable(&self, rcx: &RenderContext) -> bool {
|
||||
(self.renderable.check)(rcx)
|
||||
fn is_renderable(&self, cx: &Context) -> bool {
|
||||
(self.renderable.check)(cx)
|
||||
}
|
||||
|
||||
fn before_prepare_component(&mut self, rcx: &mut RenderContext) {
|
||||
run_actions_before_prepare_component(self, rcx);
|
||||
fn before_prepare_component(&mut self, cx: &mut Context) {
|
||||
run_actions_before_prepare_component(self, cx);
|
||||
}
|
||||
|
||||
fn prepare_component(&self, rcx: &mut RenderContext) -> PrepareMarkup {
|
||||
fn prepare_component(&self, cx: &mut Context) -> PrepareMarkup {
|
||||
let method = match self.method() {
|
||||
FormMethod::Post => Some("post".to_owned()),
|
||||
FormMethod::Get => None,
|
||||
|
|
@ -65,7 +65,7 @@ impl ComponentTrait for Form {
|
|||
method=[method]
|
||||
accept-charset=[self.charset().get()]
|
||||
{
|
||||
div { (self.elements().prepare(rcx)) }
|
||||
div { (self.elements().prepare(cx)) }
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ impl ComponentTrait for Hidden {
|
|||
self.weight
|
||||
}
|
||||
|
||||
fn prepare_component(&self, _: &mut RenderContext) -> PrepareMarkup {
|
||||
fn prepare_component(&self, _: &mut Context) -> PrepareMarkup {
|
||||
let id = self.name().get().map(|name| concat_string!("value-", name));
|
||||
PrepareMarkup::With(html! {
|
||||
input type="hidden" id=[id] name=[self.name().get()] value=[self.value().get()];
|
||||
|
|
|
|||
|
|
@ -56,12 +56,12 @@ impl ComponentTrait for Input {
|
|||
self.weight
|
||||
}
|
||||
|
||||
fn is_renderable(&self, rcx: &RenderContext) -> bool {
|
||||
(self.renderable.check)(rcx)
|
||||
fn is_renderable(&self, cx: &Context) -> bool {
|
||||
(self.renderable.check)(cx)
|
||||
}
|
||||
|
||||
#[rustfmt::skip]
|
||||
fn prepare_component(&self, rcx: &mut RenderContext) -> PrepareMarkup {
|
||||
fn prepare_component(&self, cx: &mut Context) -> PrepareMarkup {
|
||||
let type_input = match self.input_type() {
|
||||
InputType::Textfield => "text",
|
||||
InputType::Password => "password",
|
||||
|
|
@ -71,8 +71,8 @@ impl ComponentTrait for Input {
|
|||
InputType::Url => "url",
|
||||
};
|
||||
let id = self.name().get().map(|name| concat_string!("edit-", name));
|
||||
let label = self.label().prepare(rcx);
|
||||
let description = self.help_text().prepare(rcx);
|
||||
let label = self.label().prepare(cx);
|
||||
let description = self.help_text().prepare(cx);
|
||||
PrepareMarkup::With(html! {
|
||||
div class=[self.classes().get()] {
|
||||
@if !label.is_empty() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue