use crate::templ_data::repo::*; use actix_web::{web, HttpRequest, HttpResponse, Result}; use askama::Template; /// Renders the "repository/about" subpage pub async fn render(req: HttpRequest, path: web::Path) -> Result { let last_commit = CommitData { hash: "84a9a0".into(), message: "Updating just like... a bunch of shit".into(), author: "Katharina Fey".into(), date: "Today".into(), diff: (125, 55), }; let repo = pages::Details { branches: vec![BranchData { name: "develop".into(), last_commit: last_commit.clone(), }], commits: vec![last_commit], repo: RepoData { owner: "spacekookie".into(), name: "octopus".into(), tagline: "A lightweight web frontend for git repositories".into(), num_commit: 141, num_branch: 1, num_tag: 0, num_contributor: 3, size: "13.12M".into(), logo: "fakeavi.png".into(), }, base: Default::default(), } .render() .unwrap(); Ok(HttpResponse::Ok().content_type("text/html").body(repo)) }