diff --git a/examples/azure_auth/main.rs b/examples/azure_auth/main.rs index 63111f0..d16b394 100644 --- a/examples/azure_auth/main.rs +++ b/examples/azure_auth/main.rs @@ -87,7 +87,8 @@ fn create_actix_admin_builder() -> ActixAdminBuilder { navbar_title: "ActixAdmin Example", user_tenant_ref: None, base_path: "/admin", - custom_css_paths: None + custom_css_paths: None, + custom_js_paths: None }; let mut admin_builder = ActixAdminBuilder::new(configuration); diff --git a/examples/basic/main.rs b/examples/basic/main.rs index 5b2f984..9331415 100644 --- a/examples/basic/main.rs +++ b/examples/basic/main.rs @@ -54,6 +54,7 @@ fn create_actix_admin_builder() -> ActixAdminBuilder { user_tenant_ref: None, base_path: "/admin", custom_css_paths: None, + custom_js_paths: None }; let mut admin_builder = ActixAdminBuilder::new(configuration); diff --git a/examples/chat_support/main.rs b/examples/chat_support/main.rs index 8b4469f..4eea0d9 100644 --- a/examples/chat_support/main.rs +++ b/examples/chat_support/main.rs @@ -70,7 +70,8 @@ fn create_actix_admin_builder() -> ActixAdminBuilder { navbar_title: "ActixAdmin Example", user_tenant_ref: None, base_path: "/absproxy/5000/admin", - custom_css_paths: None + custom_css_paths: None, + custom_js_paths: None }; let mut admin_builder = ActixAdminBuilder::new(configuration); diff --git a/src/lib.rs b/src/lib.rs index d86f178..2d7bab7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -76,7 +76,8 @@ pub struct ActixAdminConfiguration { pub file_upload_directory: &'static str, pub navbar_title: &'static str, pub base_path: &'static str, - pub custom_css_paths: Option> + pub custom_css_paths: Option>, + pub custom_js_paths: Option> } #[derive(Clone)] diff --git a/src/routes/helpers.rs b/src/routes/helpers.rs index 5f3fe27..3f271c4 100644 --- a/src/routes/helpers.rs +++ b/src/routes/helpers.rs @@ -11,6 +11,7 @@ pub fn add_auth_context(session: &Session, actix_admin: &ActixAdmin, ctx: &mut C let enable_auth = &actix_admin.configuration.enable_auth; ctx.insert("enable_auth", &enable_auth); ctx.insert("custom_css_paths", &actix_admin.configuration.custom_css_paths); + ctx.insert("custom_js_paths", &actix_admin.configuration.custom_js_paths); ctx.insert("navbar_title", &actix_admin.configuration.navbar_title); ctx.insert("base_path", &actix_admin.configuration.base_path); ctx.insert("support_path", &actix_admin.support_path.as_ref()); diff --git a/src/templates/bootstrapv5/head.html b/src/templates/bootstrapv5/head.html index 3fa5fb4..328ea81 100644 --- a/src/templates/bootstrapv5/head.html +++ b/src/templates/bootstrapv5/head.html @@ -3,18 +3,24 @@ {{ navbar_title }} {% if custom_css_paths %} - {% for custom_css_path in custom_css_paths %} - - {% endfor %} +{% for custom_css_path in custom_css_paths %} + +{% endfor %} {% else %} - + + {% endif %} +{% if custom_js_paths %} +{% for custom_js_path in custom_js_paths %} + +{% endfor %} +{% else %} - +{% endif %} +{% if custom_js_paths %} + {% for custom_js_path in custom_js_paths %} + + {% endfor %} +{% else %} + +{% endif %}