Migrated all resources into the resources' directory.

This commit is contained in:
didier amyot committed 2023-02-11 06:57:25 -05:00
1 parent 8449cf94ee
commit eca4820fd2
16 files changed
+3 -7

No files matched your search

+1 -1
View File
@@ -30,7 +30,7 @@ nix develop
#### Architecture #### Architecture
* [ ] put all the ressources (migrations, templates and statics) into a ressources directory * [x] put all the ressources (migrations, templates and statics) into a ressources directory
#### Backend #### Backend
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1 -1
View File
@@ -94,7 +94,7 @@ fn check_migration(tx: &Transaction, id: usize, migration: &String) -> Result<()
fn get_migrations() -> Vec<String> { fn get_migrations() -> Vec<String> {
let mut ret = Vec::new(); let mut ret = Vec::new();
ret.push( ret.push(
resource_str!("migrations/sql/create_tables_001.sql") resource_str!("resources/migrations/sql/create_tables_001.sql")
.as_ref() .as_ref()
.to_string(), .to_string(),
); );
+1 -1
View File
@@ -76,7 +76,7 @@ pub async fn web_ui_main(port: u16, enable_template_autoreload: bool) -> std::io
let tmpl_reloader = AutoReloader::new(move |notifier| { let tmpl_reloader = AutoReloader::new(move |notifier| {
let mut env: minijinja::Environment<'static> = minijinja::Environment::new(); let mut env: minijinja::Environment<'static> = minijinja::Environment::new();
let tmpl_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("templates"); let tmpl_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("resources/templates");
log::info!("Using template dir {:?}", tmpl_path); log::info!("Using template dir {:?}", tmpl_path);
// if watch_path is never called, no fs watcher is created // if watch_path is never called, no fs watcher is created
-4
View File
@@ -56,8 +56,6 @@ pub async fn actions_partials(
tmpl_env.render(template_location.as_str(), ctx) tmpl_env.render(template_location.as_str(), ctx)
} }
#[actix_web::get("/static/{file_name}")] #[actix_web::get("/static/{file_name}")]
pub async fn static_file( pub async fn static_file(
req: HttpRequest req: HttpRequest
@@ -69,8 +67,6 @@ pub async fn static_file(
} }
#[derive(Deserialize, Debug)] #[derive(Deserialize, Debug)]
struct Event1{ struct Event1{
name: String, name: String,