liquid_feedback_frontend
view env/util/help.lua @ 6:8d91bccab0bf
Version beta2
Possibility to browse voters of a closed issue
Registration with invite code
Email confirmation and password recovery
Download function (for database dumps) added
Critical bug solved, which made it impossible to select your opinion on other peoples suggestions
Catching error, when trying to set an opinion on a suggestion which has been meanwhile deleted
Fixed wrong sorting order for "supporters" or "potential supporters"
Added format info for birthday (Error when entering dates in wrong format is NOT fixed in this release)
Strip space characters from certain fields and ensure they contain at least 3 characters
Showing grade in opinion/list as clear text instead of integer value
More information on initiative is displayed while voting
Colored notification box shown on pages of issues or initiatives which are currently in voting state
Changed default filter for issues to "Open"
Back link on suggestion page
Some optical changes
Removed wrong space character in LICENSE file
Possibility to browse voters of a closed issue
Registration with invite code
Email confirmation and password recovery
Download function (for database dumps) added
Critical bug solved, which made it impossible to select your opinion on other peoples suggestions
Catching error, when trying to set an opinion on a suggestion which has been meanwhile deleted
Fixed wrong sorting order for "supporters" or "potential supporters"
Added format info for birthday (Error when entering dates in wrong format is NOT fixed in this release)
Strip space characters from certain fields and ensure they contain at least 3 characters
Showing grade in opinion/list as clear text instead of integer value
More information on initiative is displayed while voting
Colored notification box shown on pages of issues or initiatives which are currently in voting state
Changed default filter for issues to "Open"
Back link on suggestion page
Some optical changes
Removed wrong space character in LICENSE file
| author | bsw/jbe |
|---|---|
| date | Sat Jan 02 12:00:00 2010 +0100 (2010-01-02) |
| parents | 80c215dbf076 |
| children | 00d1004545f1 |
line source
1 function util.help(id, title)
2 local setting_key = "liquidfeedback_frontend_hidden_help_" .. id
3 local setting = Setting:by_pk(app.session.member.id, setting_key)
4 if not setting then
5 ui.container{
6 attr = { class = "help help_visible" },
7 content = function()
8 ui.image{
9 attr = { class = "help_icon" },
10 static = "icons/16/help.png"
11 }
12 ui.container{
13 attr = { class = "help_actions" },
14 content = function()
15 ui.link{
16 content = _"Hide this help message",
17 module = "help",
18 action = "update",
19 params = {
20 help_ident = id,
21 hide = true
22 },
23 routing = {
24 default = {
25 mode = "redirect",
26 module = request.get_module(),
27 view = request.get_view(),
28 id = param.get_id_cgi(),
29 params = param.get_all_cgi()
30 }
31 }
32 }
33 end
34 }
35 local lang = locale.get("lang")
36 local basepath = request.get_app_basepath()
37 local file_name = basepath .. "/locale/help/" .. id .. "." .. lang .. ".txt"
38 local file = io.open(file_name)
39 if file ~= nil then
40 local help_text = file:read("*a")
41 if #help_text > 0 then
42 ui.container{
43 attr = { class = "wiki" },
44 content = function()
45 slot.put(format.wiki_text(help_text))
46 end
47 }
48 else
49 ui.field.text{ value = _("Empty help text: #{id}.#{lang}.txt", { id = id, lang = lang }) }
50 end
51 else
52 ui.field.text{ value = _("Missing help text: #{id}.#{lang}.txt", { id = id, lang = lang }) }
53 end
54 end
55 }
56 else
57 if util._hidden_helps == nil then
58 util._hidden_helps = {}
59 end
60 util._hidden_helps[#util._hidden_helps+1] = {
61 id = id,
62 title = title
63 }
64 end
65 end
