summaryrefslogtreecommitdiff
path: root/src/views/about.rs
blob: 349c9def3616ad96336d81b1189501166ce7d672 (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")]
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 }
    }
}