forked from Theresa/cups-webring
fixed issues caused by untested PR #1
This commit is contained in:
parent
3bfa505fa4
commit
652944146e
1 changed files with 9 additions and 1 deletions
|
|
@ -19,7 +19,7 @@ app:get("/embed", function(self)
|
|||
if from == nil then
|
||||
return {"cups webring embed needs from defined (.../embed?from=me)"}
|
||||
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)
|
||||
|
||||
app:get("/random", function(self)
|
||||
|
|
@ -39,6 +39,10 @@ app:get("/next", function(self)
|
|||
found = true
|
||||
end
|
||||
end
|
||||
if "cups" == self.params.from then
|
||||
rand = math.random(1,#members-1)
|
||||
return {redirect_to=members[rand][2]}
|
||||
end
|
||||
return {redirect_to="/"}
|
||||
end)
|
||||
|
||||
|
|
@ -55,6 +59,10 @@ app:get("/prev", function(self)
|
|||
found = true
|
||||
end
|
||||
end
|
||||
if "cups" == self.params.from then
|
||||
rand = math.random(1,#members-1)
|
||||
return {redirect_to=members[rand][2]}
|
||||
end
|
||||
return {redirect_to="/"}
|
||||
end)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue