v0.10-frontend2
This commit is contained in:
@@ -214,7 +214,7 @@ async fn ListOL<G: Html>(cx: Scope<'_>) -> View<G> {
|
||||
p {
|
||||
(if *app_state.openlibrary.get() == true {
|
||||
view!{ cx,
|
||||
ul {
|
||||
div(class="row") {
|
||||
Keyed(
|
||||
iterable=docs,
|
||||
view=move |cx, x| view! { cx,
|
||||
@@ -243,10 +243,12 @@ pub fn BookOL<G: Html>(cx: Scope, bookitem: BookUIProp) -> View<G> {
|
||||
};
|
||||
|
||||
view! { cx,
|
||||
li{
|
||||
div(class="column"){
|
||||
div(class="card"){
|
||||
(format!("{:?}",bookdisp))
|
||||
button(class="add", on:click=handle_add){ "+" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,7 +256,6 @@ pub fn BookOL<G: Html>(cx: Scope, bookitem: BookUIProp) -> View<G> {
|
||||
#[component]
|
||||
async fn AddingUI<G: Html>(cx: Scope<'_>) -> View<G> {
|
||||
let app_state = use_context::<AppState>(cx);
|
||||
|
||||
let inp_title = create_signal(cx, (*app_state.addingbook.get()).clone().title);
|
||||
let inp_olkey = create_signal(cx, (*app_state.addingbook.get()).clone().open_library_key.unwrap_or("".to_string()));
|
||||
let inp_editioncount = create_signal(cx, (*app_state.addingbook.get()).clone().edition_count.unwrap_or(0).to_string());
|
||||
@@ -272,7 +273,27 @@ let inp_place = create_signal(cx, (*app_state.addingbook.get()).clone().place.un
|
||||
let inp_subject = create_signal(cx, (*app_state.addingbook.get()).clone().subject.unwrap_or(vec!["".to_string()]).join(", "));
|
||||
let inp_time = create_signal(cx, (*app_state.addingbook.get()).clone().time.unwrap_or(vec!["".to_string()]).join(", "));
|
||||
let inp_isbn = create_signal(cx, (*app_state.addingbook.get()).clone().isbn.unwrap_or(vec!["".to_string()]).join(", "));
|
||||
|
||||
create_effect(cx, || {
|
||||
|
||||
info!("{:?}",*app_state.addingbook.get());
|
||||
inp_title.set((*app_state.addingbook.get()).clone().title);
|
||||
inp_olkey.set((*app_state.addingbook.get()).clone().open_library_key.unwrap_or("".to_string()));
|
||||
inp_editioncount.set((*app_state.addingbook.get()).clone().edition_count.unwrap_or(0).to_string());
|
||||
inp_publishyear.set((*app_state.addingbook.get()).clone().first_publish_year.unwrap_or(0).to_string());
|
||||
inp_medianpage.set((*app_state.addingbook.get()).clone().median_page_count.unwrap_or(0).to_string());
|
||||
inp_goodread.set((*app_state.addingbook.get()).clone().goodread_id.unwrap_or("".to_string()));
|
||||
inp_desc.set((*app_state.addingbook.get()).clone().description.unwrap_or("".to_string()));
|
||||
inp_cover.set((*app_state.addingbook.get()).clone().cover.unwrap_or("".to_string()));
|
||||
inp_location.set((*app_state.addingbook.get()).clone().location.unwrap_or("".to_string()));
|
||||
inp_rating.set((*app_state.addingbook.get()).clone().location.unwrap_or("".to_string()));
|
||||
inp_comments.set((*app_state.addingbook.get()).clone().comments.unwrap_or("".to_string()));
|
||||
inp_author.set((*app_state.addingbook.get()).clone().author_name.unwrap_or(vec!["".to_string()]).join(", "));
|
||||
inp_person.set((*app_state.addingbook.get()).clone().person.unwrap_or(vec!["".to_string()]).join(", "));
|
||||
inp_place.set((*app_state.addingbook.get()).clone().place.unwrap_or(vec!["".to_string()]).join(", "));
|
||||
inp_subject.set((*app_state.addingbook.get()).clone().subject.unwrap_or(vec!["".to_string()]).join(", "));
|
||||
inp_time.set((*app_state.addingbook.get()).clone().time.unwrap_or(vec!["".to_string()]).join(", "));
|
||||
inp_isbn.set((*app_state.addingbook.get()).clone().isbn.unwrap_or(vec!["".to_string()]).join(", "));
|
||||
});
|
||||
let handle_add = |_| {
|
||||
info!("Adding book");
|
||||
let authors: Vec<String> = (*inp_author.get()).clone().split(",").map(str::to_string).collect::<Vec<String>>();
|
||||
|
||||
Reference in New Issue
Block a user