summaryrefslogtreecommitdiff
path: root/src/views/about.rs
blob: d2e09580a87ee57ba9930e00f3e832515d5d2458 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::helpers::*;
use crate::tutors::abstractions::tutor::Tutor;
use askama::Template;

#[derive(Template)]
#[template(path = "about/index.html.j2")]
pub struct AboutView<T: Tutor> {
    tutors: Vec<T>,
}

impl<T: Tutor> AboutView<T> {
    pub fn with_tutors(tutors: impl IntoIterator<Item = T>) -> Self {
        let mut tutors: Vec<T> = tutors.into_iter().collect();
        tutors.sort();
        Self { tutors }
    }
}