liquid_feedback_frontend

diff app/main/draft/_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 80c215dbf076
children 72c5e0ee7c98
line diff
     1.1 --- a/app/main/draft/_action/add.lua	Thu Dec 10 12:00:00 2009 +0100
     1.2 +++ b/app/main/draft/_action/add.lua	Fri Dec 25 12:00:00 2009 +0100
     1.3 @@ -1,5 +1,22 @@
     1.4 +local tmp = db:query({ "SELECT text_entries_left FROM member_contingent_left WHERE member_id = ?", app.session.member.id }, "opt_object")
     1.5 +if tmp and tmp.text_entries_left and tmp.text_entries_left < 1 then
     1.6 +  slot.put_into("error", _"Sorry, you have reached your personal flood limit. Please be slower...")
     1.7 +  return false
     1.8 +end
     1.9 +
    1.10  local initiative = Initiative:by_id(param.get("initiative_id", atom.integer))
    1.11  
    1.12 +-- TODO important m1 selectors returning result _SET_!
    1.13 +local issue = initiative:get_reference_selector("issue"):for_share():single_object_mode():exec()
    1.14 +
    1.15 +if issue.closed then
    1.16 +  slot.put_into("error", _"This issue is already closed.")
    1.17 +  return false
    1.18 +elseif issue.half_frozen then 
    1.19 +  slot.put_into("error", _"This issue is already frozen.")
    1.20 +  return false
    1.21 +end
    1.22 +
    1.23  if Initiator:by_pk(initiative.id, app.session.member.id) then
    1.24    local draft = Draft:new()
    1.25    draft.author_id = app.session.member.id

Impressum / About Us