show all activities for admin; Fixes #984
This commit is contained in:
@ -1,10 +1,10 @@
|
||||
use csv::ReaderBuilder;
|
||||
use rocket::{FromForm, Route, State, form::Form, get, post, routes};
|
||||
use rocket_dyn_templates::{Template, context};
|
||||
use rocket::{form::Form, get, post, routes, FromForm, Route, State};
|
||||
use rocket_dyn_templates::{context, Template};
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
use crate::{
|
||||
model::{log::Log, role::Role, user::AdminUser},
|
||||
model::{activity::Activity, log::Log, role::Role, user::AdminUser},
|
||||
tera::Config,
|
||||
};
|
||||
|
||||
@ -25,11 +25,16 @@ async fn rss(db: &State<SqlitePool>, key: &str, config: &State<Config>) -> Strin
|
||||
}
|
||||
}
|
||||
|
||||
#[get("/rss", rank = 2)]
|
||||
#[get("/rss/old", rank = 2)]
|
||||
async fn show_rss(db: &State<SqlitePool>, _admin: AdminUser) -> String {
|
||||
Log::show(db).await
|
||||
}
|
||||
|
||||
#[get("/rss", rank = 2)]
|
||||
async fn show_activities(db: &State<SqlitePool>, _admin: AdminUser) -> String {
|
||||
Activity::show(db).await
|
||||
}
|
||||
|
||||
#[get("/list")]
|
||||
async fn show_list(_admin: AdminUser) -> Template {
|
||||
Template::render("admin/list/index", context!())
|
||||
@ -83,6 +88,12 @@ pub fn routes() -> Vec<Route> {
|
||||
ret.append(&mut mail::routes());
|
||||
ret.append(&mut event::routes());
|
||||
ret.append(&mut role::routes());
|
||||
ret.append(&mut routes![rss, show_rss, show_list, list]);
|
||||
ret.append(&mut routes![
|
||||
rss,
|
||||
show_rss,
|
||||
show_activities,
|
||||
show_list,
|
||||
list
|
||||
]);
|
||||
ret
|
||||
}
|
||||
|
Reference in New Issue
Block a user