feat: add rss_url to HtmlPageContext, use it in nav
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
<nav>
|
||||
<a href="/">Feed</a>
|
||||
<a href="/users">Users</a>
|
||||
<a href="/feed.rss">RSS</a>
|
||||
<a href="{{ ctx.rss_url }}">RSS</a>
|
||||
{% if let Some(email) = ctx.user_email %}
|
||||
<a href="/reviews/new">Add Review</a>
|
||||
<a href="/logout">Logout</a>
|
||||
|
||||
@@ -6,6 +6,7 @@ pub struct HtmlPageContext {
|
||||
pub user_email: Option<String>,
|
||||
pub user_id: Option<Uuid>,
|
||||
pub register_enabled: bool,
|
||||
pub rss_url: String,
|
||||
}
|
||||
|
||||
impl HtmlPageContext {
|
||||
|
||||
@@ -41,6 +41,7 @@ pub mod html {
|
||||
user_email,
|
||||
user_id: uuid,
|
||||
register_enabled: state.app_ctx.config.allow_registration,
|
||||
rss_url: "/feed.rss".to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,6 +68,7 @@ pub mod html {
|
||||
user_email: None,
|
||||
user_id: None,
|
||||
register_enabled: state.app_ctx.config.allow_registration,
|
||||
rss_url: "/feed.rss".to_string(),
|
||||
};
|
||||
let html = state
|
||||
.html_renderer
|
||||
@@ -119,6 +121,7 @@ pub mod html {
|
||||
user_email: None,
|
||||
user_id: None,
|
||||
register_enabled: true,
|
||||
rss_url: "/feed.rss".to_string(),
|
||||
};
|
||||
let html = state
|
||||
.html_renderer
|
||||
|
||||
Reference in New Issue
Block a user