liquid_feedback_frontend

view app/main/opinion/_action/update.lua @ 2:5c601807d397

Version alpha3

Dark green part of issue supporter bargraph represents all satisfied supporters, regardless of having seen the latest draft

Wiki formatting for drafts

Showing differences between two drafts of the same initiative

Display of outgoing delegation chains

Many other improvements
author bsw
date Mon Nov 23 12:00:00 2009 +0100 (2009-11-23)
parents 3bfb2fcf7ab9
children 768faea1096d
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 opinion and param.get("delete") then
8 opinion:destroy()
9 slot.put_into("notice", _"Your opinion has been updated")
10 return
11 end
13 if not opinion then
14 opinion = Opinion:new()
15 opinion.member_id = member_id
16 opinion.suggestion_id = suggestion_id
17 opinion.fulfilled = false
18 end
20 local degree = param.get("degree", atom.number)
21 local fulfilled = param.get("fulfilled", atom.boolean)
23 if degree ~= nil then
24 opinion.degree = degree
25 end
27 if fulfilled ~= nil then
28 opinion.fulfilled = fulfilled
29 end
31 opinion:save()
33 slot.put_into("notice", _"Your opinion has been updated")

Impressum / About Us