From 6556828afe63476fc03546ae51e3ba5104162ee8 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Wed, 30 Aug 2023 14:32:42 +0530 Subject: changed clients list --- src/app/manage/client/list/list_item.rs | 32 +++++--------------------------- src/app/manage/client/list/mod.rs | 9 ++++++++- src/app/manage/client/mod.rs | 30 +++++++++++++++++++++++++++++- 3 files changed, 42 insertions(+), 29 deletions(-) (limited to 'src/app') diff --git a/src/app/manage/client/list/list_item.rs b/src/app/manage/client/list/list_item.rs index 8b78ad7..2e6fed0 100644 --- a/src/app/manage/client/list/list_item.rs +++ b/src/app/manage/client/list/list_item.rs @@ -17,44 +17,22 @@ use yew::prelude::*; -use crate::app::manage::client::list::address; - use crate::models::client; #[derive(Properties, PartialEq)] pub struct Props { pub client: client::Client, + pub s_no: usize, } #[function_component(ListItem)] pub fn list_item(props: &Props) -> Html { html! {
-
- {props.client.name.clone()} - {props.client.gstin.clone()} -
- -
-
- {"Contact Details:"} - {"Name - "}{props.client.contact.contact_name.clone()} - {"Phone - "}{props.client.contact.phone_number.clone()} - {"E-Mail - "}{props.client.contact.email_address.clone()} - {"Website - "}{props.client.contact.website.clone()} -
- - - -
-
-
- -
-

- {"Options (To Be Added)"} -

-
+ {props.s_no} + {props.client.name.clone()} + {props.client.gstin.clone()} +
} } diff --git a/src/app/manage/client/list/mod.rs b/src/app/manage/client/list/mod.rs index 2e13be6..1c00f0a 100644 --- a/src/app/manage/client/list/mod.rs +++ b/src/app/manage/client/list/mod.rs @@ -31,11 +31,18 @@ pub struct Props { pub fn clients_list(props: &Props) -> Html { let list_items: Html = props.clients .iter() - .map(|c| html!()) + .enumerate() + .map(|(id, c)| html!()) .collect(); html! {
+
+ {"S. No"} + {"Client Name"} + {"GSTIN"} + +
{list_items}
diff --git a/src/app/manage/client/mod.rs b/src/app/manage/client/mod.rs index de4ac4b..12b18eb 100644 --- a/src/app/manage/client/mod.rs +++ b/src/app/manage/client/mod.rs @@ -67,10 +67,38 @@ pub fn manage_client_page() -> Html { c2s1.postal_code = "121212".to_string(); c2s1.country = "India".to_string(); c2.add_shipping_address(c2s1); - clients.push(c2); + clients.push(c2.clone()); + clients.push(c2.clone()); + clients.push(c2.clone()); + clients.push(c2.clone()); + clients.push(c2.clone()); + clients.push(c2.clone()); + clients.push(c2.clone()); + clients.push(c2.clone()); + clients.push(c2.clone()); + clients.push(c2.clone()); + clients.push(c2.clone()); + clients.push(c2.clone()); + clients.push(c2.clone()); + clients.push(c2.clone()); + clients.push(c2.clone()); + clients.push(c2.clone()); + clients.push(c2.clone()); + clients.push(c2.clone()); + clients.push(c2.clone()); + clients.push(c2.clone()); + clients.push(c2.clone()); + clients.push(c2.clone()); + clients.push(c2.clone()); + clients.push(c2.clone()); + clients.push(c2.clone()); + clients.push(c2.clone()); + clients.push(c2.clone()); + clients.push(c2.clone()); html! {
+

{"To Add: Searching, Viewing, Editing, Deletion, Batch Deletion"}

} -- cgit v1.2.3