fixed issues caused by untested PR #1
All checks were successful
/ deploy (push) Successful in 1s

This commit is contained in:
Theresa Treimer 2025-07-10 22:47:21 +02:00
parent 3bfa505fa4
commit 652944146e

View file

@ -19,7 +19,7 @@ app:get("/embed", function(self)
if from == nil then if from == nil then
return {"cups webring embed needs from defined (.../embed?from=me)"} return {"cups webring embed needs from defined (.../embed?from=me)"}
end end
return string.format('<div style="display:flex; flex-direction:row; align-items:center;"><a href="%s/prev?from=%s" target="_parent"><img src="%s/static/arrow_left.svg" width=50 height=50/></a><a href="%s"><img src="%s/static/logo_cut.svg" width=200 height=100/></a><a href="%s/next?from=%s" target="_parent"><img src="%s/static/arrow_right.svg" width=50 height=50/></a></div>', config.host, from, config.host, config.host, config.host, config.host, from, config.host), {layout = false, content_type="text/html"} return string.format('<div style="display:flex; flex-direction:row; align-items:center;"><a href="%s/prev?from=%s" target="_parent"><img src="%s/static/arrow_left.svg" width=50 height=50/></a><a href="%s" target="_parent"><img src="%s/static/logo_cut.svg" width=200 height=100/></a><a href="%s/next?from=%s" target="_parent"><img src="%s/static/arrow_right.svg" width=50 height=50/></a></div>', config.host, from, config.host, config.host, config.host, config.host, from, config.host), {layout = false, content_type="text/html"}
end) end)
app:get("/random", function(self) app:get("/random", function(self)
@ -39,6 +39,10 @@ app:get("/next", function(self)
found = true found = true
end end
end end
if "cups" == self.params.from then
rand = math.random(1,#members-1)
return {redirect_to=members[rand][2]}
end
return {redirect_to="/"} return {redirect_to="/"}
end) end)
@ -55,6 +59,10 @@ app:get("/prev", function(self)
found = true found = true
end end
end end
if "cups" == self.params.from then
rand = math.random(1,#members-1)
return {redirect_to=members[rand][2]}
end
return {redirect_to="/"} return {redirect_to="/"}
end) end)