liquid_feedback_frontend

changeset 903:dd6c00eb215f

Make preview of new initiative work with free timings
author bsw
date Tue Aug 21 01:29:28 2012 +0200 (2012-08-21)
parents eb16d41929bd
children a176129ce282
files app/main/initiative/new.lua
line diff
     1.1 --- a/app/main/initiative/new.lua	Tue Aug 21 01:22:14 2012 +0200
     1.2 +++ b/app/main/initiative/new.lua	Tue Aug 21 01:29:28 2012 +0200
     1.3 @@ -24,10 +24,19 @@
     1.4    ui.title(_"Create new issue")
     1.5  end
     1.6  
     1.7 -if not issue_id and app.session.member:has_polling_right_for_unit_id(area.unit_id) then
     1.8 +local preview = param.get("preview")
     1.9 +
    1.10 +if not preview and not issue_id and app.session.member:has_polling_right_for_unit_id(area.unit_id) then
    1.11    ui.actions(function()
    1.12 +    ui.link{ 
    1.13 +      text = _"Standard policies",
    1.14 +      module = "initiative", view = "new", params = {
    1.15 +        area_id = area.id
    1.16 +      }
    1.17 +    }
    1.18      for i, policy in ipairs(area.allowed_policies) do
    1.19        if policy.polling  then
    1.20 +        slot.put(" · ")
    1.21          ui.link{ 
    1.22            text = policy.name,
    1.23            module = "initiative", view = "new", params = {
    1.24 @@ -70,10 +79,11 @@
    1.25              name = _"free_timing",
    1.26              foreign_records = available_timings,
    1.27              foreign_id = "id",
    1.28 -            foreign_name = "name"
    1.29 +            foreign_name = "name",
    1.30 +            value = param.get("free_timing")
    1.31            }
    1.32          else
    1.33 -          ui.field.text{ label = _"Free timing", name = "free_timing" }
    1.34 +          ui.field.text{ label = _"Free timing", name = "free_timing", value = param.get("free_timing") }
    1.35          end
    1.36        end
    1.37      else
    1.38 @@ -123,7 +133,7 @@
    1.39        ui.field.boolean{ name = "polling", label = _"Poll" }
    1.40      end
    1.41      
    1.42 -    if param.get("preview") then
    1.43 +    if preview then
    1.44        ui.heading{ level = 1, content = encode.html(param.get("name")) }
    1.45        local discussion_url = param.get("discussion_url")
    1.46        ui.container{

Impressum / About Us