v3 : Décisions et « À venir » côté serveur
- ld-engine/pending : un module (article) reste à voter tant qu'aucune
version n'a été adoptée par un vote (seed a minima non confirmé, ou pas
de version en vigueur et au moins une version ouverte) ; les variantes
comptent pour un ; « sans ton vote » = aucun vote valide sur aucune version.
- overview.rs : GET /api/groups/{slug} ajoute « upcoming » (docs, mandats,
protocoles), lu au démarrage dans seeds/upcoming/<groupe>.json, trilingue,
servi seulement à qui ouvre le groupe ; GET /api/groups/{slug}/decisions,
une ligne par doc avec toVote et withoutMyVote (si la personne vote).
- Retour après connexion par défaut : « / » au lieu de « /groupes ».
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,7 @@ pub mod auth;
|
||||
pub mod config;
|
||||
pub mod docs;
|
||||
pub mod error;
|
||||
pub mod overview;
|
||||
pub mod proposals;
|
||||
pub mod publish;
|
||||
pub mod seed;
|
||||
@@ -41,6 +42,8 @@ pub struct AppState {
|
||||
pub http: reqwest::Client,
|
||||
/// Wakes the publisher as soon as an adoption is recorded.
|
||||
pub publish_wake: Arc<Notify>,
|
||||
/// What is coming in the tools of each group (`seeds/upcoming/`), read at start.
|
||||
pub upcoming: Arc<overview::Upcoming>,
|
||||
}
|
||||
|
||||
impl AppState {
|
||||
@@ -49,7 +52,8 @@ impl AppState {
|
||||
.timeout(Duration::from_secs(15))
|
||||
.user_agent(concat!("libreDecision/", env!("CARGO_PKG_VERSION")))
|
||||
.build()?;
|
||||
Ok(Self { db, cfg: Arc::new(cfg), http, publish_wake: Arc::new(Notify::new()) })
|
||||
let upcoming = Arc::new(overview::Upcoming::load(&cfg.seed_dir).await?);
|
||||
Ok(Self { db, cfg: Arc::new(cfg), http, publish_wake: Arc::new(Notify::new()), upcoming })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,7 +107,8 @@ pub fn api_router() -> Router<AppState> {
|
||||
.route("/auth/logout", post(auth::logout))
|
||||
.route("/me", get(auth::me))
|
||||
.route("/groups", get(docs::groups))
|
||||
.route("/groups/{slug}", get(docs::group))
|
||||
.route("/groups/{slug}", get(overview::group))
|
||||
.route("/groups/{slug}/decisions", get(overview::decisions))
|
||||
.route("/docs/{id}", get(docs::document))
|
||||
.route("/docs/{id}/preview", get(docs::preview))
|
||||
.route("/docs/{id}/assist", post(proposals::assist))
|
||||
|
||||
Reference in New Issue
Block a user