feat: show profile RSS in footer when viewing another user's profile

This commit is contained in:
2026-05-10 00:46:51 +02:00
parent 66f9ef887e
commit be30a1d77c
3 changed files with 12 additions and 1 deletions

View File

@@ -46,6 +46,10 @@
<span class="footer-made">Made with passion</span> <span class="footer-made">Made with passion</span>
<span class="footer-sep">·</span> <span class="footer-sep">·</span>
<a href="/feed.rss" class="footer-link">RSS</a> <a href="/feed.rss" class="footer-link">RSS</a>
{% if let Some(rss) = ctx.page_rss_url %}
<span class="footer-sep">·</span>
<a href="{{ rss }}" class="footer-link">Profile RSS</a>
{% endif %}
{% if let Some(uid) = ctx.user_id %} {% if let Some(uid) = ctx.user_id %}
<span class="footer-sep">·</span> <span class="footer-sep">·</span>
<a href="/users/{{ uid }}" class="footer-link">My Profile</a> <a href="/users/{{ uid }}" class="footer-link">My Profile</a>

View File

@@ -19,6 +19,7 @@ pub struct HtmlPageContext {
pub page_title: String, pub page_title: String,
pub canonical_url: String, pub canonical_url: String,
pub csrf_token: String, pub csrf_token: String,
pub page_rss_url: Option<String>,
} }
impl HtmlPageContext { impl HtmlPageContext {

View File

@@ -63,6 +63,7 @@ pub mod html {
page_title: "Movies Diary".to_string(), page_title: "Movies Diary".to_string(),
canonical_url: state.app_ctx.config.base_url.clone(), canonical_url: state.app_ctx.config.base_url.clone(),
csrf_token, csrf_token,
page_rss_url: None,
} }
} }
@@ -105,6 +106,7 @@ pub mod html {
page_title: "Login — Movies Diary".to_string(), page_title: "Login — Movies Diary".to_string(),
canonical_url: format!("{}/login", state.app_ctx.config.base_url), canonical_url: format!("{}/login", state.app_ctx.config.base_url),
csrf_token: csrf.0, csrf_token: csrf.0,
page_rss_url: None,
}; };
let html = state let html = state
.html_renderer .html_renderer
@@ -170,6 +172,7 @@ pub mod html {
page_title: "Register — Movies Diary".to_string(), page_title: "Register — Movies Diary".to_string(),
canonical_url: format!("{}/register", state.app_ctx.config.base_url), canonical_url: format!("{}/register", state.app_ctx.config.base_url),
csrf_token: csrf.0, csrf_token: csrf.0,
page_rss_url: None,
}; };
let html = state let html = state
.html_renderer .html_renderer
@@ -602,7 +605,10 @@ pub mod html {
(e.offset, has_more, e.limit) (e.offset, has_more, e.limit)
}) })
.unwrap_or((0, false, super::DEFAULT_PAGE_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 { let data = application::ports::ProfilePageData {
ctx, ctx,
profile_user_id: profile_user_uuid, profile_user_id: profile_user_uuid,