From 2a08227a84de5d3d07ddb5225f980e94906df666 Mon Sep 17 00:00:00 2001 From: fuxiaohei Date: Mon, 30 Oct 2023 08:05:50 +0800 Subject: [PATCH] center: update dashboard page --- binary/center/src/pages/mod.rs | 5 ++- binary/center/templates/css/input.css | 53 ++++++++++++++++++++++++ binary/center/templates/dashboard.hbs | 58 +++++++++++++++++++++++++++ 3 files changed, 115 insertions(+), 1 deletion(-) diff --git a/binary/center/src/pages/mod.rs b/binary/center/src/pages/mod.rs index 28722b29..ecc65e75 100644 --- a/binary/center/src/pages/mod.rs +++ b/binary/center/src/pages/mod.rs @@ -48,7 +48,11 @@ async fn render_dashboard(engine: AppEngine) -> impl IntoResponse { fn init_templates() -> Result> { let mut hbs = Handlebars::new(); + load_template_from_assets(&mut hbs); + Ok(hbs) +} +fn load_template_from_assets(hbs: &mut Handlebars<'static>) { crate::embed::TemplatesAssets::iter().for_each(|asset| { let asset_path = asset.to_string(); @@ -65,5 +69,4 @@ fn init_templates() -> Result> { hbs.register_template_string(&asset_path, std::str::from_utf8(&content).unwrap()) .unwrap(); }); - Ok(hbs) } diff --git a/binary/center/templates/css/input.css b/binary/center/templates/css/input.css index 74ef5f2b..b9444007 100644 --- a/binary/center/templates/css/input.css +++ b/binary/center/templates/css/input.css @@ -40,3 +40,56 @@ #top-nav-user-dropdown .item { @apply block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white; } +#main { + @apply max-w-4xl mx-auto my-6; +} +#project-top h1 { + @apply text-3xl font-semibold; +} +#project-top .count { + @apply text-gray-500 leading-8; +} +#project-searchbar { + @apply flex justify-between items-center my-4; +} +#project-search-input { + @apply block w-80 p-2 pl-10 text-sm text-gray-300 border border-gray-100 rounded-lg bg-gray-50 focus:ring-0 focus:border-gray-400 focus:bg-white focus:shadow-none duration-100; +} +#project-searchbar form label { + @apply mb-2 text-sm font-medium text-gray-600 sr-only; +} +#project-searchbar form .search-icon { + @apply absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none; +} + +#project-createbar .new-project-button { + @apply text-white bg-primary rounded-lg px-3 py-2.5 hover:border hover:border-primary hover:bg-white hover:text-primary duration-100; +} + +.project-card { + @apply border border-gray-200 rounded-lg p-5 flex justify-between w-1/2 mb-6 hover:border-gray-400 duration-200 hover:shadow; +} + +.project-card .card-title { + @apply text-lg font-semibold; +} + +.project-card .card-metadata { + @apply text-gray-500 pt-3; +} + +.project-card .card-link { + @apply text-gray-500 hover:text-primary pt-3; +} + +.project-card .card-metadata .item { + @apply border-r border-gray-200 pr-2 mr-1; +} + +.project-card .card-metadata .item:last-child { + @apply border-0; +} + +.project-card .action-button { + @apply px-3 py-2 rounded-lg text-white bg-emerald-600 hover:bg-emerald-700 duration-200; +} diff --git a/binary/center/templates/dashboard.hbs b/binary/center/templates/dashboard.hbs index a58d6342..36409b4c 100644 --- a/binary/center/templates/dashboard.hbs +++ b/binary/center/templates/dashboard.hbs @@ -7,6 +7,64 @@ {{> partials/navbar.hbs}} +
+
+

Projects

+ 13 projects +
+ +
+
+
+
+
spryest-pyknoses-242
+ + +
+
+ Running +
+
+
w-1/2
+
+
+
w-1/2
+
w-1/2
+
+
+