implement labels
This commit is contained in:
parent
c469386c6a
commit
c2944722dd
4 changed files with 97 additions and 14 deletions
|
@ -100,6 +100,11 @@ pub fn print_task_info(task_id: isize, api: &VikunjaAPI) {
|
|||
);
|
||||
|
||||
println!("Created by {}", task.created_by.username);
|
||||
println!(
|
||||
"Created: {} | Updated: {}",
|
||||
time_since(parse_datetime(&task.created).unwrap()),
|
||||
time_since(parse_datetime(&task.updated).unwrap())
|
||||
);
|
||||
|
||||
if let Some(due_date) = parse_datetime(&task.due_date) {
|
||||
// todo : color if overdue
|
||||
|
@ -118,16 +123,14 @@ pub fn print_task_info(task_id: isize, api: &VikunjaAPI) {
|
|||
}
|
||||
|
||||
if let Some(labels) = task.labels {
|
||||
// todo : labels and color
|
||||
println!("Labels: {}", labels.first().unwrap().title);
|
||||
print!("Labels: ");
|
||||
for label in labels {
|
||||
print_label(&label);
|
||||
print!(" ");
|
||||
}
|
||||
println!();
|
||||
}
|
||||
|
||||
println!(
|
||||
"Created: {} | Updated: {}",
|
||||
time_since(parse_datetime(&task.created).unwrap()),
|
||||
time_since(parse_datetime(&task.updated).unwrap())
|
||||
);
|
||||
|
||||
if task.description != "<p></p>" && !task.description.is_empty() {
|
||||
println!("---\n{}", task.description);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue