liquid_feedback_frontend

annotate env/util/help.lua @ 19:00d1004545f1

Dynamic interface using XMLHttpRequests, and many other changes

Bugfixes:
- Only allow voting on admitted initiatives
- Repaired issue search
- Don't display delegations for closed issues on member page
- Don't show revoke link in initiative, when issue is already half_frozen
- Localization for voting JavaScript
- Display author of suggestions

Disclosure of voting data after voting is finished:
- Possibility to inspect every ballot including preferences
- Show number of voters preferring one initiative to another initiative

Interface behaviour changes:
- Reversed default order of drafts
- Default order of suggestions changed
- Show new drafts of initiatives only once per day in timeline

Accessibility:
- Barrier-free voting implemented
- POST links are now accessible without JavaScript
- Changed gray for unsatisfied supporters in bar graph to a lighter gray

Other interface improvements:
- Optical enhancements
- Dynamic interface using XMLHttpRequests
- Show usage terms in about section
- Show own membership in area listing
- Show uninformed supporters greyed out and marked with yellow question mark
- Warning box in non-admitted initiatives
- When voted, don't display voting notice and change label of voting link
- Show object counts in more tabulator heads
- Enlarged member statement input field

Miscellaneous:
- Code cleanup
- Added README file containing installation instructions
- Use new WebMCP function ui.filters{...} instead of own ui.filter and ui.order functions
author bsw/jbe
date Sat Feb 20 22:10:31 2010 +0100 (2010-02-20)
parents 80c215dbf076
children 0849be391140
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@19 16 text = _"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

Impressum / About Us