Separate archived items
This commit is contained in:
parent
208cfe3608
commit
91bbfbd4d4
1 changed files with 15 additions and 1 deletions
16
src/main.rs
16
src/main.rs
|
|
@ -29,6 +29,9 @@ fn main() {
|
|||
fn display_projects() -> rouille::Response {
|
||||
let projects = db::list_all_projects().unwrap_or_default();
|
||||
|
||||
let active_projects: Vec<_> = projects.iter().filter(|p| !p.archived).collect();
|
||||
let archived_projects: Vec<_> = projects.iter().filter(|p| p.archived).collect();
|
||||
|
||||
let markup = html! {
|
||||
(DOCTYPE)
|
||||
html {
|
||||
|
|
@ -41,13 +44,24 @@ fn display_projects() -> rouille::Response {
|
|||
body {
|
||||
main {
|
||||
section {
|
||||
@for project in &projects {
|
||||
@for project in &active_projects {
|
||||
project-card
|
||||
title=(project.title)
|
||||
percentage=(project.percentage_completed)
|
||||
archived=(project.archived) {}
|
||||
}
|
||||
}
|
||||
details {
|
||||
summary { "Archived" }
|
||||
section {
|
||||
@for project in &archived_projects {
|
||||
project-card
|
||||
title=(project.title)
|
||||
percentage=(project.percentage_completed)
|
||||
archived=(project.archived) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue