diff --git a/crates/adapters/template-askama/templates/base.html b/crates/adapters/template-askama/templates/base.html index 2636eb5..f9f2f7c 100644 --- a/crates/adapters/template-askama/templates/base.html +++ b/crates/adapters/template-askama/templates/base.html @@ -46,6 +46,10 @@ Made with passion · RSS + {% if let Some(rss) = ctx.page_rss_url %} + · + Profile RSS + {% endif %} {% if let Some(uid) = ctx.user_id %} · My Profile diff --git a/crates/application/src/ports.rs b/crates/application/src/ports.rs index c61341f..09d405d 100644 --- a/crates/application/src/ports.rs +++ b/crates/application/src/ports.rs @@ -19,6 +19,7 @@ pub struct HtmlPageContext { pub page_title: String, pub canonical_url: String, pub csrf_token: String, + pub page_rss_url: Option, } impl HtmlPageContext { diff --git a/crates/presentation/src/handlers.rs b/crates/presentation/src/handlers.rs index b6dfac0..362efc6 100644 --- a/crates/presentation/src/handlers.rs +++ b/crates/presentation/src/handlers.rs @@ -63,6 +63,7 @@ pub mod html { page_title: "Movies Diary".to_string(), canonical_url: state.app_ctx.config.base_url.clone(), csrf_token, + page_rss_url: None, } } @@ -105,6 +106,7 @@ pub mod html { page_title: "Login — Movies Diary".to_string(), canonical_url: format!("{}/login", state.app_ctx.config.base_url), csrf_token: csrf.0, + page_rss_url: None, }; let html = state .html_renderer @@ -170,6 +172,7 @@ pub mod html { page_title: "Register — Movies Diary".to_string(), canonical_url: format!("{}/register", state.app_ctx.config.base_url), csrf_token: csrf.0, + page_rss_url: None, }; let html = state .html_renderer @@ -602,7 +605,10 @@ pub mod html { (e.offset, has_more, e.limit) }) .unwrap_or((0, false, super::DEFAULT_PAGE_LIMIT)); - ctx.rss_url = format!("/users/{}/feed.rss", profile_user_uuid); + if !is_own_profile { + ctx.page_rss_url = + Some(format!("/users/{}/feed.rss", profile_user_uuid)); + } let data = application::ports::ProfilePageData { ctx, profile_user_id: profile_user_uuid,