liquid_feedback_frontend
annotate app/main/index/search.lua @ 1:dd0109e81922
Version alpha2
Minor bug in bargraph output for suggestions fixed
Minor bug in bargraph output for suggestions fixed
| author | bsw |
|---|---|
| date | Wed Nov 18 12:00:00 2009 +0100 (2009-11-18) |
| parents | 3bfb2fcf7ab9 |
| children | 5c601807d397 |
| rev | line source |
|---|---|
| bsw/jbe@0 | 1 local search_for = param.get("search_for", atom.string) |
| bsw/jbe@0 | 2 local search_string = param.get("search", atom.string) |
| bsw/jbe@0 | 3 |
| bsw/jbe@0 | 4 search_for = search_for or "global" |
| bsw/jbe@0 | 5 |
| bsw/jbe@0 | 6 slot.put_into("title", _("Search results for: '#{search}'", { search = search_string })) |
| bsw/jbe@0 | 7 |
| bsw/jbe@0 | 8 |
| bsw/jbe@0 | 9 local members = {} |
| bsw/jbe@0 | 10 local issues = {} |
| bsw/jbe@0 | 11 local initiatives = {} |
| bsw/jbe@0 | 12 |
| bsw/jbe@0 | 13 |
| bsw/jbe@0 | 14 if search_for == "global" or search_for == "member" then |
| bsw/jbe@0 | 15 members = Member:search(search_string) |
| bsw/jbe@0 | 16 end |
| bsw/jbe@0 | 17 |
| bsw/jbe@0 | 18 if search_for == "global" or search_for == "issue" then |
| bsw/jbe@0 | 19 issues = Issue:search(search_string) |
| bsw/jbe@0 | 20 end |
| bsw/jbe@0 | 21 |
| bsw/jbe@0 | 22 if search_for == "initiative" then |
| bsw/jbe@0 | 23 initiatives = Initiative:search(search_string) |
| bsw/jbe@0 | 24 end |
| bsw/jbe@0 | 25 |
| bsw/jbe@0 | 26 |
| bsw/jbe@0 | 27 if #members > 0 then |
| bsw/jbe@0 | 28 ui.heading{ content = _"Members" } |
| bsw/jbe@0 | 29 execute.view{ |
| bsw/jbe@0 | 30 module = "member", |
| bsw/jbe@0 | 31 view = "_list", |
| bsw/jbe@0 | 32 params = { members = members, highlight_string = search_string }, |
| bsw/jbe@0 | 33 } |
| bsw/jbe@0 | 34 end |
| bsw/jbe@0 | 35 |
| bsw/jbe@0 | 36 if #issues > 0 then |
| bsw/jbe@0 | 37 ui.heading{ content = _"Issues" } |
| bsw/jbe@0 | 38 execute.view{ |
| bsw/jbe@0 | 39 module = "issue", |
| bsw/jbe@0 | 40 view = "_list", |
| bsw/jbe@0 | 41 params = { issues = issues, highlight_string = search_string }, |
| bsw/jbe@0 | 42 } |
| bsw/jbe@0 | 43 end |
| bsw/jbe@0 | 44 |
| bsw/jbe@0 | 45 if #initiatives > 0 then |
| bsw/jbe@0 | 46 ui.heading{ content = _"Initiatives" } |
| bsw/jbe@0 | 47 execute.view{ |
| bsw/jbe@0 | 48 module = "initiative", |
| bsw/jbe@0 | 49 view = "_list", |
| bsw/jbe@0 | 50 params = { initiatives = initiatives, highlight_string = search_string }, |
| bsw/jbe@0 | 51 } |
| bsw/jbe@0 | 52 end |
| bsw/jbe@0 | 53 |