};
insert_notebooks.insert(db).await?;
+ let insert_trash = collection::ActiveModel {
+ profile_id: Set(inserted.id),
+ repository_id: Set(repo.repository_id),
+ name: Set("Trash".to_string()),
+ parent: Set("".to_string()),
+ kind: Set(CollectionType::Trash),
+
+ ..Default::default()
+ };
+ insert_trash.insert(db).await?;
+
let insert_notes = collection::ActiveModel {
profile_id: Set(inserted.id),
repository_id: Set(repo.repository_id),
use ui_rs::{action, button, grid, hbox, imageviewer, label, sourcelist, tableview, tabview, textarea, textfield, ui_actions, UiModel};
use ui_rs::ui::*;
use crate::{App, AppStates};
-use entity::collection::{Model as Collection, Node};
+use entity::collection::{CollectionType, Model as Collection, Node};
use crate::newnotebook::new_notebook_dialog;
use crate::notebook::{notelist_getvalue, Notebook, NotebookItem};
self.groups.clear();
for elm in nodes.iter() {
+ if elm.collection.kind == CollectionType::Trash {
+ // TODO: add to trash list
+ continue;
+ }
+
self.groups.push(elm.collection.clone());
let mut notebook = SubList::new();