From 7487b34a1759889e41078e903dd9d65916dca75b Mon Sep 17 00:00:00 2001 From: Florian Briand Date: Fri, 23 Aug 2024 15:41:49 +0200 Subject: [PATCH] refacto: rename html and rs templates dirs to old_* --- crates/app/{templates => old_templates}/base.html | 0 crates/app/{templates => old_templates}/hello.html | 0 crates/app/{templates => old_templates}/index.html | 0 crates/app/{templates => old_templates}/layout/nav.html | 0 .../layout/nav/desktop/menu-items.html | 0 .../layout/nav/desktop/notifications-button.html | 0 .../layout/nav/desktop/profile-dropdown.html | 0 .../layout/nav/desktop/profile.html | 0 .../app/{templates => old_templates}/layout/nav/logo.html | 0 .../layout/nav/mobile/menu-button.html | 0 .../layout/nav/mobile/menu-items.html | 0 .../layout/nav/mobile/notifications-button.html | 0 .../layout/nav/mobile/profile-items.html | 0 .../layout/nav/mobile/profile.html | 0 .../layout/nav/nav-menu-items.html | 0 .../layout/nav/notifications-icon.html | 0 .../layout/nav/profile-menu-items.html | 0 crates/app/{templates => old_templates}/pages/cps.html | 0 crates/app/{templates => old_templates}/pages/home.html | 0 .../app/{templates => src/components}/skeletons/card.html | 0 .../components}/skeletons/menu-items.html | 0 .../components}/skeletons/page-title.html | 0 crates/app/src/lib.rs | 7 ++----- crates/app/src/main.rs | 8 +++++--- crates/app/src/{pages => old_pages}/cps.rs | 0 crates/app/src/{pages => old_pages}/home.rs | 0 crates/app/src/{pages => old_pages}/mod.rs | 0 crates/app/src/{templates => old_templates}/hello.rs | 0 crates/app/src/{templates => old_templates}/mod.rs | 0 crates/app/src/{templates => old_templates}/nav.rs | 0 crates/app/src/{templates => old_templates}/profile.rs | 0 31 files changed, 7 insertions(+), 8 deletions(-) rename crates/app/{templates => old_templates}/base.html (100%) rename crates/app/{templates => old_templates}/hello.html (100%) rename crates/app/{templates => old_templates}/index.html (100%) rename crates/app/{templates => old_templates}/layout/nav.html (100%) rename crates/app/{templates => old_templates}/layout/nav/desktop/menu-items.html (100%) rename crates/app/{templates => old_templates}/layout/nav/desktop/notifications-button.html (100%) rename crates/app/{templates => old_templates}/layout/nav/desktop/profile-dropdown.html (100%) rename crates/app/{templates => old_templates}/layout/nav/desktop/profile.html (100%) rename crates/app/{templates => old_templates}/layout/nav/logo.html (100%) rename crates/app/{templates => old_templates}/layout/nav/mobile/menu-button.html (100%) rename crates/app/{templates => old_templates}/layout/nav/mobile/menu-items.html (100%) rename crates/app/{templates => old_templates}/layout/nav/mobile/notifications-button.html (100%) rename crates/app/{templates => old_templates}/layout/nav/mobile/profile-items.html (100%) rename crates/app/{templates => old_templates}/layout/nav/mobile/profile.html (100%) rename crates/app/{templates => old_templates}/layout/nav/nav-menu-items.html (100%) rename crates/app/{templates => old_templates}/layout/nav/notifications-icon.html (100%) rename crates/app/{templates => old_templates}/layout/nav/profile-menu-items.html (100%) rename crates/app/{templates => old_templates}/pages/cps.html (100%) rename crates/app/{templates => old_templates}/pages/home.html (100%) rename crates/app/{templates => src/components}/skeletons/card.html (100%) rename crates/app/{templates => src/components}/skeletons/menu-items.html (100%) rename crates/app/{templates => src/components}/skeletons/page-title.html (100%) rename crates/app/src/{pages => old_pages}/cps.rs (100%) rename crates/app/src/{pages => old_pages}/home.rs (100%) rename crates/app/src/{pages => old_pages}/mod.rs (100%) rename crates/app/src/{templates => old_templates}/hello.rs (100%) rename crates/app/src/{templates => old_templates}/mod.rs (100%) rename crates/app/src/{templates => old_templates}/nav.rs (100%) rename crates/app/src/{templates => old_templates}/profile.rs (100%) diff --git a/crates/app/templates/base.html b/crates/app/old_templates/base.html similarity index 100% rename from crates/app/templates/base.html rename to crates/app/old_templates/base.html diff --git a/crates/app/templates/hello.html b/crates/app/old_templates/hello.html similarity index 100% rename from crates/app/templates/hello.html rename to crates/app/old_templates/hello.html diff --git a/crates/app/templates/index.html b/crates/app/old_templates/index.html similarity index 100% rename from crates/app/templates/index.html rename to crates/app/old_templates/index.html diff --git a/crates/app/templates/layout/nav.html b/crates/app/old_templates/layout/nav.html similarity index 100% rename from crates/app/templates/layout/nav.html rename to crates/app/old_templates/layout/nav.html diff --git a/crates/app/templates/layout/nav/desktop/menu-items.html b/crates/app/old_templates/layout/nav/desktop/menu-items.html similarity index 100% rename from crates/app/templates/layout/nav/desktop/menu-items.html rename to crates/app/old_templates/layout/nav/desktop/menu-items.html diff --git a/crates/app/templates/layout/nav/desktop/notifications-button.html b/crates/app/old_templates/layout/nav/desktop/notifications-button.html similarity index 100% rename from crates/app/templates/layout/nav/desktop/notifications-button.html rename to crates/app/old_templates/layout/nav/desktop/notifications-button.html diff --git a/crates/app/templates/layout/nav/desktop/profile-dropdown.html b/crates/app/old_templates/layout/nav/desktop/profile-dropdown.html similarity index 100% rename from crates/app/templates/layout/nav/desktop/profile-dropdown.html rename to crates/app/old_templates/layout/nav/desktop/profile-dropdown.html diff --git a/crates/app/templates/layout/nav/desktop/profile.html b/crates/app/old_templates/layout/nav/desktop/profile.html similarity index 100% rename from crates/app/templates/layout/nav/desktop/profile.html rename to crates/app/old_templates/layout/nav/desktop/profile.html diff --git a/crates/app/templates/layout/nav/logo.html b/crates/app/old_templates/layout/nav/logo.html similarity index 100% rename from crates/app/templates/layout/nav/logo.html rename to crates/app/old_templates/layout/nav/logo.html diff --git a/crates/app/templates/layout/nav/mobile/menu-button.html b/crates/app/old_templates/layout/nav/mobile/menu-button.html similarity index 100% rename from crates/app/templates/layout/nav/mobile/menu-button.html rename to crates/app/old_templates/layout/nav/mobile/menu-button.html diff --git a/crates/app/templates/layout/nav/mobile/menu-items.html b/crates/app/old_templates/layout/nav/mobile/menu-items.html similarity index 100% rename from crates/app/templates/layout/nav/mobile/menu-items.html rename to crates/app/old_templates/layout/nav/mobile/menu-items.html diff --git a/crates/app/templates/layout/nav/mobile/notifications-button.html b/crates/app/old_templates/layout/nav/mobile/notifications-button.html similarity index 100% rename from crates/app/templates/layout/nav/mobile/notifications-button.html rename to crates/app/old_templates/layout/nav/mobile/notifications-button.html diff --git a/crates/app/templates/layout/nav/mobile/profile-items.html b/crates/app/old_templates/layout/nav/mobile/profile-items.html similarity index 100% rename from crates/app/templates/layout/nav/mobile/profile-items.html rename to crates/app/old_templates/layout/nav/mobile/profile-items.html diff --git a/crates/app/templates/layout/nav/mobile/profile.html b/crates/app/old_templates/layout/nav/mobile/profile.html similarity index 100% rename from crates/app/templates/layout/nav/mobile/profile.html rename to crates/app/old_templates/layout/nav/mobile/profile.html diff --git a/crates/app/templates/layout/nav/nav-menu-items.html b/crates/app/old_templates/layout/nav/nav-menu-items.html similarity index 100% rename from crates/app/templates/layout/nav/nav-menu-items.html rename to crates/app/old_templates/layout/nav/nav-menu-items.html diff --git a/crates/app/templates/layout/nav/notifications-icon.html b/crates/app/old_templates/layout/nav/notifications-icon.html similarity index 100% rename from crates/app/templates/layout/nav/notifications-icon.html rename to crates/app/old_templates/layout/nav/notifications-icon.html diff --git a/crates/app/templates/layout/nav/profile-menu-items.html b/crates/app/old_templates/layout/nav/profile-menu-items.html similarity index 100% rename from crates/app/templates/layout/nav/profile-menu-items.html rename to crates/app/old_templates/layout/nav/profile-menu-items.html diff --git a/crates/app/templates/pages/cps.html b/crates/app/old_templates/pages/cps.html similarity index 100% rename from crates/app/templates/pages/cps.html rename to crates/app/old_templates/pages/cps.html diff --git a/crates/app/templates/pages/home.html b/crates/app/old_templates/pages/home.html similarity index 100% rename from crates/app/templates/pages/home.html rename to crates/app/old_templates/pages/home.html diff --git a/crates/app/templates/skeletons/card.html b/crates/app/src/components/skeletons/card.html similarity index 100% rename from crates/app/templates/skeletons/card.html rename to crates/app/src/components/skeletons/card.html diff --git a/crates/app/templates/skeletons/menu-items.html b/crates/app/src/components/skeletons/menu-items.html similarity index 100% rename from crates/app/templates/skeletons/menu-items.html rename to crates/app/src/components/skeletons/menu-items.html diff --git a/crates/app/templates/skeletons/page-title.html b/crates/app/src/components/skeletons/page-title.html similarity index 100% rename from crates/app/templates/skeletons/page-title.html rename to crates/app/src/components/skeletons/page-title.html diff --git a/crates/app/src/lib.rs b/crates/app/src/lib.rs index 8bdad03..e84842f 100644 --- a/crates/app/src/lib.rs +++ b/crates/app/src/lib.rs @@ -1,6 +1,3 @@ -mod pages; -mod templates; - use std::path::Path; use askama_axum::Template; @@ -23,7 +20,7 @@ pub fn get_router(assets_path: &Path) -> axum::Router { axum::Router::new() .nest_service("/assets", ServeDir::new(assets_path)) .route("/", axum::routing::get(root)) - .nest("/pages", pages::get_routes()) - .merge(templates::get_routes()) + // .nest("/pages", old_pages::get_routes()) + // .merge(old_templates::get_routes()) .fallback(fallback) } diff --git a/crates/app/src/main.rs b/crates/app/src/main.rs index 98f0882..ebd3b56 100644 --- a/crates/app/src/main.rs +++ b/crates/app/src/main.rs @@ -1,15 +1,17 @@ -use ::app::get_router; +use std::path::Path; +use std::{env, io}; + use axum::body::Body; use axum::http::Request; use listenfd::ListenFd; use notify::Watcher; -use std::path::Path; -use std::{env, io}; use thiserror::Error; use tokio::net::TcpListener; use tower_livereload::predicate::Predicate; use tower_livereload::LiveReloadLayer; +use ::app::get_router; + #[derive(Error, Debug)] pub enum AppError { #[error("Unable to bind to TCP listener")] diff --git a/crates/app/src/pages/cps.rs b/crates/app/src/old_pages/cps.rs similarity index 100% rename from crates/app/src/pages/cps.rs rename to crates/app/src/old_pages/cps.rs diff --git a/crates/app/src/pages/home.rs b/crates/app/src/old_pages/home.rs similarity index 100% rename from crates/app/src/pages/home.rs rename to crates/app/src/old_pages/home.rs diff --git a/crates/app/src/pages/mod.rs b/crates/app/src/old_pages/mod.rs similarity index 100% rename from crates/app/src/pages/mod.rs rename to crates/app/src/old_pages/mod.rs diff --git a/crates/app/src/templates/hello.rs b/crates/app/src/old_templates/hello.rs similarity index 100% rename from crates/app/src/templates/hello.rs rename to crates/app/src/old_templates/hello.rs diff --git a/crates/app/src/templates/mod.rs b/crates/app/src/old_templates/mod.rs similarity index 100% rename from crates/app/src/templates/mod.rs rename to crates/app/src/old_templates/mod.rs diff --git a/crates/app/src/templates/nav.rs b/crates/app/src/old_templates/nav.rs similarity index 100% rename from crates/app/src/templates/nav.rs rename to crates/app/src/old_templates/nav.rs diff --git a/crates/app/src/templates/profile.rs b/crates/app/src/old_templates/profile.rs similarity index 100% rename from crates/app/src/templates/profile.rs rename to crates/app/src/old_templates/profile.rs