liquid_feedback_frontend
annotate app/main/draft/_action/add.lua @ 0:3bfb2fcf7ab9
Version alpha1
author | bsw/jbe |
---|---|
date | Wed Nov 18 12:00:00 2009 +0100 (2009-11-18) |
parents | |
children | 80c215dbf076 |
rev | line source |
---|---|
bsw/jbe@0 | 1 local initiative = Initiative:by_id(param.get("initiative_id", atom.integer)) |
bsw/jbe@0 | 2 |
bsw/jbe@0 | 3 if Initiator:by_pk(initiative.id, app.session.member.id) then |
bsw/jbe@0 | 4 local draft = Draft:new() |
bsw/jbe@0 | 5 draft.author_id = app.session.member.id |
bsw/jbe@0 | 6 draft.initiative_id = initiative.id |
bsw/jbe@0 | 7 draft.content = param.get("content") |
bsw/jbe@0 | 8 draft:save() |
bsw/jbe@0 | 9 |
bsw/jbe@0 | 10 slot.put_into("notice", _"New draft has been added to initiative") |
bsw/jbe@0 | 11 |
bsw/jbe@0 | 12 else |
bsw/jbe@0 | 13 error('access denied') |
bsw/jbe@0 | 14 end |