liquid_feedback_frontend
annotate app/main/delegation/new.lua @ 3:768faea1096d
Version alpha4
Members interested in an issue or supporting an initiative have a weight information attached. Browsing the members causing that weight is possible.
Initiatives may provide a link to an external discussion platform
Direct link on every initiative page to create an alternative initiative
Bugfix: No error when clicking "neutral", when "neutral" is currently selected
Members interested in an issue or supporting an initiative have a weight information attached. Browsing the members causing that weight is possible.
Initiatives may provide a link to an external discussion platform
Direct link on every initiative page to create an alternative initiative
Bugfix: No error when clicking "neutral", when "neutral" is currently selected
| author | bsw |
|---|---|
| date | Mon Nov 30 12:00:00 2009 +0100 (2009-11-30) |
| parents | 3bfb2fcf7ab9 |
| children | 80c215dbf076 |
| rev | line source |
|---|---|
| bsw/jbe@0 | 1 local area = Area:by_id(param.get("area_id", atom.integer)) |
| bsw/jbe@0 | 2 if area then |
| bsw/jbe@0 | 3 slot.put_into("title", encode.html(_"Set delegation for Area '#{name}'":gsub("#{name}", area.name))) |
| bsw/jbe@0 | 4 end |
| bsw/jbe@0 | 5 |
| bsw/jbe@0 | 6 local issue = Issue:by_id(param.get("issue_id", atom.integer)) |
| bsw/jbe@0 | 7 if issue then |
| bsw/jbe@0 | 8 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))) |
| bsw/jbe@0 | 9 end |
| bsw/jbe@0 | 10 |
| bsw/jbe@0 | 11 |
| bsw/jbe@0 | 12 local contact_members = Member:new_selector() |
| bsw/jbe@0 | 13 :add_where{ "contact.member_id = ?", app.session.member.id } |
| bsw/jbe@0 | 14 :join("contact", nil, "member.id = contact.other_member_id") |
| bsw/jbe@0 | 15 :add_order_by("member.login") |
| bsw/jbe@0 | 16 :exec() |
| bsw/jbe@0 | 17 |
| bsw/jbe@0 | 18 |
| bsw/jbe@0 | 19 ui.form{ |
| bsw/jbe@0 | 20 attr = { class = "vertical" }, |
| bsw/jbe@0 | 21 module = "delegation", |
| bsw/jbe@0 | 22 action = "update", |
| bsw/jbe@0 | 23 params = { |
| bsw/jbe@0 | 24 area_id = area and area.id or nil, |
| bsw/jbe@0 | 25 issue_id = issue and issue.id or nil, |
| bsw/jbe@0 | 26 }, |
| bsw/jbe@0 | 27 routing = { |
| bsw/jbe@0 | 28 default = { |
| bsw/jbe@0 | 29 mode = "redirect", |
| bsw/jbe@0 | 30 module = area and "area" or "issue", |
| bsw/jbe@0 | 31 view = "show", |
| bsw/jbe@0 | 32 id = area and area.id or issue.id, |
| bsw/jbe@0 | 33 } |
| bsw/jbe@0 | 34 }, |
| bsw/jbe@0 | 35 content = function() |
| bsw/jbe@0 | 36 ui.field.select{ |
| bsw/jbe@0 | 37 label = _"Trustee", |
| bsw/jbe@0 | 38 name = "trustee_id", |
| bsw/jbe@0 | 39 foreign_records = contact_members, |
| bsw/jbe@0 | 40 foreign_id = "id", |
| bsw/jbe@0 | 41 foreign_name = "name" |
| bsw/jbe@0 | 42 } |
| bsw/jbe@0 | 43 ui.submit{ text = _"Save" } |
| bsw/jbe@0 | 44 end |
| bsw/jbe@0 | 45 } |