# HG changeset patch # User bsw # Date 1422356878 -3600 # Node ID abee3e49cd44c9604e3639ffbb0531701ec71455 # Parent 0df39deaa73f8592c78762a963669ce9262e9042 Initiatives cannot be updated during verification phase diff -r 0df39deaa73f -r abee3e49cd44 app/main/draft/new.lua --- a/app/main/draft/new.lua Thu Jan 08 22:04:44 2015 +0100 +++ b/app/main/draft/new.lua Tue Jan 27 12:07:58 2015 +0100 @@ -2,6 +2,20 @@ initiative:load_everything_for_member_id(app.session.member_id) initiative.issue:load_everything_for_member_id(app.session.member_id) +if issue.closed then + slot.put_into("error", _"This issue is already closed.") + request.redirect{ module = "initiative", view = "show", id = initiative.id } + return +elseif issue.half_frozen then + slot.put_into("error", _"This issue is already frozen.") + request.redirect{ module = "initiative", view = "show", id = initiative.id } + return +elseif issue.phase_finished then + slot.put_into("error", _"Current phase is already closed.") + request.redirect{ module = "initiative", view = "show", id = initiative.id } + return +end + execute.view{ module = "issue", view = "_head", params = { diff -r 0df39deaa73f -r abee3e49cd44 app/main/issue/_sidebar_whatcanido.lua --- a/app/main/issue/_sidebar_whatcanido.lua Thu Jan 08 22:04:44 2015 +0100 +++ b/app/main/issue/_sidebar_whatcanido.lua Tue Jan 27 12:07:58 2015 +0100 @@ -76,36 +76,40 @@ ui.tag { content = _"You are initiator of this initiative" } end } ui.tag { tag = "ul", attr = { class = "ul" }, content = function () - ui.tag { tag = "li", content = function () - ui.link{ - module = "draft", view = "new", - params = { initiative_id = initiative.id }, - content = _"edit proposal and/or reasons" - } - end } - ui.tag { tag = "li", content = function () - ui.link{ - attr = { class = "action" }, - module = "initiative", view = "add_initiator", - params = { initiative_id = initiative.id }, - content = _"invite another initiator" - } - end } - if #initiative.initiators > 1 then + if issue.half_frozen then + ui.tag { tag = "li", content = _"this issue is in verification phase, therefore the initiative text cannot be updated anymore" } + else + ui.tag { tag = "li", content = function () + ui.link{ + module = "draft", view = "new", + params = { initiative_id = initiative.id }, + content = _"edit proposal and/or reasons" + } + end } ui.tag { tag = "li", content = function () ui.link{ - module = "initiative", view = "remove_initiator", + attr = { class = "action" }, + module = "initiative", view = "add_initiator", params = { initiative_id = initiative.id }, - content = _"remove an initiator" + content = _"invite another initiator" + } + end } + if #initiative.initiators > 1 then + ui.tag { tag = "li", content = function () + ui.link{ + module = "initiative", view = "remove_initiator", + params = { initiative_id = initiative.id }, + content = _"remove an initiator" + } + end } + end + ui.tag { tag = "li", content = function () + ui.link{ + module = "initiative", view = "revoke", id = initiative.id, + content = _"revoke initiative" } end } end - ui.tag { tag = "li", content = function () - ui.link{ - module = "initiative", view = "revoke", id = initiative.id, - content = _"revoke initiative" - } - end } end } end } end