aboutsummaryrefslogtreecommitdiff
path: root/server/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/ui')
-rw-r--r--server/src/ui/home.rs21
-rw-r--r--server/src/ui/mod.rs2
2 files changed, 10 insertions, 13 deletions
diff --git a/server/src/ui/home.rs b/server/src/ui/home.rs
index 4e9fd28..e9136ec 100644
--- a/server/src/ui/home.rs
+++ b/server/src/ui/home.rs
@@ -5,18 +5,15 @@
*/
use super::error::MyResult;
-use rocket::{get, response::content::RawHtml, serde::json::Json, Either};
+use crate::request_info::RequestInfo;
+use jellycommon::jellyobject::ObjectBuffer;
+use jellyui::render_view;
+use rocket::{Either, get, response::content::RawHtml, serde::json::Json};
#[get("/home")]
-pub fn r_home(ri: RequestInfo) -> MyResult<Either<RawHtml<String>, Json<ApiHomeResponse>>> {
- let r = jellylogic::home::home(&ri.session)?;
-
- Ok(if matches!(ri.accept, Accept::Json) {
- Either::Right(Json(r))
- } else {
- Either::Left(RawHtml(render_page(
- &HomePage { lang: &ri.lang, r },
- ri.render_info(),
- )))
- })
+pub fn r_home(ri: RequestInfo<'_>) -> MyResult<RawHtml<String>> {
+ Ok(RawHtml(render_view(
+ ri.render_info(),
+ ObjectBuffer::new(&mut []).as_object(),
+ )))
}
diff --git a/server/src/ui/mod.rs b/server/src/ui/mod.rs
index 55fad6a..112bb6b 100644
--- a/server/src/ui/mod.rs
+++ b/server/src/ui/mod.rs
@@ -14,7 +14,7 @@ pub mod account;
// pub mod admin;
pub mod assets;
pub mod error;
-// pub mod home;
+pub mod home;
// pub mod items;
pub mod node;
// pub mod player;