liquid_feedback_frontend
view app/main/member/history.lua @ 971:a8c6e80cdf5d
Fixed showing of wrong issue cancelled information
| author | bsw | 
|---|---|
| date | Sat Mar 09 19:13:55 2013 +0100 (2013-03-09) | 
| parents | 418b590fa9ed | 
| children | 701a5cf6b067 | 
 line source
     1 local member = Member:by_id(param.get_id())
     3 slot.select("head", function()
     4   ui.container{
     5     attr = { class = "title" }, 
     6     content = _("Member name history for '#{name}'", { name = member.name })
     7   }
     8   ui.container{ attr = { class = "actions" }, content = function()
     9     ui.link{
    10       content = function()
    11           ui.image{ static = "icons/16/cancel.png" }
    12           slot.put(_"Back")
    13       end,
    14       module = "member",
    15       view = "show",
    16       id = member.id
    17     }
    18   end }
    19 end)
    21 ui.form{
    22   attr = { class = "vertical" },
    23   content = function()
    24     ui.field.text{ label = _"Current name", value = member.name }
    25     ui.field.text{ label = _"Current status", value = member.active and _'activated' or _'deactivated' }
    26   end
    27 }
    30 local entries = member:get_reference_selector("history_entries"):add_order_by("id DESC"):exec()
    32 ui.tag{
    33   tag = "table",
    34   content = function()
    35     ui.tag{
    36       tag = "tr",
    37       content = function()
    38         ui.tag{
    39           tag = "th",
    40           content = _("Name")
    41         }
    42         ui.tag{
    43           tag = "th",
    44           content = _("Status")
    45         }
    46         ui.tag{
    47           tag = "th",
    48           content = _("until")
    49         }
    50       end
    51     }
    52     for i, entry in ipairs(entries) do
    53       ui.tag{
    54         tag = "tr",
    55         content = function()
    56           ui.tag{
    57             tag = "td",
    58             content = entry.name
    59           }
    60           ui.tag{
    61             tag = "td",
    62             content = entry.active and _'activated' or _'deactivated',
    63           }
    64           ui.tag{
    65             tag = "td",
    66             content = format.timestamp(entry["until"])
    67           }
    68         end
    69       }
    70     end
    71   end
    72 }
    73 slot.put("<br />")
    74 ui.container{
    75   content = _("This member account has been created at #{created}", { created = format.timestamp(member.activated)})
    76 }
