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