liquid_feedback_frontend
view app/main/member/_profile.lua @ 296:d39fa6c0ff0b
Check voting right of delegation trustee
| author | bsw | 
|---|---|
| date | Sat Feb 25 22:20:38 2012 +0100 (2012-02-25) | 
| parents | c587d8762e62 | 
| children | 462ca3002dac | 
 line source
     1 local member = param.get("member", "table")
     3 local include_private_data = param.get("include_private_data", atom.boolean)
     5 if not member then
     6   local member_id = param.get("member_id", atom.integer)
     7   if member_id then
     8     member = Member:by_id(member_id)
     9   end
    10 end
    12 --slot.select("actions", function()
    14   if app.session.member and app.session.member_id == member.id then
    15     ui.link{
    16       attr = { class = "actions" },
    17       content = function()
    18           ui.image{ static = "icons/16/application_form.png" }
    19           slot.put(_"Edit my profile")
    20       end,
    21       module = "member",
    22       view = "edit"
    23     }
    24     ui.link{
    25       attr = { class = "actions" },
    26       content = function()
    27           ui.image{ static = "icons/16/user_gray.png" }
    28           slot.put(_"Upload images")
    29       end,
    30       module = "member",
    31       view = "edit_images"
    32     }
    33     if config.download_dir then
    34       ui.link{
    35         attr = { class = "actions" },
    36         content = function()
    37             ui.image{ static = "icons/16/database_save.png" }
    38             slot.put(_"Download")
    39         end,
    40         module = "index",
    41         view = "download"
    42       }
    43     end
    44     slot.put("<br /><br />")
    45   end
    46 --end)
    48 ui.form{
    49   attr = { class = "member vertical" },
    50   record = member,
    51   readonly = true,
    52   content = function()
    54     ui.container{
    55       attr = { class = "right" },
    56       content = function()
    58       execute.view{
    59         module = "member_image",
    60         view = "_show",
    61         params = {
    62           member = member,
    63           image_type = "photo"
    64         }
    65       }
    67       ui.container{
    68         attr = { class = "contact_data" },
    69         content = function()
    70         end
    71       }
    73       end
    74     }
    76     if member.identification then
    77       ui.field.text{    label = _"Identification", name = "identification" }
    78     end
    79     if member.name then
    80       ui.field.text{ label = _"Screen name", name = "name" }
    81     end
    82     if include_private_data and member.login then
    83       ui.field.text{    label = _"Login name", name = "login" }
    84       ui.field.text{    label = _"Notification email", name = "notify_email" }
    85     end
    87     if member.realname and #member.realname > 0 then
    88       ui.field.text{ label = _"Real name", name = "realname" }
    89     end
    90     if member.email and #member.email > 0 then
    91       ui.field.text{ label = _"email", name = "email" }
    92     end
    93     if member.xmpp_address and #member.xmpp_address > 0 then
    94       ui.field.text{ label = _"xmpp", name = "xmpp_address" }
    95     end
    96     if member.website and #member.website > 0 then
    97       ui.field.text{ label = _"Website", name = "website" }
    98     end
    99     if member.phone and #member.phone > 0 then
   100       ui.field.text{ label = _"Phone", name = "phone" }
   101     end
   102     if member.mobile_phone and #member.mobile_phone > 0 then
   103       ui.field.text{ label = _"Mobile phone", name = "mobile_phone" }
   104     end
   105     if member.address and #member.address > 0 then
   106       ui.container{
   107         content = function()
   108           ui.tag{
   109             tag = "label",
   110             attr = { class = "ui_field_label" },
   111             content = _"Address"
   112           }
   113           ui.tag{
   114             tag = "span",
   115             content = function()
   116               slot.put(encode.html_newlines(encode.html(member.address)))
   117             end
   118           }
   119         end
   120       }
   121     end
   122     if member.profession and #member.profession > 0 then
   123       ui.field.text{ label = _"Profession", name = "profession" }
   124     end
   125     if member.birthday and #member.birthday > 0 then
   126       ui.field.text{ label = _"Birthday", name = "birthday" }
   127     end
   128     if member.organizational_unit and #member.organizational_unit > 0 then
   129       ui.field.text{ label = _"Organizational unit", name = "organizational_unit" }
   130     end
   131     if member.internal_posts and #member.internal_posts > 0 then
   132       ui.field.text{ label = _"Internal posts", name = "internal_posts" }
   133     end
   134     if member.external_memberships and #member.external_memberships > 0 then
   135       ui.field.text{ label = _"Memberships", name = "external_memberships", multiline = true }
   136     end
   137     if member.external_posts and #member.external_posts > 0 then
   138       ui.field.text{ label = _"Posts", name = "external_posts", multiline = true }
   139     end    
   140     if member.admin then
   141       ui.field.boolean{ label = _"Admin?",       name = "admin" }
   142     end
   143     if member.locked then
   144       ui.field.boolean{ label = _"Locked?",      name = "locked" }
   145     end
   146     if member.last_activity then
   147       ui.field.text{ label = _"Last activity (updated daily)", value = format.date(member.last_activity) or _"not yet" }
   148     end
   150     if member.statement and #member.statement > 0 then
   151       ui.container{
   152         attr = { class = "member_statement wiki" },
   153         content = function()
   154           slot.put(member:get_content("html"))
   155         end
   156       }
   157     end
   158   end
   159 }
