20 lines
395 B
Rust
20 lines
395 B
Rust
use super::Template;
|
|
|
|
pub enum View {
|
|
Index,
|
|
Login,
|
|
}
|
|
|
|
impl Template for View {
|
|
fn template(&self) -> &'static str {
|
|
match self {
|
|
Self::Index => "views/index.html",
|
|
Self::Login => "views/login.html",
|
|
}
|
|
}
|
|
|
|
fn render(&self, tera: &tera::Tera) -> tera::Result<String> {
|
|
tera.render(self.template(), &tera::Context::new())
|
|
}
|
|
}
|