liquid_feedback_frontend
annotate 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 |
| rev | line source |
|---|---|
| bsw/jbe@4 | 1 function util.help(id, title) |
| bsw/jbe@4 | 2 local setting_key = "liquidfeedback_frontend_hidden_help_" .. id |
| bsw/jbe@4 | 3 local setting = Setting:by_pk(app.session.member.id, setting_key) |
| bsw/jbe@4 | 4 if not setting then |
| bsw/jbe@4 | 5 ui.container{ |
| bsw/jbe@4 | 6 attr = { class = "help help_visible" }, |
| bsw/jbe@4 | 7 content = function() |
| bsw/jbe@4 | 8 ui.image{ |
| bsw/jbe@4 | 9 attr = { class = "help_icon" }, |
| bsw/jbe@4 | 10 static = "icons/16/help.png" |
| bsw/jbe@4 | 11 } |
| bsw/jbe@4 | 12 ui.container{ |
| bsw/jbe@4 | 13 attr = { class = "help_actions" }, |
| bsw/jbe@4 | 14 content = function() |
| bsw/jbe@4 | 15 ui.link{ |
| bsw/jbe@4 | 16 content = _"Hide this help message", |
| bsw/jbe@4 | 17 module = "help", |
| bsw/jbe@4 | 18 action = "update", |
| bsw/jbe@4 | 19 params = { |
| bsw/jbe@4 | 20 help_ident = id, |
| bsw/jbe@4 | 21 hide = true |
| bsw/jbe@4 | 22 }, |
| bsw/jbe@4 | 23 routing = { |
| bsw/jbe@4 | 24 default = { |
| bsw/jbe@4 | 25 mode = "redirect", |
| bsw/jbe@4 | 26 module = request.get_module(), |
| bsw/jbe@4 | 27 view = request.get_view(), |
| bsw/jbe@4 | 28 id = param.get_id_cgi(), |
| bsw/jbe@4 | 29 params = param.get_all_cgi() |
| bsw/jbe@4 | 30 } |
| bsw/jbe@4 | 31 } |
| bsw/jbe@4 | 32 } |
| bsw/jbe@4 | 33 end |
| bsw/jbe@4 | 34 } |
| bsw/jbe@4 | 35 local lang = locale.get("lang") |
| bsw/jbe@4 | 36 local basepath = request.get_app_basepath() |
| bsw/jbe@4 | 37 local file_name = basepath .. "/locale/help/" .. id .. "." .. lang .. ".txt" |
| bsw/jbe@4 | 38 local file = io.open(file_name) |
| bsw/jbe@4 | 39 if file ~= nil then |
| bsw/jbe@4 | 40 local help_text = file:read("*a") |
| bsw/jbe@4 | 41 if #help_text > 0 then |
| bsw/jbe@4 | 42 ui.container{ |
| bsw/jbe@4 | 43 attr = { class = "wiki" }, |
| bsw/jbe@4 | 44 content = function() |
| bsw/jbe@4 | 45 slot.put(format.wiki_text(help_text)) |
| bsw/jbe@4 | 46 end |
| bsw/jbe@4 | 47 } |
| bsw/jbe@4 | 48 else |
| bsw/jbe@4 | 49 ui.field.text{ value = _("Empty help text: #{id}.#{lang}.txt", { id = id, lang = lang }) } |
| bsw/jbe@4 | 50 end |
| bsw/jbe@4 | 51 else |
| bsw/jbe@4 | 52 ui.field.text{ value = _("Missing help text: #{id}.#{lang}.txt", { id = id, lang = lang }) } |
| bsw/jbe@4 | 53 end |
| bsw/jbe@4 | 54 end |
| bsw/jbe@4 | 55 } |
| bsw/jbe@4 | 56 else |
| bsw/jbe@4 | 57 if util._hidden_helps == nil then |
| bsw/jbe@4 | 58 util._hidden_helps = {} |
| bsw/jbe@4 | 59 end |
| bsw/jbe@4 | 60 util._hidden_helps[#util._hidden_helps+1] = { |
| bsw/jbe@4 | 61 id = id, |
| bsw/jbe@4 | 62 title = title |
| bsw/jbe@4 | 63 } |
| bsw/jbe@4 | 64 end |
| bsw/jbe@4 | 65 end |