add labels in oneline view
This commit is contained in:
parent
74ec396296
commit
2aa573088c
2 changed files with 18 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
use crate::{
|
||||
api::{ProjectID, Task, VikunjaAPI},
|
||||
ui::{parse_datetime, print_color, time_since},
|
||||
ui::{hex_to_color, parse_datetime, print_color, print_color_bg, time_since},
|
||||
};
|
||||
|
||||
fn print_task_oneline(task: &Task, api: &VikunjaAPI) {
|
||||
|
@ -22,6 +22,15 @@ fn print_task_oneline(task: &Task, api: &VikunjaAPI) {
|
|||
print_color(crossterm::style::Color::Green, " [✓]");
|
||||
}
|
||||
|
||||
if let Some(labels) = &task.labels {
|
||||
print!(" ");
|
||||
for label in labels {
|
||||
let color = hex_to_color(&label.hex_color).unwrap();
|
||||
print_color_bg(color, &label.title.trim());
|
||||
print!(" ");
|
||||
}
|
||||
}
|
||||
|
||||
print!("\n");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue