Display category children & Add calendar stats

This commit is contained in:
2021-04-30 14:48:42 +02:00
parent e8e8f535c2
commit c3870bcded
22 changed files with 759 additions and 338 deletions

View File

@ -1,27 +0,0 @@
use chrono::{DateTime, Local};
use serde::{Deserialize, Serialize};
use uuid::Uuid;
pub type CategoryKey = Uuid;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Category {
/// The name of the category
pub name: String,
/// The description of the category
pub description: Option<String>,
/// The HTML color of the category in the rendered view
pub color: String,
/// If the session is not active, this will be None
pub started: Option<DateTime<Local>>,
/// The parent category of this category
/// If none, the category has no parent
pub parent: Option<CategoryKey>,
/// Whether the item has been "deleted", e.g. it shoudn't be shown in the view
pub deleted: bool,
}

View File

@ -13,7 +13,7 @@ pub mod trees {
pub type K = Uuid;
#[derive(Debug, Clone, Serialize, Deserialize)]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
pub struct V {
/// The name of the category
pub name: String,
@ -44,7 +44,7 @@ pub mod trees {
pub type K = Uuid;
#[derive(Debug, Clone, Serialize, Deserialize)]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
pub struct V {
/// The UUID of the category to which this session belongs
pub category: trees::category::K,