Admin declaration
Declare a resource in the admin panel.
● ● ●
use crate::entities::{blog, article};
use crate::formulaire::{BlogForm, ArticleForm};
// This file is the SOURCE for "runique start",
// which regenerates src/admins/admin.rs automatically.
// Users, groups and rights are built-in resources: nothing to declare.
admin! {
blog: blog::Model => BlogForm {
title: "Blog articles"
}
article: article::Model => ArticleForm {
title: "Articles"
}
}
// Syntax:
// resource_name: entity::Model => FormType {
// title: "Label in the menu"
// }
// resource_name -> URL segment (/admin/resource_name/list)
// entity::Model -> SeaORM model generated by model!
// FormType -> form implementing RuniqueForm
// runique start watches src/admin.rs and regenerates src/admins/admin.rs.