liquid_feedback_frontend
view app/main/delegation/new.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
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 | 72c5e0ee7c98 |
| children | bf885faf3452 |
line source
1 local area = Area:by_id(param.get("area_id", atom.integer))
2 if area then
3 slot.put_into("title", encode.html(_"Set delegation for Area '#{name}'":gsub("#{name}", area.name)))
4 util.help("delegation.new.area")
5 end
7 local issue = Issue:by_id(param.get("issue_id", atom.integer))
8 if issue then
9 slot.put_into("title", encode.html(_"Set delegation for Issue ##{number} in Area '#{area_name}'":gsub("#{number}", issue.id):gsub("#{area_name}", issue.area.name)))
10 util.help("delegation.new.issue")
11 end
13 if not area and not issue then
14 slot.put_into("title", encode.html(_"Set global delegation"))
15 util.help("delegation.new.global")
16 end
18 slot.select("actions", function()
19 if issue then
20 ui.link{
21 module = "issue",
22 view = "show",
23 id = issue.id,
24 content = function()
25 ui.image{ static = "icons/16/cancel.png" }
26 slot.put(_"Cancel")
27 end,
28 }
29 elseif area then
30 ui.link{
31 module = "area",
32 view = "show",
33 id = area.id,
34 content = function()
35 ui.image{ static = "icons/16/cancel.png" }
36 slot.put(_"Cancel")
37 end,
38 }
39 else
40 ui.link{
41 module = "index",
42 view = "index",
43 content = function()
44 ui.image{ static = "icons/16/cancel.png" }
45 slot.put(_"Cancel")
46 end,
47 }
48 end
49 end)
53 local contact_members = Member:new_selector()
54 :add_where{ "contact.member_id = ?", app.session.member.id }
55 :join("contact", nil, "member.id = contact.other_member_id")
56 :add_order_by("member.name")
57 :exec()
60 ui.form{
61 attr = { class = "vertical" },
62 module = "delegation",
63 action = "update",
64 params = {
65 area_id = area and area.id or nil,
66 issue_id = issue and issue.id or nil,
67 },
68 routing = {
69 default = {
70 mode = "redirect",
71 module = area and "area" or issue and "issue" or "index",
72 view = (area or issue) and "show" or "index",
73 id = area and area.id or issue and issue.id or nil,
74 }
75 },
76 content = function()
77 local records = {
78 {
79 id = "-1",
80 name = _"No delegation"
81 }
82 }
83 for i, record in ipairs(contact_members) do
84 records[#records+1] = record
85 end
87 ui.field.select{
88 label = _"Trustee",
89 name = "trustee_id",
90 foreign_records = records,
91 foreign_id = "id",
92 foreign_name = "name",
93 }
94 ui.submit{ text = _"Save" }
95 end
96 }
