aboutsummaryrefslogtreecommitdiff
path: root/src/pages/repo/about.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages/repo/about.rs')
-rw-r--r--src/pages/repo/about.rs33
1 files changed, 12 insertions, 21 deletions
diff --git a/src/pages/repo/about.rs b/src/pages/repo/about.rs
index fa88eb1..1f207e2 100644
--- a/src/pages/repo/about.rs
+++ b/src/pages/repo/about.rs
@@ -1,32 +1,23 @@
-use super::RepoWrapper;
-use crate::types::RepoData;
+use crate::templ_data::repo::*;
use actix_web::{web, HttpRequest, HttpResponse, Result};
use askama::Template;
-#[derive(Template)]
-#[template(path = "repo/about.html")]
-struct AboutRepo {
- repo: RepoWrapper,
- readme: String,
-}
-
/// Renders the "repository/about" subpage
pub async fn render(req: HttpRequest, path: web::Path<String>) -> Result<HttpResponse> {
- let repo = AboutRepo {
+ let repo = pages::About {
readme: include_str!("../../../README").to_string(),
- 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(),
- },
+ 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();