liquid_feedback_frontend
view app/main/member/_profile.lua @ 1309:32cc544d5a5b
Cumulative patch for upcoming frontend version 4
| author | bsw/jbe | 
|---|---|
| date | Sun Jul 15 14:07:29 2018 +0200 (2018-07-15) | 
| parents | 254661fb5d83 | 
| children | ce812dccaac2 | 
 line source
     1 local member = param.get("member", "table")
     3 local for_registration = param.get("for_registration", atom.boolean)
     5 ui.form{
     6   attr = { class = "form" },
     7   record = member,
     8   readonly = true,
     9   content = function()
    11     if not for_registration and MemberImage:by_pk(member.id, "photo", true) then
    12       ui.container { attr = { class = "member_photo" }, content = function()
    13         execute.view{
    14           module = "member_image",
    15           view = "_show",
    16           params = {
    17             member = member,
    18             image_type = "photo",
    19             force_update = app.session.member_id == member.id
    20           }
    21         }
    22       end }
    23     end
    25     if member.identification then
    26       ui.field.text{    label = _"Identification", name = "identification" }
    27     end
    28     if member.name then
    29       ui.field.text{ label = _"Screen name", name = "name" }
    30     end
    31     if for_registration and member.login then
    32       ui.field.text{    label = _"Login name", name = "login" }
    33     end
    35     if for_registration and member.notify_email then
    36       ui.field.text{    label = _"Notification email", name = "notify_email" }
    37     end
    38     if member.profile then
    39       local profile = member.profile.profile or {}
    40       for i, field in ipairs(config.member_profile_fields) do
    41         if profile[field.id] and #(profile[field.id]) > 0 then
    42           ui.field.text{ label = field.name, name = field.id, value = profile[field.id] }
    43         end
    44       end
    45     end
    47     if member.admin then
    48       ui.field.boolean{ label = _"Admin?",       name = "admin" }
    49     end
    50     if member.locked then
    51       ui.field.boolean{ label = _"Locked?",      name = "locked" }
    52     end
    53     if member.last_activity then
    54       ui.field.text{ label = _"Last activity (updated daily)", value = format.date(member.last_activity) or _"not yet" }
    55     end
    56     if member.profile and member.profile.statement and #member.profile.statement > 0 then
    57       slot.put("<br />")
    58       slot.put("<br />")
    59       ui.container{
    60         attr = { class = " wiki" },
    61         content = function()
    62           slot.put(member.profile:get_content("html"))
    63         end
    64       }
    65     end
    66   end
    67 }
