Replace Rocket and Tera with Rouille and Maud #88

Merged
glyph merged 67 commits from rouille_maud into main 2022-03-25 08:07:15 +00:00
1 changed files with 8 additions and 6 deletions
Showing only changes of commit 7d9bc2d7cd - Show all commits

View File

@ -4,16 +4,18 @@ use maud::{html, Markup};
///
/// Render a flash elements based on the given flash name and message.
pub fn build_template(flash_name: &str, flash_msg: &str) -> Markup {
let flash_class = match flash_name {
"success" => "capsule center-text flash-message font-normal border-success",
"info" => "capsule center-text flash-message font-normal border-info",
"warning" => "capsule center-text flash-message font-normal border-warning",
"error" => "capsule center-text flash-message font-normal border-danger",
let common_classes = "capsule center center-text flash-message font-normal ";
let border_class = match flash_name {
"success" => "border-success",
"info" => "border-info",
"warning" => "border-warning",
"error" => "border-danger",
_ => "",
};
html! {
div class=(flash_class) {
div class={ (common_classes) (border_class) } {
(flash_msg)
}
}