From 5249aad35741f6f029c442a04d679937fb91d2bb Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Sat, 14 Sep 2024 00:16:51 -0400 Subject: Placeholder UX, probably --- src/index/templates.rs | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'src/index/templates.rs') 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) -> 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" } + } + } + } +} -- cgit v1.2.3