mirror of
https://codeberg.org/simonrepp/hyper8.git
synced 2026-08-14 13:45:27 +02:00
Hide unlisted toggle when editing at the site's root level
This commit is contained in:
@@ -322,6 +322,11 @@ pub fn edit_page(
|
||||
String::new()
|
||||
};
|
||||
|
||||
let input_unlisted_conditionally_hidden = match collection.path.as_str() {
|
||||
"" => if collection.unlisted { format!(r#"<input name="unlisted" type="hidden" value="checked">"#)} else { String::new() },
|
||||
_ => input_unlisted
|
||||
};
|
||||
|
||||
let body = formatdoc!(r#"
|
||||
{errors}
|
||||
|
||||
@@ -331,7 +336,7 @@ pub fn edit_page(
|
||||
<form action="/collection/{path}" method="post">
|
||||
{input_title}
|
||||
{input_description}
|
||||
{input_unlisted}
|
||||
{input_unlisted_conditionally_hidden}
|
||||
|
||||
<div style="align-items: center; column-gap: .5rem; display: flex;">
|
||||
<button>Update Collection</button> {feedback_update}
|
||||
|
||||
@@ -262,6 +262,11 @@ pub fn edit_page(
|
||||
String::new()
|
||||
};
|
||||
|
||||
let input_unlisted_conditionally_hidden = match playlist.path.as_str() {
|
||||
"" => if playlist.unlisted { format!(r#"<input name="unlisted" type="hidden" value="checked">"#)} else { String::new() },
|
||||
_ => input_unlisted
|
||||
};
|
||||
|
||||
let body = formatdoc!(r#"
|
||||
{errors}
|
||||
|
||||
@@ -271,7 +276,7 @@ pub fn edit_page(
|
||||
<form action="/playlist/{path}" method="post">
|
||||
{input_title}
|
||||
{input_description}
|
||||
{input_unlisted}
|
||||
{input_unlisted_conditionally_hidden}
|
||||
|
||||
<div style="align-items: center; column-gap: .5rem; display: flex;">
|
||||
<button>Update Playlist</button> {feedback_update}
|
||||
|
||||
@@ -475,6 +475,11 @@ pub fn edit_page(
|
||||
</form>
|
||||
"#);
|
||||
|
||||
let input_unlisted_conditionally_hidden = match video.path.as_str() {
|
||||
"" => if video.unlisted { format!(r#"<input name="unlisted" type="hidden" value="checked">"#)} else { String::new() },
|
||||
_ => input_unlisted
|
||||
};
|
||||
|
||||
let body = formatdoc!(r#"
|
||||
{errors}
|
||||
|
||||
@@ -485,7 +490,7 @@ pub fn edit_page(
|
||||
{input_title}
|
||||
{input_description}
|
||||
{input_release_date}
|
||||
{input_unlisted}
|
||||
{input_unlisted_conditionally_hidden}
|
||||
|
||||
<div style="align-items: center; column-gap: .5rem; display: flex;">
|
||||
<button>Update Video</button> {feedback_update}
|
||||
|
||||
Reference in New Issue
Block a user