liquid_feedback_frontend

diff app/main/delegation/new.lua @ 111:bf885faf3452

add initiator support in delegation

if a delegation is issued from the initiative view, the initiators
from that one are added to the delegation target list. this makes it easier to delegate to the author without the need to add him to the contact list.
author Daniel Poelzleithner <poelzi@poelzi.org>
date Mon Sep 20 20:32:04 2010 +0200 (2010-09-20)
parents 72c5e0ee7c98
children 02aacb3dffe0
line diff
     1.1 --- a/app/main/delegation/new.lua	Sun Sep 19 04:56:11 2010 +0200
     1.2 +++ b/app/main/delegation/new.lua	Mon Sep 20 20:32:04 2010 +0200
     1.3 @@ -10,6 +10,8 @@
     1.4    util.help("delegation.new.issue")
     1.5  end
     1.6  
     1.7 +local initiative = Initiative:by_id(param.get("initiative_id", atom.integer))
     1.8 +
     1.9  if not area and not issue then
    1.10    slot.put_into("title", encode.html(_"Set global delegation"))
    1.11    util.help("delegation.new.global")
    1.12 @@ -80,9 +82,21 @@
    1.13          name = _"No delegation"
    1.14        }
    1.15      }
    1.16 +
    1.17      for i, record in ipairs(contact_members) do
    1.18        records[#records+1] = record
    1.19      end
    1.20 +    disabled_records = {}
    1.21 +    -- add initiative authors
    1.22 +    if initiative then
    1.23 +      records[#records+1] = {id="_", name=_"--- Initiators ---"}
    1.24 +      disabled_records["_"] = true
    1.25 +      for i,record in ipairs(initiative.initiators) do
    1.26 +        trace.debug(record)
    1.27 +        trace.debug(record.member.name)
    1.28 +        records[#records+1] = record.member
    1.29 +      end
    1.30 +    end
    1.31  
    1.32      ui.field.select{
    1.33        label = _"Trustee",
    1.34 @@ -90,7 +104,9 @@
    1.35        foreign_records = records,
    1.36        foreign_id = "id",
    1.37        foreign_name = "name",
    1.38 +      disabled_records = disabled_records
    1.39      }
    1.40 +
    1.41      ui.submit{ text = _"Save" }
    1.42    end
    1.43  }

Impressum / About Us