diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2024-09-14 00:16:51 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2024-09-14 00:18:08 -0400 |
| commit | 5249aad35741f6f029c442a04d679937fb91d2bb (patch) | |
| tree | c75085a93538367ae3f5da8f64f90b33a3c8feef /src/index/templates.rs | |
| parent | 407ca8df6284ce1a4c649b018c7326fd195bbd26 (diff) | |
Placeholder UX, probably
Diffstat (limited to 'src/index/templates.rs')
| -rw-r--r-- | src/index/templates.rs | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/src/index/templates.rs b/src/index/templates.rs index 38cd93f..7472fd0 100644 --- a/src/index/templates.rs +++ b/src/index/templates.rs @@ -33,7 +33,9 @@ fn channel_list<'c>(channels: impl IntoIterator<Item = &'c Channel>) -> Markup { fn channel_list_entry(channel: &Channel) -> Markup { html! { li { - (channel.name) " (" (channel.id) ")" + a href=(format!("/{}", channel.id)) { + (channel.name) " (" (channel.id) ")" + } } } } @@ -87,3 +89,38 @@ fn login_form() -> Markup { } } } + +pub fn channel(channel: &Channel) -> Markup { + html! { + (DOCTYPE) + head { + title { "hi - " (channel.name) } + script src="/js/channel.js" {} + template id="message" { + p { + span.sender { "(sender)" } + ": " + span.message { "(message)" } + " (at " + span.sent_at { "(sent_at)" } + ")" } + } + link rel="events" href=(format!("/{}/events", channel.id)) {} + } + body { + section class="messages" {} + section { + form action=(format!("/{}/send", channel.id)) method="post" { + label { + "message" + input name="message" type="text" autofocus {} + } + button { "send" } + } + } + section { + a href="/" { "back" } + } + } + } +} |
