diff --git a/app/index.html b/app/index.html index c6c9d5f..5bcf44e 100644 --- a/app/index.html +++ b/app/index.html @@ -21,6 +21,9 @@ as="style" /> + + + diff --git a/app/src/components/app.rs b/app/src/components/app.rs index d3bef83..ebc50c6 100644 --- a/app/src/components/app.rs +++ b/app/src/components/app.rs @@ -7,7 +7,7 @@ use crate::{ group_table::GroupTable, login::LoginForm, logout::LogoutButton, - router::{AppRoute, NavButton}, + router::{AppRoute, Link, NavButton}, user_details::UserDetails, user_table::UserTable, }, @@ -96,45 +96,48 @@ impl Component for App { let link = self.link.clone(); let is_admin = self.is_admin(); html! { -
-

{ "LLDAP" }

- {self.view_banner()} - - render = Router::render(move |switch: AppRoute| { - match switch { - AppRoute::Login => html! { - - }, - AppRoute::CreateUser => html! { - - }, - AppRoute::Index | AppRoute::ListUsers => html! { -
- - {"Create a user"} -
- }, - AppRoute::CreateGroup => html! { - - }, - AppRoute::ListGroups => html! { -
- - {"Create a group"} -
- }, - AppRoute::GroupDetails(group_id) => html! { - - }, - AppRoute::UserDetails(username) => html! { - - }, - AppRoute::ChangePassword(username) => html! { - - } - } - }) - /> +
+ {self.view_banner()} +
+
+ + render = Router::render(move |switch: AppRoute| { + match switch { + AppRoute::Login => html! { + + }, + AppRoute::CreateUser => html! { + + }, + AppRoute::Index | AppRoute::ListUsers => html! { +
+ + {"Create a user"} +
+ }, + AppRoute::CreateGroup => html! { + + }, + AppRoute::ListGroups => html! { +
+ + {"Create a group"} +
+ }, + AppRoute::GroupDetails(group_id) => html! { + + }, + AppRoute::UserDetails(username) => html! { + + }, + AppRoute::ChangePassword(username) => html! { + + } + } + }) + /> +
+
} } @@ -180,29 +183,72 @@ impl App { fn view_banner(&self) -> Html { html! { - <> - {if self.is_admin() { html! { - <> -
- - {"Users"} - +
+
+
+ +

{"LLDAP"}

+
+ + + + -
- - {"Groups"} - -
- - } } else { html!{} } } - {if self.user_info.is_some() { html! { - - }} else { html! {} }} - +
+
+
} } diff --git a/app/src/components/create_group.rs b/app/src/components/create_group.rs index 1e898ac..5f24046 100644 --- a/app/src/components/create_group.rs +++ b/app/src/components/create_group.rs @@ -106,15 +106,17 @@ impl Component for CreateGroupForm { fn view(&self) -> Html { type Field = yew_form::Field; html! { - <> -
-
+
+ +
+
{"Create a group"}
+
+
-
+
-
+
} } } diff --git a/app/src/components/create_user.rs b/app/src/components/create_user.rs index 4db5fb1..3a534ab 100644 --- a/app/src/components/create_user.rs +++ b/app/src/components/create_user.rs @@ -199,15 +199,17 @@ impl Component for CreateUserForm { fn view(&self) -> Html { type Field = yew_form::Field; html! { - <> - -
+
+ +
+
{"Create a user"}
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
} } } diff --git a/app/src/components/group_details.rs b/app/src/components/group_details.rs index 9561825..b6328cb 100644 --- a/app/src/components/group_details.rs +++ b/app/src/components/group_details.rs @@ -131,8 +131,9 @@ impl GroupDetails { } }; html! { -
-

{"Members"}

+ <> +

{g.display_name.to_string()}

+
{"Members"}
@@ -156,7 +157,7 @@ impl GroupDetails {
-
+ } } diff --git a/app/src/components/logout.rs b/app/src/components/logout.rs index 13320a9..0b49b5e 100644 --- a/app/src/components/logout.rs +++ b/app/src/components/logout.rs @@ -66,7 +66,7 @@ impl Component for LogoutButton { fn view(&self) -> Html { html! { diff --git a/app/src/components/user_details.rs b/app/src/components/user_details.rs index d6b31bc..7d00797 100644 --- a/app/src/components/user_details.rs +++ b/app/src/components/user_details.rs @@ -133,30 +133,30 @@ impl UserDetails { } }; html! { -
-

{"Group memberships"}

-
- - - - - { if self.props.is_admin { html!{ }} else { html!{} }} - - - - {if u.groups.is_empty() { - html! { - - - - } - } else { - html! {<>{u.groups.iter().map(make_group_row).collect::>()}} - }} - -
{"Group"}
{"Not member of any group"}
-
-
+ <> +
{"Group memberships"}
+
+ + + + + { if self.props.is_admin { html!{ }} else { html!{} }} + + + + {if u.groups.is_empty() { + html! { + + + + } + } else { + html! {<>{u.groups.iter().map(make_group_row).collect::>()}} + }} + +
{"Group"}
{"Not member of any group"}
+
+ } } @@ -213,21 +213,22 @@ impl Component for UserDetails { (None, Some(e)) => html! {
{"Error: "}{e.to_string()}
}, (Some(u), error) => { html! { -
- - {self.view_group_memberships(u)} - {self.view_add_group_button(u)} -
- - {"Change password"} - -
- {self.view_messages(error)} + <> +

{u.id.to_string()}

+ +
+ + {"Change password"} +
+ {self.view_group_memberships(u)} + {self.view_add_group_button(u)} + {self.view_messages(error)} + } } } diff --git a/app/src/components/user_details_form.rs b/app/src/components/user_details_form.rs index 8f70b2b..fd4a1a5 100644 --- a/app/src/components/user_details_form.rs +++ b/app/src/components/user_details_form.rs @@ -97,112 +97,112 @@ impl Component for UserDetailsForm { fn view(&self) -> Html { type Field = yew_form::Field; html! { - <> - -
- -
- {&self.props.user.id} -
-
-
- -
- -
- {&self.form.field_message("email")} +
+ +
+ +
+ {&self.props.user.id}
-
-
- -
- -
- {&self.form.field_message("display_name")} +
+ +
+ +
+ {&self.form.field_message("email")} +
-
-
- -
- -
- {&self.form.field_message("first_name")} +
+ +
+ +
+ {&self.form.field_message("display_name")} +
-
-
- -
- -
- {&self.form.field_message("last_name")} +
+ +
+ +
+ {&self.form.field_message("first_name")} +
-
-
- -
- {&self.props.user.creation_date.date().naive_local()} +
+ +
+ +
+ {&self.form.field_message("last_name")} +
+
+
+ +
+ {&self.props.user.creation_date.date().naive_local()} +
+
+
+ +
+ + -
- -
- - - } } } diff --git a/app/style.css b/app/style.css new file mode 100644 index 0000000..bcad908 --- /dev/null +++ b/app/style.css @@ -0,0 +1,12 @@ +header h1 { + font-family: 'Bebas Neue', cursive; +} + +.table>tbody { + vertical-align: middle; +} + +.table>tbody a { + font-weight: 700; + text-decoration: none; +} diff --git a/server/src/infra/tcp_server.rs b/server/src/infra/tcp_server.rs index bba761d..68d889e 100644 --- a/server/src/infra/tcp_server.rs +++ b/server/src/infra/tcp_server.rs @@ -56,7 +56,7 @@ fn http_config( })) // Serve index.html and main.js, and default to index.html. .route( - "/{filename:(index\\.html|main\\.js)?}", + "/{filename:(index\\.html|main\\.js|style\\.css)?}", web::get().to(index), ) .service(web::scope("/auth").configure(auth_service::configure_server::))