filter
Some checks are pending
ci/woodpecker/push/publish Pipeline is pending

This commit is contained in:
Mylloon 2023-04-12 01:12:14 +02:00
parent a50d894926
commit 4b85a948bc
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -21,7 +21,7 @@ struct PortfolioTemplate {
closed: Vec<Project>, closed: Vec<Project>,
} }
#[derive(Content)] #[derive(Content, Clone)]
struct Project { struct Project {
name: String, name: String,
url: String, url: String,
@ -84,9 +84,21 @@ pub async fn get_page(config: Config) -> std::string::String {
config.tmpl.render( config.tmpl.render(
"contrib2.html", "contrib2.html",
PortfolioTemplate { PortfolioTemplate {
projects: data, projects: data
waiting: Vec::new(), .iter()
closed: Vec::new(), .cloned()
.filter(|p| !p.pulls_merged.is_empty())
.collect(),
waiting: data
.iter()
.cloned()
.filter(|p| !p.pulls_open.is_empty())
.collect(),
closed: data
.iter()
.cloned()
.filter(|p| !p.pulls_closed.is_empty())
.collect(),
}, },
Infos { Infos {
page_title: Some("Mes contributions".to_string()), page_title: Some("Mes contributions".to_string()),