liquid_feedback_frontend

view app/main/opinion/_action/update.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
author bsw
date Mon Nov 30 12:00:00 2009 +0100 (2009-11-30)
parents 3bfb2fcf7ab9
children afd9f769c7ae
line source
1 local member_id = app.session.member.id
3 local suggestion_id = param.get("suggestion_id", atom.integer)
5 local opinion = Opinion:by_pk(member_id, suggestion_id)
7 if param.get("delete") then
8 if opinion then
9 opinion:destroy()
10 end
11 slot.put_into("notice", _"Your opinion has been deleted")
12 return
13 end
15 if not opinion then
16 opinion = Opinion:new()
17 opinion.member_id = member_id
18 opinion.suggestion_id = suggestion_id
19 opinion.fulfilled = false
20 end
22 local degree = param.get("degree", atom.number)
23 local fulfilled = param.get("fulfilled", atom.boolean)
25 if degree ~= nil then
26 opinion.degree = degree
27 end
29 if fulfilled ~= nil then
30 opinion.fulfilled = fulfilled
31 end
33 opinion:save()
35 slot.put_into("notice", _"Your opinion has been updated")

Impressum / About Us