liquid_feedback_frontend

view app/main/suggestion/_action/add.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 8d91bccab0bf
line source
1 local tmp = db:query({ "SELECT text_entries_left FROM member_contingent_left WHERE member_id = ?", app.session.member.id }, "opt_object")
2 if tmp and tmp.text_entries_left and tmp.text_entries_left < 1 then
3 slot.put_into("error", _"Sorry, you have reached your personal flood limit. Please be slower...")
4 return false
5 end
7 local suggestion = Suggestion:new()
9 suggestion.author_id = app.session.member.id
10 param.update(suggestion, "name", "description", "initiative_id")
11 suggestion:save()
13 -- TODO important m1 selectors returning result _SET_!
14 local issue = suggestion.initiative:get_reference_selector("issue"):for_share():single_object_mode():exec()
16 if issue.closed then
17 slot.put_into("error", _"This issue is already closed.")
18 return false
19 elseif issue.fully_frozen then
20 slot.put_into("error", _"Voting for this issue has already begun.")
21 return false
22 end
24 local opinion = Opinion:new()
26 opinion.suggestion_id = suggestion.id
27 opinion.member_id = app.session.member.id
28 opinion.degree = param.get("degree", atom.integer)
29 opinion.fulfilled = false
31 opinion:save()
33 slot.put_into("notice", _"Your suggestion has been added")

Impressum / About Us