liquid_feedback_frontend
view app/main/member/history.lua @ 1305:fd50bdd36a4b
Set name for To: field of notification mails, added missing translation function call
| author | bsw | 
|---|---|
| date | Sat May 07 19:27:58 2016 +0200 (2016-05-07) | 
| parents | 701a5cf6b067 | 
| children | 32cc544d5a5b | 
 line source
     1 local member = Member:by_id(param.get_id())
     3 ui.titleMember(member)
     5 ui.section( function()
     7   ui.sectionHead( function()
     8     ui.heading{ level = 1, content = _"Account history" }
     9   end)
    11   ui.sectionRow( function()
    12     ui.form{
    13       attr = { class = "vertical" },
    14       content = function()
    15         ui.field.text{ label = _"Current name", value = member.name }
    16         ui.field.text{ label = _"Current status", value = member.active and _'activated' or _'deactivated' }
    17       end
    18     }
    21     local entries = member:get_reference_selector("history_entries"):add_order_by("id DESC"):exec()
    23     if #entries > 0 then
    24       ui.tag{
    25         tag = "table",
    26         content = function()
    27           ui.tag{
    28             tag = "tr",
    29             content = function()
    30               ui.tag{
    31                 tag = "th",
    32                 content = _("Name")
    33               }
    34               ui.tag{
    35                 tag = "th",
    36                 content = _("Status")
    37               }
    38               ui.tag{
    39                 tag = "th",
    40                 content = _("until")
    41               }
    42             end
    43           }
    44           for i, entry in ipairs(entries) do
    45             ui.tag{
    46               tag = "tr",
    47               content = function()
    48                 ui.tag{
    49                   tag = "td",
    50                   content = entry.name
    51                 }
    52                 ui.tag{
    53                   tag = "td",
    54                   content = entry.active and _'activated' or _'deactivated',
    55                 }
    56                 ui.tag{
    57                   tag = "td",
    58                   content = format.timestamp(entry["until"])
    59                 }
    60               end
    61             }
    62           end
    63         end
    64       }
    65     end
    66     slot.put("<br />")
    67     ui.container{
    68       content = _("This member account has been created at #{created}", { created = format.timestamp(member.activated)})
    69     }
    70   end)
    72 end)
