summaryrefslogtreecommitdiff
path: root/src/index.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/index.rs')
-rw-r--r--src/index.rs16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/index.rs b/src/index.rs
index 8ff9f7e..605d9f6 100644
--- a/src/index.rs
+++ b/src/index.rs
@@ -56,8 +56,20 @@ mod templates {
html! {
ul {
@for channel in channels {
- li {
- (channel.name) "(" (channel.id) ")"
+ (channel_entry(&channel))
+ }
+ }
+ }
+ }
+
+ fn channel_entry(channel: &Channel) -> Markup {
+ let leave_url = format!("/{}/leave", channel.id);
+ html! {
+ li {
+ (channel.name) "(" (channel.id) ")"
+ form action=(leave_url) method="post" {
+ button {
+ "leave"
}
}
}