liquid_feedback_frontend

diff app/main/lf2/delegation.lua @ 217:73dbc9e2bfd4

Cummulative patch for enhancements at next generation frontend
author bsw
date Sat Mar 12 19:22:50 2011 +0100 (2011-03-12)
parents 1dab81353eb1
children 7ea52c710503
line diff
     1.1 --- a/app/main/lf2/delegation.lua	Mon Mar 07 12:15:22 2011 +0100
     1.2 +++ b/app/main/lf2/delegation.lua	Sat Mar 12 19:22:50 2011 +0100
     1.3 @@ -2,6 +2,10 @@
     1.4  
     1.5  local area = Area:by_id(param.get("area_id", atom.integer))
     1.6  local issue = Issue:by_id(param.get("issue_id", atom.integer))
     1.7 +local unit = Unit:by_id(param.get("unit_id", atom.integer))
     1.8 +
     1.9 +local delegation = Delegation:by_pk(app.session.member_id, unit and unit.id or nil, area and area.id or nil, issue and issue.id or nil)
    1.10 +
    1.11  local initiative = Initiative:by_id(param.get("initiative_id", atom.integer))
    1.12  
    1.13  local contact_members = Member:build_selector{
    1.14 @@ -10,15 +14,15 @@
    1.15  }:exec()
    1.16  
    1.17  if area then
    1.18 -  title = _"Set delegation for Area '#{name}'":gsub("#{name}", area.name)
    1.19 +  title = _("Set delegation for area '#{name}'", { name = area.name })
    1.20  end
    1.21  
    1.22  if issue then
    1.23 -  title = _"Set delegation for Issue ##{number} in Area '#{area_name}'":gsub("#{number}", issue.id):gsub("#{area_name}", issue.area.name)
    1.24 +  title = _("Set delegation for issue ##{number} in area '#{area_name}'", { number =  issue.id, area_name = issue.area.name })
    1.25  end
    1.26  
    1.27  if not area and not issue then
    1.28 -  title = _"Set unit delegation"
    1.29 +  title = _("Set delegation for unit #{name}", { name = unit.name })
    1.30  end
    1.31  
    1.32  ui.box{ content = function()
    1.33 @@ -30,6 +34,7 @@
    1.34      module = "delegation",
    1.35      action = "update",
    1.36      params = {
    1.37 +      unit_id = unit and unit.id or nil,
    1.38        area_id = area and area.id or nil,
    1.39        issue_id = issue and issue.id or nil,
    1.40      },
    1.41 @@ -121,12 +126,13 @@
    1.42        
    1.43        ui.box_row{ content = function() ui.box_col{ content = function()
    1.44          ui.field.select{
    1.45 -          label = _"Trustee",
    1.46 +          label = _"Delegate",
    1.47            name = "trustee_id",
    1.48            foreign_records = records,
    1.49            foreign_id = "id",
    1.50            foreign_name = "name",
    1.51 -          disabled_records = disabled_records
    1.52 +          disabled_records = disabled_records,
    1.53 +          value = delegation and delegation.trustee_id or nil
    1.54          }
    1.55        end } end }
    1.56        

Impressum / About Us