liquid_feedback_frontend

diff app/main/member/_show_thumb.lua @ 3:768faea1096d

Version alpha4

Members interested in an issue or supporting an initiative have a weight information attached. Browsing the members causing that weight is possible.

Initiatives may provide a link to an external discussion platform

Direct link on every initiative page to create an alternative initiative

Bugfix: No error when clicking "neutral", when "neutral" is currently selected
author bsw
date Mon Nov 30 12:00:00 2009 +0100 (2009-11-30)
parents 5c601807d397
children 80c215dbf076
line diff
     1.1 --- a/app/main/member/_show_thumb.lua	Mon Nov 23 12:00:00 2009 +0100
     1.2 +++ b/app/main/member/_show_thumb.lua	Mon Nov 30 12:00:00 2009 +0100
     1.3 @@ -1,5 +1,9 @@
     1.4  local member = param.get("member", "table")
     1.5  
     1.6 +local issue = param.get("issue", "table")
     1.7 +local initiative = param.get("initiative", "table")
     1.8 +local trustee = param.get("trustee", "table")
     1.9 +
    1.10  local name
    1.11  if member.name_highlighted then
    1.12    name = encode.highlight(member.name_highlighted)
    1.13 @@ -7,19 +11,74 @@
    1.14    name = encode.html(member.name)
    1.15  end
    1.16  
    1.17 -ui.link{
    1.18 +ui.container{
    1.19    attr = { class = "member_thumb" },
    1.20 -  module = "member",
    1.21 -  view = "show",
    1.22 -  id = member.id,
    1.23    content = function()
    1.24 -    ui.image{
    1.25 -      attr = { width = 48, height = 48 },
    1.26 -      module    = "member",
    1.27 -      view      = "avatar",
    1.28 -      id        = member.id,
    1.29 -      extension = "jpg"
    1.30 +    ui.container{
    1.31 +      attr = { class = "flags" },
    1.32 +      content = function()
    1.33 +        if (issue or initiative) and member.weight > 1 then
    1.34 +          local module
    1.35 +          if issue then
    1.36 +            module = "interest"
    1.37 +          elseif initiative then
    1.38 +            module = "supporter"
    1.39 +          end
    1.40 +          ui.link{
    1.41 +            attr = { title = _"Number of incoming delegations, follow link to see more details" },
    1.42 +            content = _("+ #{weight}", { weight = member.weight - 1 }),
    1.43 +            module = module,
    1.44 +            view = "show_incoming",
    1.45 +            params = { 
    1.46 +              member_id = member.id, 
    1.47 +              initiative_id = initiative and initiative.id or nil,
    1.48 +              issue_id = issue and issue.id or nil
    1.49 +            }
    1.50 +          }
    1.51 +        end
    1.52 +        if member.admin then
    1.53 +          ui.image{
    1.54 +            attr = { 
    1.55 +              alt   = _"Member is administrator",
    1.56 +              title = _"Member is administrator"
    1.57 +            },
    1.58 +            static = "icons/16/cog.png"
    1.59 +          }
    1.60 +        end
    1.61 +        -- TODO performance
    1.62 +        local contact = Contact:by_pk(app.session.member.id, member.id)
    1.63 +        if contact then
    1.64 +          ui.image{
    1.65 +            attr = { 
    1.66 +              alt   = _"You have saved this member as contact",
    1.67 +              title = _"You have saved this member as contact"
    1.68 +            },
    1.69 +            static = "icons/16/bullet_disk.png"
    1.70 +          }
    1.71 +        end
    1.72 +      end
    1.73      }
    1.74 -    slot.put(name)
    1.75 +    
    1.76 +    ui.link{
    1.77 +      attr = { title = _"Show member" },
    1.78 +      module = "member",
    1.79 +      view = "show",
    1.80 +      id = member.id,
    1.81 +      content = function()
    1.82 +        ui.image{
    1.83 +          attr = { width = 48, height = 48 },
    1.84 +          module    = "member",
    1.85 +          view      = "avatar",
    1.86 +          id        = member.id,
    1.87 +          extension = "jpg"
    1.88 +        }
    1.89 +        ui.container{
    1.90 +          attr = { class = "member_name" },
    1.91 +          content = function()
    1.92 +            slot.put(name)
    1.93 +          end
    1.94 +        }
    1.95 +      end
    1.96 +    }
    1.97    end
    1.98 -}
    1.99 \ No newline at end of file
   1.100 +}

Impressum / About Us