diff options
author | Katharina Fey <kookie@spacekookie.de> | 2020-06-22 01:48:59 +0200 |
---|---|---|
committer | Katharina Fey <kookie@spacekookie.de> | 2020-06-22 01:48:59 +0200 |
commit | 84a9a0ccee713e26a28ff5e54ea3776085d93b5f (patch) | |
tree | 9a0158ecc1668e8594881a4f9be7e54c8773d6a9 /src/pages/repo/details.rs | |
parent | 67ad3b7a26ed0dc99f3324011fa8e5ed316a655a (diff) |
Updating just like... a bunch of shit
Diffstat (limited to 'src/pages/repo/details.rs')
-rw-r--r-- | src/pages/repo/details.rs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/pages/repo/details.rs b/src/pages/repo/details.rs new file mode 100644 index 0000000..4745e96 --- /dev/null +++ b/src/pages/repo/details.rs @@ -0,0 +1,37 @@ +use super::RepoWrapper; +use crate::types::{BranchData, CommitData, RepoData}; +use actix_web::{web, HttpRequest, HttpResponse, Result}; +use askama::Template; + +#[derive(Template)] +#[template(path = "repo/details.html")] +struct AboutRepo { + repo: RepoWrapper, + branches: Vec<BranchData>, + commits: Vec<CommitData>, +} + +/// Renders the "repository/about" subpage +pub async fn render(req: HttpRequest, path: web::Path<String>) -> Result<HttpResponse> { + let repo = AboutRepo { + branches: vec![], + commits: vec![], + repo: RepoWrapper { + data: 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(), + }, + } + .render() + .unwrap(); + + Ok(HttpResponse::Ok().content_type("text/html").body(repo)) +} |