liquid_feedback_frontend

view app/main/interest/_action/update.lua @ 5:afd9f769c7ae

Version beta1

Final voting with Schulze-Method is now possible

Many bug fixes and code cleanup

Registration with invite codes

More sort and filter options

Seperated display of "supporters" and "potential supporters"

Optical changes

Flood limit / initiative contigent is now checked by frontend

Neccessary changes to access core beta11
author bsw/jbe
date Fri Dec 25 12:00:00 2009 +0100 (2009-12-25)
parents 3bfb2fcf7ab9
children 374bbc2ff102
line source
1 local issue_id = assert(param.get("issue_id", atom.integer), "no issue id given")
3 local interest = Interest:by_pk(issue_id, app.session.member.id)
5 -- TODO important m1 selectors returning result _SET_!
6 local issue = interest:get_reference_selector("issue"):for_share():single_object_mode():exec()
8 if issue.closed then
9 slot.put_into("error", _"This issue is already closed.")
10 return false
11 elseif issue.fully_frozen then
12 slot.put_into("error", _"Voting for this issue has already begun.")
13 return false
14 end
16 if param.get("delete", atom.boolean) then
17 if interest then
18 interest:destroy()
19 slot.put_into("notice", _"Interest removed")
20 else
21 slot.put_into("notice", _"Interest not existant")
22 end
23 return
24 end
26 if not interest then
27 interest = Interest:new()
28 interest.issue_id = issue_id
29 interest.member_id = app.session.member_id
30 interest.autoreject = false
31 end
33 local autoreject = param.get("autoreject", atom.boolean)
34 if autoreject ~= nil then
35 interest.autoreject = autoreject
36 end
38 interest:save()
40 slot.put_into("notice", _"Interest updated")

Impressum / About Us