Añade soporte nativo a Bootstrap con un nuevo tema

This commit is contained in:
Manuel Cillero 2022-02-21 00:28:22 +01:00
parent d38df3a5b6
commit 7f8b94eafe
37 changed files with 652 additions and 6 deletions

View file

@ -176,6 +176,7 @@ pub struct Assets {
metadata : Vec<(String, String)>,
stylesheets: Vec<StyleSheet>,
javascripts: Vec<JavaScript>,
with_jquery: bool,
seqid_count: u16,
}
@ -186,6 +187,7 @@ impl Assets {
metadata : Vec::new(),
stylesheets: Vec::new(),
javascripts: Vec::new(),
with_jquery: false,
seqid_count: 0,
}
}
@ -222,6 +224,20 @@ impl Assets {
self
}
pub fn add_jquery(&mut self) -> &mut Self {
if !self.with_jquery {
self.add_javascript(
JavaScript::source(
"/assets/js/jquery.min.js?ver=3.6.0"
)
.with_weight(i8::MIN)
.with_mode(JSMode::Normal)
);
self.with_jquery = true;
}
self
}
pub fn render(&mut self) -> Markup {
let ordered_css = &mut self.stylesheets;
ordered_css.sort_by_key(|o| o.weight);