1
/*
2
 * This file is part of mailpot
3
 *
4
 * Copyright 2020 - Manos Pitsidianakis
5
 *
6
 * This program is free software: you can redistribute it and/or modify
7
 * it under the terms of the GNU Affero General Public License as
8
 * published by the Free Software Foundation, either version 3 of the
9
 * License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
 * GNU Affero General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU Affero General Public License
17
 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18
 */
19

            
20
use super::*;
21

            
22
/// Show help page.
23
1
pub async fn help(
24
    _: HelpPath,
25
    mut session: WritableSession,
26
    auth: AuthContext,
27
1
) -> Result<Html<String>, ResponseError> {
28
    let crumbs = vec![
29
        Crumb {
30
            label: "Home".into(),
31
            url: "/".into(),
32
        },
33
        Crumb {
34
            label: "Help".into(),
35
            url: HelpPath.to_crumb(),
36
        },
37
    ];
38
    let context = minijinja::context! {
39
        page_title => "Help & Documentation",
40
        current_user => auth.current_user,
41
        messages => session.drain_messages(),
42
        crumbs => crumbs,
43
    };
44
    Ok(Html(TEMPLATES.get_template("help.html")?.render(context)?))
45
2
}