liquid_feedback_frontend

diff app/main/lf2/_avatars.lua @ 216:4f6e6b213fb8

Cleanup on second generation frontend code and stylesheet
author bsw
date Mon Mar 07 12:15:22 2011 +0100 (2011-03-07)
parents 3e4ad069847a
children 73dbc9e2bfd4
line diff
     1.1 --- a/app/main/lf2/_avatars.lua	Sat Mar 05 15:34:17 2011 +0100
     1.2 +++ b/app/main/lf2/_avatars.lua	Mon Mar 07 12:15:22 2011 +0100
     1.3 @@ -1,8 +1,7 @@
     1.4  local members = param.get("members", "table")
     1.5  local hidefirst = param.get("hidefirst", atom.boolean)
     1.6  local size = param.get("size") or "normal"
     1.7 -
     1.8 -local first_participation = true
     1.9 +local issue_id = param.get("issue_id", atom.integer)
    1.10  
    1.11  ui.container{ attr = { class = "avatars " .. size }, content = function()
    1.12    for i, member in ipairs(members) do
    1.13 @@ -28,14 +27,13 @@
    1.14      end
    1.15      if not hidefirst or i > 1 then
    1.16        local class = "avatar"
    1.17 -      if first_participation and member.participation then
    1.18 +      if member.participation then
    1.19          class = class .. " participation"
    1.20 -        first_participation = false
    1.21        end
    1.22        if member.overridden then
    1.23          class = class .. " overridden"
    1.24        end
    1.25 -      ui.container{ attr = { class = class, title = member.name }, content = function()
    1.26 +      local args = { attr = { class = class, title = member.name }, content = function()
    1.27          ui.avatar(member, size)
    1.28          --ui.image{ module = "member_image", view = "show", id = member.id, params = { image_type = "avatar" } }
    1.29          if size == "normal" then
    1.30 @@ -45,6 +43,14 @@
    1.31            ui.container{ attr = { class = "weight" }, content = member.weight }
    1.32          end
    1.33        end }
    1.34 +      if issue_id then
    1.35 +        args.module = "lf2"
    1.36 +        args.view = "interest"
    1.37 +        args.params = { issue_id = issue_id, member_id = member.id }
    1.38 +        ui.link(args)
    1.39 +      else
    1.40 +        ui.container(args)
    1.41 +      end
    1.42      end
    1.43    end
    1.44  end }

Impressum / About Us