liquid_feedback_frontend

view app/main/help/show.lua @ 159:5d797c6706d5

implement quorum display

show the initiative quorum as a small 1px line in bargraph
allow to update your support on the diff page
better linked title in diff page
show absolute quorum numbers in detail pages of issue and initiative
author Daniel Poelzleithner <poelzi@poelzi.org>
date Sat Oct 09 03:42:48 2010 +0200 (2010-10-09)
parents fa55c8ded9fd
children d0f99272f675
line source
1 local id = param.get_id(atom.string)
3 if not id then
4 id = "index"
5 else
6 -- sanity check. Only allow letters, digits and _-
7 id = string.match(id, "[%a%d_-]*")
8 end
10 if not app.html_title.title then
11 app.html_title.title = _("Help #{id}", { id = id })
12 end
14 local basepath = request.get_app_basepath()
15 local found_help = false
16 -- we try to load any help file that fits best
17 for x,lang in ipairs{locale.get("lang"), "en"} do
18 for x,htype in ipairs{"_full", ""} do
19 local file_name = basepath .. "/locale/help/" .. id .. htype .. "." .. lang .. ".txt.html"
20 local file = io.open(file_name)
21 if file ~= nil then
22 local help_text = file:read("*a")
23 if #help_text > 0 then
24 found_help = true
25 ui.container{
26 attr = { class = "wiki" },
27 content = function()
28 slot.put(help_text)
29 end
30 }
31 break
32 end
33 end
34 end
35 end
37 if not found_help then
38 ui.field.text{ value = _("Missing help text: #{id}.#{lang}.txt", { id = id, lang = locale.get("lang") }) }
39 end

Impressum / About Us