diff --git a/src/main.rs b/src/main.rs index 5a273201..48d65135 100644 --- a/src/main.rs +++ b/src/main.rs @@ -44,6 +44,7 @@ mod tests; mod widget; pub use crate::data::Data; +pub use crate::static_assets::static_files::assets::*; pub use api::v1::ROUTES as V1_API_ROUTES; pub use docs::DOCS; pub use pages::routes::ROUTES as PAGES; diff --git a/src/static_assets/static_files.rs b/src/static_assets/static_files.rs index c818a3ee..0e5fdc49 100644 --- a/src/static_assets/static_files.rs +++ b/src/static_assets/static_files.rs @@ -24,6 +24,53 @@ use rust_embed::RustEmbed; use crate::CACHE_AGE; +pub mod assets { + use lazy_static::lazy_static; + + use crate::FILES; + + type Img = (&'static str, &'static str); + + lazy_static! { + pub static ref KEY: Img = + (FILES.get("./static/cache/img/svg/key.svg").unwrap(), "key"); + pub static ref GITHUB: Img = ( + FILES.get("./static/cache/img/svg/github.svg").unwrap(), + "Source code" + ); + pub static ref HOME: Img = ( + FILES.get("./static/cache/img/svg/home.svg").unwrap(), + "Home" + ); + pub static ref SETTINGS_ICON: Img = ( + FILES.get("./static/cache/img/svg/settings.svg").unwrap(), + "Settings" + ); + pub static ref CREDIT_CARD: Img = ( + FILES.get("./static/cache/img/svg/credit-card.svg").unwrap(), + "Payment" + ); + pub static ref HELP_CIRCLE: Img = ( + FILES.get("./static/cache/img/svg/help-circle.svg").unwrap(), + "Help" + ); + pub static ref MESSAGE: Img = ( + FILES + .get("./static/cache/img/svg/message-square.svg") + .unwrap(), + "Message" + ); + pub static ref DOCS_ICON: Img = ( + FILES.get("./static/cache/img/svg/file-text.svg").unwrap(), + "Documentation" + ); + pub static ref MCAPTCHA_TRANS_ICON: Img = ( + FILES.get("./static/cache/img/icon-trans.png").unwrap(), + "Logo" + ); + } +} + #[derive(RustEmbed)] #[folder = "assets/"] struct Asset; diff --git a/static/cache/img/svg/bell.svg b/static/cache/img/svg/bell.svg index c0ed0e1e..231d4756 100644 --- a/static/cache/img/svg/bell.svg +++ b/static/cache/img/svg/bell.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/static/cache/img/svg/check.svg b/static/cache/img/svg/check.svg index 1c209899..378cb46b 100644 --- a/static/cache/img/svg/check.svg +++ b/static/cache/img/svg/check.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/static/cache/img/svg/clipboard.svg b/static/cache/img/svg/clipboard.svg index ccee454d..7f154402 100644 --- a/static/cache/img/svg/clipboard.svg +++ b/static/cache/img/svg/clipboard.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/static/cache/img/svg/credit-card.svg b/static/cache/img/svg/credit-card.svg index 9429a635..f875863b 100644 --- a/static/cache/img/svg/credit-card.svg +++ b/static/cache/img/svg/credit-card.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/static/cache/img/svg/edit.svg b/static/cache/img/svg/edit.svg index ec7b4ca2..93d137ba 100644 --- a/static/cache/img/svg/edit.svg +++ b/static/cache/img/svg/edit.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/static/cache/img/svg/external-link.svg b/static/cache/img/svg/external-link.svg index 6236df3e..feb2d264 100644 --- a/static/cache/img/svg/external-link.svg +++ b/static/cache/img/svg/external-link.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/static/cache/img/svg/eye-off.svg b/static/cache/img/svg/eye-off.svg index 9d28c182..6c83c3f4 100644 --- a/static/cache/img/svg/eye-off.svg +++ b/static/cache/img/svg/eye-off.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/static/cache/img/svg/eye.svg b/static/cache/img/svg/eye.svg index 44f107af..60e1e5f7 100644 --- a/static/cache/img/svg/eye.svg +++ b/static/cache/img/svg/eye.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/static/cache/img/svg/file-text.svg b/static/cache/img/svg/file-text.svg index 85186e3b..3129f0c3 100644 --- a/static/cache/img/svg/file-text.svg +++ b/static/cache/img/svg/file-text.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/static/cache/img/svg/file.svg b/static/cache/img/svg/file.svg index fa1ecc84..e66cb2c7 100644 --- a/static/cache/img/svg/file.svg +++ b/static/cache/img/svg/file.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/static/cache/img/svg/filter.svg b/static/cache/img/svg/filter.svg index 3ae2cfc7..1896efa0 100644 --- a/static/cache/img/svg/filter.svg +++ b/static/cache/img/svg/filter.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/static/cache/img/svg/github.svg b/static/cache/img/svg/github.svg index 8a1c9c0a..1c4f1671 100644 --- a/static/cache/img/svg/github.svg +++ b/static/cache/img/svg/github.svg @@ -1 +1 @@ - + diff --git a/static/cache/img/svg/globe.svg b/static/cache/img/svg/globe.svg index 4306cdcb..0309619b 100644 --- a/static/cache/img/svg/globe.svg +++ b/static/cache/img/svg/globe.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/static/cache/img/svg/help-circle.svg b/static/cache/img/svg/help-circle.svg index 1bbf3978..1b4a8255 100644 --- a/static/cache/img/svg/help-circle.svg +++ b/static/cache/img/svg/help-circle.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/static/cache/img/svg/home.svg b/static/cache/img/svg/home.svg index 867f0799..d2a372a4 100644 --- a/static/cache/img/svg/home.svg +++ b/static/cache/img/svg/home.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/static/cache/img/svg/key.svg b/static/cache/img/svg/key.svg index e778e74e..a29c08f1 100644 --- a/static/cache/img/svg/key.svg +++ b/static/cache/img/svg/key.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/static/cache/img/svg/log-out.svg b/static/cache/img/svg/log-out.svg index 625d2724..343f4df9 100644 --- a/static/cache/img/svg/log-out.svg +++ b/static/cache/img/svg/log-out.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/static/cache/img/svg/menu.svg b/static/cache/img/svg/menu.svg index 0ea1741e..292522bb 100644 --- a/static/cache/img/svg/menu.svg +++ b/static/cache/img/svg/menu.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/static/cache/img/svg/message-square.svg b/static/cache/img/svg/message-square.svg index 6a2e4e59..adff2373 100644 --- a/static/cache/img/svg/message-square.svg +++ b/static/cache/img/svg/message-square.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/static/cache/img/svg/moon.svg b/static/cache/img/svg/moon.svg index 3d94f162..5a87929f 100644 --- a/static/cache/img/svg/moon.svg +++ b/static/cache/img/svg/moon.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/static/cache/img/svg/refresh.svg b/static/cache/img/svg/refresh.svg index 10cff0ec..538a10b3 100644 --- a/static/cache/img/svg/refresh.svg +++ b/static/cache/img/svg/refresh.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/static/cache/img/svg/settings.svg b/static/cache/img/svg/settings.svg index 0318f2ce..b43fcb34 100644 --- a/static/cache/img/svg/settings.svg +++ b/static/cache/img/svg/settings.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/static/cache/img/svg/shield-off.svg b/static/cache/img/svg/shield-off.svg index 47805eed..a4ba40ce 100644 --- a/static/cache/img/svg/shield-off.svg +++ b/static/cache/img/svg/shield-off.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/static/cache/img/svg/shield.svg b/static/cache/img/svg/shield.svg index 18c6ed24..5bbf7e85 100644 --- a/static/cache/img/svg/shield.svg +++ b/static/cache/img/svg/shield.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/static/cache/img/svg/tag.svg b/static/cache/img/svg/tag.svg index 0c7a7704..dd087225 100644 --- a/static/cache/img/svg/tag.svg +++ b/static/cache/img/svg/tag.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/static/cache/img/svg/toggle-left.svg b/static/cache/img/svg/toggle-left.svg index cd4b4e62..ae76c3db 100644 --- a/static/cache/img/svg/toggle-left.svg +++ b/static/cache/img/svg/toggle-left.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/static/cache/img/svg/toggle-right.svg b/static/cache/img/svg/toggle-right.svg index 01392ab6..62b8b314 100644 --- a/static/cache/img/svg/toggle-right.svg +++ b/static/cache/img/svg/toggle-right.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/static/cache/img/svg/trash.svg b/static/cache/img/svg/trash.svg index f24d55bf..736882ee 100644 --- a/static/cache/img/svg/trash.svg +++ b/static/cache/img/svg/trash.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/static/cache/img/svg/user.svg b/static/cache/img/svg/user.svg index 7b5bc4a7..ec2d8e95 100644 --- a/static/cache/img/svg/user.svg +++ b/static/cache/img/svg/user.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/static/cache/img/svg/x-circle.svg b/static/cache/img/svg/x-circle.svg index 94aad5e5..bf327a74 100644 --- a/static/cache/img/svg/x-circle.svg +++ b/static/cache/img/svg/x-circle.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/templates/components/additional-data/index.html b/templates/components/additional-data/index.html index cd873ec8..39954444 100644 --- a/templates/components/additional-data/index.html +++ b/templates/components/additional-data/index.html @@ -1,9 +1,9 @@ -<. let data = if let Some(data) = data { .> +<. if let Some(data) = data { .> <. if !data.is_empty() { .> -