liquid_feedback_frontend

changeset 1135:abee3e49cd44

Initiatives cannot be updated during verification phase
author bsw
date Tue Jan 27 12:07:58 2015 +0100 (2015-01-27)
parents 0df39deaa73f
children 77412cc23325
files app/main/draft/new.lua app/main/issue/_sidebar_whatcanido.lua
line diff
     1.1 --- a/app/main/draft/new.lua	Thu Jan 08 22:04:44 2015 +0100
     1.2 +++ b/app/main/draft/new.lua	Tue Jan 27 12:07:58 2015 +0100
     1.3 @@ -2,6 +2,20 @@
     1.4  initiative:load_everything_for_member_id(app.session.member_id)
     1.5  initiative.issue:load_everything_for_member_id(app.session.member_id)
     1.6  
     1.7 +if issue.closed then
     1.8 +  slot.put_into("error", _"This issue is already closed.")
     1.9 +  request.redirect{ module = "initiative", view = "show", id = initiative.id }
    1.10 +  return
    1.11 +elseif issue.half_frozen then 
    1.12 +  slot.put_into("error", _"This issue is already frozen.")
    1.13 +  request.redirect{ module = "initiative", view = "show", id = initiative.id }
    1.14 +  return
    1.15 +elseif issue.phase_finished then
    1.16 +  slot.put_into("error", _"Current phase is already closed.")
    1.17 +  request.redirect{ module = "initiative", view = "show", id = initiative.id }
    1.18 +  return
    1.19 +end
    1.20 +
    1.21  
    1.22  execute.view{
    1.23    module = "issue", view = "_head", params = {
     2.1 --- a/app/main/issue/_sidebar_whatcanido.lua	Thu Jan 08 22:04:44 2015 +0100
     2.2 +++ b/app/main/issue/_sidebar_whatcanido.lua	Tue Jan 27 12:07:58 2015 +0100
     2.3 @@ -76,36 +76,40 @@
     2.4          ui.tag { content = _"You are initiator of this initiative" }
     2.5        end }
     2.6        ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
     2.7 -        ui.tag { tag = "li", content = function ()
     2.8 -          ui.link{
     2.9 -            module = "draft", view = "new",
    2.10 -            params = { initiative_id = initiative.id },
    2.11 -            content = _"edit proposal and/or reasons"
    2.12 -          }
    2.13 -        end }
    2.14 -        ui.tag { tag = "li", content = function ()
    2.15 -          ui.link{
    2.16 -            attr = { class = "action" },
    2.17 -            module = "initiative", view = "add_initiator",
    2.18 -            params = { initiative_id = initiative.id },
    2.19 -            content = _"invite another initiator"
    2.20 -          }
    2.21 -        end }
    2.22 -        if #initiative.initiators > 1 then
    2.23 +        if issue.half_frozen then
    2.24 +          ui.tag { tag = "li", content = _"this issue is in verification phase, therefore the initiative text cannot be updated anymore" }
    2.25 +        else
    2.26 +          ui.tag { tag = "li", content = function ()
    2.27 +            ui.link{
    2.28 +              module = "draft", view = "new",
    2.29 +              params = { initiative_id = initiative.id },
    2.30 +              content = _"edit proposal and/or reasons"
    2.31 +            }
    2.32 +          end }
    2.33            ui.tag { tag = "li", content = function ()
    2.34              ui.link{
    2.35 -              module = "initiative", view = "remove_initiator",
    2.36 +              attr = { class = "action" },
    2.37 +              module = "initiative", view = "add_initiator",
    2.38                params = { initiative_id = initiative.id },
    2.39 -              content = _"remove an initiator"
    2.40 +              content = _"invite another initiator"
    2.41 +            }
    2.42 +          end }
    2.43 +          if #initiative.initiators > 1 then
    2.44 +            ui.tag { tag = "li", content = function ()
    2.45 +              ui.link{
    2.46 +                module = "initiative", view = "remove_initiator",
    2.47 +                params = { initiative_id = initiative.id },
    2.48 +                content = _"remove an initiator"
    2.49 +              }
    2.50 +            end }
    2.51 +          end
    2.52 +          ui.tag { tag = "li", content = function ()
    2.53 +            ui.link{
    2.54 +              module = "initiative", view = "revoke", id = initiative.id,
    2.55 +              content = _"revoke initiative"
    2.56              }
    2.57            end }
    2.58          end
    2.59 -        ui.tag { tag = "li", content = function ()
    2.60 -          ui.link{
    2.61 -            module = "initiative", view = "revoke", id = initiative.id,
    2.62 -            content = _"revoke initiative"
    2.63 -          }
    2.64 -        end }
    2.65        end }
    2.66      end }
    2.67    end

Impressum / About Us