liquid_feedback_frontend
view app/main/draft/_action/add.lua @ 6:8d91bccab0bf
Version beta2
Possibility to browse voters of a closed issue
Registration with invite code
Email confirmation and password recovery
Download function (for database dumps) added
Critical bug solved, which made it impossible to select your opinion on other peoples suggestions
Catching error, when trying to set an opinion on a suggestion which has been meanwhile deleted
Fixed wrong sorting order for "supporters" or "potential supporters"
Added format info for birthday (Error when entering dates in wrong format is NOT fixed in this release)
Strip space characters from certain fields and ensure they contain at least 3 characters
Showing grade in opinion/list as clear text instead of integer value
More information on initiative is displayed while voting
Colored notification box shown on pages of issues or initiatives which are currently in voting state
Changed default filter for issues to "Open"
Back link on suggestion page
Some optical changes
Removed wrong space character in LICENSE file
Possibility to browse voters of a closed issue
Registration with invite code
Email confirmation and password recovery
Download function (for database dumps) added
Critical bug solved, which made it impossible to select your opinion on other peoples suggestions
Catching error, when trying to set an opinion on a suggestion which has been meanwhile deleted
Fixed wrong sorting order for "supporters" or "potential supporters"
Added format info for birthday (Error when entering dates in wrong format is NOT fixed in this release)
Strip space characters from certain fields and ensure they contain at least 3 characters
Showing grade in opinion/list as clear text instead of integer value
More information on initiative is displayed while voting
Colored notification box shown on pages of issues or initiatives which are currently in voting state
Changed default filter for issues to "Open"
Back link on suggestion page
Some optical changes
Removed wrong space character in LICENSE file
| author | bsw/jbe | 
|---|---|
| date | Sat Jan 02 12:00:00 2010 +0100 (2010-01-02) | 
| parents | afd9f769c7ae | 
| children | 72c5e0ee7c98 | 
 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 initiative = Initiative:by_id(param.get("initiative_id", atom.integer))
     9 -- TODO important m1 selectors returning result _SET_!
    10 local issue = initiative:get_reference_selector("issue"):for_share():single_object_mode():exec()
    12 if issue.closed then
    13   slot.put_into("error", _"This issue is already closed.")
    14   return false
    15 elseif issue.half_frozen then 
    16   slot.put_into("error", _"This issue is already frozen.")
    17   return false
    18 end
    20 if Initiator:by_pk(initiative.id, app.session.member.id) then
    21   local draft = Draft:new()
    22   draft.author_id = app.session.member.id
    23   draft.initiative_id = initiative.id
    24   local formatting_engine = param.get("formatting_engine")
    25   local formatting_engine_valid = false
    26   for fe, dummy in pairs(config.formatting_engine_executeables) do
    27     if formatting_engine == fe then
    28       formatting_engine_valid = true
    29     end
    30   end
    31   if not formatting_engine_valid then
    32     error("invalid formatting engine!")
    33   end
    34   draft.formatting_engine = formatting_engine
    35   draft.content = param.get("content")
    36   draft:save()
    38   slot.put_into("notice", _"New draft has been added to initiative")
    40 else
    41   error('access denied')
    42 end
