liquid_feedback_frontend

view app/main/interest/_action/update.lua @ 7:3941792e8be6

Version beta3

Table allowed_policy is respected while creating new issues

Broken vote now/later link is not shown anymore (until it's implemented)

More user friendly error page

Minor spelling error corrected
author bsw
date Sat Jan 02 12:00:00 2010 +0100 (2010-01-02)
parents afd9f769c7ae
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