liquid_feedback_frontend

annotate app/main/api/instance.lua @ 1855:080f4112b8a9

Show new suggestion button only during admission and discussion
author bsw
date Thu Mar 24 10:37:44 2022 +0100 (2022-03-24)
parents 32cc544d5a5b
children
rev   line source
bsw/jbe@1309 1 local navigation
bsw/jbe@1309 2
bsw/jbe@1309 3 if param.get("include_navigation") then
bsw/jbe@1309 4
bsw/jbe@1309 5 local items = config.meta_navigation_items_func(
bsw/jbe@1309 6 app.access_token and app.access_token.member or nil,
bsw/jbe@1309 7 param.get("client_id"),
bsw/jbe@1309 8 param.get("login_url")
bsw/jbe@1309 9 )
bsw/jbe@1309 10
bsw/jbe@1309 11 navigation = json.array()
bsw/jbe@1309 12 for i, item in ipairs(items) do
bsw/jbe@1309 13 navigation[#navigation+1] = json.object{
bsw/jbe@1309 14 name = item.name,
bsw/jbe@1309 15 description = item.description,
bsw/jbe@1309 16 url = item.url,
bsw/jbe@1309 17 active = item.active
bsw/jbe@1309 18 }
bsw/jbe@1309 19 end
bsw/jbe@1309 20
bsw/jbe@1309 21 end
bsw/jbe@1309 22
bsw/jbe@1309 23 local result = json.object{
bsw/jbe@1309 24 name = config.instance_name,
bsw/jbe@1309 25 slogan = config.meta_navigation_slogan,
bsw/jbe@1309 26 home_url = config.meta_navigation_home_url,
bsw/jbe@1309 27 logo_url = config.meta_navigation_logo_url,
bsw/jbe@1309 28 logo_alt_text = config.meta_navigation_logo_alt_text,
bsw/jbe@1309 29 navigation = navigation
bsw/jbe@1309 30 }
bsw/jbe@1309 31
bsw/jbe@1309 32 slot.set_layout(nil, "application/json")
bsw/jbe@1309 33 slot.put_into("data", json.export(json.object{ result = result }))

Impressum / About Us