liquid_feedback_frontend
view app/main/initiative/_action/add_support.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 initiative = Initiative:new_selector():add_where{ "id = ?", param.get_id()}:single_object_mode():exec()
3 -- TODO important m1 selectors returning result _SET_!
4 local issue = initiative:get_reference_selector("issue"):for_share():single_object_mode():exec()
6 if issue.closed then
7 slot.put_into("error", _"This issue is already closed.")
8 return false
9 elseif issue.fully_frozen then
10 slot.put_into("error", _"Voting for this issue has already begun.")
11 return false
12 end
14 local member = app.session.member
16 local supporter = Supporter:by_pk(initiative.id, member.id)
18 local last_draft = Draft:new_selector()
19 :add_where{ "initiative_id = ?", initiative.id }
20 :add_order_by("id DESC")
21 :limit(1)
22 :single_object_mode()
23 :exec()
25 if not supporter then
26 supporter = Supporter:new()
27 supporter.member_id = member.id
28 supporter.initiative_id = initiative.id
29 supporter.draft_id = last_draft.id
30 supporter:save()
31 slot.put_into("notice", _"Your support has been added to this initiative")
32 elseif supporter.draft_id ~= last_draft.id then
33 supporter.draft_id = last_draft.id
34 supporter:save()
35 slot.put_into("notice", _"Your support has been updated to the latest draft")
36 else
37 slot.put_into("notice", _"You are already supporting the latest draft")
38 end