User management completed. Leptos upgraded to 0.5.0.
This commit is contained in:
@@ -39,7 +39,9 @@ pub fn data_form<T: 'static + server_fn::ServerFn<()> + Clone + ForValidation>(
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal"
|
||||
on:click=move |_| {validator.reset(); opener.hide()}>
|
||||
on:click=move |_| {
|
||||
validator.reset();
|
||||
opener.hide();}>
|
||||
{trl("Close")}
|
||||
</button>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
@@ -50,3 +52,34 @@ pub fn data_form<T: 'static + server_fn::ServerFn<()> + Clone + ForValidation>(
|
||||
</ActionForm>
|
||||
}
|
||||
}
|
||||
|
||||
#[component]
|
||||
pub fn question_dialog<T: 'static + server_fn::ServerFn<()> + Clone>(
|
||||
opener: DialogOpener,
|
||||
action: Action<T, Result<ApiResponse<()>, ServerFnError>>,
|
||||
title: &'static str,
|
||||
children: Children
|
||||
) -> impl IntoView {
|
||||
let upd_val = action.value();
|
||||
|
||||
view! {
|
||||
<ActionForm action=action>
|
||||
<ModalDialog opener=opener title=title>
|
||||
<ModalBody>
|
||||
<ServerErr result={upd_val} opener=opener/>
|
||||
{children()}
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal"
|
||||
on:click=move |_| {
|
||||
opener.hide();}>
|
||||
{trl("No")}
|
||||
</button>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{trl("Yes")}
|
||||
</button>
|
||||
</ModalFooter>
|
||||
</ModalDialog>
|
||||
</ActionForm>
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user