hide download/view/chat buttons if the demo is delete/there is no chat

This commit is contained in:
Robin Appelman 2024-11-30 00:29:12 +01:00
commit 89eb98529b

View file

@ -101,17 +101,21 @@ impl Page for DemoPage {
span.time { (self.demo.duration()) } span.time { (self.demo.duration()) }
} }
p.demo-download { p.demo-download {
a.button.button-primary href = (self.demo.url) download = (self.demo.name) rel = "nofollow" { "Download" } @if !self.demo.url.is_empty() {
a.button href = (self.demo.viewer_url()) rel = "nofollow" { "View" } a.button.button-primary href = (self.demo.url) download = (self.demo.name) rel = "nofollow" { "Download" }
details.chat { a.button href = (self.demo.viewer_url()) rel = "nofollow" { "View" }
summary.button.button-tertiary { "Toggle Chat" } }
div { @if !self.demo.chat.is_empty() {
table.chat { details.chat {
@for chat in &self.demo.chat { summary.button.button-tertiary { "Toggle Chat" }
tr { div {
td.user { (chat.from) } table.chat {
td.message { (chat.text) } @for chat in &self.demo.chat {
td.duration { (chat.time()) } tr {
td.user { (chat.from) }
td.message { (chat.text) }
td.duration { (chat.time()) }
}
} }
} }
} }