Mark system library content

This commit is contained in:
2023-08-31 11:32:51 +02:00
parent 0b0188bd30
commit a8851c5e4f
6 changed files with 77 additions and 20 deletions

View File

@@ -25,7 +25,7 @@
use console::style;
use serde::{Deserialize, Serialize};
use crate::model::{Comparable, Listable, Ordner, Sortable};
use crate::model::{Comparable, FolderContent, Listable, Ordner, Sortable};
#[derive(Serialize, Deserialize, Debug)]
#[serde(deny_unknown_fields)]
@@ -56,7 +56,11 @@ pub struct PropertyCatalogue {
impl Listable for PropertyCatalogue {
fn to_listed_string(&self) -> String {
format!(
"Merkmalskatalog '{}' in Revision '{}'",
"Merkmalskatalog ({}) '{}' in Revision '{}'",
match self.is_system_library_content() {
true => style("S").yellow(),
_ => style("u"),
},
style(&self.name).yellow(),
style(&self.revision).yellow()
)
@@ -89,6 +93,12 @@ impl Comparable for PropertyCatalogue {
}
}
impl FolderContent for PropertyCatalogue {
fn get_library_folder(&self) -> String {
self.ordner.bibliothek.name.to_string()
}
}
#[derive(Serialize, Deserialize, Debug)]
#[serde(deny_unknown_fields)]
pub struct Versions {