Learn how to use Rust to build ATProto powered applications
1///The askama template types for HTML
2///
3use crate::db::StatusFromDb;
4use askama::Template;
5use serde::{Deserialize, Serialize};
6
7#[derive(Template)]
8#[template(path = "home.html")]
9pub struct HomeTemplate<'a> {
10 pub title: &'a str,
11 pub status_options: &'a [&'a str],
12 pub profile: Option<Profile>,
13 pub statuses: Vec<StatusFromDb>,
14 pub my_status: Option<String>,
15}
16
17#[derive(Serialize, Deserialize, Debug, Clone)]
18pub struct Profile {
19 pub did: String,
20 pub display_name: Option<String>,
21}
22
23#[derive(Template)]
24#[template(path = "login.html")]
25pub struct LoginTemplate<'a> {
26 pub title: &'a str,
27 pub error: Option<&'a str>,
28}
29
30#[derive(Template)]
31#[template(path = "error.html")]
32pub struct ErrorTemplate<'a> {
33 pub title: &'a str,
34 pub error: &'a str,
35}