Skip to main content

oxblade_adminlte/
lib.rs

1//! Rust port of jeroennoten/laravel-adminlte: adminLTE dashboard layouts, menus and plugins for Laravel for Rust.
2//!
3//! Upstream: <https://github.com/jeroennoten/Laravel-AdminLTE>
4//!
5//! ```
6//! assert_eq!(oxblade_adminlte::version(), env!("CARGO_PKG_VERSION"));
7//! ```
8#![forbid(unsafe_code)]
9#![deny(missing_docs)]
10
11/// The version of this crate.
12///
13/// ```
14/// assert!(!oxblade_adminlte::version().is_empty());
15/// ```
16pub fn version() -> &'static str {
17    env!("CARGO_PKG_VERSION")
18}
19
20#[cfg(test)]
21mod tests {
22    #[test]
23    fn version_is_set() {
24        assert_eq!(super::version(), env!("CARGO_PKG_VERSION"));
25    }
26}
27
28mod layout;
29pub use layout::{ColorMode, Layout, LayoutView};
30
31#[cfg(feature = "laravel")]
32mod provider;
33#[cfg(feature = "laravel")]
34pub use provider::AdminLteServiceProvider;
35
36/// Static light/dark/auto initializer, analogous to PHP's no-flash script.
37///
38/// Serve these bytes as JavaScript and pass that URL as `theme_init_url` to
39/// the page. It does not read or save preferences, or call a server endpoint.
40///
41/// ```
42/// assert!(oxblade_adminlte::THEME_INIT_JS.contains("prefers-color-scheme"));
43/// ```
44pub const THEME_INIT_JS: &str = include_str!("../resources/assets/theme-init.js");
45
46mod url;
47pub use url::{InvalidUrl, SafeUrl};
48
49mod menu;
50pub use menu::{Menu, MenuBindings, MenuBuilder, MenuEdit, MenuItem, MenuKey};
51
52mod assets;
53pub use assets::{AssetConfig, AssetHost, AssetMode, PageAssets, PluginActivation, Plugins};
54
55mod auth;
56pub use auth::{AuthForm, AuthFormError, AuthKind};